diff --git a/ethers/wallet.nim b/ethers/wallet.nim index 4a58e85..f69a846 100644 --- a/ethers/wallet.nim +++ b/ethers/wallet.nim @@ -45,6 +45,12 @@ proc createRandom*(_: type Wallet, provider: JsonRpcProvider): Wallet = result.address = Address.init(result.publicKey.toCanonicalAddress()) result.provider = some provider +method provider*(wallet: Wallet): Provider = + if wallet.provider.isSome: + return wallet.provider.get + else: + raise newException(WalletError, "Wallet has no provider") + method populateTransaction*(wallet: Wallet, tx: transaction.Transaction): Future[transaction.Transaction] {.async.} = var populated = tx if tx.nonce.isNone: