@0xsquid/react-hooks 8.2.0 → 8.3.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 +5 -1
- package/dist/core/types/event.d.ts +2 -1
- package/dist/core/types/route.d.ts +4 -0
- package/dist/hooks/transaction/useGetRoute.d.ts +6 -4
- package/dist/{index-CBCEbiL_.js → index-BYTPPn3v.js} +16 -9
- package/dist/index-BYTPPn3v.js.map +1 -0
- package/dist/{index-8l2o48hl.js → index-iLEj6QB2.js} +16 -9
- package/dist/index-iLEj6QB2.js.map +1 -0
- package/dist/{index.es-Cr0Cyn6l.js → index.es-BEOob50G.js} +2 -2
- package/dist/{index.es-Cr0Cyn6l.js.map → index.es-BEOob50G.js.map} +1 -1
- package/dist/{index.es-BluimAHt.js → index.es-Dng6NJoN.js} +2 -2
- package/dist/{index.es-BluimAHt.js.map → index.es-Dng6NJoN.js.map} +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1 -1
- package/dist/{secretService-DrLLHqjS.js → secretService-D-PXW1nB.js} +2 -2
- package/dist/{secretService-DrLLHqjS.js.map → secretService-D-PXW1nB.js.map} +1 -1
- package/dist/{secretService-DzyNkwb3.js → secretService-rdyT76TV.js} +2 -2
- package/dist/{secretService-DzyNkwb3.js.map → secretService-rdyT76TV.js.map} +1 -1
- package/dist/services/internal/eventService.d.ts +2 -1
- package/dist/{stellarService.client-cU1Vl8_G.js → stellarService.client-CTIU9xRo.js} +2 -2
- package/dist/{stellarService.client-cU1Vl8_G.js.map → stellarService.client-CTIU9xRo.js.map} +1 -1
- package/dist/{stellarService.client-BZTyfT7o.js → stellarService.client-kBgnFbAC.js} +2 -2
- package/dist/{stellarService.client-BZTyfT7o.js.map → stellarService.client-kBgnFbAC.js.map} +1 -1
- package/package.json +1 -1
- package/dist/index-8l2o48hl.js.map +0 -1
- package/dist/index-CBCEbiL_.js.map +0 -1
|
@@ -22260,7 +22260,7 @@ const keys = () => ({
|
|
|
22260
22260
|
// ============
|
|
22261
22261
|
// Transactions
|
|
22262
22262
|
// ============
|
|
22263
|
-
transaction: (fromChainId, toChainId, toTokenAddress, fromTokenAddress, price, slippage, getGasOnDestination, sourceUserAddress, degenMode, destinationAddress, fallbackAddress, quoteOnly, fromChainType, preHook, postHook) => [
|
|
22263
|
+
transaction: (fromChainId, toChainId, toTokenAddress, fromTokenAddress, price, slippage, getGasOnDestination, sourceUserAddress, degenMode, destinationAddress, fallbackAddress, quoteOnly, fromChainType, preHook, postHook, overrideGasRefundAddress) => [
|
|
22264
22264
|
...keys().transactions(),
|
|
22265
22265
|
QueryKeys.Transaction,
|
|
22266
22266
|
fromChainId,
|
|
@@ -22278,6 +22278,7 @@ const keys = () => ({
|
|
|
22278
22278
|
fromChainType,
|
|
22279
22279
|
preHook,
|
|
22280
22280
|
postHook,
|
|
22281
|
+
overrideGasRefundAddress,
|
|
22281
22282
|
],
|
|
22282
22283
|
swapTransactionStatus: (transactionId) => [
|
|
22283
22284
|
...keys().transactions(),
|
|
@@ -22441,6 +22442,7 @@ const getConfigWithDefaults = (config) => {
|
|
|
22441
22442
|
degenMode: get$2(config, "degenMode", defaultConfigValues.degenMode),
|
|
22442
22443
|
preHook: get$2(config, "preHook", defaultConfigValues.preHook),
|
|
22443
22444
|
postHook: get$2(config, "postHook", defaultConfigValues.postHook),
|
|
22445
|
+
overrideGasRefundAddress: get$2(config, "overrideGasRefundAddress", defaultConfigValues.overrideGasRefundAddress),
|
|
22444
22446
|
};
|
|
22445
22447
|
};
|
|
22446
22448
|
const randomIntFromInterval = (min, max) => {
|
|
@@ -23130,7 +23132,7 @@ const filterViewableTokens = (tokens, config, direction) => {
|
|
|
23130
23132
|
};
|
|
23131
23133
|
const getSecretNetworkBalances = async (chainData, cosmosAddress, squidTokens, keplrTypeWallet) => {
|
|
23132
23134
|
const squidSecretTokens = squidTokens.filter((t) => t.chainId === CHAIN_IDS.SECRET);
|
|
23133
|
-
const { fetchAllSecretBalances } = await import('./secretService-
|
|
23135
|
+
const { fetchAllSecretBalances } = await import('./secretService-rdyT76TV.js');
|
|
23134
23136
|
return fetchAllSecretBalances(chainData, cosmosAddress, squidSecretTokens, keplrTypeWallet);
|
|
23135
23137
|
};
|
|
23136
23138
|
function getTokenAssetsKey(token) {
|
|
@@ -26414,7 +26416,7 @@ function useStellarWallets() {
|
|
|
26414
26416
|
return;
|
|
26415
26417
|
try {
|
|
26416
26418
|
const { allowAllModules: initializeAllModules } = await import('@creit.tech/stellar-wallets-kit');
|
|
26417
|
-
const { formatStellarWallet } = await import('./stellarService.client-
|
|
26419
|
+
const { formatStellarWallet } = await import('./stellarService.client-kBgnFbAC.js');
|
|
26418
26420
|
const modules = initializeAllModules();
|
|
26419
26421
|
const promises = modules.map(async (module) => {
|
|
26420
26422
|
const isAvailable = await module.isAvailable();
|
|
@@ -27914,7 +27916,7 @@ function hederaWalletConnect(parameters) {
|
|
|
27914
27916
|
const optionalChains = config.chains.map((x) => x.id);
|
|
27915
27917
|
if (!optionalChains.length)
|
|
27916
27918
|
return;
|
|
27917
|
-
const { EthereumProvider } = await import('./index.es-
|
|
27919
|
+
const { EthereumProvider } = await import('./index.es-Dng6NJoN.js');
|
|
27918
27920
|
const rawProvider = await EthereumProvider.init({
|
|
27919
27921
|
...restParameters,
|
|
27920
27922
|
disableProviderPing: true,
|
|
@@ -32181,7 +32183,9 @@ const useApproval = ({ squidRoute, }) => {
|
|
|
32181
32183
|
// This is to ensure we're using the latest expiry timestamp
|
|
32182
32184
|
if (squidRoute) {
|
|
32183
32185
|
queryClient.refetchQueries({
|
|
32184
|
-
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
|
|
32186
|
+
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,
|
|
32187
|
+
// TODO: update types
|
|
32188
|
+
squidRoute.params?.overrideGasRefundAddress),
|
|
32185
32189
|
});
|
|
32186
32190
|
}
|
|
32187
32191
|
},
|
|
@@ -35982,7 +35986,7 @@ const useGetRoute = () => {
|
|
|
35982
35986
|
* These data will be used to trigger the transaction
|
|
35983
35987
|
* @returns {Route} Route data
|
|
35984
35988
|
*/
|
|
35985
|
-
return useMutation(async ({ fromChain, toChain, fromToken, toToken, sourceUserAddress, destinationAddress, fromPrice, bypassGuardrails, quoteOnly, fromChainType, postHook, preHook, }) => {
|
|
35989
|
+
return useMutation(async ({ fromChain, toChain, fromToken, toToken, sourceUserAddress, destinationAddress, fromPrice, bypassGuardrails, quoteOnly, fromChainType, postHook, preHook, overrideGasRefundAddress, }) => {
|
|
35986
35990
|
if (!fromChain || !toChain || !fromToken || !toToken || !fromPrice) {
|
|
35987
35991
|
return undefined;
|
|
35988
35992
|
}
|
|
@@ -36016,6 +36020,7 @@ const useGetRoute = () => {
|
|
|
36016
36020
|
bypassGuardrails,
|
|
36017
36021
|
preHook,
|
|
36018
36022
|
postHook,
|
|
36023
|
+
overrideGasRefundAddress,
|
|
36019
36024
|
};
|
|
36020
36025
|
// If the swap is involving cosmos chains, we need to add the fallback addresses (if any)
|
|
36021
36026
|
if (cosmosFallbackAddresses &&
|
|
@@ -36028,7 +36033,7 @@ const useGetRoute = () => {
|
|
|
36028
36033
|
});
|
|
36029
36034
|
// Cache the route data
|
|
36030
36035
|
// Useful when the getRoute mutation is called from another hook
|
|
36031
|
-
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), route);
|
|
36036
|
+
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);
|
|
36032
36037
|
return route;
|
|
36033
36038
|
});
|
|
36034
36039
|
};
|
|
@@ -36051,7 +36056,7 @@ refetchIntervalInBackground = false, refetchInterval = 30000, quoteOnly = true,
|
|
|
36051
36056
|
const sourceUserAddress = isDepositAddressEnabled && isAvailableAsPaymentMethod
|
|
36052
36057
|
? depositRefundAddress ?? sourceConnectedAddress
|
|
36053
36058
|
: sourceConnectedAddress;
|
|
36054
|
-
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), [
|
|
36059
|
+
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), [
|
|
36055
36060
|
fromChain?.chainId,
|
|
36056
36061
|
toChain?.chainId,
|
|
36057
36062
|
toToken?.address,
|
|
@@ -36067,6 +36072,7 @@ refetchIntervalInBackground = false, refetchInterval = 30000, quoteOnly = true,
|
|
|
36067
36072
|
fromChain?.chainType,
|
|
36068
36073
|
config.preHook,
|
|
36069
36074
|
config.postHook,
|
|
36075
|
+
config.overrideGasRefundAddress,
|
|
36070
36076
|
]);
|
|
36071
36077
|
const queryEnabled = enabled != undefined
|
|
36072
36078
|
? enabled
|
|
@@ -36096,6 +36102,7 @@ refetchIntervalInBackground = false, refetchInterval = 30000, quoteOnly = true,
|
|
|
36096
36102
|
fromChainType: fromChain?.chainType,
|
|
36097
36103
|
postHook: config.postHook,
|
|
36098
36104
|
preHook: config.preHook,
|
|
36105
|
+
overrideGasRefundAddress: config.overrideGasRefundAddress,
|
|
36099
36106
|
});
|
|
36100
36107
|
return route;
|
|
36101
36108
|
}, {
|
|
@@ -36785,4 +36792,4 @@ const SquidProvider = ({ children, config, placeholder, }) => {
|
|
|
36785
36792
|
};
|
|
36786
36793
|
|
|
36787
36794
|
export { useAllTokensWithBalanceForChainType as $, AxelarStatusResponseType as A, useSquidQueryClient as B, CHAIN_IDS as C, DEFAULT_LOCALE as D, useSquid as E, useStellarAccountActivation as F, useAddressBookStore as G, HistoryTxType as H, useAssetsColorsStore as I, useFavoriteTokensStore as J, useHistoryStore as K, useSendTransactionStore as L, useConfigStore as M, Nr as N, useSquidStore as O, useSwapRoutePersistStore as P, QueryKeys as Q, useTransactionStore as R, SquidStatusErrorType as S, TransactionErrorType as T, ConnectingWalletStatus as U, useWalletStore as V, Wo as W, XamanXrplNetwork as X, useDepositAddress as Y, useSwap as Z, useAllConnectedWalletBalances as _, WindowWalletFlag as a, filterChains as a$, useCosmosBalance as a0, useEvmBalance as a1, useMultiChainBalance as a2, useMultipleTokenPrices as a3, useNativeBalance as a4, useNativeTokenForChain as a5, useSingleTokenPrice as a6, useSquidTokens as a7, useHistoricalData as a8, useTokensData as a9, useWallet as aA, useWallets as aB, useXrplTrustLine as aC, TX_STATUS_CONSTANTS as aD, FINAL_TRANSACTION_STATUSES as aE, useGetFiatQuote as aF, useGetOnRampConfig as aG, useExecuteFiatQuote as aH, useFiatOnRampTxStatus as aI, useFiatTransactions as aJ, useCurrencyDetails as aK, useCountryDetails as aL, useAvailableQuotes as aM, useRecommendedQuote as aN, useGetOnrampPaymentTypes as aO, useSuggestedFiatAmounts as aP, SquidProvider as aQ, EnsService as aR, getXummClient as aS, isXamanXAppContext as aT, getQueryHeaders as aU, getStatusCode as aV, is404Error as aW, assetsBaseUrl as aX, shareSubgraphId as aY, sortTokensBySharedSubgraphIds as aZ, getSupportedChainIdsForDirection as a_, useEstimateSendTransaction as aa, useSendTransaction as ab, useSendTransactionGas as ac, useAllTransactionsStatus as ad, useApproval as ae, useEstimate as af, useEstimatePriceImpact as ag, useExecuteTransaction as ah, useGetRoute as ai, useGetRouteWrapper as aj, useRouteWarnings as ak, useSendTransactionStatus as al, useSwapTransactionStatus as am, useAvatar as an, useHistory as ao, useUserParams as ap, useDebouncedValue as aq, useAddToken as ar, useAutoConnect as as, useEnsDataForAddress as at, useEnsSearch as au, useGnosisContext as av, useIsSameAddressAndGnosisContext as aw, useIntegratorContext as ax, useMultiChainWallet as ay, useSigner as az, chainTypeToZeroAddressMap as b, formatUsdAmount as b$, filterTokens as b0, getTokenImage as b1, getNewSwapParamsFromInput as b2, sortAllTokens as b3, findToken as b4, findNativeToken as b5, normalizeIbcAddress as b6, groupTokensBySymbol as b7, groupTokensByChainId as b8, filterViewableTokens as b9, normalizeError as bA, transactionErrorCode as bB, isUserRejectionError as bC, getTransactionError as bD, handleTransactionErrorEvents as bE, isSwapRouteError as bF, isStatusError as bG, createQuoteRequestParamsHash as bH, WidgetEvents as bI, EvmNetworkNotSupportedErrorCode as bJ, addEthereumChain as bK, parseEvmAddress as bL, formatEvmWallet as bM, filterWagmiConnector as bN, waitForReceiptWithRetry as bO, getUserCountry as bP, getCountryData as bQ, getCurrencyData as bR, adaptiveRound as bS, getSuggestedAmountsForCurrency as bT, HederaExtensionHelper as bU, convertHederaAccountIdToEvmAddress as bV, convertEvmAddressToHederaAccountId as bW, parseToBigInt as bX, roundNumericValue as bY, formatUnitsRounded as bZ, formatTokenAmount as b_, getSecretNetworkBalances as ba, getTokenAssetsKey as bb, fetchAssetsColors as bc, initializeSquidWithAssetsColors as bd, isEmptyObject as be, normalizeTokenSymbol as bf, areTokenSymbolsCompatible as bg, isEvmosChain as bh, getConfigWithDefaults as bi, randomIntFromInterval as bj, getTokensForChain as bk, getFirstAvailableChainId as bl, fetchHighestBalanceToken as bm, getInitialOrDefaultTokenAddressForChain as bn, getInitialTokenAddressForChain as bo, filterTokensForDestination as bp, getInitialChainIdFromConfig as bq, getCosmosKey as br, getKeysSettled as bs, getAllKeysForSupportedCosmosChains as bt, isCosmosAddressValid as bu, getCosmosSigningClient as bv, getCosmosChainInfosObject as bw, connectCosmosWallet as bx, isFallbackAddressNeeded as by, suggestChainOrThrow as bz, chainTypeToNativeTokenAddressMap as c, trimExtraDecimals as c0, getNumericValue as c1, cleanAmount as c2, convertTokenAmountToUSD as c3, convertUSDToTokenAmount as c4, calculateTotal24hChange as c5, searchTokens as c6, filterSolanaWallets as c7, isSolanaAddressValid as c8, executeSolanaSwap as c9, isHistoryTransactionFailed as cA, isHistoryTransactionWarning as cB, isHistoryTransactionEnded as cC, formatHash as cD, isWalletAddressValid as cE, redirectToExtensionsStore as cF, accessProperty as cG, populateWallets as cH, getDefaultChain as cI, sortWallets as cJ, areSameAddress as cK, sortAddressBook as cL, calculateTotalUsdBalanceUSD as cM, addTokenToWallet as cN, isEvmChainNotSupportedError as cO, getWalletSupportedChainTypes as cP, getConnectorForChainType as cQ, walletSupportsChainType as cR, connectWallet as cS, cancelConnectWallet as cT, isProblematicConnector as cU, mergeWallets as cV, isXionSmartContractAddress as cW, isXrplAddressValid as cX, buildXrplTrustSetTx as cY, getXrplNetwork as cZ, parseXrplPaymentTx as c_, executeSolanaTransfer 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, getHistoryTransactionId as cp, getStepStatuses as cq, getHalfSuccessState as cr, getStepsInfos as cs, getSwapTxStatusRefetchInterval as ct, getSendTxStatusRefetchInterval as cu, chainflipMultihopBridgeType as cv, getBridgeType as cw, getTransactionStatus as cx, getTransactionEndStatus as cy, isHistoryTransactionPending as cz, definedInWindow as d, er as e, formatBNToReadable as f, destinationAddressResetValue as g, fallbackAddressResetValue as h, nativeCosmosTokenAddress as i, nativeEvmTokenAddress as j, nativeSolanaTokenAddress as k, nativeStellarTokenAddress as l, nativeSuiTokenAddress as m, nativeBitcoinTokenAddress as n, nativeXrplTokenAddress as o, CosmosProvider as p, SendTransactionStatus as q, TransactionStatus as r, useTrackSearchEmpty as s, useSquidChains as t, useCosmosContext as u, useClient as v, walletIconBaseUrl as w, useCosmosForChain as x, useHederaTokenAssociations as y, useKeyboardNavigation as z };
|
|
36788
|
-
//# sourceMappingURL=index-
|
|
36795
|
+
//# sourceMappingURL=index-iLEj6QB2.js.map
|