Add sendRawTransaction

This commit is contained in:
Jackie 2022-07-12 20:24:52 +02:00 committed by markspanbroek
parent 671d42889a
commit 2c9eb595d2
2 changed files with 9 additions and 0 deletions

View File

@ -151,6 +151,14 @@ method getChainId*(provider: JsonRpcProvider): Future[UInt256] {.async.} =
except CatchableError:
return parse(await client.net_version(), UInt256)
method sendRawTransaction*(provider: JsonRpcProvider, rawTransaction: string): Future[TransactionResponse] {.async.} =
convertError:
let
client = await provider.client
hash = await client.eth_sendRawTransaction(rawTransaction)
return TransactionResponse(hash: hash, provider: provider)
proc subscribe(provider: JsonRpcProvider,
name: string,
filter: ?Filter,

View File

@ -8,6 +8,7 @@ proc eth_getTransactionCount(address: Address, blockTag: BlockTag): UInt256
proc eth_estimateGas(transaction: Transaction): UInt256
proc eth_chainId(): UInt256
proc eth_sendTransaction(transaction: Transaction): TransactionHash
proc eth_sendRawTransaction(data: string): TransactionHash
proc eth_getTransactionReceipt(hash: TransactionHash): ?TransactionReceipt
proc eth_sign(account: Address, message: seq[byte]): seq[byte]
proc eth_subscribe(name: string, filter: Filter): JsonNode