Skip to content

Commit

Permalink
chore: add bridgeSteps to txMeta during bridge tx
Browse files Browse the repository at this point in the history
  • Loading branch information
infiniteflower committed Nov 13, 2024
1 parent 474d7cf commit 2a6a2b2
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions ui/ducks/bridge/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,32 @@ export const submitBridgeTransaction = (
approvalTxId,
// this is the decimal (non atomic) amount (not USD value) of source token to swap
swapTokenValue: sentAmountDec,
// Convert chainIds to hex
bridgeSteps: quoteResponse.quote.steps.map((step) => ({
...step,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
action: step.action as any,
srcChainId: new Numeric(step.srcChainId, 10)
.toPrefixedHexString()
.toLowerCase() as `0x${string}`,
destChainId: step.destChainId
? (new Numeric(step.destChainId, 10)
.toPrefixedHexString()
.toLowerCase() as `0x${string}`)
: undefined,
srcAsset: {
...step.srcAsset,
chainId: new Numeric(step.srcAsset.chainId, 10)
.toPrefixedHexString()
.toLowerCase() as `0x${string}`,
},
destAsset: {
...step.destAsset,
chainId: new Numeric(step.destAsset.chainId, 10)
.toPrefixedHexString()
.toLowerCase() as `0x${string}`,
},
})),
},
});

Expand Down

0 comments on commit 2a6a2b2

Please sign in to comment.