public CeloAccountSignerTransactionManager(IClient rpcClient, Account account, BigInteger?chainId, string feeCurrency = null, string gatewayFeeRecipient = null, BigInteger?gatewayFee = null) { if (!chainId.HasValue) { NetVersion nv = new NetVersion(rpcClient); string version = nv.SendRequestAsync().GetAwaiter().GetResult(); ChainId = BigInteger.Parse(version); } else { ChainId = chainId.Value; } FeeCurrency = feeCurrency; GatewayFeeRecipient = gatewayFeeRecipient; GatewayFee = gatewayFee; Account = account ?? throw new ArgumentNullException(nameof(account)); Client = rpcClient; _transactionSigner = new CeloAccountOfflineTransactionSigner(); }
public CeloAccountSignerTransactionManager(IClient rpcClient, string privateKey, BigInteger?chainId, string feeCurrency = null, string gatewayFeeRecipient = null, BigInteger?gatewayFee = null) { if (!chainId.HasValue) { NetVersion nv = new NetVersion(rpcClient); string version = nv.SendRequestAsync().GetAwaiter().GetResult(); ChainId = BigInteger.Parse(version); } else { ChainId = chainId.Value; } FeeCurrency = feeCurrency; GatewayFeeRecipient = gatewayFeeRecipient; GatewayFee = gatewayFee; if (privateKey == null) { throw new ArgumentNullException(nameof(privateKey)); } Client = rpcClient; Account = new Account(privateKey); Account.NonceService = new InMemoryNonceService(Account.Address, rpcClient); _transactionSigner = new CeloAccountOfflineTransactionSigner(); }