From 2e65796a06a39ac97ea5ff72294ad29e4faf26af Mon Sep 17 00:00:00 2001 From: Anthony Laibe Date: Mon, 12 Dec 2022 10:31:41 +0100 Subject: [PATCH] feat(@wallet): cbridge integration --- src/app_service/service/eth/dto/transaction.nim | 2 ++ src/app_service/service/transaction/service.nim | 10 +++++++++- vendor/status-go | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/app_service/service/eth/dto/transaction.nim b/src/app_service/service/eth/dto/transaction.nim index 0289a64377..8aa3e67c1c 100644 --- a/src/app_service/service/eth/dto/transaction.nim +++ b/src/app_service/service/eth/dto/transaction.nim @@ -61,6 +61,7 @@ type TransactionBridgeDto* = object chainID*: int simpleTx*: TransactionDataDto hopTx*: TransactionDataDto + cbridgeTx*: TransactionDataDto proc `%`*(x: TransactionBridgeDto): JsonNode = result = newJobject() @@ -68,3 +69,4 @@ proc `%`*(x: TransactionBridgeDto): JsonNode = result["chainID"] = %x.chainID result["simpleTx"] = %x.simpleTx result["hopTx"] = %x.hopTx + result["cbridgeTx"] = %x.cbridgeTx diff --git a/src/app_service/service/transaction/service.nim b/src/app_service/service/transaction/service.nim index ce2b398d6b..10df69b1bc 100644 --- a/src/app_service/service/transaction/service.nim +++ b/src/app_service/service/transaction/service.nim @@ -315,6 +315,7 @@ QtObject: for route in routes: var simpleTx = TransactionDataDto() var hopTx = TransactionDataDto() + var cbridgeTx = TransactionDataDto() var txData = TransactionDataDto() var gasFees: string = "" @@ -333,7 +334,7 @@ QtObject: var path = TransactionBridgeDto(bridgeName: route.bridgeName, chainID: route.fromNetwork.chainId) if(route.bridgeName == "Simple"): path.simpleTx = txData - else: + elif(route.bridgeName == "Hop"): hopTx = txData hopTx.chainID = route.toNetwork.chainId.some hopTx.symbol = tokenSymbol.some @@ -341,6 +342,13 @@ QtObject: hopTx.amount = route.amountIn.some hopTx.bonderFee = route.bonderFees.some path.hopTx = hopTx + else: + cbridgeTx = txData + cbridgeTx.chainID = route.toNetwork.chainId.some + cbridgeTx.symbol = tokenSymbol.some + cbridgeTx.recipient = parseAddress(to_addr).some + cbridgeTx.amount = route.amountIn.some + path.cbridgeTx = cbridgeTx paths.add(path) diff --git a/vendor/status-go b/vendor/status-go index 9137257638..99ff0a18b0 160000 --- a/vendor/status-go +++ b/vendor/status-go @@ -1 +1 @@ -Subproject commit 9137257638bb5b9f6d7e336d0a2a24d65838a2ac +Subproject commit 99ff0a18b0c9017a2b3ece03fd829f6616e4e436