示例#1
0
        public void broadcast_transaction()
        {
            var args = new BroadcastTransactionArgs()
            {
                Trx = GetSignedTransaction()
            };
            var resp = Api.BroadcastTransaction(args, CancellationToken.None);

            WriteLine(resp);
            Assert.IsFalse(resp.IsError);
        }
示例#2
0
        public async Task broadcast_transaction()
        {
            var args = new BroadcastTransactionArgs
            {
                Trx = await GetSignedTransaction().ConfigureAwait(false)
            };
            var resp = await Api.BroadcastTransactionAsync(args, CancellationToken.None).ConfigureAwait(false);

            WriteLine(resp);
            Assert.IsFalse(resp.IsError);
        }
        public void broadcast_transaction()
        {
            var args = new BroadcastTransactionArgs()
            {
                Trx = GetSignedTransaction()
            };
            var resp = Api.BroadcastTransaction(args, CancellationToken.None);

            Console.WriteLine(resp.Error);
            Assert.IsFalse(resp.IsError);
            Console.WriteLine(JsonConvert.SerializeObject(resp.Result));
        }
示例#4
0
        /// <summary>
        /// Create and Broadcast a transaction to the network
        ///
        /// The transaction will be checked for validity in the local database prior to broadcasting. If it fails to apply locally, an error will be thrown and the transaction will not be broadcast.
        /// </summary>
        /// <param name="userPrivateKeys"></param>
        /// <param name="token">Throws a <see cref="T:System.OperationCanceledException" /> if this token has had cancellation requested.</param>
        /// <param name="operations"></param>
        /// <returns></returns>
        /// <exception cref="T:System.OperationCanceledException">The token has had cancellation requested.</exception>
        public JsonRpcResponse BroadcastOperations(IList <byte[]> userPrivateKeys, CancellationToken token, params BaseOperation[] operations)
        {
            var prop = GetDynamicGlobalProperties(token);

            if (prop.IsError)
            {
                return(prop);
            }

            var transaction = CreateTransaction(prop.Result, userPrivateKeys, token, operations);
            var args        = new BroadcastTransactionArgs()
            {
                Trx = transaction
            };

            return(BroadcastTransaction(args, token));
        }
示例#5
0
        /// <summary>
        /// Create and Broadcast a transaction to the network
        ///
        /// The transaction will be checked for validity in the local database prior to broadcasting. If it fails to apply locally, an error will be thrown and the transaction will not be broadcast.
        /// </summary>
        /// <param name="userPrivateKeys"></param>
        /// <param name="token">Throws a <see cref="T:System.OperationCanceledException" /> if this token has had cancellation requested.</param>
        /// <param name="operations"></param>
        /// <returns></returns>
        /// <exception cref="T:System.OperationCanceledException">The token has had cancellation requested.</exception>
        public async Task <JsonRpcResponse <VoidResponse> > CondenserBroadcastOperationsAsync(IList <byte[]> userPrivateKeys, BaseOperation[] operations, CancellationToken token)
        {
            var prop = await CondenserGetDynamicGlobalPropertiesAsync(token).ConfigureAwait(false);

            if (prop.IsError)
            {
                return(new JsonRpcResponse <VoidResponse>(prop));
            }

            var transaction = await CreateTransactionAsync(prop.Result, userPrivateKeys, operations, token).ConfigureAwait(false);

            var args = new BroadcastTransactionArgs
            {
                Trx = transaction
            };

            return(await CondenserBroadcastTransactionAsync(args, token).ConfigureAwait(false));
        }
示例#6
0
        /// <summary>
        /// Create and Broadcast a transaction to the network
        ///
        /// The transaction will be checked for validity in the local database prior to broadcasting. If it fails to apply locally, an error will be thrown and the transaction will not be broadcast.
        /// </summary>
        /// <param name="userPrivateKeys"></param>
        /// <param name="token">Throws a <see cref="T:System.OperationCanceledException" /> if this token has had cancellation requested.</param>
        /// <param name="operations"></param>
        /// <returns></returns>
        /// <exception cref="T:System.OperationCanceledException">The token has had cancellation requested.</exception>
        public async Task <JsonRpcResponse <VoidResponse> > BroadcastOperationsLikeSteemit(IList <byte[]> userPrivateKeys, BaseOperation[] operations, CancellationToken token)
        {
            var prop = await GetDynamicGlobalProperties(token);

            if (prop.IsError)
            {
                return(new JsonRpcResponse <VoidResponse>(prop));
            }

            var transaction = await CreateTransaction(prop.Result, userPrivateKeys, operations, token);

            var args = new BroadcastTransactionArgs
            {
                Trx = transaction
            };

            return(await BroadcastTransactionLikeSteemit(args, token));
        }
示例#7
0
 /// <summary>
 /// API name: broadcast_transaction
 ///
 /// </summary>
 /// <param name="args">API type: broadcast_transaction_args</param>
 /// <param name="token">Throws a <see cref="T:System.OperationCanceledException" /> if this token has had cancellation requested.</param>
 /// <exception cref="T:System.OperationCanceledException">The token has had cancellation requested.</exception>
 public Task <JsonRpcResponse <VoidResponse> > BroadcastTransactionLikeSteemitAsync(BroadcastTransactionArgs args, CancellationToken token)
 {
     return(CondenserBroadcastRequestAsync <VoidResponse>(KnownApiNames.NetworkBroadcastApi, "broadcast_transaction", args, token));
 }
示例#8
0
 /// <summary>
 /// API name: broadcast_transaction
 ///
 /// </summary>
 /// <param name="args">API type: broadcast_transaction_args</param>
 /// <param name="token">Throws a <see cref="T:System.OperationCanceledException" /> if this token has had cancellation requested.</param>
 /// <exception cref="T:System.OperationCanceledException">The token has had cancellation requested.</exception>
 public JsonRpcResponse BroadcastTransaction(BroadcastTransactionArgs args, CancellationToken token)
 {
     return(CustomGetRequest(KnownApiNames.NetworkBroadcastApi, "broadcast_transaction", args, token));
 }
示例#9
0
 /// <summary>
 /// API name: broadcast_transaction
 ///
 /// </summary>
 /// <param name="args">API type: broadcast_transaction_args</param>
 /// <param name="token">Throws a <see cref="T:System.OperationCanceledException" /> if this token has had cancellation requested.</param>
 /// <exception cref="T:System.OperationCanceledException">The token has had cancellation requested.</exception>
 public Task <JsonRpcResponse <VoidResponse> > CondenserBroadcastTransaction(BroadcastTransactionArgs args, CancellationToken token)
 {
     return(CondenserCustomGetRequest <VoidResponse>(KnownApiNames.CondenserApi, "broadcast_transaction", args, token));
 }