@0xsquid/react-hooks 8.8.1-beta-canton.1 → 8.8.1-beta-canton.3
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/hooks/store/useDepositAddressStore.d.ts +8 -2
- package/dist/hooks/swap/useDepositAddress.d.ts +4 -3
- package/dist/{index-BOyZL5gB.js → index-BXuWPj5X.js} +24 -21
- package/dist/{index-BOyZL5gB.js.map → index-BXuWPj5X.js.map} +1 -1
- package/dist/{index-C6O8biTF.js → index-DSDEoKAQ.js} +24 -21
- package/dist/{index-C6O8biTF.js.map → index-DSDEoKAQ.js.map} +1 -1
- package/dist/{index.es-CjEZHrFG.js → index.es-C7vw_7iQ.js} +2 -2
- package/dist/{index.es-CjEZHrFG.js.map → index.es-C7vw_7iQ.js.map} +1 -1
- package/dist/{index.es-DXtULgAw.js → index.es-CP6uAXkL.js} +2 -2
- package/dist/{index.es-DXtULgAw.js.map → index.es-CP6uAXkL.js.map} +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1 -1
- package/dist/{secretService-DQhP5g0c.js → secretService-BaRVTuK5.js} +2 -2
- package/dist/{secretService-DQhP5g0c.js.map → secretService-BaRVTuK5.js.map} +1 -1
- package/dist/{secretService-s34iHqOe.js → secretService-L7xBX95y.js} +2 -2
- package/dist/{secretService-s34iHqOe.js.map → secretService-L7xBX95y.js.map} +1 -1
- package/dist/{stellarService.client-DlaL8w0o.js → stellarService.client-Cnzwca-X.js} +2 -2
- package/dist/{stellarService.client-DlaL8w0o.js.map → stellarService.client-Cnzwca-X.js.map} +1 -1
- package/dist/{stellarService.client-BQrRZDwB.js → stellarService.client-SFl8OhRJ.js} +2 -2
- package/dist/{stellarService.client-BQrRZDwB.js.map → stellarService.client-SFl8OhRJ.js.map} +1 -1
- package/package.json +1 -1
|
@@ -23354,7 +23354,7 @@ const filterViewableTokens = (tokens, config, direction) => {
|
|
|
23354
23354
|
};
|
|
23355
23355
|
const getSecretNetworkBalances = async (chainData, cosmosAddress, squidTokens, keplrTypeWallet) => {
|
|
23356
23356
|
const squidSecretTokens = squidTokens.filter((t) => t.chainId === CHAIN_IDS.SECRET);
|
|
23357
|
-
const { fetchAllSecretBalances } = await import('./secretService-
|
|
23357
|
+
const { fetchAllSecretBalances } = await import('./secretService-L7xBX95y.js');
|
|
23358
23358
|
return fetchAllSecretBalances(chainData, cosmosAddress, squidSecretTokens, keplrTypeWallet);
|
|
23359
23359
|
};
|
|
23360
23360
|
function getTokenAssetsKey(token) {
|
|
@@ -26763,7 +26763,7 @@ function useStellarWallets() {
|
|
|
26763
26763
|
try {
|
|
26764
26764
|
const { allowAllModules: initializeAllModules } = await import('@creit.tech/stellar-wallets-kit');
|
|
26765
26765
|
const { LedgerModule } = await import('@creit.tech/stellar-wallets-kit/modules/ledger.module.mjs');
|
|
26766
|
-
const { formatStellarWallet } = await import('./stellarService.client-
|
|
26766
|
+
const { formatStellarWallet } = await import('./stellarService.client-Cnzwca-X.js');
|
|
26767
26767
|
const modules = [...initializeAllModules(), new LedgerModule()];
|
|
26768
26768
|
const promises = modules.map(async (module) => {
|
|
26769
26769
|
const isAvailable = await module.isAvailable();
|
|
@@ -30113,7 +30113,7 @@ function hederaWalletConnect(parameters) {
|
|
|
30113
30113
|
const optionalChains = config.chains.map((x) => x.id);
|
|
30114
30114
|
if (!optionalChains.length)
|
|
30115
30115
|
return;
|
|
30116
|
-
const { EthereumProvider } = await import('./index.es-
|
|
30116
|
+
const { EthereumProvider } = await import('./index.es-CP6uAXkL.js');
|
|
30117
30117
|
const rawProvider = await EthereumProvider.init({
|
|
30118
30118
|
...restParameters,
|
|
30119
30119
|
disableProviderPing: true,
|
|
@@ -30794,21 +30794,21 @@ const useSendTransactionStore = create((set, get) => ({
|
|
|
30794
30794
|
|
|
30795
30795
|
const useDepositAddressStore = create((set) => ({
|
|
30796
30796
|
deposit: null,
|
|
30797
|
-
|
|
30797
|
+
selectedPaymentMethod: "connectedWallet",
|
|
30798
30798
|
setDeposit: (data) => {
|
|
30799
30799
|
set({ deposit: data });
|
|
30800
30800
|
},
|
|
30801
|
-
|
|
30802
|
-
set({
|
|
30801
|
+
setPaymentMethod: (method) => {
|
|
30802
|
+
set({ selectedPaymentMethod: method });
|
|
30803
30803
|
},
|
|
30804
30804
|
}));
|
|
30805
30805
|
|
|
30806
30806
|
function useDepositAddress(squidRoute) {
|
|
30807
|
-
const {
|
|
30808
|
-
|
|
30807
|
+
const { selectedPaymentMethod, depositAddress } = useDepositAddressStore((state) => ({
|
|
30808
|
+
selectedPaymentMethod: state.selectedPaymentMethod,
|
|
30809
30809
|
depositAddress: state.deposit?.depositAddress,
|
|
30810
30810
|
}));
|
|
30811
|
-
const { setDeposit,
|
|
30811
|
+
const { setDeposit, setPaymentMethod, deposit } = useDepositAddressStore();
|
|
30812
30812
|
const { squid } = useSquidStore();
|
|
30813
30813
|
const { fromChain } = useSwap();
|
|
30814
30814
|
const isAvailableAsPaymentMethod = useMemo(() => {
|
|
@@ -30825,12 +30825,14 @@ function useDepositAddress(squidRoute) {
|
|
|
30825
30825
|
return (squidRoute?.transactionRequest?.type ===
|
|
30826
30826
|
SquidDataType.ChainflipDepositAddress);
|
|
30827
30827
|
}, [squidRoute?.transactionRequest?.type]);
|
|
30828
|
-
|
|
30829
|
-
|
|
30830
|
-
|
|
30831
|
-
|
|
30832
|
-
|
|
30833
|
-
|
|
30828
|
+
// Effective payment method: the user's intent clamped by what the current
|
|
30829
|
+
// source chain can actually do. Reading this (instead of raw intent) is what
|
|
30830
|
+
// keeps every consumer in sync — if the source chain can't use a deposit
|
|
30831
|
+
// address, the effective method is "connectedWallet" immediately at read time.
|
|
30832
|
+
const paymentMethod = isAvailableAsPaymentMethod
|
|
30833
|
+
? selectedPaymentMethod
|
|
30834
|
+
: "connectedWallet";
|
|
30835
|
+
const isDepositAddressActive = paymentMethod === "depositAddress";
|
|
30834
30836
|
const closeDepositChannel = useCallback(() => {
|
|
30835
30837
|
setDeposit(null);
|
|
30836
30838
|
}, [setDeposit]);
|
|
@@ -30862,11 +30864,11 @@ function useDepositAddress(squidRoute) {
|
|
|
30862
30864
|
}
|
|
30863
30865
|
});
|
|
30864
30866
|
return {
|
|
30865
|
-
|
|
30867
|
+
paymentMethod,
|
|
30868
|
+
isDepositAddressActive,
|
|
30866
30869
|
isAvailableAsPaymentMethod,
|
|
30867
30870
|
swapWillGenerateDepositAddress,
|
|
30868
|
-
|
|
30869
|
-
disable,
|
|
30871
|
+
setPaymentMethod,
|
|
30870
30872
|
getRouteWithDeposit,
|
|
30871
30873
|
depositAddress,
|
|
30872
30874
|
closeDepositChannel,
|
|
@@ -33041,6 +33043,7 @@ const sourceReceivedStatuses = [
|
|
|
33041
33043
|
"COMPLETE",
|
|
33042
33044
|
// Canton (Squid Intents)
|
|
33043
33045
|
"awaiting",
|
|
33046
|
+
"success",
|
|
33044
33047
|
];
|
|
33045
33048
|
/**
|
|
33046
33049
|
* Tracks a generated deposit address before it becomes a persisted swap history item.
|
|
@@ -36955,7 +36958,7 @@ refetchIntervalInBackground = false, refetchInterval = 30000, quoteOnly = true,
|
|
|
36955
36958
|
const squid = useSquidStore((state) => state.squid);
|
|
36956
36959
|
const fallbackAddress = useSwapRoutePersistStore((store) => store.swapRoute?.fallbackAddress);
|
|
36957
36960
|
const depositRefundAddress = useSwapRoutePersistStore((store) => store.swapRoute?.depositRefundAddress);
|
|
36958
|
-
const {
|
|
36961
|
+
const { isDepositAddressActive } = useDepositAddress();
|
|
36959
36962
|
const getRouteMutation = useGetRoute();
|
|
36960
36963
|
const { fromChain, toChain, fromPrice, destinationAddress: { address: destinationAddress } = {}, fromToken, toToken, } = useSwap();
|
|
36961
36964
|
const { connectedAddress: { address: sourceConnectedAddress }, } = useMultiChainWallet(fromChain);
|
|
@@ -36963,7 +36966,7 @@ refetchIntervalInBackground = false, refetchInterval = 30000, quoteOnly = true,
|
|
|
36963
36966
|
// Tokens will be sent to this address in case of swap failure
|
|
36964
36967
|
//
|
|
36965
36968
|
// If deposit address is not selected, we use the connected address as the source address instead
|
|
36966
|
-
const sourceUserAddress =
|
|
36969
|
+
const sourceUserAddress = isDepositAddressActive
|
|
36967
36970
|
? depositRefundAddress ?? sourceConnectedAddress
|
|
36968
36971
|
: sourceConnectedAddress;
|
|
36969
36972
|
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), [
|
|
@@ -37629,4 +37632,4 @@ const SquidProvider = ({ children, config, placeholder, }) => {
|
|
|
37629
37632
|
};
|
|
37630
37633
|
|
|
37631
37634
|
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, useRecommendedQuote 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, 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_, 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, useDepositTransactionStatus 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, getTransactionStatus 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, isActionCompletedOnSourceTx as cN, sleep as cO, isChainflipDepositRoute as cP, isChainflipBridgeTransaction as cQ, isOnChainTxData as cR, isDepositAddressDirectTransferRoute as cS, getHistoryTransactionId as cT, getStepStatuses as cU, getHalfSuccessState as cV, getStepsInfos as cW, getSwapTxStatusRefetchInterval as cX, getSendTxStatusRefetchInterval as cY, chainflipMultihopBridgeType as cZ, getBridgeType 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, getTransactionEndStatus as d0, isHistoryTransactionPending as d1, isHistoryTransactionFailed as d2, isHistoryTransactionWarning as d3, isHistoryTransactionEnded as d4, formatHash as d5, isWalletAddressValid as d6, redirectToExtensionsStore as d7, accessProperty as d8, populateWallets as d9, getDefaultChain as da, sortWallets as db, areSameAddress as dc, sortAddressBook as dd, calculateTotalUsdBalanceUSD as de, addTokenToWallet as df, isEvmChainNotSupportedError as dg, getWalletSupportedChainTypes as dh, getConnectorForChainType as di, walletSupportsChainType as dj, connectWallet as dk, cancelConnectWallet as dl, isProblematicConnector as dm, mergeWallets as dn, isXionSmartContractAddress as dp, isXrplAddressValid as dq, buildXrplTrustSetTx as dr, getXrplNetwork as ds, parseXrplPaymentTx as dt, parseXrplTokenAddress as du, 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 };
|
|
37632
|
-
//# sourceMappingURL=index-
|
|
37635
|
+
//# sourceMappingURL=index-DSDEoKAQ.js.map
|