@0xsquid/react-hooks 8.7.2-beta-interactive-to-amount.0 → 8.7.2-beta-interactive-to-amount.1
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 -0
- package/dist/hooks/transaction/useGetRoute.d.ts +1 -0
- package/dist/{index-uUESkMSI.js → index-B9EnYPpR.js} +14 -9
- package/dist/index-B9EnYPpR.js.map +1 -0
- package/dist/{index-6eFn7nS3.js → index-BL3rpZzC.js} +14 -9
- package/dist/index-BL3rpZzC.js.map +1 -0
- package/dist/{index.es-C0R5BhSh.js → index.es-C93MXP-M.js} +2 -2
- package/dist/{index.es-C0R5BhSh.js.map → index.es-C93MXP-M.js.map} +1 -1
- package/dist/{index.es-CRHo3jIu.js → index.es-Da6lPGPH.js} +2 -2
- package/dist/{index.es-CRHo3jIu.js.map → index.es-Da6lPGPH.js.map} +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1 -1
- package/dist/{secretService-C8LsM_VG.js → secretService-Bp_azQsY.js} +2 -2
- package/dist/{secretService-C8LsM_VG.js.map → secretService-Bp_azQsY.js.map} +1 -1
- package/dist/{secretService-B87PUWJl.js → secretService-CO9haOur.js} +2 -2
- package/dist/{secretService-B87PUWJl.js.map → secretService-CO9haOur.js.map} +1 -1
- package/dist/{stellarService.client-DidQHS07.js → stellarService.client-B-EC09rP.js} +2 -2
- package/dist/{stellarService.client-DidQHS07.js.map → stellarService.client-B-EC09rP.js.map} +1 -1
- package/dist/{stellarService.client-BFgOtfFI.js → stellarService.client-CrlGBSG9.js} +2 -2
- package/dist/{stellarService.client-BFgOtfFI.js.map → stellarService.client-CrlGBSG9.js.map} +1 -1
- package/package.json +1 -1
- package/dist/index-6eFn7nS3.js.map +0 -1
- package/dist/index-uUESkMSI.js.map +0 -1
|
@@ -22395,7 +22395,7 @@ const keys = () => ({
|
|
|
22395
22395
|
// ============
|
|
22396
22396
|
// Transactions
|
|
22397
22397
|
// ============
|
|
22398
|
-
transaction: (fromChainId, toChainId, toTokenAddress, fromTokenAddress, fromAmount, toAmount, slippage, sourceUserAddress, degenMode, destinationAddress, fallbackAddress, quoteOnly, fromChainType, preHook, postHook, overrideGasRefundAddress) => [
|
|
22398
|
+
transaction: (fromChainId, toChainId, toTokenAddress, fromTokenAddress, fromAmount, toAmount, slippage, sourceUserAddress, degenMode, destinationAddress, fallbackAddress, quoteOnly, fromChainType, preHook, postHook, overrideGasRefundAddress, prefer) => [
|
|
22399
22399
|
...keys().transactions(),
|
|
22400
22400
|
QueryKeys.Transaction,
|
|
22401
22401
|
fromChainId,
|
|
@@ -22414,6 +22414,7 @@ const keys = () => ({
|
|
|
22414
22414
|
preHook,
|
|
22415
22415
|
postHook,
|
|
22416
22416
|
overrideGasRefundAddress,
|
|
22417
|
+
prefer,
|
|
22417
22418
|
],
|
|
22418
22419
|
swapTransactionStatus: (transactionId) => [
|
|
22419
22420
|
...keys().transactions(),
|
|
@@ -22605,6 +22606,7 @@ const getConfigWithDefaults = (config) => {
|
|
|
22605
22606
|
preHook: get$2(config, "preHook", defaultConfigValues.preHook),
|
|
22606
22607
|
postHook: get$2(config, "postHook", defaultConfigValues.postHook),
|
|
22607
22608
|
overrideGasRefundAddress: get$2(config, "overrideGasRefundAddress", defaultConfigValues.overrideGasRefundAddress),
|
|
22609
|
+
prefer: get$2(config, "prefer", defaultConfigValues.prefer),
|
|
22608
22610
|
};
|
|
22609
22611
|
};
|
|
22610
22612
|
const randomIntFromInterval = (min, max) => {
|
|
@@ -23298,7 +23300,7 @@ const filterViewableTokens = (tokens, config, direction) => {
|
|
|
23298
23300
|
};
|
|
23299
23301
|
const getSecretNetworkBalances = async (chainData, cosmosAddress, squidTokens, keplrTypeWallet) => {
|
|
23300
23302
|
const squidSecretTokens = squidTokens.filter((t) => t.chainId === CHAIN_IDS.SECRET);
|
|
23301
|
-
const { fetchAllSecretBalances } = await import('./secretService-
|
|
23303
|
+
const { fetchAllSecretBalances } = await import('./secretService-CO9haOur.js');
|
|
23302
23304
|
return fetchAllSecretBalances(chainData, cosmosAddress, squidSecretTokens, keplrTypeWallet);
|
|
23303
23305
|
};
|
|
23304
23306
|
function getTokenAssetsKey(token) {
|
|
@@ -26693,7 +26695,7 @@ function useStellarWallets() {
|
|
|
26693
26695
|
try {
|
|
26694
26696
|
const { allowAllModules: initializeAllModules } = await import('@creit.tech/stellar-wallets-kit');
|
|
26695
26697
|
const { LedgerModule } = await import('@creit.tech/stellar-wallets-kit/modules/ledger.module');
|
|
26696
|
-
const { formatStellarWallet } = await import('./stellarService.client-
|
|
26698
|
+
const { formatStellarWallet } = await import('./stellarService.client-B-EC09rP.js');
|
|
26697
26699
|
const modules = [...initializeAllModules(), new LedgerModule()];
|
|
26698
26700
|
const promises = modules.map(async (module) => {
|
|
26699
26701
|
const isAvailable = await module.isAvailable();
|
|
@@ -30025,7 +30027,7 @@ function hederaWalletConnect(parameters) {
|
|
|
30025
30027
|
const optionalChains = config.chains.map((x) => x.id);
|
|
30026
30028
|
if (!optionalChains.length)
|
|
30027
30029
|
return;
|
|
30028
|
-
const { EthereumProvider } = await import('./index.es-
|
|
30030
|
+
const { EthereumProvider } = await import('./index.es-Da6lPGPH.js');
|
|
30029
30031
|
const rawProvider = await EthereumProvider.init({
|
|
30030
30032
|
...restParameters,
|
|
30031
30033
|
disableProviderPing: true,
|
|
@@ -32846,7 +32848,7 @@ const useApproval = ({ squidRoute, }) => {
|
|
|
32846
32848
|
queryClient.refetchQueries({
|
|
32847
32849
|
queryKey: keys().transaction(squidRoute.params.fromChain, squidRoute.params.toChain, squidRoute.params.toToken, squidRoute.params.fromToken, fromAmount, toAmount, 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,
|
|
32848
32850
|
// TODO: update types
|
|
32849
|
-
squidRoute.params?.overrideGasRefundAddress),
|
|
32851
|
+
squidRoute.params?.overrideGasRefundAddress, squidRoute.params?.prefer),
|
|
32850
32852
|
});
|
|
32851
32853
|
}
|
|
32852
32854
|
},
|
|
@@ -36695,7 +36697,7 @@ const useGetRoute = () => {
|
|
|
36695
36697
|
* These data will be used to trigger the transaction
|
|
36696
36698
|
* @returns {Route} Route data
|
|
36697
36699
|
*/
|
|
36698
|
-
return useMutation(async ({ fromChain, toChain, fromToken, toToken, sourceUserAddress, destinationAddress, fromPrice = "", toPrice = "", bypassGuardrails, quoteOnly, fromChainType, postHook, preHook, overrideGasRefundAddress, }) => {
|
|
36700
|
+
return useMutation(async ({ fromChain, toChain, fromToken, toToken, sourceUserAddress, destinationAddress, fromPrice = "", toPrice = "", bypassGuardrails, quoteOnly, fromChainType, postHook, preHook, overrideGasRefundAddress, prefer, }) => {
|
|
36699
36701
|
if (!fromChain ||
|
|
36700
36702
|
!toChain ||
|
|
36701
36703
|
!fromToken ||
|
|
@@ -36750,10 +36752,11 @@ const useGetRoute = () => {
|
|
|
36750
36752
|
}
|
|
36751
36753
|
const { route } = await squid.getRoute({
|
|
36752
36754
|
...params,
|
|
36755
|
+
...(prefer ? { prefer } : {}),
|
|
36753
36756
|
});
|
|
36754
36757
|
// Cache the route data
|
|
36755
36758
|
// Useful when the getRoute mutation is called from another hook
|
|
36756
|
-
queryClient.setQueryData(keys().transaction(fromChain, toChain, toToken.address, fromToken.address, fromPrice, toPrice, config.slippage, sourceUserAddress, config.degenMode, destinationAddress, swapRoute?.fallbackAddress, quoteOnly, fromChainType, config.preHook, config.postHook, overrideGasRefundAddress), route);
|
|
36759
|
+
queryClient.setQueryData(keys().transaction(fromChain, toChain, toToken.address, fromToken.address, fromPrice, toPrice, config.slippage, sourceUserAddress, config.degenMode, destinationAddress, swapRoute?.fallbackAddress, quoteOnly, fromChainType, config.preHook, config.postHook, overrideGasRefundAddress, config.prefer), route);
|
|
36757
36760
|
return route;
|
|
36758
36761
|
});
|
|
36759
36762
|
};
|
|
@@ -36776,7 +36779,7 @@ refetchIntervalInBackground = false, refetchInterval = 30000, quoteOnly = true,
|
|
|
36776
36779
|
const sourceUserAddress = isDepositAddressEnabled && isAvailableAsPaymentMethod
|
|
36777
36780
|
? depositRefundAddress ?? sourceConnectedAddress
|
|
36778
36781
|
: sourceConnectedAddress;
|
|
36779
|
-
const squidRouteQueryKeys = useMemo(() => keys().transaction(fromChain?.chainId, toChain?.chainId, toToken?.address, fromToken?.address, fromAmount, toAmount, config.slippage, sourceUserAddress, config.degenMode, destinationAddress, fallbackAddress, quoteOnly, fromChain?.chainType, config.preHook, config.postHook, config.overrideGasRefundAddress), [
|
|
36782
|
+
const squidRouteQueryKeys = useMemo(() => keys().transaction(fromChain?.chainId, toChain?.chainId, toToken?.address, fromToken?.address, fromAmount, toAmount, config.slippage, sourceUserAddress, config.degenMode, destinationAddress, fallbackAddress, quoteOnly, fromChain?.chainType, config.preHook, config.postHook, config.overrideGasRefundAddress, config.prefer), [
|
|
36780
36783
|
fromChain?.chainId,
|
|
36781
36784
|
toChain?.chainId,
|
|
36782
36785
|
toToken?.address,
|
|
@@ -36793,6 +36796,7 @@ refetchIntervalInBackground = false, refetchInterval = 30000, quoteOnly = true,
|
|
|
36793
36796
|
config.preHook,
|
|
36794
36797
|
config.postHook,
|
|
36795
36798
|
config.overrideGasRefundAddress,
|
|
36799
|
+
config.prefer,
|
|
36796
36800
|
]);
|
|
36797
36801
|
const queryEnabled = enabled != undefined
|
|
36798
36802
|
? enabled
|
|
@@ -36823,6 +36827,7 @@ refetchIntervalInBackground = false, refetchInterval = 30000, quoteOnly = true,
|
|
|
36823
36827
|
postHook: config.postHook,
|
|
36824
36828
|
preHook: config.preHook,
|
|
36825
36829
|
overrideGasRefundAddress: config.overrideGasRefundAddress,
|
|
36830
|
+
prefer: config.prefer,
|
|
36826
36831
|
});
|
|
36827
36832
|
return route;
|
|
36828
36833
|
}, {
|
|
@@ -37483,4 +37488,4 @@ const SquidProvider = ({ children, config, placeholder, }) => {
|
|
|
37483
37488
|
};
|
|
37484
37489
|
|
|
37485
37490
|
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, useSwapTransactionStatus as aA, useAvatar as aB, useHistory 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, useSourceChainGasToken as ak, useSquidTokens as al, useHistoricalData as am, useTokensData as an, useEstimateSendTransaction as ao, useSendTransaction as ap, useSendTransactionGas as aq, useAllTransactionsStatus as ar, useApproval as as, useEstimate as at, useEstimatePriceImpact as au, useExecuteTransaction as av, useGetRoute as aw, useGetRouteWrapper as ax, useRouteWarnings as ay, useSendTransactionStatus 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, isHistoryTransactionPending 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, 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_, scaleWeiToHbar as ca, parseToBigInt as cb, roundNumericValue as cc, formatUnitsRounded as cd, formatTokenAmount as ce, formatUsdAmount as cf, trimExtraDecimals as cg, getNumericValue as ch, isZeroAmount 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 };
|
|
37486
|
-
//# sourceMappingURL=index-
|
|
37491
|
+
//# sourceMappingURL=index-BL3rpZzC.js.map
|