@0xsquid/react-hooks 8.5.1-beta-stellar-tempo.0 → 8.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/constants.d.ts +0 -3
- package/dist/core/externalLinks.d.ts +1 -1
- package/dist/core/queries/queries-keys.d.ts +1 -1
- package/dist/core/types/config.d.ts +10 -2
- package/dist/core/types/event.d.ts +4 -0
- package/dist/hooks/index.d.ts +2 -1
- package/dist/hooks/swap/useUrlSwapParams.d.ts +10 -0
- package/dist/hooks/transaction/send/useEstimateSendTransactionGas.d.ts +2 -10
- package/dist/hooks/transaction/useEstimate.d.ts +12 -7
- package/dist/hooks/user/useUserParams.d.ts +4 -0
- package/dist/{index-BSX11dad.js → index-BvAot66c.js} +317 -298
- package/dist/index-BvAot66c.js.map +1 -0
- package/dist/{index-XR8ODWxH.js → index-Ck3Byj7H.js} +313 -298
- package/dist/index-Ck3Byj7H.js.map +1 -0
- package/dist/{index.es-CczeKjuj.js → index.es-83oSJcJe.js} +2 -2
- package/dist/{index.es-CczeKjuj.js.map → index.es-83oSJcJe.js.map} +1 -1
- package/dist/{index.es-CkrP1GZJ.js → index.es-C_BgGjLx.js} +2 -2
- package/dist/{index.es-CkrP1GZJ.js.map → index.es-C_BgGjLx.js.map} +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/dist/{secretService-ChCrHmS3.js → secretService-Cj_HK_on.js} +2 -2
- package/dist/{secretService-ChCrHmS3.js.map → secretService-Cj_HK_on.js.map} +1 -1
- package/dist/{secretService-ScgDU3bX.js → secretService-zFFQM-jC.js} +2 -2
- package/dist/{secretService-ScgDU3bX.js.map → secretService-zFFQM-jC.js.map} +1 -1
- package/dist/server.d.ts +1 -0
- package/dist/server.esm.js +100 -0
- package/dist/server.esm.js.map +1 -0
- package/dist/server.js +111 -0
- package/dist/server.js.map +1 -0
- package/dist/services/index.d.ts +1 -0
- package/dist/services/internal/assetsService.d.ts +2 -2
- package/dist/services/internal/configService.d.ts +2 -1
- package/dist/services/internal/estimateService.d.ts +28 -15
- package/dist/services/internal/eventService.d.ts +4 -0
- package/dist/services/internal/urlParamsService.d.ts +19 -0
- package/dist/{stellarService.client-D65n-wCV.js → stellarService.client-CBzr6pLs.js} +2 -2
- package/dist/{stellarService.client-D65n-wCV.js.map → stellarService.client-CBzr6pLs.js.map} +1 -1
- package/dist/{stellarService.client-BaDOSK8x.js → stellarService.client-CI86BfjV.js} +2 -2
- package/dist/{stellarService.client-BaDOSK8x.js.map → stellarService.client-CI86BfjV.js.map} +1 -1
- package/dist/tests/urlParamsService.test.d.ts +1 -0
- package/package.json +13 -1
- package/dist/hooks/tokens/useSourceChainGasToken.d.ts +0 -10
- package/dist/hooks/transaction/useTempoFeeCheck.d.ts +0 -11
- package/dist/index-BSX11dad.js.map +0 -1
- package/dist/index-XR8ODWxH.js.map +0 -1
- package/dist/services/internal/tempoService.d.ts +0 -38
|
@@ -36,7 +36,7 @@ import { InjectiveSigningStargateClient } from '@injectivelabs/sdk-ts/dist/cjs/c
|
|
|
36
36
|
import { Squid } from '@0xsquid/sdk';
|
|
37
37
|
import { mainnet } from 'viem/chains';
|
|
38
38
|
|
|
39
|
-
const squidApiBaseUrl = "https://api.
|
|
39
|
+
const squidApiBaseUrl = "https://v2.api.squidrouter.com";
|
|
40
40
|
|
|
41
41
|
const WALLETCONNECT_PROJECT_ID = "db6a4f6ff58e4172b2fd52f01360bc49";
|
|
42
42
|
const WALLETCONNECT_WALLET_IDS = {
|
|
@@ -124,9 +124,6 @@ const CHAIN_IDS = {
|
|
|
124
124
|
SONEIUM: "1868",
|
|
125
125
|
PEAQ: "3338",
|
|
126
126
|
HEDERA: "295",
|
|
127
|
-
MANTRA: "5888",
|
|
128
|
-
CITREA: "4114",
|
|
129
|
-
TEMPO: "4217",
|
|
130
127
|
// others
|
|
131
128
|
BITCOIN: "bitcoin",
|
|
132
129
|
SOLANA: "solana-mainnet-beta",
|
|
@@ -22391,7 +22388,7 @@ const keys = () => ({
|
|
|
22391
22388
|
// ============
|
|
22392
22389
|
// Transactions
|
|
22393
22390
|
// ============
|
|
22394
|
-
transaction: (fromChainId, toChainId, toTokenAddress, fromTokenAddress, price, slippage, sourceUserAddress, degenMode, destinationAddress, fallbackAddress, quoteOnly, fromChainType, preHook, postHook, overrideGasRefundAddress) => [
|
|
22391
|
+
transaction: (fromChainId, toChainId, toTokenAddress, fromTokenAddress, price, slippage, getGasOnDestination, sourceUserAddress, degenMode, destinationAddress, fallbackAddress, quoteOnly, fromChainType, preHook, postHook, overrideGasRefundAddress) => [
|
|
22395
22392
|
...keys().transactions(),
|
|
22396
22393
|
QueryKeys.Transaction,
|
|
22397
22394
|
fromChainId,
|
|
@@ -22400,6 +22397,7 @@ const keys = () => ({
|
|
|
22400
22397
|
fromTokenAddress,
|
|
22401
22398
|
price,
|
|
22402
22399
|
slippage,
|
|
22400
|
+
getGasOnDestination,
|
|
22403
22401
|
sourceUserAddress,
|
|
22404
22402
|
degenMode,
|
|
22405
22403
|
destinationAddress,
|
|
@@ -22576,11 +22574,19 @@ const getPrefixKey = (key) => {
|
|
|
22576
22574
|
}
|
|
22577
22575
|
};
|
|
22578
22576
|
|
|
22577
|
+
const isNamedTokenConfig = (t) => "networkName" in t;
|
|
22578
|
+
const resolveChainIdFromAsset = (asset, chains) => {
|
|
22579
|
+
const chainId = isNamedTokenConfig(asset)
|
|
22580
|
+
? chains.find((c) => c.networkName.toLowerCase() === asset.networkName.toLowerCase())?.chainId
|
|
22581
|
+
: asset.chainId;
|
|
22582
|
+
return chains.some((c) => c.chainId === chainId) ? chainId : undefined;
|
|
22583
|
+
};
|
|
22579
22584
|
const getConfigWithDefaults = (config) => {
|
|
22580
22585
|
return {
|
|
22581
22586
|
integratorId: get$2(config, "integratorId", defaultConfigValues.integratorId),
|
|
22582
22587
|
slippage: get$2(config, "slippage", defaultConfigValues.slippage),
|
|
22583
22588
|
collectFees: get$2(config, "collectFees", defaultConfigValues.collectFees),
|
|
22589
|
+
enableGetGasOnDestination: get$2(config, "enableGetGasOnDestination", defaultConfigValues.enableGetGasOnDestination),
|
|
22584
22590
|
apiUrl: get$2(config, "apiUrl", defaultConfigValues.apiUrl),
|
|
22585
22591
|
priceImpactWarnings: get$2(config, "priceImpactWarnings", defaultConfigValues.priceImpactWarnings),
|
|
22586
22592
|
initialAssets: get$2(config, "initialAssets", defaultConfigValues.initialAssets),
|
|
@@ -22703,15 +22709,20 @@ const getInitialOrDefaultTokenAddressForChain = ({ tokens, config, chainId, dire
|
|
|
22703
22709
|
* @returns The initial token address if found; otherwise, the default token address.
|
|
22704
22710
|
*/
|
|
22705
22711
|
const getInitialTokenAddressForChain = ({ chainId, config, direction, tokens, unavailableTokenAddress, }) => {
|
|
22706
|
-
|
|
22707
|
-
|
|
22708
|
-
|
|
22709
|
-
|
|
22710
|
-
|
|
22711
|
-
|
|
22712
|
-
|
|
22713
|
-
|
|
22714
|
-
|
|
22712
|
+
const initialAsset = config.initialAssets?.[direction];
|
|
22713
|
+
if (!initialAsset)
|
|
22714
|
+
return undefined;
|
|
22715
|
+
if (isNamedTokenConfig(initialAsset)) {
|
|
22716
|
+
if (!initialAsset.symbol)
|
|
22717
|
+
return undefined;
|
|
22718
|
+
return tokens.find((t) => t.chainId === chainId &&
|
|
22719
|
+
t.symbol.toLowerCase() === initialAsset.symbol.toLowerCase())?.address;
|
|
22720
|
+
}
|
|
22721
|
+
if (initialAsset.chainId === chainId &&
|
|
22722
|
+
initialAsset.address !== unavailableTokenAddress &&
|
|
22723
|
+
tokens.some((t) => t.chainId === initialAsset.chainId &&
|
|
22724
|
+
t.address.toLowerCase() === initialAsset.address.toLowerCase())) {
|
|
22725
|
+
return initialAsset.address;
|
|
22715
22726
|
}
|
|
22716
22727
|
};
|
|
22717
22728
|
/**
|
|
@@ -22756,15 +22767,14 @@ const getInitialChainIdFromConfig = ({ config, direction, chains = [], }) => {
|
|
|
22756
22767
|
return undefined;
|
|
22757
22768
|
const supportedChainIds = getSupportedChainIdsForDirection(chains.map((c) => c.chainId), config, direction);
|
|
22758
22769
|
const availableChains = chains.filter((c) => supportedChainIds.includes(c.chainId));
|
|
22759
|
-
|
|
22760
|
-
|
|
22761
|
-
|
|
22762
|
-
|
|
22770
|
+
const initialAsset = config.initialAssets?.[direction];
|
|
22771
|
+
if (!initialAsset)
|
|
22772
|
+
return undefined;
|
|
22773
|
+
if (isNamedTokenConfig(initialAsset)) {
|
|
22774
|
+
return availableChains.find((c) => c.networkName.toLowerCase() === initialAsset.networkName.toLowerCase())?.chainId;
|
|
22763
22775
|
}
|
|
22764
|
-
if (
|
|
22765
|
-
|
|
22766
|
-
availableChains.some((c) => c.chainId === String(config.initialAssets?.to?.chainId))) {
|
|
22767
|
-
return String(config.initialAssets.to.chainId);
|
|
22776
|
+
if (availableChains.some((c) => c.chainId === initialAsset.chainId)) {
|
|
22777
|
+
return initialAsset.chainId;
|
|
22768
22778
|
}
|
|
22769
22779
|
return undefined;
|
|
22770
22780
|
};
|
|
@@ -23070,8 +23080,8 @@ const sortAllTokens = (tokenA, tokenB) => {
|
|
|
23070
23080
|
return 0;
|
|
23071
23081
|
};
|
|
23072
23082
|
const findToken = (tokens, chainId, address) => tokens.find((t) => t.chainId === chainId && t.address === address);
|
|
23073
|
-
const findNativeToken = (tokens, chain) => tokens.find((t) => t.symbol.toUpperCase() === chain
|
|
23074
|
-
t.chainId == chain
|
|
23083
|
+
const findNativeToken = (tokens, chain) => tokens.find((t) => t.symbol.toUpperCase() === chain?.nativeCurrency.symbol.toUpperCase() &&
|
|
23084
|
+
t.chainId == chain?.chainId);
|
|
23075
23085
|
const normalizeIbcAddress = (address) => {
|
|
23076
23086
|
if (!address.toLowerCase().startsWith("ibc/")) {
|
|
23077
23087
|
return address;
|
|
@@ -23282,7 +23292,7 @@ const filterViewableTokens = (tokens, config, direction) => {
|
|
|
23282
23292
|
};
|
|
23283
23293
|
const getSecretNetworkBalances = async (chainData, cosmosAddress, squidTokens, keplrTypeWallet) => {
|
|
23284
23294
|
const squidSecretTokens = squidTokens.filter((t) => t.chainId === CHAIN_IDS.SECRET);
|
|
23285
|
-
const { fetchAllSecretBalances } = await import('./secretService-
|
|
23295
|
+
const { fetchAllSecretBalances } = await import('./secretService-zFFQM-jC.js');
|
|
23286
23296
|
return fetchAllSecretBalances(chainData, cosmosAddress, squidSecretTokens, keplrTypeWallet);
|
|
23287
23297
|
};
|
|
23288
23298
|
function getTokenAssetsKey(token) {
|
|
@@ -24973,7 +24983,7 @@ class OnrampService {
|
|
|
24973
24983
|
});
|
|
24974
24984
|
return data;
|
|
24975
24985
|
}
|
|
24976
|
-
async getConfiguration({ chains
|
|
24986
|
+
async getConfiguration({ chains, tokens, }) {
|
|
24977
24987
|
const { data } = await axios.get(`${this.baseUrl}/config`);
|
|
24978
24988
|
// Filter supportedCryptos to only include tokens that match our provided tokens
|
|
24979
24989
|
const filteredCryptos = data.supportedCryptos.filter((supportedCrypto) => tokens.some((token) => token.address.toLowerCase() ===
|
|
@@ -25978,6 +25988,88 @@ function isHistoryTransactionEnded({ txType, data, }) {
|
|
|
25978
25988
|
}
|
|
25979
25989
|
}
|
|
25980
25990
|
|
|
25991
|
+
/**
|
|
25992
|
+
* Parses URL search params into an initialAssets config object.
|
|
25993
|
+
*
|
|
25994
|
+
* Supports two formats:
|
|
25995
|
+
* - Legacy: ?chains=fromId,toId&tokens=fromAddr,toAddr
|
|
25996
|
+
* - Pretty: ?fromChain=ethereum&fromToken=eth&toChain=polygon&toToken=usdc
|
|
25997
|
+
* - Collapsed chain/token: when both from/to chains or tokens are the same,
|
|
25998
|
+
* they are collapsed into a single param:
|
|
25999
|
+
* - ?chain=ethereum -> from and to chains are both ethereum
|
|
26000
|
+
* - ?token=eth -> from and to tokens are both eth
|
|
26001
|
+
*/
|
|
26002
|
+
const parseInitialAssetsFromUrl = (searchParams) => {
|
|
26003
|
+
// Legacy format
|
|
26004
|
+
if (searchParams.has("chains") || searchParams.has("tokens")) {
|
|
26005
|
+
const [fromTokenAddress, toTokenAddress] = searchParams.get("tokens")?.split(",") ?? [];
|
|
26006
|
+
const [fromChainId, toChainId] = searchParams.get("chains")?.split(",") ?? [];
|
|
26007
|
+
const from = fromChainId && fromTokenAddress
|
|
26008
|
+
? { chainId: fromChainId, address: fromTokenAddress }
|
|
26009
|
+
: undefined;
|
|
26010
|
+
const to = toChainId && toTokenAddress
|
|
26011
|
+
? { chainId: toChainId, address: toTokenAddress }
|
|
26012
|
+
: undefined;
|
|
26013
|
+
return { from, to };
|
|
26014
|
+
}
|
|
26015
|
+
// Pretty format
|
|
26016
|
+
const chainParam = searchParams.get("chain")?.toLowerCase();
|
|
26017
|
+
const tokenParam = searchParams.get("token")?.toLowerCase();
|
|
26018
|
+
const fromChainParam = searchParams.get("fromChain")?.toLowerCase() ?? chainParam;
|
|
26019
|
+
const toTokenExplicit = searchParams.get("toToken")?.toLowerCase();
|
|
26020
|
+
// ?chain=X falls back for toChain when toToken is explicit (same-chain bridge shorthand)
|
|
26021
|
+
const toChainParam = searchParams.get("toChain")?.toLowerCase() ??
|
|
26022
|
+
(toTokenExplicit ? chainParam : undefined);
|
|
26023
|
+
const fromTokenParam = searchParams.get("fromToken")?.toLowerCase() ?? tokenParam;
|
|
26024
|
+
const toTokenParam = toTokenExplicit ?? (toChainParam ? tokenParam : undefined);
|
|
26025
|
+
const from = fromChainParam
|
|
26026
|
+
? { networkName: fromChainParam, symbol: fromTokenParam }
|
|
26027
|
+
: undefined;
|
|
26028
|
+
const to = toChainParam
|
|
26029
|
+
? { networkName: toChainParam, symbol: toTokenParam }
|
|
26030
|
+
: undefined;
|
|
26031
|
+
return { from, to };
|
|
26032
|
+
};
|
|
26033
|
+
/**
|
|
26034
|
+
* Builds URL search params from a `swapParamsChanged` event detail.
|
|
26035
|
+
* Uses the pretty format, collapsing chain/token params when both sides match.
|
|
26036
|
+
*/
|
|
26037
|
+
const buildUrlSearchParamsFromSwapEvent = (swapParams) => {
|
|
26038
|
+
const fromNetworkName = swapParams.fromNetworkName?.toLowerCase();
|
|
26039
|
+
const toNetworkName = swapParams.toNetworkName?.toLowerCase();
|
|
26040
|
+
const fromTokenSymbol = swapParams.fromTokenSymbol?.toLowerCase();
|
|
26041
|
+
const toTokenSymbol = swapParams.toTokenSymbol?.toLowerCase();
|
|
26042
|
+
const params = new URLSearchParams();
|
|
26043
|
+
const bothResolved = fromNetworkName && fromTokenSymbol && toNetworkName && toTokenSymbol;
|
|
26044
|
+
if (bothResolved) {
|
|
26045
|
+
if (fromNetworkName === toNetworkName) {
|
|
26046
|
+
params.set("chain", fromNetworkName);
|
|
26047
|
+
}
|
|
26048
|
+
else {
|
|
26049
|
+
params.set("fromChain", fromNetworkName);
|
|
26050
|
+
params.set("toChain", toNetworkName);
|
|
26051
|
+
}
|
|
26052
|
+
if (fromTokenSymbol === toTokenSymbol) {
|
|
26053
|
+
params.set("token", fromTokenSymbol);
|
|
26054
|
+
}
|
|
26055
|
+
else {
|
|
26056
|
+
params.set("fromToken", fromTokenSymbol);
|
|
26057
|
+
params.set("toToken", toTokenSymbol);
|
|
26058
|
+
}
|
|
26059
|
+
}
|
|
26060
|
+
else {
|
|
26061
|
+
if (fromNetworkName && fromTokenSymbol) {
|
|
26062
|
+
params.set("fromChain", fromNetworkName);
|
|
26063
|
+
params.set("fromToken", fromTokenSymbol);
|
|
26064
|
+
}
|
|
26065
|
+
if (toNetworkName && toTokenSymbol) {
|
|
26066
|
+
params.set("toChain", toNetworkName);
|
|
26067
|
+
params.set("toToken", toTokenSymbol);
|
|
26068
|
+
}
|
|
26069
|
+
}
|
|
26070
|
+
return params;
|
|
26071
|
+
};
|
|
26072
|
+
|
|
25981
26073
|
// Memoized map to store chain data, calculated only once
|
|
25982
26074
|
let memoizedChainsByIdMap = null;
|
|
25983
26075
|
// Optimize calculation to prevent unnecessary re-renders
|
|
@@ -26598,7 +26690,7 @@ function useStellarWallets() {
|
|
|
26598
26690
|
try {
|
|
26599
26691
|
const { allowAllModules: initializeAllModules } = await import('@creit.tech/stellar-wallets-kit');
|
|
26600
26692
|
const { LedgerModule } = await import('@creit.tech/stellar-wallets-kit/modules/ledger.module');
|
|
26601
|
-
const { formatStellarWallet } = await import('./stellarService.client-
|
|
26693
|
+
const { formatStellarWallet } = await import('./stellarService.client-CI86BfjV.js');
|
|
26602
26694
|
const modules = [...initializeAllModules(), new LedgerModule()];
|
|
26603
26695
|
const promises = modules.map(async (module) => {
|
|
26604
26696
|
const isAvailable = await module.isAvailable();
|
|
@@ -27502,20 +27594,14 @@ const useSwap = () => {
|
|
|
27502
27594
|
const { tokens } = useSquidTokens();
|
|
27503
27595
|
const queryClient = useQueryClient();
|
|
27504
27596
|
const { chains, supportedDestinationChains, supportedSourceChains } = useSquidChains();
|
|
27505
|
-
const sourceChainId = useMemo(() => swapRoute?.fromChainId
|
|
27506
|
-
(
|
|
27507
|
-
initialAssets
|
|
27508
|
-
|
|
27509
|
-
|
|
27510
|
-
initialAssets?.
|
|
27511
|
-
|
|
27512
|
-
|
|
27513
|
-
(supportedDestinationChains.find((c) => c.chainId === initialAssets?.to?.chainId) &&
|
|
27514
|
-
initialAssets?.to?.chainId), [
|
|
27515
|
-
swapRoute?.toChainId,
|
|
27516
|
-
supportedDestinationChains,
|
|
27517
|
-
initialAssets?.to?.chainId,
|
|
27518
|
-
]);
|
|
27597
|
+
const sourceChainId = useMemo(() => swapRoute?.fromChainId ??
|
|
27598
|
+
(initialAssets?.from
|
|
27599
|
+
? resolveChainIdFromAsset(initialAssets.from, supportedSourceChains)
|
|
27600
|
+
: undefined), [swapRoute?.fromChainId, supportedSourceChains, initialAssets?.from]);
|
|
27601
|
+
const destChainId = useMemo(() => swapRoute?.toChainId ??
|
|
27602
|
+
(initialAssets?.to
|
|
27603
|
+
? resolveChainIdFromAsset(initialAssets.to, supportedDestinationChains)
|
|
27604
|
+
: undefined), [swapRoute?.toChainId, supportedDestinationChains, initialAssets?.to]);
|
|
27519
27605
|
const fromChain = useMemo(() => supportedSourceChains.find((c) => c.chainId === swapRoute?.fromChainId), [swapRoute?.fromChainId, supportedSourceChains]);
|
|
27520
27606
|
const toChain = useMemo(() => supportedDestinationChains.find((c) => c.chainId === swapRoute?.toChainId), [swapRoute?.toChainId, supportedDestinationChains]);
|
|
27521
27607
|
const fromTokens = useMemo(() => getTokensForChain(tokens, sourceChainId), [tokens, sourceChainId]);
|
|
@@ -27576,11 +27662,30 @@ const useSwap = () => {
|
|
|
27576
27662
|
queryClient,
|
|
27577
27663
|
connectedSourceAddress: connectedSourceAddress.address,
|
|
27578
27664
|
});
|
|
27665
|
+
const { fromChainId, toChainId, fromTokenAddress, toTokenAddress } = newSwapParams;
|
|
27666
|
+
const fromChainData = fromChainId
|
|
27667
|
+
? chains.find((c) => c.chainId === fromChainId)
|
|
27668
|
+
: undefined;
|
|
27669
|
+
const toChainData = toChainId
|
|
27670
|
+
? chains.find((c) => c.chainId === toChainId)
|
|
27671
|
+
: undefined;
|
|
27672
|
+
const fromTokenData = fromChainId && fromTokenAddress
|
|
27673
|
+
? tokens.find((t) => t.chainId === fromChainId &&
|
|
27674
|
+
t.address.toLowerCase() === fromTokenAddress.toLowerCase())
|
|
27675
|
+
: undefined;
|
|
27676
|
+
const toTokenData = toChainId && toTokenAddress
|
|
27677
|
+
? tokens.find((t) => t.chainId === toChainId &&
|
|
27678
|
+
t.address.toLowerCase() === toTokenAddress.toLowerCase())
|
|
27679
|
+
: undefined;
|
|
27579
27680
|
WidgetEvents.getInstance().dispatchSwapParamsChanged({
|
|
27580
|
-
fromChainId
|
|
27581
|
-
toChainId
|
|
27582
|
-
fromTokenAddress
|
|
27583
|
-
toTokenAddress
|
|
27681
|
+
fromChainId,
|
|
27682
|
+
toChainId,
|
|
27683
|
+
fromTokenAddress,
|
|
27684
|
+
toTokenAddress,
|
|
27685
|
+
fromNetworkName: fromChainData?.networkName,
|
|
27686
|
+
toNetworkName: toChainData?.networkName,
|
|
27687
|
+
fromTokenSymbol: fromTokenData?.symbol,
|
|
27688
|
+
toTokenSymbol: toTokenData?.symbol,
|
|
27584
27689
|
});
|
|
27585
27690
|
useSwapRoutePersistStore.setState({
|
|
27586
27691
|
swapRoute: newSwapParams,
|
|
@@ -29420,8 +29525,6 @@ function useNativeTokenForChain(chain) {
|
|
|
29420
29525
|
}
|
|
29421
29526
|
};
|
|
29422
29527
|
const nativeTokenForChainType = useMemo(() => {
|
|
29423
|
-
if (!chain)
|
|
29424
|
-
return undefined;
|
|
29425
29528
|
return findNativeToken(getTokensForChainType(), chain);
|
|
29426
29529
|
}, [chain]);
|
|
29427
29530
|
return { nativeToken: nativeTokenForChainType };
|
|
@@ -29905,7 +30008,7 @@ function hederaWalletConnect(parameters) {
|
|
|
29905
30008
|
const optionalChains = config.chains.map((x) => x.id);
|
|
29906
30009
|
if (!optionalChains.length)
|
|
29907
30010
|
return;
|
|
29908
|
-
const { EthereumProvider } = await import('./index.es-
|
|
30011
|
+
const { EthereumProvider } = await import('./index.es-83oSJcJe.js');
|
|
29909
30012
|
const rawProvider = await EthereumProvider.init({
|
|
29910
30013
|
...restParameters,
|
|
29911
30014
|
disableProviderPing: true,
|
|
@@ -30647,6 +30750,28 @@ function useDepositAddress(squidRoute) {
|
|
|
30647
30750
|
};
|
|
30648
30751
|
}
|
|
30649
30752
|
|
|
30753
|
+
/**
|
|
30754
|
+
* Reads initial swap assets from URL params on mount, and keeps the URL in
|
|
30755
|
+
* sync with swap param changes emitted by the widget.
|
|
30756
|
+
*/
|
|
30757
|
+
const useUrlSwapParams = () => {
|
|
30758
|
+
const initialAssets = useMemo(() => typeof window !== "undefined"
|
|
30759
|
+
? parseInitialAssetsFromUrl(new URLSearchParams(window.location.search))
|
|
30760
|
+
: undefined, []);
|
|
30761
|
+
useEffect(() => {
|
|
30762
|
+
const onSwapParamsChanged = (event) => {
|
|
30763
|
+
const params = buildUrlSearchParamsFromSwapEvent(event?.detail);
|
|
30764
|
+
const qs = params.toString();
|
|
30765
|
+
history.pushState({}, "", qs ? "?" + qs : location.pathname);
|
|
30766
|
+
};
|
|
30767
|
+
WidgetEvents.getInstance().listenToWidget("swapParamsChanged", onSwapParamsChanged);
|
|
30768
|
+
return () => {
|
|
30769
|
+
WidgetEvents.getInstance().removeWidgetListener("swapParamsChanged", onSwapParamsChanged);
|
|
30770
|
+
};
|
|
30771
|
+
}, []);
|
|
30772
|
+
return { initialAssets };
|
|
30773
|
+
};
|
|
30774
|
+
|
|
30650
30775
|
const useAllTokensWithBalanceForChainType = ({ chainType, address, direction, queryOptions, }) => {
|
|
30651
30776
|
const { evmChains, cosmosChains, suiChains, xrplChains, stellarChains } = useSquidChains(direction);
|
|
30652
30777
|
const { evmTokens, cosmosTokens, solanaTokens, bitcoinTokens, suiTokens, xrplTokens, stellarTokens, } = useSquidTokens(direction);
|
|
@@ -31031,143 +31156,6 @@ const useSingleTokenPrice = (tokenData) => {
|
|
|
31031
31156
|
return { tokenPrice, getUSDValue };
|
|
31032
31157
|
};
|
|
31033
31158
|
|
|
31034
|
-
const TEMPO_FEE_MANAGER_ADDRESS = "0xfeec000000000000000000000000000000000000";
|
|
31035
|
-
const feeManagerAbi = [
|
|
31036
|
-
{
|
|
31037
|
-
name: "userTokens",
|
|
31038
|
-
type: "function",
|
|
31039
|
-
stateMutability: "view",
|
|
31040
|
-
inputs: [{ type: "address", name: "user" }],
|
|
31041
|
-
outputs: [{ type: "address" }],
|
|
31042
|
-
},
|
|
31043
|
-
];
|
|
31044
|
-
const isTempoChain = (chainId) => chainId === CHAIN_IDS.TEMPO;
|
|
31045
|
-
/**
|
|
31046
|
-
* Convert a fee amount from virtual USD (18 decimals, attodollars)
|
|
31047
|
-
* to 6-decimal TIP-20 stablecoin units (microdollars).
|
|
31048
|
-
* All TIP-20 tokens on Tempo have 6 decimals.
|
|
31049
|
-
*/
|
|
31050
|
-
const convertTempoFeeToStablecoinUnits = (feeIn18Dec) => feeIn18Dec / BigInt(10 ** 12);
|
|
31051
|
-
|
|
31052
|
-
const BALANCE_QUERY_STALE_TIME = 10_000;
|
|
31053
|
-
/**
|
|
31054
|
-
* Returns raw on-chain gas token data for Tempo chains, or null when the source
|
|
31055
|
-
* chain is not Tempo.
|
|
31056
|
-
*/
|
|
31057
|
-
const useTempoFeeCheck = ({ fromChain, fromToken, }) => {
|
|
31058
|
-
const { connectedAddresses } = useWallet();
|
|
31059
|
-
const evmAddress = parseEvmAddress(connectedAddresses[ChainType.EVM]);
|
|
31060
|
-
const isTempo = isTempoChain(fromChain?.chainId);
|
|
31061
|
-
const chainId = Number(fromChain?.chainId);
|
|
31062
|
-
// Read account-level gas token preference from FeeManager precompile
|
|
31063
|
-
// See docs: https://docs.tempo.xyz/protocol/fees/spec-fee#account-level
|
|
31064
|
-
const { data: accountGasTokenAddress } = useReadContract({
|
|
31065
|
-
address: TEMPO_FEE_MANAGER_ADDRESS,
|
|
31066
|
-
abi: feeManagerAbi,
|
|
31067
|
-
functionName: "userTokens",
|
|
31068
|
-
args: evmAddress ? [evmAddress] : undefined,
|
|
31069
|
-
chainId,
|
|
31070
|
-
query: {
|
|
31071
|
-
enabled: isTempo && !!evmAddress,
|
|
31072
|
-
staleTime: 30_000,
|
|
31073
|
-
},
|
|
31074
|
-
});
|
|
31075
|
-
const hasAccountFeePreference = !!accountGasTokenAddress &&
|
|
31076
|
-
// By default, the zero address is returned when the user has no preference set
|
|
31077
|
-
zeroAddress$1.toLowerCase() !== accountGasTokenAddress.toLowerCase();
|
|
31078
|
-
// Fetch balance of the account-preferred gas token (if set)
|
|
31079
|
-
const { data: accountGasTokenBalance } = useBalance({
|
|
31080
|
-
address: evmAddress,
|
|
31081
|
-
token: hasAccountFeePreference ? accountGasTokenAddress : undefined,
|
|
31082
|
-
chainId,
|
|
31083
|
-
query: {
|
|
31084
|
-
enabled: isTempo && hasAccountFeePreference && !!evmAddress,
|
|
31085
|
-
staleTime: BALANCE_QUERY_STALE_TIME,
|
|
31086
|
-
},
|
|
31087
|
-
});
|
|
31088
|
-
const fromTokenAddress = parseEvmAddress(fromToken?.address);
|
|
31089
|
-
const { data: fromTokenBalance } = useBalance({
|
|
31090
|
-
address: evmAddress,
|
|
31091
|
-
token: fromTokenAddress,
|
|
31092
|
-
chainId,
|
|
31093
|
-
query: {
|
|
31094
|
-
enabled: isTempo && !!evmAddress,
|
|
31095
|
-
staleTime: BALANCE_QUERY_STALE_TIME,
|
|
31096
|
-
},
|
|
31097
|
-
});
|
|
31098
|
-
if (!isTempo)
|
|
31099
|
-
return null;
|
|
31100
|
-
if (hasAccountFeePreference) {
|
|
31101
|
-
if (!accountGasTokenAddress || !accountGasTokenBalance)
|
|
31102
|
-
return null;
|
|
31103
|
-
return {
|
|
31104
|
-
gasTokenAddress: accountGasTokenAddress,
|
|
31105
|
-
gasBalance: accountGasTokenBalance.value,
|
|
31106
|
-
};
|
|
31107
|
-
}
|
|
31108
|
-
if (!fromTokenAddress || !fromTokenBalance)
|
|
31109
|
-
return null;
|
|
31110
|
-
return {
|
|
31111
|
-
gasTokenAddress: fromTokenAddress,
|
|
31112
|
-
gasBalance: fromTokenBalance.value,
|
|
31113
|
-
};
|
|
31114
|
-
};
|
|
31115
|
-
|
|
31116
|
-
function useSourceChainGasToken({ fromChain, fromToken, }) {
|
|
31117
|
-
const { nativeToken } = useNativeTokenForChain(fromChain);
|
|
31118
|
-
const { evmTokens } = useSquidTokens();
|
|
31119
|
-
const { nativeBalance } = useNativeBalance(fromChain);
|
|
31120
|
-
const tempoFeeData = useTempoFeeCheck({ fromChain, fromToken });
|
|
31121
|
-
const chainFeeParams = useMemo(() => {
|
|
31122
|
-
if (fromToken?.address == null ||
|
|
31123
|
-
fromChain?.chainId == null ||
|
|
31124
|
-
nativeBalance?.value == null) {
|
|
31125
|
-
return null;
|
|
31126
|
-
}
|
|
31127
|
-
if (isTempoChain(fromChain.chainId)) {
|
|
31128
|
-
if (!tempoFeeData)
|
|
31129
|
-
return null;
|
|
31130
|
-
const fromTokenPaysNetworkFee = tempoFeeData.gasTokenAddress.toLowerCase() ===
|
|
31131
|
-
fromToken.address.toLowerCase();
|
|
31132
|
-
return {
|
|
31133
|
-
fromTokenPaysNetworkFee,
|
|
31134
|
-
gasTokenBalanceWei: tempoFeeData.gasBalance,
|
|
31135
|
-
normalizeFee: convertTempoFeeToStablecoinUnits,
|
|
31136
|
-
};
|
|
31137
|
-
}
|
|
31138
|
-
return {
|
|
31139
|
-
fromTokenPaysNetworkFee: fromToken.address.toLowerCase() ===
|
|
31140
|
-
chainTypeToNativeTokenAddressMap[fromToken.type].toLowerCase(),
|
|
31141
|
-
gasTokenBalanceWei: nativeBalance.value,
|
|
31142
|
-
normalizeFee: (fee) => fee,
|
|
31143
|
-
};
|
|
31144
|
-
}, [
|
|
31145
|
-
fromToken?.address,
|
|
31146
|
-
fromToken?.type,
|
|
31147
|
-
fromChain?.chainId,
|
|
31148
|
-
nativeBalance?.value,
|
|
31149
|
-
tempoFeeData,
|
|
31150
|
-
]);
|
|
31151
|
-
const gasToken = useMemo(() => {
|
|
31152
|
-
if (fromChain?.chainId == null || fromToken?.address == null)
|
|
31153
|
-
return undefined;
|
|
31154
|
-
if (isTempoChain(fromChain.chainId)) {
|
|
31155
|
-
if (!tempoFeeData)
|
|
31156
|
-
return undefined;
|
|
31157
|
-
return evmTokens.find((t) => t.chainId === fromChain.chainId &&
|
|
31158
|
-
t.address.toLowerCase() === tempoFeeData.gasTokenAddress.toLowerCase());
|
|
31159
|
-
}
|
|
31160
|
-
return nativeToken;
|
|
31161
|
-
}, [
|
|
31162
|
-
fromChain?.chainId,
|
|
31163
|
-
fromToken?.address,
|
|
31164
|
-
nativeToken,
|
|
31165
|
-
tempoFeeData,
|
|
31166
|
-
evmTokens,
|
|
31167
|
-
]);
|
|
31168
|
-
return { gasToken, chainFeeParams };
|
|
31169
|
-
}
|
|
31170
|
-
|
|
31171
31159
|
const MAX_COINGECKO_QUERY_TOKENS = 100;
|
|
31172
31160
|
const fetchHistoricalData = async (coingeckoId, timeFrame) => {
|
|
31173
31161
|
const now = Math.floor(Date.now() / 1000);
|
|
@@ -31318,23 +31306,24 @@ const calculateTotalNativeFees = ({ expressFeeCost, firstFeeCost, firstGasCost,
|
|
|
31318
31306
|
(sameTokenBetweenFees
|
|
31319
31307
|
? BigInt(firstFeeCost?.amount ?? "0") + BigInt(firstGasCost?.amount ?? "0")
|
|
31320
31308
|
: BigInt(firstGasCost?.amount ?? "0"));
|
|
31321
|
-
const
|
|
31322
|
-
|
|
31323
|
-
|
|
31324
|
-
|
|
31325
|
-
|
|
31326
|
-
|
|
31327
|
-
|
|
31328
|
-
|
|
31329
|
-
|
|
31330
|
-
|
|
31331
|
-
|
|
31332
|
-
|
|
31333
|
-
|
|
31334
|
-
|
|
31335
|
-
|
|
31336
|
-
|
|
31337
|
-
}
|
|
31309
|
+
const isFromBalanceEnoughToSwap = ({ isFromTokenNative, fromAmount, totalFeesInNativeTokenPlusRatio, nativeTokenBalanceFromChainWei, }) => {
|
|
31310
|
+
const fromAmountBigInt = BigInt(fromAmount ?? "0");
|
|
31311
|
+
const totalFeesInNativeTokenPlusRatioBigInt = totalFeesInNativeTokenPlusRatio;
|
|
31312
|
+
const nativeTokenBalanceFromChainWeiBigInt = nativeTokenBalanceFromChainWei;
|
|
31313
|
+
return isFromTokenNative
|
|
31314
|
+
? fromAmountBigInt + totalFeesInNativeTokenPlusRatioBigInt <=
|
|
31315
|
+
nativeTokenBalanceFromChainWeiBigInt
|
|
31316
|
+
: totalFeesInNativeTokenPlusRatioBigInt <=
|
|
31317
|
+
nativeTokenBalanceFromChainWeiBigInt;
|
|
31318
|
+
};
|
|
31319
|
+
const calculateMinAmountValueWarnMsg = ({ isFromTokenNative, nativeTokenBalanceFromChainWei, sourceChainNativeTokenDecimals, totalFeesInNativeTokenPlusRatio, }) => isFromTokenNative
|
|
31320
|
+
? (() => {
|
|
31321
|
+
const minAmount = nativeTokenBalanceFromChainWei - totalFeesInNativeTokenPlusRatio;
|
|
31322
|
+
return minAmount > BigInt(0)
|
|
31323
|
+
? formatBNToReadable(minAmount, sourceChainNativeTokenDecimals)
|
|
31324
|
+
: "0";
|
|
31325
|
+
})()
|
|
31326
|
+
: undefined;
|
|
31338
31327
|
/**
|
|
31339
31328
|
* Calculates the estimated duration of a route
|
|
31340
31329
|
*
|
|
@@ -31373,10 +31362,12 @@ const formatEstimatedRouteDuration = ({ estimatedRouteDuration, isSingleChainRou
|
|
|
31373
31362
|
* @returns {Object} An object containing various estimate results and calculations, including token information,
|
|
31374
31363
|
* amounts, fees, gas costs, and other relevant data for the transaction.
|
|
31375
31364
|
*/
|
|
31376
|
-
const calculateEstimateResults = ({ squidRoute, tokens, fromChain, toChain, collectFees,
|
|
31365
|
+
const calculateEstimateResults = ({ squidRoute, tokens, fromChain, toChain, collectFees, nativeTokenBalanceFromChainWei, }) => {
|
|
31377
31366
|
const fromToken = findToken(tokens, squidRoute?.params.fromChain, squidRoute?.params.fromToken);
|
|
31378
31367
|
const fromAmount = squidRoute?.estimate?.fromAmount;
|
|
31379
31368
|
const fromAmountFormatted = formatAmount(fromAmount, fromToken?.decimals);
|
|
31369
|
+
const sourceChainNativeToken = findNativeToken(tokens, fromChain);
|
|
31370
|
+
const destChainNativeToken = findNativeToken(tokens, toChain);
|
|
31380
31371
|
const toAmountUSD = squidRoute?.estimate?.toAmountUSD;
|
|
31381
31372
|
const exchangeRate = squidRoute?.estimate.exchangeRate ?? "0";
|
|
31382
31373
|
const toAmountMinUSD = squidRoute?.estimate.toAmountMinUSD ?? "0";
|
|
@@ -31395,6 +31386,10 @@ const calculateEstimateResults = ({ squidRoute, tokens, fromChain, toChain, coll
|
|
|
31395
31386
|
const expectedGasRefundCostUSD = convertTokenAmountToUSD(formatBNToReadable(expectedGasRefundCost, firstFeeCost?.token.decimals ?? 18), firstFeeCost?.token.usdPrice ?? "0");
|
|
31396
31387
|
const sameTokenBetweenFees = firstFeeCost?.token.address === firstGasCost?.token.address &&
|
|
31397
31388
|
firstFeeCost?.token.chainId === firstGasCost?.token.chainId;
|
|
31389
|
+
const isFromTokenNative =
|
|
31390
|
+
// TODO: temporary fix, currently nativeCurrency.symbol is not always in uppercase
|
|
31391
|
+
fromToken?.symbol.toUpperCase() ===
|
|
31392
|
+
fromChain?.nativeCurrency.symbol.toUpperCase();
|
|
31398
31393
|
const totalNativeFees = calculateTotalNativeFees({
|
|
31399
31394
|
expressFeeCost,
|
|
31400
31395
|
firstFeeCost,
|
|
@@ -31402,32 +31397,30 @@ const calculateEstimateResults = ({ squidRoute, tokens, fromChain, toChain, coll
|
|
|
31402
31397
|
sameTokenBetweenFees,
|
|
31403
31398
|
});
|
|
31404
31399
|
const totalFeesInNativeTokenPlusRatio = (totalNativeFees * BigInt(110)) / BigInt(100);
|
|
31405
|
-
const
|
|
31406
|
-
|
|
31407
|
-
chainFeeParams,
|
|
31400
|
+
const fromBalanceEnoughToSwap = isFromBalanceEnoughToSwap({
|
|
31401
|
+
isFromTokenNative,
|
|
31408
31402
|
fromAmount,
|
|
31409
|
-
|
|
31403
|
+
fromTokenDecimals: fromToken?.decimals,
|
|
31404
|
+
totalFeesInNativeTokenPlusRatio,
|
|
31405
|
+
nativeTokenBalanceFromChainWei,
|
|
31410
31406
|
});
|
|
31411
31407
|
const minAmountValueWarnMsg = calculateMinAmountValueWarnMsg({
|
|
31412
|
-
|
|
31413
|
-
|
|
31414
|
-
|
|
31408
|
+
isFromTokenNative,
|
|
31409
|
+
nativeTokenBalanceFromChainWei,
|
|
31410
|
+
sourceChainNativeTokenDecimals: sourceChainNativeToken?.decimals,
|
|
31411
|
+
totalFeesInNativeTokenPlusRatio,
|
|
31415
31412
|
});
|
|
31416
31413
|
const isSingleChainRoute = fromChain?.chainId === toChain?.chainId;
|
|
31417
31414
|
const estimatedRouteDuration = formatEstimatedRouteDuration({
|
|
31418
31415
|
estimatedRouteDuration: squidRoute?.estimate?.estimatedRouteDuration,
|
|
31419
31416
|
isSingleChainRoute,
|
|
31420
31417
|
});
|
|
31421
|
-
// native fees + fromAmount (if native)
|
|
31422
|
-
const totalGasBalanceNeeded = networkFeesWei +
|
|
31423
|
-
BigInt(chainFeeParams?.fromTokenPaysNetworkFee ? fromAmount ?? 0 : 0);
|
|
31424
|
-
const gasBalanceNeeded = gasToken
|
|
31425
|
-
? formatBNToReadable(totalGasBalanceNeeded, gasToken.decimals)
|
|
31426
|
-
: undefined;
|
|
31427
31418
|
return {
|
|
31428
31419
|
fromToken,
|
|
31429
31420
|
fromAmount,
|
|
31430
31421
|
fromAmountFormatted,
|
|
31422
|
+
sourceChainNativeToken,
|
|
31423
|
+
destChainNativeToken,
|
|
31431
31424
|
toAmountUSD,
|
|
31432
31425
|
exchangeRate,
|
|
31433
31426
|
toAmountMinUSD,
|
|
@@ -31442,12 +31435,12 @@ const calculateEstimateResults = ({ squidRoute, tokens, fromChain, toChain, coll
|
|
|
31442
31435
|
expectedGasRefundCost,
|
|
31443
31436
|
expectedGasRefundCostUSD,
|
|
31444
31437
|
sameTokenBetweenFees,
|
|
31445
|
-
|
|
31438
|
+
isFromTokenNative,
|
|
31446
31439
|
totalNativeFees,
|
|
31447
|
-
|
|
31440
|
+
totalFeesInNativeTokenPlusRatio,
|
|
31441
|
+
fromBalanceEnoughToSwap,
|
|
31448
31442
|
minAmountValueWarnMsg,
|
|
31449
31443
|
estimatedRouteDuration,
|
|
31450
|
-
gasBalanceNeeded,
|
|
31451
31444
|
};
|
|
31452
31445
|
};
|
|
31453
31446
|
/**
|
|
@@ -31481,6 +31474,28 @@ const calculateTotalWithRefundEstimate = (allFeeCosts, expectedGasRefundCost, ge
|
|
|
31481
31474
|
feeToken: firstFeeCost?.token,
|
|
31482
31475
|
};
|
|
31483
31476
|
};
|
|
31477
|
+
/**
|
|
31478
|
+
* Calculates the proposed gas amount for the destination chain.
|
|
31479
|
+
*
|
|
31480
|
+
* @param destChainNativeToken - The symbol of the native token for the destination chain.
|
|
31481
|
+
* @returns An object containing the proposed gas amount value and the currency symbol.
|
|
31482
|
+
*/
|
|
31483
|
+
const getProposedGasDestinationAmount = (destChainNativeToken) => {
|
|
31484
|
+
const gasAmounts = {
|
|
31485
|
+
GLMR: 5.289,
|
|
31486
|
+
ETH: 0.0009,
|
|
31487
|
+
AVAX: 0.115,
|
|
31488
|
+
BNB: 0.00425,
|
|
31489
|
+
FTM: 4.45,
|
|
31490
|
+
CELO: 3.052,
|
|
31491
|
+
KAVA: 2.339,
|
|
31492
|
+
MATIC: 1.795,
|
|
31493
|
+
};
|
|
31494
|
+
return {
|
|
31495
|
+
value: gasAmounts[destChainNativeToken ?? ""] ?? 0,
|
|
31496
|
+
currency: destChainNativeToken,
|
|
31497
|
+
};
|
|
31498
|
+
};
|
|
31484
31499
|
|
|
31485
31500
|
function useSendTransactionGas({ chain, token, from, }) {
|
|
31486
31501
|
return useQuery({
|
|
@@ -31502,11 +31517,7 @@ function useSendTransactionGas({ chain, token, from, }) {
|
|
|
31502
31517
|
// Some RPC providers require the sender to have enough balance, otherwise estimation reverts
|
|
31503
31518
|
// so we'll try to use the user provided address when possible
|
|
31504
31519
|
const sender = from || dummyAddress;
|
|
31505
|
-
|
|
31506
|
-
// We can simulate an ERC20 transfer instead
|
|
31507
|
-
const supportsNativeTransfers = chain.chainId !== CHAIN_IDS.TEMPO;
|
|
31508
|
-
const isNativeToken = token.address.toLowerCase() === nativeEvmTokenAddress.toLowerCase();
|
|
31509
|
-
if (isNativeToken && supportsNativeTransfers) {
|
|
31520
|
+
if (token.address.toLowerCase() === nativeEvmTokenAddress.toLowerCase()) {
|
|
31510
31521
|
const gas = await client.estimateGas({
|
|
31511
31522
|
from: sender,
|
|
31512
31523
|
to: dummyAddress,
|
|
@@ -31526,14 +31537,7 @@ function useSendTransactionGas({ chain, token, from, }) {
|
|
|
31526
31537
|
data,
|
|
31527
31538
|
chainId: chain.chainId,
|
|
31528
31539
|
});
|
|
31529
|
-
|
|
31530
|
-
// Tempo fees are denominated in virtual USD (18 dec, 1e-18 USD units).
|
|
31531
|
-
// Convert to 6-dec stablecoin units so all callers receive a
|
|
31532
|
-
// consistent unit without needing to know about the chain.
|
|
31533
|
-
if (chain.chainId === CHAIN_IDS.TEMPO) {
|
|
31534
|
-
return convertTempoFeeToStablecoinUnits(feeWei);
|
|
31535
|
-
}
|
|
31536
|
-
return feeWei;
|
|
31540
|
+
return gas * maxFeePerGas;
|
|
31537
31541
|
}
|
|
31538
31542
|
case ChainType.COSMOS: {
|
|
31539
31543
|
// TODO: get gas estimation from backend
|
|
@@ -31580,33 +31584,19 @@ function useEstimateSendTransaction({ chain, token, amount, balance, from, }) {
|
|
|
31580
31584
|
token,
|
|
31581
31585
|
from,
|
|
31582
31586
|
});
|
|
31583
|
-
const {
|
|
31584
|
-
|
|
31585
|
-
|
|
31586
|
-
});
|
|
31587
|
-
const gasBalanceEnough = useMemo(() => {
|
|
31588
|
-
if (!amount || !token?.decimals)
|
|
31587
|
+
const { nativeBalance } = useNativeBalance(chain);
|
|
31588
|
+
const isNativeBalanceEnoughToPayGasFees = useMemo(() => {
|
|
31589
|
+
if (!nativeBalance?.value || !amount || !token?.decimals) {
|
|
31589
31590
|
return false;
|
|
31590
|
-
|
|
31591
|
-
|
|
31592
|
-
|
|
31593
|
-
|
|
31594
|
-
|
|
31595
|
-
|
|
31596
|
-
|
|
31597
|
-
|
|
31598
|
-
|
|
31599
|
-
// native fees + fromAmount (if native)
|
|
31600
|
-
const totalGasBalanceNeeded = estimatedGas +
|
|
31601
|
-
parseToBigInt(chainFeeParams?.fromTokenPaysNetworkFee ? amount ?? "0" : "0", token.decimals);
|
|
31602
|
-
return formatBNToReadable(totalGasBalanceNeeded, gasToken.decimals);
|
|
31603
|
-
}, [
|
|
31604
|
-
amount,
|
|
31605
|
-
chainFeeParams?.fromTokenPaysNetworkFee,
|
|
31606
|
-
estimatedGas,
|
|
31607
|
-
gasToken?.decimals,
|
|
31608
|
-
token?.decimals,
|
|
31609
|
-
]);
|
|
31591
|
+
}
|
|
31592
|
+
const isTokenNative = token.address.toLowerCase() ===
|
|
31593
|
+
chainTypeToNativeTokenAddressMap[token.type].toLowerCase();
|
|
31594
|
+
if (isTokenNative) {
|
|
31595
|
+
return (parseToBigInt(amount, token.decimals) + estimatedGas <=
|
|
31596
|
+
nativeBalance.value);
|
|
31597
|
+
}
|
|
31598
|
+
return estimatedGas <= nativeBalance.value;
|
|
31599
|
+
}, [amount, estimatedGas, nativeBalance?.value, token]);
|
|
31610
31600
|
const isBalanceEnough = useMemo(() => {
|
|
31611
31601
|
if (token?.decimals == null || !balance || !amount)
|
|
31612
31602
|
return false;
|
|
@@ -31614,21 +31604,28 @@ function useEstimateSendTransaction({ chain, token, amount, balance, from, }) {
|
|
|
31614
31604
|
parseToBigInt(amount, token.decimals));
|
|
31615
31605
|
}, [amount, balance, token?.decimals]);
|
|
31616
31606
|
const minAmountValueWarnMsg = useMemo(() => {
|
|
31617
|
-
if (!token?.address || !
|
|
31607
|
+
if (!token?.address || !nativeBalance?.value || !estimatedGas)
|
|
31618
31608
|
return undefined;
|
|
31609
|
+
const isFromTokenNative = token.address.toLowerCase() ===
|
|
31610
|
+
chainTypeToNativeTokenAddressMap[token.type].toLowerCase();
|
|
31619
31611
|
return calculateMinAmountValueWarnMsg({
|
|
31620
|
-
|
|
31621
|
-
|
|
31622
|
-
|
|
31612
|
+
isFromTokenNative,
|
|
31613
|
+
nativeTokenBalanceFromChainWei: nativeBalance.value,
|
|
31614
|
+
sourceChainNativeTokenDecimals: nativeBalance.decimals,
|
|
31615
|
+
totalFeesInNativeTokenPlusRatio: estimatedGas,
|
|
31623
31616
|
});
|
|
31624
|
-
}, [
|
|
31617
|
+
}, [
|
|
31618
|
+
estimatedGas,
|
|
31619
|
+
nativeBalance?.decimals,
|
|
31620
|
+
nativeBalance?.value,
|
|
31621
|
+
token?.address,
|
|
31622
|
+
token?.type,
|
|
31623
|
+
]);
|
|
31625
31624
|
return {
|
|
31626
31625
|
estimatedGas,
|
|
31627
|
-
gasBalanceNeeded,
|
|
31628
31626
|
isBalanceEnough,
|
|
31629
|
-
tokenPaysNetworkFee: chainFeeParams?.fromTokenPaysNetworkFee ?? false,
|
|
31630
31627
|
isLoading,
|
|
31631
|
-
|
|
31628
|
+
isNativeBalanceEnoughToPayGasFees,
|
|
31632
31629
|
minAmountValueWarnMsg,
|
|
31633
31630
|
};
|
|
31634
31631
|
}
|
|
@@ -32690,7 +32687,7 @@ const useApproval = ({ squidRoute, }) => {
|
|
|
32690
32687
|
// This is to ensure we're using the latest expiry timestamp
|
|
32691
32688
|
if (squidRoute) {
|
|
32692
32689
|
queryClient.refetchQueries({
|
|
32693
|
-
queryKey: keys().transaction(squidRoute.params.fromChain, squidRoute.params.toChain, squidRoute.params.toToken, squidRoute.params.fromToken, fromPrice, squidRoute.params.slippage, squidRoute.params.fromAddress, squidRoute.params.bypassGuardrails, squidRoute.params.toAddress, squidRoute.params.fallbackAddresses?.[0]?.address, squidRoute.params.quoteOnly, getChainType(squidRoute.params.fromChain), squidRoute.params.preHook, squidRoute.params.postHook,
|
|
32690
|
+
queryKey: keys().transaction(squidRoute.params.fromChain, squidRoute.params.toChain, squidRoute.params.toToken, squidRoute.params.fromToken, fromPrice, squidRoute.params.slippage, squidRoute.params.receiveGasOnDestination, squidRoute.params.fromAddress, squidRoute.params.bypassGuardrails, squidRoute.params.toAddress, squidRoute.params.fallbackAddresses?.[0]?.address, squidRoute.params.quoteOnly, getChainType(squidRoute.params.fromChain), squidRoute.params.preHook, squidRoute.params.postHook,
|
|
32694
32691
|
// TODO: update types
|
|
32695
32692
|
squidRoute.params?.overrideGasRefundAddress),
|
|
32696
32693
|
});
|
|
@@ -32709,30 +32706,17 @@ const AXELAR_PROVIDER_IMAGE_URL = "https://raw.githubusercontent.com/0xsquid/ass
|
|
|
32709
32706
|
const useEstimate = (squidRoute) => {
|
|
32710
32707
|
const collectFees = useConfigStore((state) => state.config.collectFees);
|
|
32711
32708
|
const { tokens } = useSquidTokens();
|
|
32712
|
-
const { fromChain, toChain
|
|
32713
|
-
const
|
|
32714
|
-
const { chainFeeParams, gasToken } = useSourceChainGasToken({
|
|
32715
|
-
fromChain,
|
|
32716
|
-
fromToken,
|
|
32717
|
-
});
|
|
32709
|
+
const { fromChain, toChain } = useSwap();
|
|
32710
|
+
const { nativeBalance } = useNativeBalance(fromChain);
|
|
32718
32711
|
const estimateResults = useMemo(() => calculateEstimateResults({
|
|
32719
32712
|
squidRoute,
|
|
32720
32713
|
tokens,
|
|
32721
32714
|
fromChain,
|
|
32722
32715
|
toChain,
|
|
32723
32716
|
collectFees: !!collectFees && collectFees.fee > 0,
|
|
32724
|
-
|
|
32725
|
-
|
|
32726
|
-
|
|
32727
|
-
squidRoute,
|
|
32728
|
-
tokens,
|
|
32729
|
-
fromChain,
|
|
32730
|
-
toChain,
|
|
32731
|
-
collectFees,
|
|
32732
|
-
chainFeeParams,
|
|
32733
|
-
gasToken,
|
|
32734
|
-
]);
|
|
32735
|
-
const fromBalanceFormatted = useMultiChainBalance({
|
|
32717
|
+
nativeTokenBalanceFromChainWei: nativeBalance?.value ?? BigInt("0"),
|
|
32718
|
+
}), [squidRoute, tokens, fromChain, toChain, collectFees, nativeBalance]);
|
|
32719
|
+
const balanceFormatted = useMultiChainBalance({
|
|
32736
32720
|
chain: fromChain,
|
|
32737
32721
|
token: estimateResults.fromToken,
|
|
32738
32722
|
userAddress: squidRoute?.params.fromAddress ?? "",
|
|
@@ -32744,6 +32728,7 @@ const useEstimate = (squidRoute) => {
|
|
|
32744
32728
|
estimateResults.expectedGasRefundCost,
|
|
32745
32729
|
getUSDValue,
|
|
32746
32730
|
]);
|
|
32731
|
+
const proposedGasDestinationAmount = useMemo(() => getProposedGasDestinationAmount(estimateResults.destChainNativeToken?.symbol), [estimateResults.destChainNativeToken]);
|
|
32747
32732
|
const { feeCostsFormatted, totalFeeCostsUsd } = useMemo(() => {
|
|
32748
32733
|
const feeCosts = squidRoute?.estimate.feeCosts ?? [];
|
|
32749
32734
|
const feeCostsRenamed = [];
|
|
@@ -32802,21 +32787,21 @@ const useEstimate = (squidRoute) => {
|
|
|
32802
32787
|
totalFeeCostsUsd: totalFeeCostsUsdFormatted,
|
|
32803
32788
|
};
|
|
32804
32789
|
}, [squidRoute?.estimate.feeCosts]);
|
|
32805
|
-
const slippageFormatted =
|
|
32806
|
-
|
|
32807
|
-
|
|
32808
|
-
|
|
32809
|
-
|
|
32810
|
-
|
|
32790
|
+
const slippageFormatted =
|
|
32791
|
+
// TODO: update types
|
|
32792
|
+
Number(squidRoute?.estimate?.aggregateSlippage ?? 0).toFixed(2) +
|
|
32793
|
+
"%";
|
|
32794
|
+
const enoughBalanceToSwap = +balanceFormatted >= 0 &&
|
|
32795
|
+
+balanceFormatted > +estimateResults.fromAmountFormatted;
|
|
32811
32796
|
return {
|
|
32812
32797
|
...estimateResults,
|
|
32813
|
-
|
|
32798
|
+
balanceFormatted,
|
|
32814
32799
|
slippageFormatted,
|
|
32815
32800
|
totalWithRefundEstimate,
|
|
32816
|
-
|
|
32801
|
+
proposedGasDestinationAmount,
|
|
32802
|
+
enoughBalanceToSwap,
|
|
32817
32803
|
feeCostsFormatted,
|
|
32818
32804
|
totalFeeCostsUsd,
|
|
32819
|
-
gasToken,
|
|
32820
32805
|
};
|
|
32821
32806
|
};
|
|
32822
32807
|
|
|
@@ -36584,7 +36569,7 @@ const useGetRoute = () => {
|
|
|
36584
36569
|
});
|
|
36585
36570
|
// Cache the route data
|
|
36586
36571
|
// Useful when the getRoute mutation is called from another hook
|
|
36587
|
-
queryClient.setQueryData(keys().transaction(fromChain, toChain, toToken.address, fromToken.address, fromPrice, config.slippage, sourceUserAddress, config.degenMode, destinationAddress, swapRoute?.fallbackAddress, quoteOnly, fromChainType, config.preHook, config.postHook, overrideGasRefundAddress), route);
|
|
36572
|
+
queryClient.setQueryData(keys().transaction(fromChain, toChain, toToken.address, fromToken.address, fromPrice, config.slippage, config.enableGetGasOnDestination, sourceUserAddress, config.degenMode, destinationAddress, swapRoute?.fallbackAddress, quoteOnly, fromChainType, config.preHook, config.postHook, overrideGasRefundAddress), route);
|
|
36588
36573
|
return route;
|
|
36589
36574
|
});
|
|
36590
36575
|
};
|
|
@@ -36607,13 +36592,14 @@ refetchIntervalInBackground = false, refetchInterval = 30000, quoteOnly = true,
|
|
|
36607
36592
|
const sourceUserAddress = isDepositAddressEnabled && isAvailableAsPaymentMethod
|
|
36608
36593
|
? depositRefundAddress ?? sourceConnectedAddress
|
|
36609
36594
|
: sourceConnectedAddress;
|
|
36610
|
-
const squidRouteQueryKeys = useMemo(() => keys().transaction(fromChain?.chainId, toChain?.chainId, toToken?.address, fromToken?.address, fromPrice, config.slippage, sourceUserAddress, config.degenMode, destinationAddress, fallbackAddress, quoteOnly, fromChain?.chainType, config.preHook, config.postHook, config.overrideGasRefundAddress), [
|
|
36595
|
+
const squidRouteQueryKeys = useMemo(() => keys().transaction(fromChain?.chainId, toChain?.chainId, toToken?.address, fromToken?.address, fromPrice, config.slippage, config.enableGetGasOnDestination, sourceUserAddress, config.degenMode, destinationAddress, fallbackAddress, quoteOnly, fromChain?.chainType, config.preHook, config.postHook, config.overrideGasRefundAddress), [
|
|
36611
36596
|
fromChain?.chainId,
|
|
36612
36597
|
toChain?.chainId,
|
|
36613
36598
|
toToken?.address,
|
|
36614
36599
|
fromToken?.address,
|
|
36615
36600
|
fromPrice,
|
|
36616
36601
|
config.slippage,
|
|
36602
|
+
config.enableGetGasOnDestination,
|
|
36617
36603
|
sourceUserAddress,
|
|
36618
36604
|
config.degenMode,
|
|
36619
36605
|
destinationAddress,
|
|
@@ -36885,6 +36871,35 @@ const useAvatar = (seed = zeroAddress) => {
|
|
|
36885
36871
|
return avatar || "";
|
|
36886
36872
|
};
|
|
36887
36873
|
|
|
36874
|
+
const useUserParams = () => {
|
|
36875
|
+
const enableGetGasOnDestination = useConfigStore((state) => state.config.enableGetGasOnDestination);
|
|
36876
|
+
const { fromToken, toToken, toChain, fromChain } = useSwap();
|
|
36877
|
+
// =============
|
|
36878
|
+
// GAS
|
|
36879
|
+
// =============
|
|
36880
|
+
const getGasOnDestSupportedForThisRoute = useMemo(() =>
|
|
36881
|
+
// Not supporting get gas on dest for same chains
|
|
36882
|
+
fromChain?.chainId !== toChain?.chainId &&
|
|
36883
|
+
// If the destination chain is cosmos, we don't support getting gas there
|
|
36884
|
+
toChain?.chainType !== ChainType.COSMOS &&
|
|
36885
|
+
// Not supporting get gas on dest for same tokens (bridge)
|
|
36886
|
+
((fromToken?.subGraphIds?.some((sgi) => !!toToken?.subGraphIds?.includes(sgi)) &&
|
|
36887
|
+
toToken?.subGraphIds?.some((sgi) => !!fromToken?.subGraphIds?.includes(sgi))) ||
|
|
36888
|
+
// Except for uusdc -> uusdc
|
|
36889
|
+
(fromToken?.subGraphIds?.includes("uusdc") &&
|
|
36890
|
+
toToken?.subGraphIds?.includes("uusdc"))), [
|
|
36891
|
+
fromChain?.chainId,
|
|
36892
|
+
fromToken?.subGraphIds,
|
|
36893
|
+
toChain?.chainId,
|
|
36894
|
+
toToken?.subGraphIds,
|
|
36895
|
+
toChain?.chainType,
|
|
36896
|
+
]);
|
|
36897
|
+
return {
|
|
36898
|
+
gasEnabled: enableGetGasOnDestination && getGasOnDestSupportedForThisRoute,
|
|
36899
|
+
getGasOnDestSupportedForThisRoute,
|
|
36900
|
+
};
|
|
36901
|
+
};
|
|
36902
|
+
|
|
36888
36903
|
const useAddToken = (chainToCompare, tokenToCompare) => {
|
|
36889
36904
|
const { chain: currentEvmChain } = useAccount();
|
|
36890
36905
|
const { connector } = useAccount();
|
|
@@ -37312,5 +37327,5 @@ const SquidProvider = ({ children, config, placeholder, }) => {
|
|
|
37312
37327
|
React.createElement(CosmosProvider, null, children)))))))))) : (placeholder);
|
|
37313
37328
|
};
|
|
37314
37329
|
|
|
37315
|
-
export { useDepositAddress as $, AxelarStatusResponseType as A, useHederaTokenAssociations as B, CHAIN_IDS as C, DEFAULT_LOCALE as D, useKeyboardNavigation as E, useSquidQueryClient as F, useSquid as G, HistoryTxType as H, useStellarAccountActivation as I, useStellarTrustLine as J, useAddressBookStore as K, useAssetsColorsStore as L, useFavoriteTokensStore as M, Nr as N, useHistoryStore as O, useSendTransactionStore as P, QueryKeys as Q, useConfigStore as R, SquidStatusErrorType as S, TransactionErrorType as T, useSquidStore as U, useSwapRoutePersistStore as V, Wo as W, XamanXrplNetwork as X, useTransactionStore as Y, ConnectingWalletStatus as Z, useWalletStore as _, WindowWalletFlag as a,
|
|
37316
|
-
//# sourceMappingURL=index-
|
|
37330
|
+
export { useDepositAddress as $, AxelarStatusResponseType as A, useHederaTokenAssociations as B, CHAIN_IDS as C, DEFAULT_LOCALE as D, useKeyboardNavigation as E, useSquidQueryClient as F, useSquid as G, HistoryTxType as H, useStellarAccountActivation as I, useStellarTrustLine as J, useAddressBookStore as K, useAssetsColorsStore as L, useFavoriteTokensStore as M, Nr as N, useHistoryStore as O, useSendTransactionStore as P, QueryKeys as Q, useConfigStore as R, SquidStatusErrorType as S, TransactionErrorType as T, useSquidStore as U, useSwapRoutePersistStore as V, Wo as W, XamanXrplNetwork as X, useTransactionStore as Y, ConnectingWalletStatus as Z, useWalletStore as _, WindowWalletFlag as a, useGetOnrampPaymentTypes as a$, useSwap as a0, buildUrlSearchParamsFromSwapEvent as a1, parseInitialAssetsFromUrl as a2, useUrlSwapParams as a3, useAllConnectedWalletBalances as a4, useAllTokensWithBalanceForChainType as a5, useCosmosBalance as a6, useEvmBalance as a7, useMultiChainBalance as a8, useMultipleTokenPrices as a9, useAvatar as aA, useHistory as aB, useUserParams as aC, useDebouncedValue as aD, useAddToken as aE, useAutoConnect as aF, useEnsDataForAddress as aG, useEnsSearch as aH, useGnosisContext as aI, useIsSameAddressAndGnosisContext as aJ, useIntegratorContext as aK, useMultiChainWallet as aL, useSigner as aM, useWallet as aN, useWallets as aO, useXrplTrustLine as aP, TX_STATUS_CONSTANTS as aQ, FINAL_TRANSACTION_STATUSES as aR, useGetFiatQuote as aS, useGetOnRampConfig as aT, useExecuteFiatQuote as aU, useFiatOnRampTxStatus as aV, useFiatTransactions as aW, useCurrencyDetails as aX, useCountryDetails as aY, useAvailableQuotes as aZ, useRecommendedQuote as a_, useBitcoinNativeBalance as aa, useCosmosNativeBalance as ab, useEvmNativeBalance as ac, useNativeBalance as ad, useSolanaNativeBalance as ae, useStellarNativeBalance as af, useSuiNativeBalance as ag, useXrplNativeBalance as ah, useNativeTokenForChain as ai, useSingleTokenPrice as aj, useSquidTokens as ak, useHistoricalData as al, useTokensData as am, useEstimateSendTransaction as an, useSendTransaction as ao, useSendTransactionGas as ap, useAllTransactionsStatus as aq, useApproval as ar, useEstimate as as, useEstimatePriceImpact as at, useExecuteTransaction as au, useGetRoute as av, useGetRouteWrapper as aw, useRouteWarnings as ax, useSendTransactionStatus as ay, useSwapTransactionStatus as az, chainTypeToZeroAddressMap as b, filterWagmiConnector as b$, useSuggestedFiatAmounts as b0, SquidProvider as b1, EnsService as b2, getXummClient as b3, isXamanXAppContext as b4, getQueryHeaders as b5, getStatusCode as b6, is404Error as b7, assetsBaseUrl as b8, shareSubgraphId as b9, fetchHighestBalanceToken as bA, getInitialOrDefaultTokenAddressForChain as bB, getInitialTokenAddressForChain as bC, filterTokensForDestination as bD, getInitialChainIdFromConfig as bE, getCosmosKey as bF, getKeysSettled as bG, getAllKeysForSupportedCosmosChains as bH, isCosmosAddressValid as bI, getCosmosSigningClient as bJ, getCosmosChainInfosObject as bK, connectCosmosWallet as bL, isFallbackAddressNeeded as bM, suggestChainOrThrow as bN, normalizeError as bO, transactionErrorCode as bP, isUserRejectionError as bQ, getTransactionError as bR, handleTransactionErrorEvents as bS, isSwapRouteError as bT, isStatusError as bU, createQuoteRequestParamsHash as bV, WidgetEvents as bW, EvmNetworkNotSupportedErrorCode as bX, addEthereumChain as bY, parseEvmAddress as bZ, formatEvmWallet as b_, sortTokensBySharedSubgraphIds as ba, getSupportedChainIdsForDirection as bb, filterChains as bc, filterTokens as bd, getTokenImage as be, getNewSwapParamsFromInput as bf, sortAllTokens as bg, findToken as bh, findNativeToken as bi, normalizeIbcAddress as bj, groupTokensBySymbol as bk, groupTokensByChainId as bl, filterViewableTokens as bm, getSecretNetworkBalances as bn, getTokenAssetsKey as bo, fetchAssetsColors as bp, initializeSquidWithAssetsColors as bq, isEmptyObject as br, normalizeTokenSymbol as bs, areTokenSymbolsCompatible as bt, isEvmosChain as bu, resolveChainIdFromAsset as bv, getConfigWithDefaults as bw, randomIntFromInterval as bx, getTokensForChain as by, getFirstAvailableChainId as bz, chainTypeToNativeTokenAddressMap as c, isHistoryTransactionFailed as c$, waitForReceiptWithRetry as c0, getUserCountry as c1, getCountryData as c2, getCurrencyData as c3, adaptiveRound as c4, getSuggestedAmountsForCurrency as c5, HederaExtensionHelper as c6, convertHederaAccountIdToEvmAddress as c7, convertEvmAddressToHederaAccountId as c8, scaleHbarToWei as c9, isValidHorizonAsset as cA, formatTransactionHistoryDate as cB, getAxelarExplorerTxUrl as cC, getSourceExplorerTxUrl as cD, getMainExplorerUrl as cE, formatDistance as cF, formatSeconds as cG, formatSwapTxStatusResponseForStorage as cH, simplifyRouteAction as cI, fetchSwapTransactionStatus as cJ, compareTransactionIds as cK, isCoralBridgeAction as cL, sleep as cM, isDepositRoute as cN, isChainflipBridgeTransaction as cO, isOnChainTxData as cP, getHistoryTransactionId as cQ, getStepStatuses as cR, getHalfSuccessState as cS, getStepsInfos as cT, getSwapTxStatusRefetchInterval as cU, getSendTxStatusRefetchInterval as cV, chainflipMultihopBridgeType as cW, getBridgeType as cX, getTransactionStatus as cY, getTransactionEndStatus as cZ, isHistoryTransactionPending as c_, scaleWeiToHbar as ca, parseToBigInt as cb, roundNumericValue as cc, formatUnitsRounded as cd, formatTokenAmount as ce, formatUsdAmount as cf, trimExtraDecimals as cg, getNumericValue as ch, cleanAmount as ci, convertTokenAmountToUSD as cj, convertUSDToTokenAmount as ck, calculateTotal24hChange as cl, getRouteExpiry as cm, searchTokens as cn, filterSolanaWallets as co, isSolanaAddressValid as cp, executeSolanaSwap as cq, executeSolanaTransfer as cr, isStellarAddressValid as cs, getStellarNetwork as ct, stellarAddressToScVal as cu, getStellarTrustLineAsset as cv, isStellarToken as cw, isStellarIssuedToken as cx, getStellarHorizonApiUrl as cy, isValidIssuedAsset as cz, definedInWindow as d, isHistoryTransactionWarning as d0, isHistoryTransactionEnded as d1, formatHash as d2, isWalletAddressValid as d3, redirectToExtensionsStore as d4, accessProperty as d5, populateWallets as d6, getDefaultChain as d7, sortWallets as d8, areSameAddress as d9, sortAddressBook as da, calculateTotalUsdBalanceUSD as db, addTokenToWallet as dc, isEvmChainNotSupportedError as dd, getWalletSupportedChainTypes as de, getConnectorForChainType as df, walletSupportsChainType as dg, connectWallet as dh, cancelConnectWallet as di, isProblematicConnector as dj, mergeWallets as dk, isXionSmartContractAddress as dl, isXrplAddressValid as dm, buildXrplTrustSetTx as dn, getXrplNetwork as dp, parseXrplPaymentTx as dq, parseXrplTokenAddress as dr, er as e, formatBNToReadable as f, DEFAULT_ROUTE_REFETCH_INTERVAL as g, destinationAddressResetValue as h, fallbackAddressResetValue as i, nativeCosmosTokenAddress as j, nativeEvmTokenAddress as k, nativeSolanaTokenAddress as l, nativeStellarTokenAddress as m, nativeBitcoinTokenAddress as n, nativeSuiTokenAddress as o, nativeXrplTokenAddress as p, CosmosProvider as q, SendTransactionStatus as r, TransactionStatus as s, useTrackSearchEmpty as t, useCosmosContext as u, useSquidChains as v, walletIconBaseUrl as w, useClient as x, useCosmosForChain as y, useHederaAccountActivation as z };
|
|
37331
|
+
//# sourceMappingURL=index-Ck3Byj7H.js.map
|