mirror of
https://github.com/logos-storage/nim-ethers.git
synced 2026-07-31 12:03:16 +00:00
Add eth_call, allowing JsonNode to be passed directly to the RPC server
This commit is contained in:
parent
c09ac02dab
commit
68f07e96fc
@ -1,3 +1,4 @@
|
|||||||
|
import std/json
|
||||||
import pkg/chronicles
|
import pkg/chronicles
|
||||||
import ./basics
|
import ./basics
|
||||||
import ./transaction
|
import ./transaction
|
||||||
@ -102,7 +103,7 @@ method getBlock*(provider: Provider, tag: BlockTag): Future[?Block] {.base, gcsa
|
|||||||
doAssert false, "not implemented"
|
doAssert false, "not implemented"
|
||||||
|
|
||||||
method call*(provider: Provider,
|
method call*(provider: Provider,
|
||||||
tx: PastTransaction,
|
tx: JsonNode,
|
||||||
blockTag = BlockTag.latest): Future[seq[byte]] {.base, gcsafe.} =
|
blockTag = BlockTag.latest): Future[seq[byte]] {.base, gcsafe.} =
|
||||||
doAssert false, "not implemented"
|
doAssert false, "not implemented"
|
||||||
|
|
||||||
|
|||||||
@ -139,14 +139,14 @@ method getBlock*(provider: JsonRpcProvider,
|
|||||||
return await client.eth_getBlockByNumber(tag, false)
|
return await client.eth_getBlockByNumber(tag, false)
|
||||||
|
|
||||||
method call*(provider: JsonRpcProvider,
|
method call*(provider: JsonRpcProvider,
|
||||||
tx: Transaction,
|
tx: JsonNode,
|
||||||
blockTag = BlockTag.latest): Future[seq[byte]] {.async.} =
|
blockTag = BlockTag.latest): Future[seq[byte]] {.async.} =
|
||||||
convertError:
|
convertError:
|
||||||
let client = await provider.client
|
let client = await provider.client
|
||||||
return await client.eth_call(tx, blockTag)
|
return await client.eth_call(tx, blockTag)
|
||||||
|
|
||||||
method call*(provider: JsonRpcProvider,
|
method call*(provider: JsonRpcProvider,
|
||||||
tx: PastTransaction,
|
tx: Transaction,
|
||||||
blockTag = BlockTag.latest): Future[seq[byte]] {.async.} =
|
blockTag = BlockTag.latest): Future[seq[byte]] {.async.} =
|
||||||
convertError:
|
convertError:
|
||||||
let client = await provider.client
|
let client = await provider.client
|
||||||
|
|||||||
@ -3,6 +3,7 @@ proc eth_accounts: seq[Address]
|
|||||||
proc eth_blockNumber: UInt256
|
proc eth_blockNumber: UInt256
|
||||||
proc eth_call(transaction: Transaction, blockTag: BlockTag): seq[byte]
|
proc eth_call(transaction: Transaction, blockTag: BlockTag): seq[byte]
|
||||||
proc eth_call(transaction: PastTransaction, blockTag: BlockTag): seq[byte]
|
proc eth_call(transaction: PastTransaction, blockTag: BlockTag): seq[byte]
|
||||||
|
proc eth_call(transaction: JsonNode, blockTag: BlockTag): seq[byte]
|
||||||
proc eth_gasPrice(): UInt256
|
proc eth_gasPrice(): UInt256
|
||||||
proc eth_getBlockByNumber(blockTag: BlockTag, includeTransactions: bool): ?Block
|
proc eth_getBlockByNumber(blockTag: BlockTag, includeTransactions: bool): ?Block
|
||||||
proc eth_getLogs(filter: EventFilter | Filter | FilterByBlockHash): JsonNode
|
proc eth_getLogs(filter: EventFilter | Filter | FilterByBlockHash): JsonNode
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user