diff --git a/ethers/providers/jsonrpc.nim b/ethers/providers/jsonrpc.nim index bbfc00e..5b5dd9e 100644 --- a/ethers/providers/jsonrpc.nim +++ b/ethers/providers/jsonrpc.nim @@ -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, diff --git a/ethers/providers/jsonrpc/signatures.nim b/ethers/providers/jsonrpc/signatures.nim index e0f9211..223bb7a 100644 --- a/ethers/providers/jsonrpc/signatures.nim +++ b/ethers/providers/jsonrpc/signatures.nim @@ -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