diff --git a/ethers/providers/rpccalls/conversions.nim b/ethers/providers/rpccalls/conversions.nim index 1a21ed7..493b061 100644 --- a/ethers/providers/rpccalls/conversions.nim +++ b/ethers/providers/rpccalls/conversions.nim @@ -12,6 +12,14 @@ func `%`*(bytes: seq[byte]): JsonNode = func fromJson*(json: JsonNode, name: string, result: var seq[byte]) = result = hexToSeqByte(json.getStr()) +# byte arrays + +func `%`*[N](bytes: array[N, byte]): JsonNode = + %("0x" & bytes.toHex) + +func fromJson*[N](json: JsonNode, name: string, result: var array[N, byte]) = + hexToByteArray(json.getStr(), result) + # Address func `%`*(address: Address): JsonNode = diff --git a/ethers/providers/rpccalls/signatures.nim b/ethers/providers/rpccalls/signatures.nim index 68ade27..e7eb521 100644 --- a/ethers/providers/rpccalls/signatures.nim +++ b/ethers/providers/rpccalls/signatures.nim @@ -6,3 +6,4 @@ proc eth_gasPrice(): UInt256 proc eth_getTransactionCount(address: Address, blockTag: BlockTag): UInt256 proc eth_estimateGas(transaction: Transaction): UInt256 proc eth_chainId(): UInt256 +proc eth_sendTransaction(transaction: Transaction): array[32, byte]