Ejemplo n.º 1
0
        public async Task <string> SendTransactionAsync(Transaction tx)
        {
            var clients = this.Clients.Values.Where(x => string.IsNullOrEmpty(x.Wallet.Options.RpcServerAddress) == false);

            if (clients.Count() > 0)
            {
                var sendTransactionTasks = clients
                                           .Select(x => Wallet.Wallet.SendTransactionAsync(tx, TransactionOptions.NewFrom(x.Wallet.Options)));

                return(await await Task.WhenAny(sendTransactionTasks));
            }

            return(await Wallet.Wallet.SendTransactionAsync(tx, TransactionOptions.NewFrom(this.options)));
        }
Ejemplo n.º 2
0
        public string SendTransactionAsync(NknSdk.Common.Protobuf.Transaction.Transaction tx)
        {
            if (string.IsNullOrWhiteSpace(this.Wallet.Options.RpcServerAddress))
            {
                try
                {
                    return(NknSdk.Wallet.Wallet.SendTransactionAsync(tx, TransactionOptions.NewFrom(this.Wallet.Options)));
                }
                catch (Exception)
                {
                }
            }

            return(NknSdk.Wallet.Wallet.SendTransactionAsync(tx, TransactionOptions.NewFrom(this.options)));
        }
Ejemplo n.º 3
0
 public Task <string> SendTransactionAsync(Transaction tx) => Wallet.SendTransactionAsync(tx, TransactionOptions.NewFrom(this.Options));