Skip to content

Commit 1949b8b

Browse files
authored
Merge pull request #124 from skip-mev/handle-swap-out
Handle swap exact out in route display
2 parents 2db5902 + 69f8b6f commit 1949b8b

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

Diff for: chain-registry

Submodule chain-registry updated 129 files

Diff for: src/components/RouteDisplay.tsx

+18
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,24 @@ const RouteDisplay: FC<Props> = ({ route }) => {
331331
].denomOut;
332332
}
333333

334+
if ("swapOut" in operation.swap) {
335+
_actions.push({
336+
type: "SWAP",
337+
sourceAsset: operation.swap.swapOut.swapOperations[0].denomIn,
338+
destinationAsset:
339+
operation.swap.swapOut.swapOperations[
340+
operation.swap.swapOut.swapOperations.length - 1
341+
].denomOut,
342+
chain: operation.swap.swapOut.swapVenue.chainID,
343+
venue: operation.swap.swapOut.swapVenue.name,
344+
});
345+
346+
asset =
347+
operation.swap.swapOut.swapOperations[
348+
operation.swap.swapOut.swapOperations.length - 1
349+
].denomOut;
350+
}
351+
334352
return;
335353
}
336354

0 commit comments

Comments
 (0)