Example #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;
 }
Example #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);
 }
Example #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;
 }
Example #6
0
 /// <summary>
 /// ContractClient Constructor
 /// </summary>
 /// <param name="rpc">the RPC client to call NEO RPC methods</param>
 public ContractClient(RpcClient rpc)
 {
     rpcClient = rpc;
 }
Example #7
0
 /// <summary>
 /// Nep5API Constructor
 /// </summary>
 /// <param name="rpcClient">the RPC client to call NEO RPC methods</param>
 public Nep5API(RpcClient rpcClient) : base(rpcClient)
 {
 }
Example #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;
 }
Example #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));
        }
Example #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;
 }
Example #11
0
        public async Task <RpcStateRoot> GetStateRootAsync(uint index)
        {
            var result = await rpcClient.RpcSendAsync(RpcClient.GetRpcName(), index).ConfigureAwait(false);

            return(RpcStateRoot.FromJson(result));
        }
Example #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;
 }
Example #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;
 }