mirror of
https://github.com/codex-storage/nim-ethers.git
synced 2025-01-25 10:49:10 +00:00
Add new method to wallet
This commit is contained in:
parent
4c047fd997
commit
ac7785dd04
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user