示例#1
0
 /// <summary>
 /// WalletAPI Constructor
 /// </summary>
 /// <param name="rpc">the RPC client to call NEO RPC methods</param>
 public WalletAPI(RpcClient rpc)
 {
     rpcClient = rpc;
     nep17API  = new Nep17API(rpc);
 }
 /// <summary>
 /// TransactionManagerFactory Constructor
 /// </summary>
 /// <param name="rpcClient">the RPC client to call NEO RPC API</param>
 /// <param name="magic">
 /// the network Magic value to use when signing transactions.
 /// Defaults to ProtocolSettings.Default.Magic if not specified.
 /// </param>
 public TransactionManagerFactory(RpcClient rpcClient, uint?magic = null)
 {
     this.rpcClient = rpcClient;
     this.magic     = magic ?? ProtocolSettings.Default.Magic;
 }
示例#3
0
 /// <summary>
 /// TransactionManager Constructor
 /// </summary>
 /// <param name="rpc">the RPC client to call NEO RPC API</param>
 /// <param name="sender">the account script hash of sender</param>
 public TransactionManager(RpcClient rpc)
 {
     rpcClient = rpc;
     policyAPI = new PolicyAPI(rpc);
     nep5API   = new Nep5API(rpc);
 }
示例#4
0
 /// <summary>
 /// PolicyAPI Constructor
 /// </summary>
 /// <param name="rpcClient">the RPC client to call NEO RPC methods</param>
 public PolicyAPI(RpcClient rpcClient) : base(rpcClient)
 {
 }
 /// <summary>
 /// TransactionManagerFactory Constructor
 /// </summary>
 /// <param name="rpcClient">the RPC client to call NEO RPC API</param>
 public TransactionManagerFactory(RpcClient rpcClient)
 {
     this.rpcClient = rpcClient;
 }
示例#6
0
 /// <summary>
 /// ContractClient Constructor
 /// </summary>
 /// <param name="rpc">the RPC client to call NEO RPC methods</param>
 public ContractClient(RpcClient rpc)
 {
     rpcClient = rpc;
 }
示例#7
0
 /// <summary>
 /// Nep5API Constructor
 /// </summary>
 /// <param name="rpcClient">the RPC client to call NEO RPC methods</param>
 public Nep5API(RpcClient rpcClient) : base(rpcClient)
 {
 }
示例#8
0
 /// <summary>
 /// TransactionManager Constructor
 /// </summary>
 /// <param name="tx">the transaction to manage. Typically buildt</param>
 /// <param name="rpcClient">the RPC client to call NEO RPC API</param>
 public TransactionManager(Transaction tx, RpcClient rpcClient)
 {
     this.tx        = tx;
     this.context   = new ContractParametersContext(null, tx, rpcClient.protocolSettings.Network);
     this.rpcClient = rpcClient;
 }
示例#9
0
        /// <summary>
        /// Helper function for one-off TransactionManager creation
        /// </summary>
        public static Task <TransactionManager> MakeTransactionAsync(RpcClient rpcClient, byte[] script, Signer[] signers = null, TransactionAttribute[] attributes = null)
        {
            var factory = new TransactionManagerFactory(rpcClient);

            return(factory.MakeTransactionAsync(script, signers, attributes));
        }
示例#10
0
 /// <summary>
 /// TransactionManager Constructor
 /// </summary>
 /// <param name="rpc">the RPC client to call NEO RPC API</param>
 /// <param name="sender">the account script hash of sender</param>
 public TransactionManager(RpcClient rpc, UInt160 sender)
 {
     rpcClient   = rpc;
     this.sender = sender;
 }
示例#11
0
        public async Task <RpcStateRoot> GetStateRootAsync(uint index)
        {
            var result = await rpcClient.RpcSendAsync(RpcClient.GetRpcName(), index).ConfigureAwait(false);

            return(RpcStateRoot.FromJson(result));
        }
示例#12
0
 public StateAPI(RpcClient rpc)
 {
     this.rpcClient = rpc;
 }
 /// <summary>
 /// TransactionManager Constructor
 /// </summary>
 /// <param name="tx">the transaction to manage. Typically buildt</param>
 /// <param name="rpcClient">the RPC client to call NEO RPC API</param>
 public TransactionManager(Transaction tx, RpcClient rpcClient)
 {
     this.tx        = tx;
     this.context   = new ContractParametersContext(null, tx);
     this.rpcClient = rpcClient;
 }
示例#14
0
 /// <summary>
 /// ContractClient Constructor
 /// </summary>
 /// <param name="rpc">the RPC client to call NEO RPC methods</param>
 /// <param name="magic">
 /// the network Magic value to use when signing transactions.
 /// Defaults to ProtocolSettings.Default.Magic if not specified.
 /// </param>
 public ContractClient(RpcClient rpc, uint?magic = null)
 {
     rpcClient  = rpc;
     this.magic = magic;
 }