Skip to content

Commit

Permalink
fix(swap-router): Make sure amount is in bigint type as well
Browse files Browse the repository at this point in the history
  • Loading branch information
gulcinuras committed Jan 13, 2025
1 parent e3c1d31 commit 29795f6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/liquid-stake/tAlgoClient.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,5 +174,5 @@ describe("TinymanTAlgoClient", () => {
expect(finalTAlgoAccountAsset?.amount).toBe(
(initialTAlgoAccountAsset?.amount ?? 0) - burnAmount
);
}, 10000);
}, 18000);
});
6 changes: 4 additions & 2 deletions src/swap/v2/router/swap-router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,10 @@ export async function getSwapRoute({
Number((serializedResponse as SwapRouterResponse).asset_in.id) !== assetInID ||
Number((serializedResponse as SwapRouterResponse).asset_out.id) !== assetOutID ||
(serializedResponse as SwapRouterResponse).swap_type === SwapType.FixedInput
? amount !== BigInt((serializedResponse as SwapRouterResponse).input_amount ?? 0)
: amount !== BigInt((serializedResponse as SwapRouterResponse).output_amount ?? 0)
? BigInt(amount) !==
BigInt((serializedResponse as SwapRouterResponse).input_amount ?? 0)
: BigInt(amount) !==
BigInt((serializedResponse as SwapRouterResponse).output_amount ?? 0)
) {
throw new SwapQuoteError(
SwapQuoteErrorType.UnknownError,
Expand Down

0 comments on commit 29795f6

Please sign in to comment.