mirror of
https://github.com/status-im/status-desktop.git
synced 2025-02-21 02:58:55 +00:00
feat(@wallet): cbridge integration
This commit is contained in:
parent
a7a69e1320
commit
2e65796a06
@ -61,6 +61,7 @@ type TransactionBridgeDto* = object
|
|||||||
chainID*: int
|
chainID*: int
|
||||||
simpleTx*: TransactionDataDto
|
simpleTx*: TransactionDataDto
|
||||||
hopTx*: TransactionDataDto
|
hopTx*: TransactionDataDto
|
||||||
|
cbridgeTx*: TransactionDataDto
|
||||||
|
|
||||||
proc `%`*(x: TransactionBridgeDto): JsonNode =
|
proc `%`*(x: TransactionBridgeDto): JsonNode =
|
||||||
result = newJobject()
|
result = newJobject()
|
||||||
@ -68,3 +69,4 @@ proc `%`*(x: TransactionBridgeDto): JsonNode =
|
|||||||
result["chainID"] = %x.chainID
|
result["chainID"] = %x.chainID
|
||||||
result["simpleTx"] = %x.simpleTx
|
result["simpleTx"] = %x.simpleTx
|
||||||
result["hopTx"] = %x.hopTx
|
result["hopTx"] = %x.hopTx
|
||||||
|
result["cbridgeTx"] = %x.cbridgeTx
|
||||||
|
@ -315,6 +315,7 @@ QtObject:
|
|||||||
for route in routes:
|
for route in routes:
|
||||||
var simpleTx = TransactionDataDto()
|
var simpleTx = TransactionDataDto()
|
||||||
var hopTx = TransactionDataDto()
|
var hopTx = TransactionDataDto()
|
||||||
|
var cbridgeTx = TransactionDataDto()
|
||||||
var txData = TransactionDataDto()
|
var txData = TransactionDataDto()
|
||||||
var gasFees: string = ""
|
var gasFees: string = ""
|
||||||
|
|
||||||
@ -333,7 +334,7 @@ QtObject:
|
|||||||
var path = TransactionBridgeDto(bridgeName: route.bridgeName, chainID: route.fromNetwork.chainId)
|
var path = TransactionBridgeDto(bridgeName: route.bridgeName, chainID: route.fromNetwork.chainId)
|
||||||
if(route.bridgeName == "Simple"):
|
if(route.bridgeName == "Simple"):
|
||||||
path.simpleTx = txData
|
path.simpleTx = txData
|
||||||
else:
|
elif(route.bridgeName == "Hop"):
|
||||||
hopTx = txData
|
hopTx = txData
|
||||||
hopTx.chainID = route.toNetwork.chainId.some
|
hopTx.chainID = route.toNetwork.chainId.some
|
||||||
hopTx.symbol = tokenSymbol.some
|
hopTx.symbol = tokenSymbol.some
|
||||||
@ -341,6 +342,13 @@ QtObject:
|
|||||||
hopTx.amount = route.amountIn.some
|
hopTx.amount = route.amountIn.some
|
||||||
hopTx.bonderFee = route.bonderFees.some
|
hopTx.bonderFee = route.bonderFees.some
|
||||||
path.hopTx = hopTx
|
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)
|
paths.add(path)
|
||||||
|
|
||||||
|
2
vendor/status-go
vendored
2
vendor/status-go
vendored
@ -1 +1 @@
|
|||||||
Subproject commit 9137257638bb5b9f6d7e336d0a2a24d65838a2ac
|
Subproject commit 99ff0a18b0c9017a2b3ece03fd829f6616e4e436
|
Loading…
x
Reference in New Issue
Block a user