/// <summary>
        /// Create an unsigned Transaction object with given parameters.
        /// </summary>
        /// <param name="script">Transaction Script</param>
        /// <param name="attributes">Transaction Attributes</param>
        /// <returns></returns>
        public async Task <TransactionManager> MakeTransactionAsync(byte[] script, Signer[] signers = null, TransactionAttribute[] attributes = null)
        {
            uint blockCount = await rpcClient.GetBlockCountAsync().ConfigureAwait(false) - 1;

            RpcInvokeResult invokeResult = await rpcClient.InvokeScriptAsync(script, signers).ConfigureAwait(false);

            var tx = new Transaction
            {
                Version         = 0,
                Nonce           = (uint)new Random().Next(),
                Script          = script,
                Signers         = signers ?? Array.Empty <Signer>(),
                ValidUntilBlock = blockCount - 1 + Transaction.MaxValidUntilBlockIncrement,
                SystemFee       = invokeResult.GasConsumed,
                Attributes      = attributes ?? Array.Empty <TransactionAttribute>(),
            };

            return(new TransactionManager(tx, rpcClient));
        }
        /// <summary>
        /// Create an unsigned Transaction object with given parameters.
        /// </summary>
        /// <param name="script">Transaction Script</param>
        /// <param name="attributes">Transaction Attributes</param>
        /// <returns></returns>
        public async Task <TransactionManager> MakeTransactionAsync(byte[] script, Signer[] signers = null, TransactionAttribute[] attributes = null)
        {
            RpcInvokeResult invokeResult = await rpcClient.InvokeScriptAsync(script, signers).ConfigureAwait(false);

            return(await MakeTransactionAsync(script, invokeResult.GasConsumed, signers, attributes).ConfigureAwait(false));
        }
 /// <summary>
 /// Use RPC method to test invoke operation.
 /// </summary>
 /// <param name="scriptHash">contract script hash</param>
 /// <param name="operation">contract operation</param>
 /// <param name="args">operation arguments</param>
 /// <returns></returns>
 public Task <RpcInvokeResult> TestInvokeAsync(UInt160 scriptHash, string operation, params object[] args)
 {
     byte[] script = scriptHash.MakeScript(operation, true, args);
     return(rpcClient.InvokeScriptAsync(script));
 }