fix(wallet): properly marshall multiTxCommand type

Part of #15098
This commit is contained in:
Dario Gabriel Lipicar 2024-06-07 10:51:42 -03:00 committed by dlipicar
parent 4145be8f76
commit 10fbdbfc2c
1 changed files with 9 additions and 0 deletions

View File

@ -54,6 +54,15 @@ proc `$`*(self: MultiTransactionDto): string =
multiTxType:{self.multiTxType}
)"""
proc `%`*(self: MultiTransactionCommandDto): JsonNode {.inline.} =
result = newJObject()
result["fromAddress"] = %(self.fromAddress)
result["toAddress"] = %(self.toAddress)
result["fromAsset"] = %(self.fromAsset)
result["toAsset"] = %(self.toAsset)
result["fromAmount"] = %(self.fromAmount)
result["type"] = %int(self.multiTxType)
proc getTransactionByHash*(chainId: int, hash: string): RpcResponse[JsonNode] =
core.callPrivateRPCWithChainId("eth_getTransactionByHash", chainId, %* [hash])