Skip to content

Commit

Permalink
Merge pull request #360 from tonkeeper/fix/swaps-ton-to-query
Browse files Browse the repository at this point in the history
Support ton in ft and tt params for swaps widget
  • Loading branch information
KuznetsovNikita authored Jan 14, 2025
2 parents efbfdf0 + ba2dd44 commit 291f5fe
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions apps/web-swap-widget/src/libs/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { useSwapFromAsset, useSwapToAsset } from '@tonkeeper/uikit/dist/state/sw
import { useAllSwapAssets } from '@tonkeeper/uikit/dist/state/swap/useSwapAssets';
import { tonAssetAddressToString } from '@tonkeeper/core/dist/entries/crypto/asset/ton-asset';
import { Address } from '@ton/core';
import { TON_ASSET } from '@tonkeeper/core/dist/entries/crypto/asset/constants';

export const useAppHeight = () => {
useEffect(() => {
Expand Down Expand Up @@ -102,6 +103,8 @@ export const useApplyQueryParams = () => {
tonAssetAddressToString(asset.address).toLowerCase() ===
Address.parse(fromAssetParam).toRawString()
)
: fromAssetParam?.toLowerCase() === 'ton'
? TON_ASSET
: undefined;
if (fromAssetToSet) {
setFromAsset(fromAssetToSet);
Expand All @@ -114,6 +117,8 @@ export const useApplyQueryParams = () => {
tonAssetAddressToString(asset.address).toLowerCase() ===
Address.parse(toAssetParam).toRawString()
)
: toAssetParam?.toLowerCase() === 'ton'
? TON_ASSET
: undefined;
if (toAssetToSet) {
setToAsset(toAssetToSet);
Expand Down

0 comments on commit 291f5fe

Please sign in to comment.