@0xsquid/react-hooks 8.7.2 → 8.8.1-beta-canton.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/client/index.d.ts +1 -0
- package/dist/core/constants.d.ts +2 -0
- package/dist/core/types/canton.d.ts +2 -0
- package/dist/core/types/cosmos.d.ts +5 -0
- package/dist/core/types/wallet.d.ts +9 -6
- package/dist/hooks/chains/useSquidChains.d.ts +1 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/store/useDepositAddressStore.d.ts +15 -3
- package/dist/hooks/swap/useDepositAddress.d.ts +2 -4
- package/dist/hooks/tokens/useSquidTokens.d.ts +1 -0
- package/dist/hooks/transaction/useDepositTransactionStatus.d.ts +25 -0
- package/dist/hooks/transaction/useSwapStatusQuery.d.ts +26 -0
- package/dist/hooks/wallet/useMultiChainWallet.d.ts +41 -15
- package/dist/hooks/wallet/useWallet.d.ts +45 -15
- package/dist/{index-DaYYG81O.js → index-CtTVUC-R.js} +331 -169
- package/dist/index-CtTVUC-R.js.map +1 -0
- package/dist/{index-D3bbd13Z.js → index-D1udDcRZ.js} +334 -169
- package/dist/index-D1udDcRZ.js.map +1 -0
- package/dist/{index.es-Bn83pLT9.js → index.es-DFjaMQJG.js} +2 -2
- package/dist/{index.es-Bn83pLT9.js.map → index.es-DFjaMQJG.js.map} +1 -1
- package/dist/{index.es-Ds1lt_e4.js → index.es-Q71H7cJa.js} +2 -2
- package/dist/{index.es-Ds1lt_e4.js.map → index.es-Q71H7cJa.js.map} +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +5 -2
- package/dist/index.js.map +1 -1
- package/dist/{secretService-CM6noWhX.js → secretService-BJNdJc-J.js} +2 -2
- package/dist/{secretService-CM6noWhX.js.map → secretService-BJNdJc-J.js.map} +1 -1
- package/dist/{secretService-CKReaNYo.js → secretService-Dg5_VwtW.js} +2 -2
- package/dist/{secretService-CKReaNYo.js.map → secretService-Dg5_VwtW.js.map} +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/server.esm.js +8 -1
- package/dist/server.esm.js.map +1 -1
- package/dist/server.js +8 -0
- package/dist/server.js.map +1 -1
- package/dist/services/internal/assetsService.d.ts +1 -1
- package/dist/services/internal/cantonService.d.ts +2 -0
- package/dist/services/internal/estimateService.d.ts +18 -8
- package/dist/services/internal/transactionService.d.ts +12 -2
- package/dist/{stellarService.client-Ko2roGXL.js → stellarService.client-B9xCCNV0.js} +2 -2
- package/dist/{stellarService.client-Ko2roGXL.js.map → stellarService.client-B9xCCNV0.js.map} +1 -1
- package/dist/{stellarService.client-0dfuo3PJ.js → stellarService.client-BFUfF3-j.js} +2 -2
- package/dist/{stellarService.client-0dfuo3PJ.js.map → stellarService.client-BFUfF3-j.js.map} +1 -1
- package/package.json +2 -2
- package/dist/index-D3bbd13Z.js.map +0 -1
- package/dist/index-DaYYG81O.js.map +0 -1
|
@@ -57,6 +57,8 @@ const solanaZeroAddress = "11111111111111111111111111111111";
|
|
|
57
57
|
const suiZeroAddress = "0x0000000000000000000000000000000000000000";
|
|
58
58
|
const xrplZeroAddress = "rrrrrrrrrrrrrrrrrrrrrhoLvTp";
|
|
59
59
|
const stellarZeroAddress = "GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWHF";
|
|
60
|
+
// TODO: check
|
|
61
|
+
const cantonZeroAddress = "none::12200000000000000000000000000000000000000000000000000000000000000000";
|
|
60
62
|
const chainTypeToZeroAddressMap = {
|
|
61
63
|
[ChainType.EVM]: zeroAddress$1,
|
|
62
64
|
[ChainType.COSMOS]: cosmosZeroAddress,
|
|
@@ -65,6 +67,7 @@ const chainTypeToZeroAddressMap = {
|
|
|
65
67
|
[ChainType.SUI]: suiZeroAddress,
|
|
66
68
|
[ChainType.XRPL]: xrplZeroAddress,
|
|
67
69
|
[ChainType.STELLAR]: stellarZeroAddress,
|
|
70
|
+
[ChainType.CANTON]: cantonZeroAddress,
|
|
68
71
|
};
|
|
69
72
|
const nativeEvmTokenAddress = "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee";
|
|
70
73
|
const nativeCosmosTokenAddress = "uosmo";
|
|
@@ -73,6 +76,7 @@ const nativeBitcoinTokenAddress = "satoshi";
|
|
|
73
76
|
const nativeSuiTokenAddress = "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI";
|
|
74
77
|
const nativeXrplTokenAddress = "xrp";
|
|
75
78
|
const nativeStellarTokenAddress = "CAS3J7GYLGXMF6TDJBBYYSE3HQ6BBSMLNUQ34T6TZMYMW2EVH34XOWMA";
|
|
79
|
+
const nativeCantonTokenAddress = "DSO::1220b1431ef217342db44d516bb9befde802be7d8899637d290895fa58880f19accc";
|
|
76
80
|
// by setting slippage to undefined, it's set to "auto"
|
|
77
81
|
const defaultSlippage = undefined;
|
|
78
82
|
const destinationAddressResetValue = "null";
|
|
@@ -136,6 +140,7 @@ const CHAIN_IDS = {
|
|
|
136
140
|
XRPL_TESTNET: "xrpl-testnet",
|
|
137
141
|
STELLAR: "stellar-mainnet",
|
|
138
142
|
STELLAR_TESTNET: "stellar-testnet",
|
|
143
|
+
CANTON: "canton",
|
|
139
144
|
};
|
|
140
145
|
const chainTypeToDefaultChainIdMap = {
|
|
141
146
|
[ChainType.EVM]: CHAIN_IDS.ETHEREUM,
|
|
@@ -145,6 +150,7 @@ const chainTypeToDefaultChainIdMap = {
|
|
|
145
150
|
[ChainType.SUI]: CHAIN_IDS.SUI,
|
|
146
151
|
[ChainType.XRPL]: CHAIN_IDS.XRPL,
|
|
147
152
|
[ChainType.STELLAR]: CHAIN_IDS.STELLAR,
|
|
153
|
+
[ChainType.CANTON]: CHAIN_IDS.CANTON,
|
|
148
154
|
};
|
|
149
155
|
const chainTypeToNativeTokenAddressMap = {
|
|
150
156
|
[ChainType.EVM]: nativeEvmTokenAddress,
|
|
@@ -154,6 +160,7 @@ const chainTypeToNativeTokenAddressMap = {
|
|
|
154
160
|
[ChainType.SUI]: nativeSuiTokenAddress,
|
|
155
161
|
[ChainType.XRPL]: nativeXrplTokenAddress,
|
|
156
162
|
[ChainType.STELLAR]: nativeStellarTokenAddress,
|
|
163
|
+
[ChainType.CANTON]: nativeCantonTokenAddress,
|
|
157
164
|
};
|
|
158
165
|
const defaultConfigValues = {
|
|
159
166
|
integratorId: INTEGRATOR_ID,
|
|
@@ -20851,6 +20858,18 @@ const isBitcoinAddressValid = (address$1) => {
|
|
|
20851
20858
|
}
|
|
20852
20859
|
};
|
|
20853
20860
|
|
|
20861
|
+
// Canton PartyID = address
|
|
20862
|
+
const CANTON_PARTY_ID_SEPARATOR = "::";
|
|
20863
|
+
function isCantonAddressValid(address) {
|
|
20864
|
+
// Canton address format: `name::fingerprint`, where name is an arbitrary string
|
|
20865
|
+
// and fingerprint is a 64-character hex string with a 1220 prefix (SHA-256 hash of the public key)
|
|
20866
|
+
const parts = address.split(CANTON_PARTY_ID_SEPARATOR);
|
|
20867
|
+
if (parts.length !== 2)
|
|
20868
|
+
return false;
|
|
20869
|
+
const [name, fingerprint] = parts;
|
|
20870
|
+
return name.length > 0 && /^1220[0-9a-f]{64}$/.test(fingerprint);
|
|
20871
|
+
}
|
|
20872
|
+
|
|
20854
20873
|
var HistoryTxType;
|
|
20855
20874
|
(function (HistoryTxType) {
|
|
20856
20875
|
HistoryTxType[HistoryTxType["SWAP"] = 0] = "SWAP";
|
|
@@ -21107,13 +21126,23 @@ const compareTransactionIds = (idA, idB) => {
|
|
|
21107
21126
|
*/
|
|
21108
21127
|
function isCoralBridgeAction(action) {
|
|
21109
21128
|
return (action.type === ActionType.RFQ &&
|
|
21110
|
-
// TODO: update types
|
|
21111
|
-
action.provider
|
|
21129
|
+
// TODO: update types to use enum
|
|
21130
|
+
action.provider === "Squid Intents");
|
|
21131
|
+
}
|
|
21132
|
+
/**
|
|
21133
|
+
* Determines if a given action completes as part of the user's source transaction.
|
|
21134
|
+
* Action types like RFQ are fulfilled by a solver in a separate transaction,
|
|
21135
|
+
* so they are NOT completed on source even if they share the same chain.
|
|
21136
|
+
*/
|
|
21137
|
+
function isActionCompletedOnSourceTx(action, fromChainId) {
|
|
21138
|
+
if (action.type === ActionType.RFQ)
|
|
21139
|
+
return false;
|
|
21140
|
+
return action.fromChain === fromChainId && action.toChain === fromChainId;
|
|
21112
21141
|
}
|
|
21113
21142
|
function sleep(ms) {
|
|
21114
21143
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
21115
21144
|
}
|
|
21116
|
-
const
|
|
21145
|
+
const isChainflipDepositRoute = (route) => {
|
|
21117
21146
|
return (!!route &&
|
|
21118
21147
|
route.transactionRequest?.type === SquidDataType.ChainflipDepositAddress);
|
|
21119
21148
|
};
|
|
@@ -21138,6 +21167,12 @@ function isOnChainTxData(squidData) {
|
|
|
21138
21167
|
SquidDataType.DepositAddressWithMemo,
|
|
21139
21168
|
].includes(squidData.type);
|
|
21140
21169
|
}
|
|
21170
|
+
/**
|
|
21171
|
+
* Checks if a route is of type DepositAddressDirectTransfer
|
|
21172
|
+
*/
|
|
21173
|
+
function isDepositAddressDirectTransferRoute(squidData) {
|
|
21174
|
+
return (squidData.type === SquidDataType.DepositAddressDirectTransfer);
|
|
21175
|
+
}
|
|
21141
21176
|
function getHistoryTransactionId(tx) {
|
|
21142
21177
|
switch (tx.txType) {
|
|
21143
21178
|
case HistoryTxType.SWAP:
|
|
@@ -21640,7 +21675,17 @@ const chainTypeToTrimLength = {
|
|
|
21640
21675
|
start: 4,
|
|
21641
21676
|
end: 4,
|
|
21642
21677
|
},
|
|
21678
|
+
// abc...123::abc...123
|
|
21679
|
+
[ChainType.CANTON]: {
|
|
21680
|
+
start: 3,
|
|
21681
|
+
end: 3,
|
|
21682
|
+
},
|
|
21643
21683
|
};
|
|
21684
|
+
const truncateWithEllipsis = (value, startLength, endLength) => value.length <= startLength + endLength
|
|
21685
|
+
? value
|
|
21686
|
+
: value.slice(0, startLength) +
|
|
21687
|
+
"..." +
|
|
21688
|
+
value.slice(value.length - endLength);
|
|
21644
21689
|
const formatHash = ({ chainType, hash }) => {
|
|
21645
21690
|
if (!hash)
|
|
21646
21691
|
return "";
|
|
@@ -21653,14 +21698,15 @@ const formatHash = ({ chainType, hash }) => {
|
|
|
21653
21698
|
chainTypeFormat = ChainType.COSMOS;
|
|
21654
21699
|
}
|
|
21655
21700
|
}
|
|
21656
|
-
const
|
|
21657
|
-
|
|
21658
|
-
|
|
21659
|
-
|
|
21660
|
-
return
|
|
21661
|
-
|
|
21662
|
-
|
|
21663
|
-
|
|
21701
|
+
const { start, end } = chainTypeToTrimLength[chainTypeFormat];
|
|
21702
|
+
if (chainTypeFormat === ChainType.CANTON &&
|
|
21703
|
+
hash.includes(CANTON_PARTY_ID_SEPARATOR)) {
|
|
21704
|
+
const [namespace, identifier] = hash.split(CANTON_PARTY_ID_SEPARATOR);
|
|
21705
|
+
return (truncateWithEllipsis(namespace, start, end) +
|
|
21706
|
+
CANTON_PARTY_ID_SEPARATOR +
|
|
21707
|
+
truncateWithEllipsis(identifier, start, end));
|
|
21708
|
+
}
|
|
21709
|
+
return truncateWithEllipsis(hash, start, end);
|
|
21664
21710
|
};
|
|
21665
21711
|
const isWalletAddressValid = (chainData, address) => {
|
|
21666
21712
|
if (!address || !chainData?.chainType)
|
|
@@ -21680,6 +21726,8 @@ const isWalletAddressValid = (chainData, address) => {
|
|
|
21680
21726
|
return isXrplAddressValid(address);
|
|
21681
21727
|
case ChainType.STELLAR:
|
|
21682
21728
|
return isStellarAddressValid(address);
|
|
21729
|
+
case ChainType.CANTON:
|
|
21730
|
+
return isCantonAddressValid(address);
|
|
21683
21731
|
}
|
|
21684
21732
|
};
|
|
21685
21733
|
const redirectToExtensionsStore = (wallet) => {
|
|
@@ -21941,6 +21989,8 @@ const connectByChainType = async (chainType, wallet, defaultChain, params) => {
|
|
|
21941
21989
|
connector,
|
|
21942
21990
|
},
|
|
21943
21991
|
});
|
|
21992
|
+
case ChainType.CANTON:
|
|
21993
|
+
return null;
|
|
21944
21994
|
}
|
|
21945
21995
|
};
|
|
21946
21996
|
const getChainTypesToConnect = (selectedChainTypes, defaultChain, supportedChains) => {
|
|
@@ -23015,7 +23065,10 @@ const getNewSwapParamsFromInput = ({ inputParams, initialSwapRoute, tokens, chai
|
|
|
23015
23065
|
else {
|
|
23016
23066
|
newFallbackAddress = fallbackAddress ?? initialSwapRoute?.fallbackAddress;
|
|
23017
23067
|
}
|
|
23018
|
-
const
|
|
23068
|
+
const sourceChainChanged = fromChainId !== undefined && fromChainId !== initialSwapRoute?.fromChainId;
|
|
23069
|
+
const newDepositRefundAddress = sourceChainChanged
|
|
23070
|
+
? undefined
|
|
23071
|
+
: depositRefundAddress || initialSwapRoute?.depositRefundAddress;
|
|
23019
23072
|
return {
|
|
23020
23073
|
fromChainId: srcChainId,
|
|
23021
23074
|
fromTokenAddress: sourceTokenAddress,
|
|
@@ -23294,7 +23347,7 @@ const filterViewableTokens = (tokens, config, direction) => {
|
|
|
23294
23347
|
};
|
|
23295
23348
|
const getSecretNetworkBalances = async (chainData, cosmosAddress, squidTokens, keplrTypeWallet) => {
|
|
23296
23349
|
const squidSecretTokens = squidTokens.filter((t) => t.chainId === CHAIN_IDS.SECRET);
|
|
23297
|
-
const { fetchAllSecretBalances } = await import('./secretService-
|
|
23350
|
+
const { fetchAllSecretBalances } = await import('./secretService-BJNdJc-J.js');
|
|
23298
23351
|
return fetchAllSecretBalances(chainData, cosmosAddress, squidSecretTokens, keplrTypeWallet);
|
|
23299
23352
|
};
|
|
23300
23353
|
function getTokenAssetsKey(token) {
|
|
@@ -25268,7 +25321,7 @@ const useSquidTokens = (direction) => {
|
|
|
25268
25321
|
config.availableChains,
|
|
25269
25322
|
direction,
|
|
25270
25323
|
]);
|
|
25271
|
-
const { evmTokens, cosmosTokens, solanaTokens, bitcoinTokens, suiTokens, xrplTokens, stellarTokens, } = useMemo(() => {
|
|
25324
|
+
const { evmTokens, cosmosTokens, solanaTokens, bitcoinTokens, suiTokens, xrplTokens, stellarTokens, cantonTokens, } = useMemo(() => {
|
|
25272
25325
|
return tokens?.reduce((acc, token) => {
|
|
25273
25326
|
switch (token.type) {
|
|
25274
25327
|
case ChainType.EVM:
|
|
@@ -25292,6 +25345,9 @@ const useSquidTokens = (direction) => {
|
|
|
25292
25345
|
case ChainType.STELLAR:
|
|
25293
25346
|
acc.stellarTokens.push(token);
|
|
25294
25347
|
break;
|
|
25348
|
+
case ChainType.CANTON:
|
|
25349
|
+
acc.cantonTokens.push(token);
|
|
25350
|
+
break;
|
|
25295
25351
|
}
|
|
25296
25352
|
return acc;
|
|
25297
25353
|
}, {
|
|
@@ -25302,6 +25358,7 @@ const useSquidTokens = (direction) => {
|
|
|
25302
25358
|
suiTokens: [],
|
|
25303
25359
|
xrplTokens: [],
|
|
25304
25360
|
stellarTokens: [],
|
|
25361
|
+
cantonTokens: [],
|
|
25305
25362
|
});
|
|
25306
25363
|
}, [tokens]);
|
|
25307
25364
|
const findToken = useCallback((address, chainId) => {
|
|
@@ -25319,6 +25376,7 @@ const useSquidTokens = (direction) => {
|
|
|
25319
25376
|
suiTokens,
|
|
25320
25377
|
xrplTokens,
|
|
25321
25378
|
stellarTokens,
|
|
25379
|
+
cantonTokens,
|
|
25322
25380
|
};
|
|
25323
25381
|
};
|
|
25324
25382
|
|
|
@@ -25856,6 +25914,7 @@ const chainTypeToRefetchInterval = {
|
|
|
25856
25914
|
[ChainType.SUI]: 1_000,
|
|
25857
25915
|
[ChainType.XRPL]: 1_000,
|
|
25858
25916
|
[ChainType.STELLAR]: 1_000,
|
|
25917
|
+
[ChainType.CANTON]: 1_000,
|
|
25859
25918
|
};
|
|
25860
25919
|
/**
|
|
25861
25920
|
* Returns the status refetch interval of a Send transaction
|
|
@@ -26122,7 +26181,7 @@ const useSquidChains = (direction) => {
|
|
|
26122
26181
|
const chain = findChain(chainId);
|
|
26123
26182
|
return chain?.chainType;
|
|
26124
26183
|
}, [findChain]);
|
|
26125
|
-
const { evmChains, cosmosChains, suiChains, stellarChains, xrplChains } = useMemo(() => {
|
|
26184
|
+
const { evmChains, cosmosChains, suiChains, stellarChains, xrplChains, cantonChains, } = useMemo(() => {
|
|
26126
26185
|
return chains.reduce((acc, chain) => {
|
|
26127
26186
|
switch (chain.chainType) {
|
|
26128
26187
|
case ChainType.EVM:
|
|
@@ -26140,6 +26199,9 @@ const useSquidChains = (direction) => {
|
|
|
26140
26199
|
case ChainType.STELLAR:
|
|
26141
26200
|
acc.stellarChains.push(chain);
|
|
26142
26201
|
break;
|
|
26202
|
+
case ChainType.CANTON:
|
|
26203
|
+
acc.cantonChains.push(chain);
|
|
26204
|
+
break;
|
|
26143
26205
|
}
|
|
26144
26206
|
return acc;
|
|
26145
26207
|
}, {
|
|
@@ -26148,6 +26210,7 @@ const useSquidChains = (direction) => {
|
|
|
26148
26210
|
suiChains: [],
|
|
26149
26211
|
xrplChains: [],
|
|
26150
26212
|
stellarChains: [],
|
|
26213
|
+
cantonChains: [],
|
|
26151
26214
|
});
|
|
26152
26215
|
}, [chains]);
|
|
26153
26216
|
const { supportedSourceChains, supportedDestinationChains } = useMemo(() => {
|
|
@@ -26168,6 +26231,7 @@ const useSquidChains = (direction) => {
|
|
|
26168
26231
|
suiChains,
|
|
26169
26232
|
xrplChains,
|
|
26170
26233
|
stellarChains,
|
|
26234
|
+
cantonChains,
|
|
26171
26235
|
getChainType,
|
|
26172
26236
|
findChain,
|
|
26173
26237
|
};
|
|
@@ -26692,7 +26756,7 @@ function useStellarWallets() {
|
|
|
26692
26756
|
try {
|
|
26693
26757
|
const { allowAllModules: initializeAllModules } = await import('@creit.tech/stellar-wallets-kit');
|
|
26694
26758
|
const { LedgerModule } = await import('@creit.tech/stellar-wallets-kit/modules/ledger.module.mjs');
|
|
26695
|
-
const { formatStellarWallet } = await import('./stellarService.client-
|
|
26759
|
+
const { formatStellarWallet } = await import('./stellarService.client-B9xCCNV0.js');
|
|
26696
26760
|
const modules = [...initializeAllModules(), new LedgerModule()];
|
|
26697
26761
|
const promises = modules.map(async (module) => {
|
|
26698
26762
|
const isAvailable = await module.isAvailable();
|
|
@@ -27391,6 +27455,7 @@ const useMultiChainWallet = (chain) => {
|
|
|
27391
27455
|
const suiAddress = connectedAddresses[ChainType.SUI];
|
|
27392
27456
|
const xrplAddress = connectedAddresses[ChainType.XRPL];
|
|
27393
27457
|
const stellarAddress = connectedAddresses[ChainType.STELLAR];
|
|
27458
|
+
const cantonAddress = connectedAddresses[ChainType.CANTON];
|
|
27394
27459
|
// Cosmos is a special case because the address changes on every chain
|
|
27395
27460
|
// so we can't use the default cosmos connected address
|
|
27396
27461
|
const { data: cosmosAddress } = useCosmosForChain(chain);
|
|
@@ -27478,6 +27543,16 @@ const useMultiChainWallet = (chain) => {
|
|
|
27478
27543
|
chainType: chain.chainType,
|
|
27479
27544
|
}),
|
|
27480
27545
|
};
|
|
27546
|
+
case ChainType.CANTON:
|
|
27547
|
+
if (!cantonAddress)
|
|
27548
|
+
return {};
|
|
27549
|
+
return {
|
|
27550
|
+
address: cantonAddress,
|
|
27551
|
+
formatted: formatHash({
|
|
27552
|
+
hash: cantonAddress,
|
|
27553
|
+
chainType: chain.chainType,
|
|
27554
|
+
}),
|
|
27555
|
+
};
|
|
27481
27556
|
}
|
|
27482
27557
|
}, [
|
|
27483
27558
|
chain?.chainType,
|
|
@@ -27489,6 +27564,7 @@ const useMultiChainWallet = (chain) => {
|
|
|
27489
27564
|
suiAddress,
|
|
27490
27565
|
xrplAddress,
|
|
27491
27566
|
stellarAddress,
|
|
27567
|
+
cantonAddress,
|
|
27492
27568
|
]);
|
|
27493
27569
|
/**
|
|
27494
27570
|
* Change current network for desired chain
|
|
@@ -28313,6 +28389,8 @@ async function createClient(chain) {
|
|
|
28313
28389
|
return new XrplRpcClient(chain.rpc);
|
|
28314
28390
|
case ChainType.STELLAR:
|
|
28315
28391
|
return new StellarRpcClient(chain.rpc);
|
|
28392
|
+
case ChainType.CANTON:
|
|
28393
|
+
return null;
|
|
28316
28394
|
}
|
|
28317
28395
|
}
|
|
28318
28396
|
|
|
@@ -29505,7 +29583,7 @@ const useStellarBalance = ({ userAddress, chain, enabled, token, refreshInterval
|
|
|
29505
29583
|
};
|
|
29506
29584
|
|
|
29507
29585
|
function useNativeTokenForChain(chain) {
|
|
29508
|
-
const { evmTokens, cosmosTokens, solanaTokens, bitcoinTokens, suiTokens, xrplTokens, stellarTokens, } = useSquidTokens();
|
|
29586
|
+
const { evmTokens, cosmosTokens, solanaTokens, bitcoinTokens, suiTokens, xrplTokens, stellarTokens, cantonTokens, } = useSquidTokens();
|
|
29509
29587
|
const getTokensForChainType = () => {
|
|
29510
29588
|
if (!chain?.chainType)
|
|
29511
29589
|
return [];
|
|
@@ -29524,6 +29602,8 @@ function useNativeTokenForChain(chain) {
|
|
|
29524
29602
|
return xrplTokens;
|
|
29525
29603
|
case ChainType.STELLAR:
|
|
29526
29604
|
return stellarTokens;
|
|
29605
|
+
case ChainType.CANTON:
|
|
29606
|
+
return cantonTokens;
|
|
29527
29607
|
}
|
|
29528
29608
|
};
|
|
29529
29609
|
const nativeTokenForChainType = useMemo(() => {
|
|
@@ -29548,14 +29628,20 @@ const useEvmNativeBalance = ({ address, chain, }) => {
|
|
|
29548
29628
|
},
|
|
29549
29629
|
});
|
|
29550
29630
|
const balance = useMemo(() => {
|
|
29551
|
-
if (nativeEvmBalance?.decimals && nativeEvmBalance?.value) {
|
|
29631
|
+
if (nativeEvmBalance?.decimals != null && nativeEvmBalance?.value != null) {
|
|
29632
|
+
if (chain?.chainId === CHAIN_IDS.HEDERA) {
|
|
29633
|
+
return {
|
|
29634
|
+
decimals: 8,
|
|
29635
|
+
value: scaleWeiToHbar(nativeEvmBalance.value),
|
|
29636
|
+
};
|
|
29637
|
+
}
|
|
29552
29638
|
return {
|
|
29553
29639
|
decimals: nativeEvmBalance.decimals,
|
|
29554
29640
|
value: nativeEvmBalance.value,
|
|
29555
29641
|
};
|
|
29556
29642
|
}
|
|
29557
29643
|
return;
|
|
29558
|
-
}, [nativeEvmBalance?.decimals, nativeEvmBalance?.value]);
|
|
29644
|
+
}, [nativeEvmBalance?.decimals, nativeEvmBalance?.value, chain?.chainId]);
|
|
29559
29645
|
return {
|
|
29560
29646
|
balance,
|
|
29561
29647
|
isLoading,
|
|
@@ -29752,6 +29838,11 @@ const useNativeBalance = (chain) => {
|
|
|
29752
29838
|
break;
|
|
29753
29839
|
case ChainType.STELLAR:
|
|
29754
29840
|
balance = nativeStellarBalance;
|
|
29841
|
+
break;
|
|
29842
|
+
case ChainType.CANTON:
|
|
29843
|
+
// TODO: implement canton balance fetching
|
|
29844
|
+
balance = undefined;
|
|
29845
|
+
break;
|
|
29755
29846
|
}
|
|
29756
29847
|
const balanceFormatted = !!balance
|
|
29757
29848
|
? formatBNToReadable(balance.value, balance.decimals)
|
|
@@ -29788,6 +29879,9 @@ const useNativeBalance = (chain) => {
|
|
|
29788
29879
|
return isXrpLoading;
|
|
29789
29880
|
case ChainType.STELLAR:
|
|
29790
29881
|
return isStellarLoading;
|
|
29882
|
+
case ChainType.CANTON:
|
|
29883
|
+
// TODO: implement canton balance fetching
|
|
29884
|
+
return false;
|
|
29791
29885
|
}
|
|
29792
29886
|
}, [
|
|
29793
29887
|
chain?.chainType,
|
|
@@ -30012,7 +30106,7 @@ function hederaWalletConnect(parameters) {
|
|
|
30012
30106
|
const optionalChains = config.chains.map((x) => x.id);
|
|
30013
30107
|
if (!optionalChains.length)
|
|
30014
30108
|
return;
|
|
30015
|
-
const { EthereumProvider } = await import('./index.es-
|
|
30109
|
+
const { EthereumProvider } = await import('./index.es-DFjaMQJG.js');
|
|
30016
30110
|
const rawProvider = await EthereumProvider.init({
|
|
30017
30111
|
...restParameters,
|
|
30018
30112
|
disableProviderPing: true,
|
|
@@ -30242,6 +30336,8 @@ const useSigner = ({ chain }) => {
|
|
|
30242
30336
|
return isXrplSignerReady;
|
|
30243
30337
|
case ChainType.STELLAR:
|
|
30244
30338
|
return isStellarSignerReady;
|
|
30339
|
+
case ChainType.CANTON:
|
|
30340
|
+
return false;
|
|
30245
30341
|
}
|
|
30246
30342
|
}, [
|
|
30247
30343
|
chain?.chainType,
|
|
@@ -30714,6 +30810,7 @@ function useDepositAddress(squidRoute) {
|
|
|
30714
30810
|
const chainsSupportingDepositAddress = [
|
|
30715
30811
|
CHAIN_IDS.BITCOIN,
|
|
30716
30812
|
CHAIN_IDS.SOLANA,
|
|
30813
|
+
CHAIN_IDS.CANTON,
|
|
30717
30814
|
];
|
|
30718
30815
|
return chainsSupportingDepositAddress.includes(fromChain.chainId);
|
|
30719
30816
|
}, [fromChain?.chainId]);
|
|
@@ -30728,20 +30825,33 @@ function useDepositAddress(squidRoute) {
|
|
|
30728
30825
|
toggleDepositFlow(false);
|
|
30729
30826
|
}, [toggleDepositFlow]);
|
|
30730
30827
|
const closeDepositChannel = useCallback(() => {
|
|
30731
|
-
toggleDepositFlow(false);
|
|
30732
30828
|
setDeposit(null);
|
|
30733
|
-
}, [
|
|
30829
|
+
}, [setDeposit]);
|
|
30734
30830
|
const getRouteWithDeposit = useMutation(async ({ route }) => {
|
|
30735
|
-
if (!squid)
|
|
30736
|
-
throw new Error("
|
|
30737
|
-
|
|
30738
|
-
|
|
30739
|
-
|
|
30740
|
-
|
|
30741
|
-
|
|
30742
|
-
|
|
30743
|
-
|
|
30744
|
-
|
|
30831
|
+
if (!squid || !route.transactionRequest)
|
|
30832
|
+
throw new Error("Missing required params");
|
|
30833
|
+
if (isChainflipDepositRoute(route)) {
|
|
30834
|
+
const depositAddressResponse = (await squid.executeRoute({
|
|
30835
|
+
signer: {},
|
|
30836
|
+
route,
|
|
30837
|
+
}));
|
|
30838
|
+
setDeposit({
|
|
30839
|
+
amount: depositAddressResponse.amount,
|
|
30840
|
+
depositAddress: depositAddressResponse.depositAddress,
|
|
30841
|
+
statusTrackingId: depositAddressResponse.chainflipStatusTrackingId,
|
|
30842
|
+
});
|
|
30843
|
+
return;
|
|
30844
|
+
}
|
|
30845
|
+
else if (isDepositAddressDirectTransferRoute(route.transactionRequest)) {
|
|
30846
|
+
const orderHash = route.transactionRequest.data;
|
|
30847
|
+
setDeposit({
|
|
30848
|
+
amount: route.params.fromAmount ?? "",
|
|
30849
|
+
depositAddress: route.transactionRequest.target,
|
|
30850
|
+
statusTrackingId: orderHash,
|
|
30851
|
+
memo: orderHash,
|
|
30852
|
+
});
|
|
30853
|
+
return;
|
|
30854
|
+
}
|
|
30745
30855
|
});
|
|
30746
30856
|
return {
|
|
30747
30857
|
isEnabled,
|
|
@@ -30780,7 +30890,7 @@ const useUrlSwapParams = () => {
|
|
|
30780
30890
|
|
|
30781
30891
|
const useAllTokensWithBalanceForChainType = ({ chainType, address, direction, queryOptions, }) => {
|
|
30782
30892
|
const { evmChains, cosmosChains, suiChains, xrplChains, stellarChains } = useSquidChains(direction);
|
|
30783
|
-
const { evmTokens, cosmosTokens, solanaTokens, bitcoinTokens, suiTokens, xrplTokens, stellarTokens, } = useSquidTokens(direction);
|
|
30893
|
+
const { evmTokens, cosmosTokens, solanaTokens, bitcoinTokens, suiTokens, xrplTokens, stellarTokens, cantonTokens, } = useSquidTokens(direction);
|
|
30784
30894
|
const { keplrTypeWallet } = useCosmosContext();
|
|
30785
30895
|
const placeholderData = useMemo(() => {
|
|
30786
30896
|
const tokens = {
|
|
@@ -30791,6 +30901,7 @@ const useAllTokensWithBalanceForChainType = ({ chainType, address, direction, qu
|
|
|
30791
30901
|
[ChainType.SUI]: suiTokens.map((t) => ({ ...t, balance: "0" })),
|
|
30792
30902
|
[ChainType.XRPL]: xrplTokens.map((t) => ({ ...t, balance: "0" })),
|
|
30793
30903
|
[ChainType.STELLAR]: stellarTokens.map((t) => ({ ...t, balance: "0" })),
|
|
30904
|
+
[ChainType.CANTON]: cantonTokens.map((t) => ({ ...t, balance: "0" })),
|
|
30794
30905
|
};
|
|
30795
30906
|
if (!chainType) {
|
|
30796
30907
|
// Return all tokens with zero balance
|
|
@@ -30812,6 +30923,7 @@ const useAllTokensWithBalanceForChainType = ({ chainType, address, direction, qu
|
|
|
30812
30923
|
suiTokens,
|
|
30813
30924
|
xrplTokens,
|
|
30814
30925
|
stellarTokens,
|
|
30926
|
+
cantonTokens,
|
|
30815
30927
|
]);
|
|
30816
30928
|
const isQueryEnabled = useMemo(() => {
|
|
30817
30929
|
// Respect the queryOptions.enabled override if provided
|
|
@@ -30834,6 +30946,8 @@ const useAllTokensWithBalanceForChainType = ({ chainType, address, direction, qu
|
|
|
30834
30946
|
return xrplTokens.length > 0;
|
|
30835
30947
|
case ChainType.STELLAR:
|
|
30836
30948
|
return stellarTokens.length > 0;
|
|
30949
|
+
case ChainType.CANTON:
|
|
30950
|
+
return cantonTokens.length > 0;
|
|
30837
30951
|
}
|
|
30838
30952
|
}, [
|
|
30839
30953
|
chainType,
|
|
@@ -30846,6 +30960,7 @@ const useAllTokensWithBalanceForChainType = ({ chainType, address, direction, qu
|
|
|
30846
30960
|
suiTokens.length,
|
|
30847
30961
|
xrplTokens.length,
|
|
30848
30962
|
stellarTokens.length,
|
|
30963
|
+
cantonTokens.length,
|
|
30849
30964
|
]);
|
|
30850
30965
|
const query = useQuery(keys().allTokensBalance(address, chainType, direction), async () => {
|
|
30851
30966
|
// Return zero balances if no address
|
|
@@ -30955,6 +31070,12 @@ const useAllConnectedWalletBalances = ({ direction, queryOptions = {
|
|
|
30955
31070
|
direction,
|
|
30956
31071
|
queryOptions,
|
|
30957
31072
|
});
|
|
31073
|
+
const cantonBalancesQuery = useAllTokensWithBalanceForChainType({
|
|
31074
|
+
chainType: ChainType.CANTON,
|
|
31075
|
+
address: connectedAddresses?.[ChainType.CANTON],
|
|
31076
|
+
direction,
|
|
31077
|
+
queryOptions,
|
|
31078
|
+
});
|
|
30958
31079
|
// Create a map of chain type to balance query results
|
|
30959
31080
|
const balanceQueries = useMemo(() => ({
|
|
30960
31081
|
[ChainType.EVM]: evmBalancesQuery,
|
|
@@ -30964,6 +31085,7 @@ const useAllConnectedWalletBalances = ({ direction, queryOptions = {
|
|
|
30964
31085
|
[ChainType.SUI]: suiBalancesQuery,
|
|
30965
31086
|
[ChainType.XRPL]: xrplBalancesQuery,
|
|
30966
31087
|
[ChainType.STELLAR]: stellarBalancesQuery,
|
|
31088
|
+
[ChainType.CANTON]: cantonBalancesQuery,
|
|
30967
31089
|
}), [
|
|
30968
31090
|
evmBalancesQuery,
|
|
30969
31091
|
cosmosBalancesQuery,
|
|
@@ -30972,6 +31094,7 @@ const useAllConnectedWalletBalances = ({ direction, queryOptions = {
|
|
|
30972
31094
|
suiBalancesQuery,
|
|
30973
31095
|
xrplBalancesQuery,
|
|
30974
31096
|
stellarBalancesQuery,
|
|
31097
|
+
cantonBalancesQuery,
|
|
30975
31098
|
]);
|
|
30976
31099
|
// Combine all tokens from different chains
|
|
30977
31100
|
const allTokens = useMemo(() => Object.values(balanceQueries).flatMap((query) => query.data?.tokens ?? []), [balanceQueries]);
|
|
@@ -31071,6 +31194,9 @@ const useMultiChainBalance = ({ chain, token, userAddress, enabled = true, }) =>
|
|
|
31071
31194
|
return xrplBalance;
|
|
31072
31195
|
case ChainType.STELLAR:
|
|
31073
31196
|
return stellarBalance;
|
|
31197
|
+
case ChainType.CANTON:
|
|
31198
|
+
// TODO: implement canton balance fetching
|
|
31199
|
+
return "0";
|
|
31074
31200
|
}
|
|
31075
31201
|
}, [
|
|
31076
31202
|
chain?.chainType,
|
|
@@ -31503,19 +31629,6 @@ const formatEstimatedRouteDuration = ({ estimatedRouteDuration, isSingleChainRou
|
|
|
31503
31629
|
format: (sTemplate, mTemplate, hTemplate) => formatSeconds(durationInSeconds, sTemplate, mTemplate, hTemplate),
|
|
31504
31630
|
};
|
|
31505
31631
|
};
|
|
31506
|
-
/**
|
|
31507
|
-
* Calculates and formats various estimate results based on the provided Squid route and additional parameters.
|
|
31508
|
-
*
|
|
31509
|
-
* @param {RouteResponse["route"]} squidRoute - The Squid route containing estimate information.
|
|
31510
|
-
* @param {Token[]} tokens - An array of token objects.
|
|
31511
|
-
* @param {ChainData} fromChain - The source chain object.
|
|
31512
|
-
* @param {ChainData} toChain - The destination chain object.
|
|
31513
|
-
* @param {boolean} collectFees - Flag indicating whether to collect fees.
|
|
31514
|
-
* @param {string} nativeTokenBalanceFromChain - The native token balance on the source chain.
|
|
31515
|
-
* @param {boolean} expressActivatedUI - Flag indicating whether express mode is activated in the UI.
|
|
31516
|
-
* @returns {Object} An object containing various estimate results and calculations, including token information,
|
|
31517
|
-
* amounts, fees, gas costs, and other relevant data for the transaction.
|
|
31518
|
-
*/
|
|
31519
31632
|
const calculateEstimateResults = ({ squidRoute, tokens, fromChain, toChain, collectFees, chainFeeParams, gasToken, }) => {
|
|
31520
31633
|
const fromToken = findToken(tokens, squidRoute?.params.fromChain, squidRoute?.params.fromToken);
|
|
31521
31634
|
const fromAmount = squidRoute?.estimate?.fromAmount;
|
|
@@ -31534,7 +31647,7 @@ const calculateEstimateResults = ({ squidRoute, tokens, fromChain, toChain, coll
|
|
|
31534
31647
|
const integratorFeeCost = allFeeCosts.length > 0 && collectFees
|
|
31535
31648
|
? allFeeCosts.find((f) => f.name === "Integrator fee")
|
|
31536
31649
|
: undefined;
|
|
31537
|
-
const expectedGasRefundCost = calculateExpectedGasRefundCost(firstFeeCost, fromChain?.chainType, estimate?.actions
|
|
31650
|
+
const expectedGasRefundCost = calculateExpectedGasRefundCost(firstFeeCost, fromChain?.chainType, estimate?.actions?.map(simplifyRouteAction));
|
|
31538
31651
|
const expectedGasRefundCostUSD = convertTokenAmountToUSD(formatBNToReadable(expectedGasRefundCost, firstFeeCost?.token.decimals ?? 18), firstFeeCost?.token.usdPrice ?? "0");
|
|
31539
31652
|
const sameTokenBetweenFees = firstFeeCost?.token.address === firstGasCost?.token.address &&
|
|
31540
31653
|
firstFeeCost?.token.chainId === firstGasCost?.token.chainId;
|
|
@@ -32192,6 +32305,9 @@ function useSendTransaction({ to, amount, token, chain, }) {
|
|
|
32192
32305
|
chain,
|
|
32193
32306
|
});
|
|
32194
32307
|
break;
|
|
32308
|
+
case ChainType.CANTON: {
|
|
32309
|
+
throw new Error("Not implemented");
|
|
32310
|
+
}
|
|
32195
32311
|
}
|
|
32196
32312
|
return {
|
|
32197
32313
|
amount,
|
|
@@ -32395,6 +32511,8 @@ async function getSendTransactionStatus({ chain, txHash, }) {
|
|
|
32395
32511
|
txHash,
|
|
32396
32512
|
chain,
|
|
32397
32513
|
});
|
|
32514
|
+
case ChainType.CANTON:
|
|
32515
|
+
throw new Error("Not implemented");
|
|
32398
32516
|
}
|
|
32399
32517
|
}
|
|
32400
32518
|
|
|
@@ -32418,7 +32536,7 @@ const useHistory = (txType) => {
|
|
|
32418
32536
|
fromChain: tx.params.fromChain,
|
|
32419
32537
|
fromToken: tx.params.fromToken,
|
|
32420
32538
|
fromAddress: tx.params.fromAddress,
|
|
32421
|
-
fromAmount: tx.params.fromAmount,
|
|
32539
|
+
fromAmount: tx.params.fromAmount ?? "",
|
|
32422
32540
|
toChain: tx.params.toChain,
|
|
32423
32541
|
toToken: tx.params.toToken,
|
|
32424
32542
|
toAddress: tx.params.toAddress,
|
|
@@ -32846,6 +32964,125 @@ const useApproval = ({ squidRoute, }) => {
|
|
|
32846
32964
|
};
|
|
32847
32965
|
};
|
|
32848
32966
|
|
|
32967
|
+
const useSwapStatusQuery = ({ transaction, retry = 25, refetchOnWindowFocus = "always", enabled = true, onStatus, onEndStatus, onNotFound, onError, }) => {
|
|
32968
|
+
const config = useConfigStore((state) => state.config);
|
|
32969
|
+
const isInitialized = useConfigStore((state) => state.isInitialized);
|
|
32970
|
+
const [isTransactionComplete, setIsTransactionComplete] = useState(false);
|
|
32971
|
+
const [refetchInterval, setRefetchInterval] = useState(getSwapTxStatusRefetchInterval(transaction));
|
|
32972
|
+
const { getChainType } = useSquidChains();
|
|
32973
|
+
const fetchTransactionStatusWithLatestConfig = useCallback(async () => {
|
|
32974
|
+
const latestConfig = useConfigStore.getState().config;
|
|
32975
|
+
return fetchSwapTransactionStatus({
|
|
32976
|
+
transaction,
|
|
32977
|
+
integratorId: latestConfig.integratorId,
|
|
32978
|
+
apiUrl: latestConfig.apiUrl,
|
|
32979
|
+
});
|
|
32980
|
+
}, [transaction]);
|
|
32981
|
+
const transactionStatusQuery = useQuery(keys().swapTransactionStatus(transaction?.transactionId), fetchTransactionStatusWithLatestConfig, {
|
|
32982
|
+
enabled: enabled &&
|
|
32983
|
+
transaction?.transactionId !== "0" &&
|
|
32984
|
+
!!transaction?.transactionId &&
|
|
32985
|
+
!!transaction.fromAddress &&
|
|
32986
|
+
!!config.apiUrl &&
|
|
32987
|
+
transaction !== undefined &&
|
|
32988
|
+
!isTransactionComplete &&
|
|
32989
|
+
isInitialized,
|
|
32990
|
+
refetchInterval(statusResponse) {
|
|
32991
|
+
if (statusResponse &&
|
|
32992
|
+
transactionEndStatuses.includes(getTransactionStatus(statusResponse) ?? "")) {
|
|
32993
|
+
return false;
|
|
32994
|
+
}
|
|
32995
|
+
return refetchInterval;
|
|
32996
|
+
},
|
|
32997
|
+
retryDelay: getChainType(transaction?.fromChain) === ChainType.COSMOS ? 5000 : 3000,
|
|
32998
|
+
retry: getChainType(transaction?.fromChain) === ChainType.COSMOS ? 6 : retry,
|
|
32999
|
+
refetchOnWindowFocus,
|
|
33000
|
+
onSuccess: (statusResponse) => {
|
|
33001
|
+
WidgetEvents.getInstance().dispatchSwapStatus(statusResponse.squidTransactionStatus ?? "");
|
|
33002
|
+
onStatus?.({
|
|
33003
|
+
status: getTransactionStatus(statusResponse) ?? "",
|
|
33004
|
+
statusResponse,
|
|
33005
|
+
});
|
|
33006
|
+
const endStatus = getTransactionEndStatus({ statusResponse });
|
|
33007
|
+
if (endStatus) {
|
|
33008
|
+
setIsTransactionComplete(true);
|
|
33009
|
+
onEndStatus?.({ status: endStatus, statusResponse });
|
|
33010
|
+
}
|
|
33011
|
+
},
|
|
33012
|
+
onError: (error) => {
|
|
33013
|
+
if (is404Error(error.cause)) {
|
|
33014
|
+
onNotFound?.();
|
|
33015
|
+
return;
|
|
33016
|
+
}
|
|
33017
|
+
setRefetchInterval(-1);
|
|
33018
|
+
setIsTransactionComplete(true);
|
|
33019
|
+
onError?.();
|
|
33020
|
+
},
|
|
33021
|
+
});
|
|
33022
|
+
return {
|
|
33023
|
+
transactionStatusQuery,
|
|
33024
|
+
};
|
|
33025
|
+
};
|
|
33026
|
+
|
|
33027
|
+
// Statuses that indicate the source deposit has been received and the swap is
|
|
33028
|
+
// now progressing — the point at which it becomes a history-backed transaction.
|
|
33029
|
+
const sourceReceivedStatuses = [
|
|
33030
|
+
"DEPOSIT_RECEIVED",
|
|
33031
|
+
"BROADCAST_REQUESTED",
|
|
33032
|
+
"COMPLETE",
|
|
33033
|
+
];
|
|
33034
|
+
/**
|
|
33035
|
+
* Tracks a generated deposit address before it becomes a persisted swap history item.
|
|
33036
|
+
*
|
|
33037
|
+
* Mirrors the hooks-first pattern of `useExecuteTransaction`: once the source deposit
|
|
33038
|
+
* is received, it registers the transaction in the transaction + history stores, then
|
|
33039
|
+
* signals the view (via `onReceived`) to navigate. The view never writes to the stores.
|
|
33040
|
+
*/
|
|
33041
|
+
const useDepositTransactionStatus = ({ transaction, route, retry = 25, refetchOnWindowFocus = "always", enabled = true, onReceived, }) => {
|
|
33042
|
+
const { fromChain, toChain } = useSwap();
|
|
33043
|
+
const { addSwapTransaction } = useHistory();
|
|
33044
|
+
const getTransaction = useTransactionStore((state) => state.getTransaction);
|
|
33045
|
+
const setTransactionStoreState = useTransactionStore((state) => state.setTransactionState);
|
|
33046
|
+
return useSwapStatusQuery({
|
|
33047
|
+
transaction,
|
|
33048
|
+
retry,
|
|
33049
|
+
refetchOnWindowFocus,
|
|
33050
|
+
enabled,
|
|
33051
|
+
onStatus: ({ status }) => {
|
|
33052
|
+
if (!sourceReceivedStatuses.includes(status))
|
|
33053
|
+
return;
|
|
33054
|
+
if (!transaction?.transactionId || !route?.transactionRequest)
|
|
33055
|
+
return;
|
|
33056
|
+
const txLocalId = transaction.transactionId;
|
|
33057
|
+
if (getTransaction(txLocalId))
|
|
33058
|
+
return;
|
|
33059
|
+
useTransactionStore.setState({
|
|
33060
|
+
txLocalId,
|
|
33061
|
+
currentTransaction: undefined,
|
|
33062
|
+
});
|
|
33063
|
+
const tx = {
|
|
33064
|
+
routeType: route.transactionRequest.type,
|
|
33065
|
+
fromChain,
|
|
33066
|
+
toChain,
|
|
33067
|
+
fromAddress: transaction.fromAddress,
|
|
33068
|
+
transactionId: txLocalId,
|
|
33069
|
+
transactionIdForStatus: transaction.transactionIdForStatus,
|
|
33070
|
+
quoteId: route.quoteId,
|
|
33071
|
+
status: TransactionStatus.ONGOING,
|
|
33072
|
+
sourceStatus: TransactionStatus.SUCCESS,
|
|
33073
|
+
timestamp: Date.now(),
|
|
33074
|
+
};
|
|
33075
|
+
setTransactionStoreState(txLocalId, tx);
|
|
33076
|
+
addSwapTransaction({
|
|
33077
|
+
...tx,
|
|
33078
|
+
params: route.params,
|
|
33079
|
+
estimate: route.estimate,
|
|
33080
|
+
});
|
|
33081
|
+
onReceived?.();
|
|
33082
|
+
},
|
|
33083
|
+
});
|
|
33084
|
+
};
|
|
33085
|
+
|
|
32849
33086
|
const DEFAULT_PROVIDER_IMAGE_URL = "https://raw.githubusercontent.com/0xsquid/assets/main/images/webp128/providers/squid.webp";
|
|
32850
33087
|
const AXELAR_PROVIDER_IMAGE_URL = "https://raw.githubusercontent.com/0xsquid/assets/main/images/webp128/providers/axelar.webp";
|
|
32851
33088
|
const useEstimate = (squidRoute) => {
|
|
@@ -35894,6 +36131,12 @@ coin.DecProto = {
|
|
|
35894
36131
|
|
|
35895
36132
|
const useExecuteTransaction = (squidRoute) => {
|
|
35896
36133
|
const { fromChain, toChain, fromToken, toToken, isSameChain } = useSwap();
|
|
36134
|
+
// A route completes on source tx only if it's same-chain AND
|
|
36135
|
+
// every action is fulfilled in the user's source transaction
|
|
36136
|
+
const isCompletedOnSourceTx = isSameChain &&
|
|
36137
|
+
!!fromChain &&
|
|
36138
|
+
!!squidRoute &&
|
|
36139
|
+
squidRoute.estimate.actions.every((a) => isActionCompletedOnSourceTx(a, fromChain.chainId));
|
|
35897
36140
|
const { evmSigner, cosmosSigner, solanaSigner, bitcoinSigner, suiSigner, xrplSigner, stellarSigner, } = useSigner({
|
|
35898
36141
|
chain: fromChain,
|
|
35899
36142
|
});
|
|
@@ -35928,7 +36171,7 @@ const useExecuteTransaction = (squidRoute) => {
|
|
|
35928
36171
|
routeType: route.transactionRequest.type,
|
|
35929
36172
|
nonce,
|
|
35930
36173
|
transactionId: txHash,
|
|
35931
|
-
transactionIdForStatus
|
|
36174
|
+
transactionIdForStatus,
|
|
35932
36175
|
quoteId,
|
|
35933
36176
|
status,
|
|
35934
36177
|
sourceStatus,
|
|
@@ -36158,7 +36401,7 @@ const useExecuteTransaction = (squidRoute) => {
|
|
|
36158
36401
|
if (!route.params.fromAddress || !route.params.toAddress) {
|
|
36159
36402
|
throw new Error("From or to address is required");
|
|
36160
36403
|
}
|
|
36161
|
-
const isDirectTransfer =
|
|
36404
|
+
const isDirectTransfer = isChainflipDepositRoute(route);
|
|
36162
36405
|
// Means it's a transfer to a deposit address
|
|
36163
36406
|
// Instead of a Swap/Contract call using a DEX like Jupiter
|
|
36164
36407
|
if (isDirectTransfer) {
|
|
@@ -36169,7 +36412,7 @@ const useExecuteTransaction = (squidRoute) => {
|
|
|
36169
36412
|
throw new Error("Deposit address is required");
|
|
36170
36413
|
}
|
|
36171
36414
|
const signature = await executeSolanaTransfer({
|
|
36172
|
-
amount: BigInt(route.params.fromAmount),
|
|
36415
|
+
amount: BigInt(route.params.fromAmount ?? ""),
|
|
36173
36416
|
target: depositData.depositAddress,
|
|
36174
36417
|
signer: solanaSigner,
|
|
36175
36418
|
connection: solanaConnection,
|
|
@@ -36179,7 +36422,7 @@ const useExecuteTransaction = (squidRoute) => {
|
|
|
36179
36422
|
const txParams = setTransactionState({
|
|
36180
36423
|
route,
|
|
36181
36424
|
txHash,
|
|
36182
|
-
transactionIdForStatus: depositData.
|
|
36425
|
+
transactionIdForStatus: depositData.statusTrackingId,
|
|
36183
36426
|
userAddress: sourceUserAddress,
|
|
36184
36427
|
status: TransactionStatus.INITIAL_LOADING,
|
|
36185
36428
|
sourceStatus: TransactionStatus.ONGOING,
|
|
@@ -36228,46 +36471,9 @@ const useExecuteTransaction = (squidRoute) => {
|
|
|
36228
36471
|
? error
|
|
36229
36472
|
: new Error("Failed to execute Solana transaction");
|
|
36230
36473
|
}
|
|
36231
|
-
}, {
|
|
36232
|
-
onError: (error, variables) => {
|
|
36233
|
-
const currentTx = getTransaction(variables.id);
|
|
36234
|
-
const errorObject = getTransactionError(error);
|
|
36235
|
-
setTransactionStoreState(variables.id, {
|
|
36236
|
-
...currentTx,
|
|
36237
|
-
status: TransactionStatus.ERROR,
|
|
36238
|
-
sourceStatus: TransactionStatus.ERROR,
|
|
36239
|
-
error: errorObject,
|
|
36240
|
-
});
|
|
36241
|
-
if (currentTx?.transactionId &&
|
|
36242
|
-
errorObject.type === TransactionErrorType.CALL_EXCEPTION) {
|
|
36243
|
-
replaceSwapTransactionStatus({
|
|
36244
|
-
transactionId: currentTx.transactionId,
|
|
36245
|
-
statusResponse: currentTx.statusResponse,
|
|
36246
|
-
status: TransactionStatus.ERROR,
|
|
36247
|
-
});
|
|
36248
|
-
}
|
|
36249
|
-
},
|
|
36250
|
-
onSuccess: (_data, variables) => {
|
|
36251
|
-
const currentTx = getTransaction(variables.id);
|
|
36252
|
-
queryClient.invalidateQueries(getPrefixKey(QueryKeys.Balances));
|
|
36253
|
-
if (isSameChain && currentTx?.transactionId) {
|
|
36254
|
-
replaceSwapTransactionStatus({
|
|
36255
|
-
transactionId: currentTx.transactionId,
|
|
36256
|
-
statusResponse: currentTx.statusResponse,
|
|
36257
|
-
status: TransactionStatus.SUCCESS,
|
|
36258
|
-
});
|
|
36259
|
-
}
|
|
36260
|
-
setTransactionStoreState(variables.id, {
|
|
36261
|
-
...currentTx,
|
|
36262
|
-
sourceStatus: TransactionStatus.SUCCESS,
|
|
36263
|
-
status: isSameChain
|
|
36264
|
-
? TransactionStatus.SUCCESS
|
|
36265
|
-
: TransactionStatus.ONGOING,
|
|
36266
|
-
});
|
|
36267
|
-
},
|
|
36268
36474
|
});
|
|
36269
36475
|
const swapMutationBitcoin = useMutation(async ({ id, route }) => {
|
|
36270
|
-
const { depositAddress, amount: sendAmount,
|
|
36476
|
+
const { depositAddress, amount: sendAmount, statusTrackingId, } = useDepositAddressStore.getState().deposit ?? {};
|
|
36271
36477
|
if (!depositAddress) {
|
|
36272
36478
|
throw new Error(`Invalid deposit address: ${depositAddress}`);
|
|
36273
36479
|
}
|
|
@@ -36290,7 +36496,7 @@ const useExecuteTransaction = (squidRoute) => {
|
|
|
36290
36496
|
txHash,
|
|
36291
36497
|
// When bridging from Bitcoin we need to send the chainflipId to the status endpoint
|
|
36292
36498
|
// instead of the Bitcoin transaction hash
|
|
36293
|
-
transactionIdForStatus:
|
|
36499
|
+
transactionIdForStatus: statusTrackingId,
|
|
36294
36500
|
userAddress: sourceUserAddress,
|
|
36295
36501
|
status: TransactionStatus.INITIAL_LOADING,
|
|
36296
36502
|
sourceStatus: TransactionStatus.ONGOING,
|
|
@@ -36485,7 +36691,7 @@ const useExecuteTransaction = (squidRoute) => {
|
|
|
36485
36691
|
const handleTransactionSuccess = useCallback((id) => {
|
|
36486
36692
|
const currentTx = getTransaction(id);
|
|
36487
36693
|
queryClient.invalidateQueries(getPrefixKey(QueryKeys.Balances));
|
|
36488
|
-
if (
|
|
36694
|
+
if (isCompletedOnSourceTx && currentTx?.transactionId) {
|
|
36489
36695
|
replaceSwapTransactionStatus({
|
|
36490
36696
|
transactionId: currentTx.transactionId,
|
|
36491
36697
|
statusResponse: currentTx.statusResponse,
|
|
@@ -36495,13 +36701,13 @@ const useExecuteTransaction = (squidRoute) => {
|
|
|
36495
36701
|
setTransactionStoreState(id, {
|
|
36496
36702
|
...currentTx,
|
|
36497
36703
|
sourceStatus: TransactionStatus.SUCCESS,
|
|
36498
|
-
status:
|
|
36704
|
+
status: isCompletedOnSourceTx
|
|
36499
36705
|
? TransactionStatus.SUCCESS
|
|
36500
36706
|
: TransactionStatus.ONGOING,
|
|
36501
36707
|
});
|
|
36502
36708
|
}, [
|
|
36503
36709
|
getTransaction,
|
|
36504
|
-
|
|
36710
|
+
isCompletedOnSourceTx,
|
|
36505
36711
|
queryClient,
|
|
36506
36712
|
replaceSwapTransactionStatus,
|
|
36507
36713
|
setTransactionStoreState,
|
|
@@ -36524,8 +36730,8 @@ const useExecuteTransaction = (squidRoute) => {
|
|
|
36524
36730
|
if (currentTx?.transactionId &&
|
|
36525
36731
|
errorObject.type === TransactionErrorType.CALL_EXCEPTION) {
|
|
36526
36732
|
replaceSwapTransactionStatus({
|
|
36527
|
-
transactionId: currentTx
|
|
36528
|
-
statusResponse: currentTx
|
|
36733
|
+
transactionId: currentTx.transactionId,
|
|
36734
|
+
statusResponse: currentTx.statusResponse,
|
|
36529
36735
|
status: TransactionStatus.ERROR,
|
|
36530
36736
|
});
|
|
36531
36737
|
}
|
|
@@ -36891,94 +37097,50 @@ function useSendTransactionStatus({ chain, txHash, }) {
|
|
|
36891
37097
|
* Fetch status of a Swap transaction
|
|
36892
37098
|
*/
|
|
36893
37099
|
const useSwapTransactionStatus = ({ transaction, retry = 25, refetchOnWindowFocus = "always", enabled = true, }) => {
|
|
36894
|
-
const config = useConfigStore((state) => state.config);
|
|
36895
|
-
const isInitialized = useConfigStore((state) => state.isInitialized);
|
|
36896
37100
|
const { replaceSwapTransactionStatus } = useHistory();
|
|
36897
37101
|
const findTransaction = useHistoryStore((state) => state.findTransaction);
|
|
36898
|
-
const [isTransactionComplete, setIsTransactionComplete] = useState(false);
|
|
36899
|
-
const [refetchInterval, setRefetchInterval] = useState(getSwapTxStatusRefetchInterval(transaction));
|
|
36900
|
-
const { getChainType } = useSquidChains();
|
|
36901
37102
|
const currentHistoryItem = useMemo(() => findTransaction({
|
|
36902
37103
|
transactionId: transaction?.transactionId,
|
|
36903
37104
|
txType: HistoryTxType.SWAP,
|
|
36904
37105
|
}), [findTransaction, transaction?.transactionId]);
|
|
36905
|
-
|
|
36906
|
-
|
|
36907
|
-
|
|
36908
|
-
|
|
36909
|
-
*/
|
|
36910
|
-
const fetchTransactionStatusWithLatestConfig = useCallback(async () => {
|
|
36911
|
-
const latestConfig = useConfigStore.getState().config;
|
|
36912
|
-
return fetchSwapTransactionStatus({
|
|
36913
|
-
transaction,
|
|
36914
|
-
integratorId: latestConfig.integratorId,
|
|
36915
|
-
apiUrl: latestConfig.apiUrl,
|
|
36916
|
-
});
|
|
36917
|
-
}, [transaction]);
|
|
36918
|
-
const transactionStatusQuery = useQuery(keys().swapTransactionStatus(transaction?.transactionId), fetchTransactionStatusWithLatestConfig, {
|
|
37106
|
+
const transactionStatusQuery = useSwapStatusQuery({
|
|
37107
|
+
transaction,
|
|
37108
|
+
retry,
|
|
37109
|
+
refetchOnWindowFocus,
|
|
36919
37110
|
enabled: enabled &&
|
|
36920
|
-
transaction?.transactionId !== "0" &&
|
|
36921
|
-
!!transaction?.transactionId &&
|
|
36922
|
-
!!transaction.fromAddress &&
|
|
36923
|
-
!!config.apiUrl &&
|
|
36924
|
-
transaction !== undefined &&
|
|
36925
|
-
!isTransactionComplete &&
|
|
36926
|
-
isInitialized &&
|
|
36927
37111
|
!!currentHistoryItem &&
|
|
36928
37112
|
!isHistoryTransactionEnded({
|
|
36929
37113
|
data: currentHistoryItem?.data,
|
|
36930
37114
|
txType: HistoryTxType.SWAP,
|
|
36931
37115
|
}),
|
|
36932
|
-
|
|
36933
|
-
|
|
36934
|
-
|
|
36935
|
-
|
|
36936
|
-
|
|
36937
|
-
|
|
36938
|
-
|
|
36939
|
-
}
|
|
36940
|
-
return refetchInterval; // Had to handle a variable here because after onError, we want the interval to stop
|
|
37116
|
+
onEndStatus: ({ status, statusResponse }) => {
|
|
37117
|
+
if (!transaction?.transactionId)
|
|
37118
|
+
return;
|
|
37119
|
+
replaceSwapTransactionStatus({
|
|
37120
|
+
transactionId: transaction.transactionId,
|
|
37121
|
+
statusResponse,
|
|
37122
|
+
status,
|
|
37123
|
+
});
|
|
36941
37124
|
},
|
|
36942
|
-
|
|
36943
|
-
|
|
36944
|
-
|
|
36945
|
-
|
|
36946
|
-
|
|
36947
|
-
|
|
36948
|
-
|
|
36949
|
-
|
|
36950
|
-
if (endStatus && transaction?.transactionId) {
|
|
36951
|
-
setIsTransactionComplete(true);
|
|
36952
|
-
replaceSwapTransactionStatus({
|
|
36953
|
-
transactionId: transaction.transactionId,
|
|
36954
|
-
statusResponse,
|
|
36955
|
-
status: endStatus,
|
|
36956
|
-
});
|
|
36957
|
-
}
|
|
37125
|
+
onNotFound: () => {
|
|
37126
|
+
if (!transaction?.transactionId)
|
|
37127
|
+
return;
|
|
37128
|
+
replaceSwapTransactionStatus({
|
|
37129
|
+
transactionId: transaction.transactionId,
|
|
37130
|
+
statusResponse: undefined,
|
|
37131
|
+
status: TransactionStatus.NOT_FOUND,
|
|
37132
|
+
});
|
|
36958
37133
|
},
|
|
36959
|
-
onError: (
|
|
36960
|
-
// `fetchTransactionStatus` throws an error with a cause being an AxiosError
|
|
36961
|
-
const is404 = is404Error(error.cause);
|
|
37134
|
+
onError: () => {
|
|
36962
37135
|
if (!transaction?.transactionId)
|
|
36963
37136
|
return;
|
|
36964
|
-
|
|
36965
|
-
|
|
36966
|
-
|
|
36967
|
-
|
|
36968
|
-
|
|
36969
|
-
});
|
|
36970
|
-
}
|
|
36971
|
-
else {
|
|
36972
|
-
setRefetchInterval(-1);
|
|
36973
|
-
setIsTransactionComplete(true);
|
|
36974
|
-
replaceSwapTransactionStatus({
|
|
36975
|
-
transactionId: transaction.transactionId,
|
|
36976
|
-
statusResponse: undefined,
|
|
36977
|
-
status: TransactionStatus.ERROR,
|
|
36978
|
-
});
|
|
36979
|
-
}
|
|
37137
|
+
replaceSwapTransactionStatus({
|
|
37138
|
+
transactionId: transaction.transactionId,
|
|
37139
|
+
statusResponse: undefined,
|
|
37140
|
+
status: TransactionStatus.ERROR,
|
|
37141
|
+
});
|
|
36980
37142
|
},
|
|
36981
|
-
});
|
|
37143
|
+
}).transactionStatusQuery;
|
|
36982
37144
|
return {
|
|
36983
37145
|
transactionStatusQuery,
|
|
36984
37146
|
latestStatus: transactionStatusQuery.data
|
|
@@ -37455,5 +37617,5 @@ const SquidProvider = ({ children, config, placeholder, }) => {
|
|
|
37455
37617
|
React.createElement(CosmosProvider, null, children)))))))))) : (placeholder);
|
|
37456
37618
|
};
|
|
37457
37619
|
|
|
37458
|
-
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,
|
|
37459
|
-
//# sourceMappingURL=index-
|
|
37620
|
+
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 };
|
|
37621
|
+
//# sourceMappingURL=index-CtTVUC-R.js.map
|