2022-01-18 13:26:41 +00:00
|
|
|
import ./basics
|
2022-01-20 11:56:18 +00:00
|
|
|
import ./transaction
|
2022-01-24 11:14:31 +00:00
|
|
|
import ./blocktag
|
2022-01-18 13:26:41 +00:00
|
|
|
|
|
|
|
export basics
|
2022-01-20 11:56:18 +00:00
|
|
|
export transaction
|
2022-01-24 11:14:31 +00:00
|
|
|
export blocktag
|
2022-01-18 13:26:41 +00:00
|
|
|
|
2022-01-18 13:51:53 +00:00
|
|
|
push: {.upraises: [].}
|
|
|
|
|
2022-01-18 11:10:20 +00:00
|
|
|
type
|
|
|
|
Provider* = ref object of RootObj
|
2022-02-02 15:56:37 +00:00
|
|
|
Subscription* = ref object of RootObj
|
|
|
|
Filter* = object
|
|
|
|
address*: Address
|
|
|
|
topics*: seq[Topic]
|
|
|
|
Log* = object
|
|
|
|
data*: seq[byte]
|
|
|
|
topics*: seq[Topic]
|
|
|
|
LogHandler* = proc(log: Log) {.gcsafe, upraises:[].}
|
|
|
|
Topic* = array[32, byte]
|
2022-03-16 13:02:44 +00:00
|
|
|
Block* = object
|
|
|
|
number*: UInt256
|
|
|
|
timestamp*: UInt256
|
|
|
|
hash*: array[32, byte]
|
2022-01-18 13:26:41 +00:00
|
|
|
|
|
|
|
method getBlockNumber*(provider: Provider): Future[UInt256] {.base.} =
|
|
|
|
doAssert false, "not implemented"
|
2022-03-16 13:02:44 +00:00
|
|
|
|
|
|
|
method getBlock*(provider: Provider, tag: BlockTag): Future[Block] {.base.} =
|
|
|
|
doAssert false, "not implemented"
|
2022-01-20 11:56:18 +00:00
|
|
|
|
|
|
|
method call*(provider: Provider, tx: Transaction): Future[seq[byte]] {.base.} =
|
|
|
|
doAssert false, "not implemented"
|
2022-01-24 11:12:52 +00:00
|
|
|
|
|
|
|
method getGasPrice*(provider: Provider): Future[UInt256] {.base.} =
|
|
|
|
doAssert false, "not implemented"
|
2022-01-24 11:14:31 +00:00
|
|
|
|
|
|
|
method getTransactionCount*(provider: Provider,
|
|
|
|
address: Address,
|
|
|
|
blockTag = BlockTag.latest):
|
|
|
|
Future[UInt256] {.base.} =
|
|
|
|
doAssert false, "not implemented"
|
2022-01-24 13:40:47 +00:00
|
|
|
|
|
|
|
method estimateGas*(provider: Provider,
|
|
|
|
transaction: Transaction): Future[UInt256] {.base.} =
|
|
|
|
doAssert false, "not implemented"
|
2022-01-24 16:29:25 +00:00
|
|
|
|
|
|
|
method getChainId*(provider: Provider): Future[UInt256] {.base.} =
|
|
|
|
doAssert false, "not implemented"
|
2022-02-02 15:56:37 +00:00
|
|
|
|
|
|
|
method subscribe*(provider: Provider,
|
|
|
|
filter: Filter,
|
|
|
|
callback: LogHandler):
|
|
|
|
Future[Subscription] {.base.} =
|
|
|
|
doAssert false, "not implemented"
|
|
|
|
|
|
|
|
method unsubscribe*(subscription: Subscription) {.base, async.} =
|
|
|
|
doAssert false, "not implemented"
|