Add sendRawTransaction
This commit is contained in:
parent
671d42889a
commit
2c9eb595d2
|
@ -151,6 +151,14 @@ method getChainId*(provider: JsonRpcProvider): Future[UInt256] {.async.} =
|
||||||
except CatchableError:
|
except CatchableError:
|
||||||
return parse(await client.net_version(), UInt256)
|
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,
|
proc subscribe(provider: JsonRpcProvider,
|
||||||
name: string,
|
name: string,
|
||||||
filter: ?Filter,
|
filter: ?Filter,
|
||||||
|
|
|
@ -8,6 +8,7 @@ proc eth_getTransactionCount(address: Address, blockTag: BlockTag): UInt256
|
||||||
proc eth_estimateGas(transaction: Transaction): UInt256
|
proc eth_estimateGas(transaction: Transaction): UInt256
|
||||||
proc eth_chainId(): UInt256
|
proc eth_chainId(): UInt256
|
||||||
proc eth_sendTransaction(transaction: Transaction): TransactionHash
|
proc eth_sendTransaction(transaction: Transaction): TransactionHash
|
||||||
|
proc eth_sendRawTransaction(data: string): TransactionHash
|
||||||
proc eth_getTransactionReceipt(hash: TransactionHash): ?TransactionReceipt
|
proc eth_getTransactionReceipt(hash: TransactionHash): ?TransactionReceipt
|
||||||
proc eth_sign(account: Address, message: seq[byte]): seq[byte]
|
proc eth_sign(account: Address, message: seq[byte]): seq[byte]
|
||||||
proc eth_subscribe(name: string, filter: Filter): JsonNode
|
proc eth_subscribe(name: string, filter: Filter): JsonNode
|
||||||
|
|
Loading…
Reference in New Issue