@0xsquid/react-hooks 8.7.2-beta-interactive-to-amount.1 → 8.7.2-beta-fav-chains.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/queries/queries-keys.d.ts +1 -1
- package/dist/core/types/config.d.ts +1 -2
- package/dist/core/types/event.d.ts +2 -1
- package/dist/core/types/route.d.ts +4 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/store/useFavoriteChainsStore.d.ts +20 -0
- package/dist/hooks/store/useSquidStore.d.ts +1 -2
- package/dist/hooks/swap/useSwap.d.ts +2 -4
- package/dist/hooks/transaction/useGetRoute.d.ts +8 -9
- package/dist/{index-B9EnYPpR.js → index-0fyTkU8o.js} +63 -69
- package/dist/index-0fyTkU8o.js.map +1 -0
- package/dist/{index-BL3rpZzC.js → index-DYs5b-an.js} +63 -69
- package/dist/index-DYs5b-an.js.map +1 -0
- package/dist/{index.es-Da6lPGPH.js → index.es-Bxk-BRsk.js} +2 -2
- package/dist/{index.es-Da6lPGPH.js.map → index.es-Bxk-BRsk.js.map} +1 -1
- package/dist/{index.es-C93MXP-M.js → index.es-X0Xkh3ET.js} +2 -2
- package/dist/{index.es-C93MXP-M.js.map → index.es-X0Xkh3ET.js.map} +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +2 -2
- package/dist/{secretService-Bp_azQsY.js → secretService-BExN6uOo.js} +2 -2
- package/dist/{secretService-Bp_azQsY.js.map → secretService-BExN6uOo.js.map} +1 -1
- package/dist/{secretService-CO9haOur.js → secretService-CJJobQlZ.js} +2 -2
- package/dist/{secretService-CO9haOur.js.map → secretService-CJJobQlZ.js.map} +1 -1
- package/dist/services/internal/eventService.d.ts +2 -1
- package/dist/services/internal/numberService.d.ts +0 -1
- package/dist/{stellarService.client-B-EC09rP.js → stellarService.client-eIqTLitu.js} +3 -3
- package/dist/{stellarService.client-B-EC09rP.js.map → stellarService.client-eIqTLitu.js.map} +1 -1
- package/dist/{stellarService.client-CrlGBSG9.js → stellarService.client-yODv6HFL.js} +3 -3
- package/dist/{stellarService.client-CrlGBSG9.js.map → stellarService.client-yODv6HFL.js.map} +1 -1
- package/package.json +3 -3
- package/dist/index-B9EnYPpR.js.map +0 -1
- package/dist/index-BL3rpZzC.js.map +0 -1
|
@@ -3950,9 +3950,6 @@ const getNumericValue = ({ value, precision, useComaEvery3Digits = true, hideIfZ
|
|
|
3950
3950
|
const finalValue = `${isNegative ? "-" : ""}${prefix}${formattedIfVerySmall}${suffix ? ` ${suffix}` : ""}`;
|
|
3951
3951
|
return wrapInParens ? `(${finalValue})` : finalValue;
|
|
3952
3952
|
};
|
|
3953
|
-
function isZeroAmount(amount) {
|
|
3954
|
-
return !amount || amount === "0";
|
|
3955
|
-
}
|
|
3956
3953
|
|
|
3957
3954
|
/**
|
|
3958
3955
|
* Creates a hash string from quote request parameters to track changes
|
|
@@ -22395,15 +22392,14 @@ const keys = () => ({
|
|
|
22395
22392
|
// ============
|
|
22396
22393
|
// Transactions
|
|
22397
22394
|
// ============
|
|
22398
|
-
transaction: (fromChainId, toChainId, toTokenAddress, fromTokenAddress,
|
|
22395
|
+
transaction: (fromChainId, toChainId, toTokenAddress, fromTokenAddress, price, slippage, sourceUserAddress, degenMode, destinationAddress, fallbackAddress, quoteOnly, fromChainType, preHook, postHook, overrideGasRefundAddress) => [
|
|
22399
22396
|
...keys().transactions(),
|
|
22400
22397
|
QueryKeys.Transaction,
|
|
22401
22398
|
fromChainId,
|
|
22402
22399
|
toChainId,
|
|
22403
22400
|
toTokenAddress,
|
|
22404
22401
|
fromTokenAddress,
|
|
22405
|
-
|
|
22406
|
-
toAmount,
|
|
22402
|
+
price,
|
|
22407
22403
|
slippage,
|
|
22408
22404
|
sourceUserAddress,
|
|
22409
22405
|
degenMode,
|
|
@@ -22414,7 +22410,6 @@ const keys = () => ({
|
|
|
22414
22410
|
preHook,
|
|
22415
22411
|
postHook,
|
|
22416
22412
|
overrideGasRefundAddress,
|
|
22417
|
-
prefer,
|
|
22418
22413
|
],
|
|
22419
22414
|
swapTransactionStatus: (transactionId) => [
|
|
22420
22415
|
...keys().transactions(),
|
|
@@ -22606,7 +22601,6 @@ const getConfigWithDefaults = (config) => {
|
|
|
22606
22601
|
preHook: get$2(config, "preHook", defaultConfigValues.preHook),
|
|
22607
22602
|
postHook: get$2(config, "postHook", defaultConfigValues.postHook),
|
|
22608
22603
|
overrideGasRefundAddress: get$2(config, "overrideGasRefundAddress", defaultConfigValues.overrideGasRefundAddress),
|
|
22609
|
-
prefer: get$2(config, "prefer", defaultConfigValues.prefer),
|
|
22610
22604
|
};
|
|
22611
22605
|
};
|
|
22612
22606
|
const randomIntFromInterval = (min, max) => {
|
|
@@ -23300,7 +23294,7 @@ const filterViewableTokens = (tokens, config, direction) => {
|
|
|
23300
23294
|
};
|
|
23301
23295
|
const getSecretNetworkBalances = async (chainData, cosmosAddress, squidTokens, keplrTypeWallet) => {
|
|
23302
23296
|
const squidSecretTokens = squidTokens.filter((t) => t.chainId === CHAIN_IDS.SECRET);
|
|
23303
|
-
const { fetchAllSecretBalances } = await import('./secretService-
|
|
23297
|
+
const { fetchAllSecretBalances } = await import('./secretService-CJJobQlZ.js');
|
|
23304
23298
|
return fetchAllSecretBalances(chainData, cosmosAddress, squidSecretTokens, keplrTypeWallet);
|
|
23305
23299
|
};
|
|
23306
23300
|
function getTokenAssetsKey(token) {
|
|
@@ -25157,7 +25151,10 @@ const useConfigStore = create(() => ({
|
|
|
25157
25151
|
isInitialized: false,
|
|
25158
25152
|
}));
|
|
25159
25153
|
const useTransactionStore = create((set, get) => ({
|
|
25154
|
+
fromPrice: undefined,
|
|
25155
|
+
txLocalId: undefined,
|
|
25160
25156
|
transactions: {},
|
|
25157
|
+
currentTransaction: undefined,
|
|
25161
25158
|
setTransactionState(txId, tx) {
|
|
25162
25159
|
if (!txId)
|
|
25163
25160
|
return;
|
|
@@ -26694,8 +26691,8 @@ function useStellarWallets() {
|
|
|
26694
26691
|
return;
|
|
26695
26692
|
try {
|
|
26696
26693
|
const { allowAllModules: initializeAllModules } = await import('@creit.tech/stellar-wallets-kit');
|
|
26697
|
-
const { LedgerModule } = await import('@creit.tech/stellar-wallets-kit/modules/ledger.module');
|
|
26698
|
-
const { formatStellarWallet } = await import('./stellarService.client-
|
|
26694
|
+
const { LedgerModule } = await import('@creit.tech/stellar-wallets-kit/modules/ledger.module.mjs');
|
|
26695
|
+
const { formatStellarWallet } = await import('./stellarService.client-eIqTLitu.js');
|
|
26699
26696
|
const modules = [...initializeAllModules(), new LedgerModule()];
|
|
26700
26697
|
const promises = modules.map(async (module) => {
|
|
26701
26698
|
const isAvailable = await module.isAvailable();
|
|
@@ -27594,8 +27591,7 @@ const useMultiChainWallet = (chain) => {
|
|
|
27594
27591
|
|
|
27595
27592
|
const useSwap = () => {
|
|
27596
27593
|
const { initialAssets, defaultTokensPerChain, disabledChains, availableChains, } = useConfigStore((state) => state.config);
|
|
27597
|
-
const
|
|
27598
|
-
const toAmount = useTransactionStore((state) => state.toAmount);
|
|
27594
|
+
const fromPrice = useTransactionStore((state) => state.fromPrice);
|
|
27599
27595
|
const { swapRoute } = useSwapRoutePersistStore();
|
|
27600
27596
|
const { tokens } = useSquidTokens();
|
|
27601
27597
|
const queryClient = useQueryClient();
|
|
@@ -27647,17 +27643,8 @@ const useSwap = () => {
|
|
|
27647
27643
|
}),
|
|
27648
27644
|
};
|
|
27649
27645
|
}, [destAddressData, destAddressEnsData.data, toChain?.chainType]);
|
|
27650
|
-
const
|
|
27651
|
-
useTransactionStore.setState({
|
|
27652
|
-
fromAmount: amount || undefined,
|
|
27653
|
-
toAmount: undefined,
|
|
27654
|
-
});
|
|
27655
|
-
}, []);
|
|
27656
|
-
const toAmountChanged = useCallback((amount) => {
|
|
27657
|
-
useTransactionStore.setState({
|
|
27658
|
-
toAmount: amount || undefined,
|
|
27659
|
-
fromAmount: undefined,
|
|
27660
|
-
});
|
|
27646
|
+
const fromPriceChanged = useCallback((price) => {
|
|
27647
|
+
useTransactionStore.setState({ fromPrice: price || undefined });
|
|
27661
27648
|
}, []);
|
|
27662
27649
|
/**
|
|
27663
27650
|
* When user changes something from the SwapView
|
|
@@ -27817,10 +27804,8 @@ const useSwap = () => {
|
|
|
27817
27804
|
tokenItems,
|
|
27818
27805
|
onSwapChange,
|
|
27819
27806
|
invertSwaps,
|
|
27820
|
-
|
|
27821
|
-
|
|
27822
|
-
fromAmountChanged,
|
|
27823
|
-
toAmountChanged,
|
|
27807
|
+
fromPrice,
|
|
27808
|
+
fromPriceChanged,
|
|
27824
27809
|
toToken,
|
|
27825
27810
|
fromToken,
|
|
27826
27811
|
fromChain,
|
|
@@ -30027,7 +30012,7 @@ function hederaWalletConnect(parameters) {
|
|
|
30027
30012
|
const optionalChains = config.chains.map((x) => x.id);
|
|
30028
30013
|
if (!optionalChains.length)
|
|
30029
30014
|
return;
|
|
30030
|
-
const { EthereumProvider } = await import('./index.es-
|
|
30015
|
+
const { EthereumProvider } = await import('./index.es-Bxk-BRsk.js');
|
|
30031
30016
|
const rawProvider = await EthereumProvider.init({
|
|
30032
30017
|
...restParameters,
|
|
30033
30018
|
disableProviderPing: true,
|
|
@@ -30164,6 +30149,7 @@ const createWagmiConfig = (squidChains, hederaExtensions) => {
|
|
|
30164
30149
|
description: SQUID_METADATA.description,
|
|
30165
30150
|
};
|
|
30166
30151
|
return createConfig({
|
|
30152
|
+
ssr: true,
|
|
30167
30153
|
chains: wagmiChains,
|
|
30168
30154
|
transports: Object.fromEntries(wagmiChains.map((chain) => [
|
|
30169
30155
|
chain.id,
|
|
@@ -30657,6 +30643,32 @@ const useAddressBookStore = create(persist((set) => ({
|
|
|
30657
30643
|
name: "squid.addressbook.store",
|
|
30658
30644
|
}));
|
|
30659
30645
|
|
|
30646
|
+
const useFavoriteChainsStore = create(persist((set, get) => ({
|
|
30647
|
+
favoriteChains: [],
|
|
30648
|
+
addFavoriteChain(chain) {
|
|
30649
|
+
set((state) => ({
|
|
30650
|
+
favoriteChains: [...state.favoriteChains, chain],
|
|
30651
|
+
}));
|
|
30652
|
+
},
|
|
30653
|
+
removeFavoriteChain(chain) {
|
|
30654
|
+
set((state) => ({
|
|
30655
|
+
favoriteChains: state.favoriteChains.filter((c) => c.chainId !== chain.chainId),
|
|
30656
|
+
}));
|
|
30657
|
+
},
|
|
30658
|
+
toggleFavoriteChain(chain) {
|
|
30659
|
+
const isFavorite = get().favoriteChains.some((c) => c.chainId === chain.chainId);
|
|
30660
|
+
if (isFavorite) {
|
|
30661
|
+
get().removeFavoriteChain(chain);
|
|
30662
|
+
}
|
|
30663
|
+
else {
|
|
30664
|
+
get().addFavoriteChain(chain);
|
|
30665
|
+
}
|
|
30666
|
+
},
|
|
30667
|
+
}), {
|
|
30668
|
+
name: "squid.favorite.chains.store",
|
|
30669
|
+
version: 1,
|
|
30670
|
+
}));
|
|
30671
|
+
|
|
30660
30672
|
const useFavoriteTokensStore = create(persist((set, get) => ({
|
|
30661
30673
|
favoriteTokens: [],
|
|
30662
30674
|
addFavoriteToken(token) {
|
|
@@ -32432,7 +32444,7 @@ const useHistory = (txType) => {
|
|
|
32432
32444
|
fromChain: tx.params.fromChain,
|
|
32433
32445
|
fromToken: tx.params.fromToken,
|
|
32434
32446
|
fromAddress: tx.params.fromAddress,
|
|
32435
|
-
fromAmount: tx.params.fromAmount
|
|
32447
|
+
fromAmount: tx.params.fromAmount,
|
|
32436
32448
|
toChain: tx.params.toChain,
|
|
32437
32449
|
toToken: tx.params.toToken,
|
|
32438
32450
|
toAddress: tx.params.toAddress,
|
|
@@ -32673,7 +32685,7 @@ const useApproval = ({ squidRoute, }) => {
|
|
|
32673
32685
|
const publicClient = usePublicClient();
|
|
32674
32686
|
const queryClient = useQueryClient();
|
|
32675
32687
|
const squid = useSquidStore((state) => state.squid);
|
|
32676
|
-
const { fromChain, fromToken,
|
|
32688
|
+
const { fromChain, fromToken, fromPrice, isSameChain } = useSwap();
|
|
32677
32689
|
const { evmSigner } = useSigner({ chain: fromChain });
|
|
32678
32690
|
const { connector: activeConnector } = useAccount();
|
|
32679
32691
|
const { getChainType } = useSquidChains();
|
|
@@ -32846,9 +32858,9 @@ const useApproval = ({ squidRoute, }) => {
|
|
|
32846
32858
|
// This is to ensure we're using the latest expiry timestamp
|
|
32847
32859
|
if (squidRoute) {
|
|
32848
32860
|
queryClient.refetchQueries({
|
|
32849
|
-
queryKey: keys().transaction(squidRoute.params.fromChain, squidRoute.params.toChain, squidRoute.params.toToken, squidRoute.params.fromToken,
|
|
32861
|
+
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,
|
|
32850
32862
|
// TODO: update types
|
|
32851
|
-
squidRoute.params?.overrideGasRefundAddress
|
|
32863
|
+
squidRoute.params?.overrideGasRefundAddress),
|
|
32852
32864
|
});
|
|
32853
32865
|
}
|
|
32854
32866
|
},
|
|
@@ -32865,7 +32877,7 @@ const AXELAR_PROVIDER_IMAGE_URL = "https://raw.githubusercontent.com/0xsquid/ass
|
|
|
32865
32877
|
const useEstimate = (squidRoute) => {
|
|
32866
32878
|
const collectFees = useConfigStore((state) => state.config.collectFees);
|
|
32867
32879
|
const { tokens } = useSquidTokens();
|
|
32868
|
-
const { fromChain, toChain,
|
|
32880
|
+
const { fromChain, toChain, fromPrice } = useSwap();
|
|
32869
32881
|
const fromToken = useMemo(() => findToken(tokens, squidRoute?.params.fromChain, squidRoute?.params.fromToken), [tokens, squidRoute?.params.fromChain, squidRoute?.params.fromToken]);
|
|
32870
32882
|
const { chainFeeParams, gasToken } = useSourceChainGasToken({
|
|
32871
32883
|
fromChain,
|
|
@@ -32961,9 +32973,9 @@ const useEstimate = (squidRoute) => {
|
|
|
32961
32973
|
const slippageFormatted = Number(squidRoute?.estimate?.aggregateSlippage ?? 0).toFixed(2) + "%";
|
|
32962
32974
|
const fromBalanceEnoughToSwap = useMemo(() => {
|
|
32963
32975
|
const fromBalanceNum = Number(fromBalanceFormatted ?? 0);
|
|
32964
|
-
const
|
|
32965
|
-
return fromBalanceNum >=
|
|
32966
|
-
}, [fromBalanceFormatted,
|
|
32976
|
+
const fromPriceNum = Number(fromPrice ?? 0);
|
|
32977
|
+
return fromBalanceNum >= fromPriceNum;
|
|
32978
|
+
}, [fromBalanceFormatted, fromPrice]);
|
|
32967
32979
|
return {
|
|
32968
32980
|
...estimateResults,
|
|
32969
32981
|
fromBalanceFormatted,
|
|
@@ -36182,12 +36194,8 @@ const useExecuteTransaction = (squidRoute) => {
|
|
|
36182
36194
|
if (!depositData?.depositAddress) {
|
|
36183
36195
|
throw new Error("Deposit address is required");
|
|
36184
36196
|
}
|
|
36185
|
-
const fromAmount = route.params.fromAmount || route.estimate.fromAmount;
|
|
36186
|
-
if (isZeroAmount(fromAmount)) {
|
|
36187
|
-
throw new Error("fromAmount is required for Solana transfer");
|
|
36188
|
-
}
|
|
36189
36197
|
const signature = await executeSolanaTransfer({
|
|
36190
|
-
amount: BigInt(fromAmount),
|
|
36198
|
+
amount: BigInt(route.params.fromAmount),
|
|
36191
36199
|
target: depositData.depositAddress,
|
|
36192
36200
|
signer: solanaSigner,
|
|
36193
36201
|
connection: solanaConnection,
|
|
@@ -36697,12 +36705,8 @@ const useGetRoute = () => {
|
|
|
36697
36705
|
* These data will be used to trigger the transaction
|
|
36698
36706
|
* @returns {Route} Route data
|
|
36699
36707
|
*/
|
|
36700
|
-
return useMutation(async ({ fromChain, toChain, fromToken, toToken, sourceUserAddress, destinationAddress, fromPrice
|
|
36701
|
-
if (!fromChain ||
|
|
36702
|
-
!toChain ||
|
|
36703
|
-
!fromToken ||
|
|
36704
|
-
!toToken ||
|
|
36705
|
-
(!fromPrice && !toPrice)) {
|
|
36708
|
+
return useMutation(async ({ fromChain, toChain, fromToken, toToken, sourceUserAddress, destinationAddress, fromPrice, bypassGuardrails, quoteOnly, fromChainType, postHook, preHook, overrideGasRefundAddress, }) => {
|
|
36709
|
+
if (!fromChain || !toChain || !fromToken || !toToken || !fromPrice) {
|
|
36706
36710
|
return undefined;
|
|
36707
36711
|
}
|
|
36708
36712
|
// Dispatch requestQuote event
|
|
@@ -36712,7 +36716,6 @@ const useGetRoute = () => {
|
|
|
36712
36716
|
fromToken: fromToken.address,
|
|
36713
36717
|
toToken: toToken.address,
|
|
36714
36718
|
fromAmount: fromPrice,
|
|
36715
|
-
toAmount: toPrice,
|
|
36716
36719
|
fromAddress: sourceUserAddress,
|
|
36717
36720
|
toAddress: destinationAddress,
|
|
36718
36721
|
});
|
|
@@ -36721,13 +36724,13 @@ const useGetRoute = () => {
|
|
|
36721
36724
|
const fromTokenAddress = fromToken.address;
|
|
36722
36725
|
const toTokenAddress = toToken.address;
|
|
36723
36726
|
const fromAmount = parseToBigInt(fromPrice?.toString() ?? "0", fromToken?.decimals).toString();
|
|
36724
|
-
const toAmount = parseToBigInt(toPrice?.toString() ?? "0", toToken?.decimals).toString();
|
|
36725
36727
|
const fromAddress = sourceUserAddress ??
|
|
36726
36728
|
chainTypeToZeroAddressMap[fromChainType ?? ChainType.EVM];
|
|
36727
36729
|
const params = {
|
|
36728
36730
|
fromChain,
|
|
36729
36731
|
fromToken: fromTokenAddress,
|
|
36730
36732
|
fromAddress,
|
|
36733
|
+
fromAmount,
|
|
36731
36734
|
toChain,
|
|
36732
36735
|
toToken: toTokenAddress,
|
|
36733
36736
|
toAddress: destinationAddress ?? "",
|
|
@@ -36744,19 +36747,12 @@ const useGetRoute = () => {
|
|
|
36744
36747
|
cosmosFallbackAddresses[0].address) {
|
|
36745
36748
|
params.fallbackAddresses = cosmosFallbackAddresses;
|
|
36746
36749
|
}
|
|
36747
|
-
if (!isZeroAmount(fromAmount)) {
|
|
36748
|
-
params.fromAmount = fromAmount;
|
|
36749
|
-
}
|
|
36750
|
-
else if (!isZeroAmount(toAmount)) {
|
|
36751
|
-
params.toAmount = toAmount;
|
|
36752
|
-
}
|
|
36753
36750
|
const { route } = await squid.getRoute({
|
|
36754
36751
|
...params,
|
|
36755
|
-
...(prefer ? { prefer } : {}),
|
|
36756
36752
|
});
|
|
36757
36753
|
// Cache the route data
|
|
36758
36754
|
// Useful when the getRoute mutation is called from another hook
|
|
36759
|
-
queryClient.setQueryData(keys().transaction(fromChain, toChain, toToken.address, fromToken.address, fromPrice,
|
|
36755
|
+
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);
|
|
36760
36756
|
return route;
|
|
36761
36757
|
});
|
|
36762
36758
|
};
|
|
@@ -36770,7 +36766,7 @@ refetchIntervalInBackground = false, refetchInterval = 30000, quoteOnly = true,
|
|
|
36770
36766
|
const depositRefundAddress = useSwapRoutePersistStore((store) => store.swapRoute?.depositRefundAddress);
|
|
36771
36767
|
const { isAvailableAsPaymentMethod, isEnabled: isDepositAddressEnabled } = useDepositAddress();
|
|
36772
36768
|
const getRouteMutation = useGetRoute();
|
|
36773
|
-
const { fromChain, toChain,
|
|
36769
|
+
const { fromChain, toChain, fromPrice, destinationAddress: { address: destinationAddress } = {}, fromToken, toToken, } = useSwap();
|
|
36774
36770
|
const { connectedAddress: { address: sourceConnectedAddress }, } = useMultiChainWallet(fromChain);
|
|
36775
36771
|
// When the payment method is deposit address, users can specify a refund address on the source chain
|
|
36776
36772
|
// Tokens will be sent to this address in case of swap failure
|
|
@@ -36779,13 +36775,12 @@ refetchIntervalInBackground = false, refetchInterval = 30000, quoteOnly = true,
|
|
|
36779
36775
|
const sourceUserAddress = isDepositAddressEnabled && isAvailableAsPaymentMethod
|
|
36780
36776
|
? depositRefundAddress ?? sourceConnectedAddress
|
|
36781
36777
|
: sourceConnectedAddress;
|
|
36782
|
-
const squidRouteQueryKeys = useMemo(() => keys().transaction(fromChain?.chainId, toChain?.chainId, toToken?.address, fromToken?.address,
|
|
36778
|
+
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), [
|
|
36783
36779
|
fromChain?.chainId,
|
|
36784
36780
|
toChain?.chainId,
|
|
36785
36781
|
toToken?.address,
|
|
36786
36782
|
fromToken?.address,
|
|
36787
|
-
|
|
36788
|
-
toAmount,
|
|
36783
|
+
fromPrice,
|
|
36789
36784
|
config.slippage,
|
|
36790
36785
|
sourceUserAddress,
|
|
36791
36786
|
config.degenMode,
|
|
@@ -36796,12 +36791,12 @@ refetchIntervalInBackground = false, refetchInterval = 30000, quoteOnly = true,
|
|
|
36796
36791
|
config.preHook,
|
|
36797
36792
|
config.postHook,
|
|
36798
36793
|
config.overrideGasRefundAddress,
|
|
36799
|
-
config.prefer,
|
|
36800
36794
|
]);
|
|
36801
36795
|
const queryEnabled = enabled != undefined
|
|
36802
36796
|
? enabled
|
|
36803
36797
|
: squid !== undefined &&
|
|
36804
|
-
|
|
36798
|
+
fromPrice !== undefined &&
|
|
36799
|
+
fromPrice !== "0" &&
|
|
36805
36800
|
toChain?.chainId !== undefined &&
|
|
36806
36801
|
toToken?.address !== undefined;
|
|
36807
36802
|
const queryClient = useQueryClient();
|
|
@@ -36819,15 +36814,13 @@ refetchIntervalInBackground = false, refetchInterval = 30000, quoteOnly = true,
|
|
|
36819
36814
|
toToken,
|
|
36820
36815
|
sourceUserAddress,
|
|
36821
36816
|
destinationAddress,
|
|
36822
|
-
fromPrice
|
|
36823
|
-
toPrice: toAmount,
|
|
36817
|
+
fromPrice,
|
|
36824
36818
|
bypassGuardrails: config.degenMode,
|
|
36825
36819
|
quoteOnly,
|
|
36826
36820
|
fromChainType: fromChain?.chainType,
|
|
36827
36821
|
postHook: config.postHook,
|
|
36828
36822
|
preHook: config.preHook,
|
|
36829
36823
|
overrideGasRefundAddress: config.overrideGasRefundAddress,
|
|
36830
|
-
prefer: config.prefer,
|
|
36831
36824
|
});
|
|
36832
36825
|
return route;
|
|
36833
36826
|
}, {
|
|
@@ -37449,6 +37442,7 @@ const SquidProvider = ({ children, config, placeholder, }) => {
|
|
|
37449
37442
|
// Even with an error, we want wagmi to be defined so that we can display the maintenance mode layout
|
|
37450
37443
|
// Create wagmi config with mainnet as fallback in maintenance mode
|
|
37451
37444
|
const newWagmiConfig = createConfig({
|
|
37445
|
+
ssr: true,
|
|
37452
37446
|
chains: [mainnet],
|
|
37453
37447
|
connectors: [injected()],
|
|
37454
37448
|
transports: {
|
|
@@ -37487,5 +37481,5 @@ const SquidProvider = ({ children, config, placeholder, }) => {
|
|
|
37487
37481
|
React.createElement(CosmosProvider, null, children)))))))))) : (placeholder);
|
|
37488
37482
|
};
|
|
37489
37483
|
|
|
37490
|
-
export {
|
|
37491
|
-
//# sourceMappingURL=index-
|
|
37484
|
+
export { useWalletStore 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, useFavoriteChainsStore as M, Nr as N, useFavoriteTokensStore as O, useHistoryStore as P, QueryKeys as Q, useSendTransactionStore as R, SquidStatusErrorType as S, TransactionErrorType as T, useConfigStore as U, useSquidStore as V, Wo as W, XamanXrplNetwork as X, useSwapRoutePersistStore as Y, useTransactionStore as Z, ConnectingWalletStatus as _, WindowWalletFlag as a, useRecommendedQuote as a$, useDepositAddress as a0, useSwap as a1, buildUrlSearchParamsFromSwapEvent as a2, parseInitialAssetsFromUrl as a3, useUrlSwapParams as a4, useAllConnectedWalletBalances as a5, useAllTokensWithBalanceForChainType as a6, useCosmosBalance as a7, useEvmBalance as a8, useMultiChainBalance as a9, useSendTransactionStatus as aA, useSwapTransactionStatus as aB, useAvatar as aC, useHistory as aD, useDebouncedValue as aE, useAddToken as aF, useAutoConnect as aG, useEnsDataForAddress as aH, useEnsSearch as aI, useGnosisContext as aJ, useIsSameAddressAndGnosisContext as aK, useIntegratorContext as aL, useMultiChainWallet as aM, useSigner as aN, useWallet as aO, useWallets as aP, useXrplTrustLine as aQ, TX_STATUS_CONSTANTS as aR, FINAL_TRANSACTION_STATUSES as aS, useGetFiatQuote as aT, useGetOnRampConfig as aU, useExecuteFiatQuote as aV, useFiatOnRampTxStatus as aW, useFiatTransactions as aX, useCurrencyDetails as aY, useCountryDetails as aZ, useAvailableQuotes as a_, useMultipleTokenPrices as aa, useBitcoinNativeBalance as ab, useCosmosNativeBalance as ac, useEvmNativeBalance as ad, useNativeBalance as ae, useSolanaNativeBalance as af, useStellarNativeBalance as ag, useSuiNativeBalance as ah, useXrplNativeBalance as ai, useNativeTokenForChain as aj, useSingleTokenPrice as ak, useSourceChainGasToken as al, useSquidTokens as am, useHistoricalData as an, useTokensData as ao, useEstimateSendTransaction as ap, useSendTransaction as aq, useSendTransactionGas as ar, useAllTransactionsStatus as as, useApproval as at, useEstimate as au, useEstimatePriceImpact as av, useExecuteTransaction as aw, useGetRoute as ax, useGetRouteWrapper as ay, useRouteWarnings as az, chainTypeToZeroAddressMap as b, formatEvmWallet as b$, useGetOnrampPaymentTypes as b0, useSuggestedFiatAmounts as b1, SquidProvider as b2, EnsService as b3, getXummClient as b4, isXamanXAppContext as b5, getQueryHeaders as b6, getStatusCode as b7, is404Error as b8, assetsBaseUrl as b9, getFirstAvailableChainId as bA, fetchHighestBalanceToken as bB, getInitialOrDefaultTokenAddressForChain as bC, getInitialTokenAddressForChain as bD, filterTokensForDestination as bE, getInitialChainIdFromConfig as bF, getCosmosKey as bG, getKeysSettled as bH, getAllKeysForSupportedCosmosChains as bI, isCosmosAddressValid as bJ, getCosmosSigningClient as bK, getCosmosChainInfosObject as bL, connectCosmosWallet as bM, isFallbackAddressNeeded as bN, suggestChainOrThrow as bO, normalizeError as bP, transactionErrorCode as bQ, isUserRejectionError as bR, getTransactionError as bS, handleTransactionErrorEvents as bT, isSwapRouteError as bU, isStatusError as bV, createQuoteRequestParamsHash as bW, WidgetEvents as bX, EvmNetworkNotSupportedErrorCode as bY, addEthereumChain as bZ, parseEvmAddress as b_, shareSubgraphId as ba, sortTokensBySharedSubgraphIds as bb, getSupportedChainIdsForDirection as bc, filterChains as bd, filterTokens as be, getTokenImage as bf, getNewSwapParamsFromInput as bg, sortAllTokens as bh, findToken as bi, findNativeToken as bj, normalizeIbcAddress as bk, groupTokensBySymbol as bl, groupTokensByChainId as bm, filterViewableTokens as bn, getSecretNetworkBalances as bo, getTokenAssetsKey as bp, fetchAssetsColors as bq, initializeSquidWithAssetsColors as br, isEmptyObject as bs, normalizeTokenSymbol as bt, areTokenSymbolsCompatible as bu, isEvmosChain as bv, resolveChainIdFromAsset as bw, getConfigWithDefaults as bx, randomIntFromInterval as by, getTokensForChain as bz, chainTypeToNativeTokenAddressMap as c, isHistoryTransactionPending as c$, filterWagmiConnector as c0, waitForReceiptWithRetry as c1, getUserCountry as c2, getCountryData as c3, getCurrencyData as c4, adaptiveRound as c5, getSuggestedAmountsForCurrency as c6, HederaExtensionHelper as c7, convertHederaAccountIdToEvmAddress as c8, convertEvmAddressToHederaAccountId as c9, isValidIssuedAsset as cA, isValidHorizonAsset as cB, formatTransactionHistoryDate as cC, getAxelarExplorerTxUrl as cD, getSourceExplorerTxUrl as cE, getMainExplorerUrl as cF, formatDistance as cG, formatSeconds as cH, formatSwapTxStatusResponseForStorage as cI, simplifyRouteAction as cJ, fetchSwapTransactionStatus as cK, compareTransactionIds as cL, isCoralBridgeAction as cM, sleep as cN, isDepositRoute as cO, isChainflipBridgeTransaction as cP, isOnChainTxData as cQ, getHistoryTransactionId as cR, getStepStatuses as cS, getHalfSuccessState as cT, getStepsInfos as cU, getSwapTxStatusRefetchInterval as cV, getSendTxStatusRefetchInterval as cW, chainflipMultihopBridgeType as cX, getBridgeType as cY, getTransactionStatus as cZ, getTransactionEndStatus as c_, scaleHbarToWei as ca, scaleWeiToHbar as cb, parseToBigInt as cc, roundNumericValue as cd, formatUnitsRounded as ce, formatTokenAmount as cf, formatUsdAmount as cg, trimExtraDecimals as ch, getNumericValue as ci, cleanAmount as cj, convertTokenAmountToUSD as ck, convertUSDToTokenAmount as cl, calculateTotal24hChange as cm, getRouteExpiry as cn, searchTokens as co, filterSolanaWallets as cp, isSolanaAddressValid as cq, executeSolanaSwap as cr, executeSolanaTransfer as cs, isStellarAddressValid as ct, getStellarNetwork as cu, stellarAddressToScVal as cv, getStellarTrustLineAsset as cw, isStellarToken as cx, isStellarIssuedToken as cy, getStellarHorizonApiUrl as cz, definedInWindow as d, isHistoryTransactionFailed as d0, isHistoryTransactionWarning as d1, isHistoryTransactionEnded as d2, formatHash as d3, isWalletAddressValid as d4, redirectToExtensionsStore as d5, accessProperty as d6, populateWallets as d7, getDefaultChain as d8, sortWallets as d9, areSameAddress as da, sortAddressBook as db, calculateTotalUsdBalanceUSD as dc, addTokenToWallet as dd, isEvmChainNotSupportedError as de, getWalletSupportedChainTypes as df, getConnectorForChainType as dg, walletSupportsChainType as dh, connectWallet as di, cancelConnectWallet as dj, isProblematicConnector as dk, mergeWallets as dl, isXionSmartContractAddress as dm, isXrplAddressValid as dn, buildXrplTrustSetTx as dp, getXrplNetwork as dq, parseXrplPaymentTx as dr, parseXrplTokenAddress as ds, 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 };
|
|
37485
|
+
//# sourceMappingURL=index-DYs5b-an.js.map
|