@0xsquid/react-hooks 8.13.1-beta.0 → 8.14.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/types/solana.d.ts +8 -0
- package/dist/{index-OUfYMn5i.js → index-BjIX7utV.js} +218 -78
- package/dist/index-BjIX7utV.js.map +1 -0
- package/dist/{index-oLTLWI9S.js → index-DkBrtnan.js} +218 -79
- package/dist/index-DkBrtnan.js.map +1 -0
- package/dist/{index.es-CoocBNVs.js → index.es-BQULJYpe.js} +2 -2
- package/dist/{index.es-CoocBNVs.js.map → index.es-BQULJYpe.js.map} +1 -1
- package/dist/{index.es-BWO-JBU8.js → index.es-CeXN3P4q.js} +2 -2
- package/dist/{index.es-BWO-JBU8.js.map → index.es-CeXN3P4q.js.map} +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/{secretService-DkpDcrSv.js → secretService-BBTgxmnG.js} +2 -2
- package/dist/{secretService-DkpDcrSv.js.map → secretService-BBTgxmnG.js.map} +1 -1
- package/dist/{secretService-C8zVh8hn.js → secretService-BebOsCud.js} +2 -2
- package/dist/{secretService-C8zVh8hn.js.map → secretService-BebOsCud.js.map} +1 -1
- package/dist/services/internal/errorService.d.ts +5 -2
- package/dist/services/internal/evmService.d.ts +1 -0
- package/dist/{stellarService.client-DE2oaaTW.js → stellarService.client-B6_2UV4u.js} +2 -2
- package/dist/{stellarService.client-DE2oaaTW.js.map → stellarService.client-B6_2UV4u.js.map} +1 -1
- package/dist/{stellarService.client-BKpjqyn_.js → stellarService.client-DlQku8Rs.js} +2 -2
- package/dist/{stellarService.client-BKpjqyn_.js.map → stellarService.client-DlQku8Rs.js.map} +1 -1
- package/dist/tests/errorService.test.d.ts +1 -0
- package/dist/tests/solanaService.test.d.ts +1 -0
- package/dist/tests/useEvmBalance.test.d.ts +1 -0
- package/dist/tests/useEvmNativeBalance.test.d.ts +1 -0
- package/package.json +1 -1
- package/dist/index-OUfYMn5i.js.map +0 -1
- package/dist/index-oLTLWI9S.js.map +0 -1
|
@@ -231,6 +231,19 @@ class QrCodeGenerationError extends Error {
|
|
|
231
231
|
}
|
|
232
232
|
}
|
|
233
233
|
|
|
234
|
+
const SOLANA_ON_CHAIN_ERROR_CODE = "SOLANA_ON_CHAIN_ERROR";
|
|
235
|
+
const SOLANA_BLOCKHASH_EXPIRED_CODE = "SOLANA_BLOCKHASH_EXPIRED";
|
|
236
|
+
class SolanaTransactionError extends Error {
|
|
237
|
+
code;
|
|
238
|
+
signature;
|
|
239
|
+
constructor(code, message, signature) {
|
|
240
|
+
super(message);
|
|
241
|
+
this.name = "SolanaTransactionError";
|
|
242
|
+
this.code = code;
|
|
243
|
+
this.signature = signature;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
|
|
234
247
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
235
248
|
|
|
236
249
|
function getDefaultExportFromCjs (x) {
|
|
@@ -4203,24 +4216,38 @@ class WidgetEvents extends EventTarget {
|
|
|
4203
4216
|
}
|
|
4204
4217
|
}
|
|
4205
4218
|
|
|
4219
|
+
const isRecord$1 = (value) => typeof value === "object" && value !== null;
|
|
4220
|
+
const isErrorCode = (value) => typeof value === "string" || typeof value === "number";
|
|
4221
|
+
const toErrorLike = (value) => {
|
|
4222
|
+
if (!isRecord$1(value))
|
|
4223
|
+
return undefined;
|
|
4224
|
+
const { code, message, reason, error, data, cause } = value;
|
|
4225
|
+
return {
|
|
4226
|
+
code: isErrorCode(code) ? code : undefined,
|
|
4227
|
+
message: typeof message === "string" ? message : undefined,
|
|
4228
|
+
reason: typeof reason === "string" ? reason : undefined,
|
|
4229
|
+
error: toErrorLike(error),
|
|
4230
|
+
data: toErrorLike(data),
|
|
4231
|
+
cause: toErrorLike(cause),
|
|
4232
|
+
};
|
|
4233
|
+
};
|
|
4206
4234
|
/**
|
|
4207
4235
|
* Normalizes different error structures into a consistent format
|
|
4208
4236
|
* This helps handle different wallet error formats uniformly
|
|
4209
4237
|
*/
|
|
4210
4238
|
const normalizeError = (error) => {
|
|
4239
|
+
const errorLike = toErrorLike(error);
|
|
4240
|
+
if (!errorLike)
|
|
4241
|
+
return {};
|
|
4211
4242
|
// Handle nested error objects (like Rainbow's error.error structure)
|
|
4212
|
-
|
|
4213
|
-
return {
|
|
4214
|
-
code: error.error.code,
|
|
4215
|
-
message: error.error.message,
|
|
4216
|
-
reason: error.error.reason,
|
|
4217
|
-
};
|
|
4218
|
-
}
|
|
4219
|
-
// Handle direct error properties
|
|
4243
|
+
const source = errorLike.error ?? errorLike;
|
|
4220
4244
|
return {
|
|
4221
|
-
code:
|
|
4222
|
-
message:
|
|
4223
|
-
reason:
|
|
4245
|
+
code: source.code,
|
|
4246
|
+
message: source.message,
|
|
4247
|
+
reason: source.reason,
|
|
4248
|
+
dataCode: source.data?.code,
|
|
4249
|
+
dataMessage: source.data?.message,
|
|
4250
|
+
causeMessage: source.cause?.message,
|
|
4224
4251
|
};
|
|
4225
4252
|
};
|
|
4226
4253
|
const transactionErrorCode = {
|
|
@@ -4254,11 +4281,6 @@ const transactionErrorCode = {
|
|
|
4254
4281
|
type: TransactionErrorType.REJECTED_BY_USER,
|
|
4255
4282
|
internalLabel: "EVM: REJECTED: CODE 4001",
|
|
4256
4283
|
},
|
|
4257
|
-
// Rainbow
|
|
4258
|
-
"-32603": {
|
|
4259
|
-
type: TransactionErrorType.REJECTED_BY_USER,
|
|
4260
|
-
internalLabel: "EVM: REJECTED: CODE -32603",
|
|
4261
|
-
},
|
|
4262
4284
|
// Joey (XRPL)
|
|
4263
4285
|
"User rejected.": {
|
|
4264
4286
|
type: TransactionErrorType.REJECTED_BY_USER,
|
|
@@ -4318,16 +4340,60 @@ const transactionErrorCode = {
|
|
|
4318
4340
|
type: TransactionErrorType.CALL_EXCEPTION,
|
|
4319
4341
|
internalLabel: "EVM: CALL_EXCEPTION",
|
|
4320
4342
|
},
|
|
4343
|
+
[SOLANA_ON_CHAIN_ERROR_CODE]: {
|
|
4344
|
+
type: TransactionErrorType.CALL_EXCEPTION,
|
|
4345
|
+
internalLabel: "SOL: Transaction failed on chain",
|
|
4346
|
+
},
|
|
4347
|
+
[SOLANA_BLOCKHASH_EXPIRED_CODE]: {
|
|
4348
|
+
type: TransactionErrorType.UNKNOWN,
|
|
4349
|
+
internalLabel: "SOL: Transaction blockhash expired",
|
|
4350
|
+
},
|
|
4321
4351
|
UNKNOWN: {
|
|
4322
4352
|
type: TransactionErrorType.UNKNOWN,
|
|
4323
4353
|
internalLabel: "UNKNOWN ERROR: Transaction failed",
|
|
4324
4354
|
},
|
|
4325
4355
|
};
|
|
4356
|
+
// Rainbow reports a user rejection with the generic JSON-RPC internal error
|
|
4357
|
+
// code, while Phantom uses the same code for real failures.
|
|
4358
|
+
const INTERNAL_RPC_ERROR_CODE = "-32603";
|
|
4359
|
+
const userRejectionMessagePatterns = [
|
|
4360
|
+
/user rejected/i,
|
|
4361
|
+
/rejected the request/i,
|
|
4362
|
+
/rejected by the user/i,
|
|
4363
|
+
/user denied/i,
|
|
4364
|
+
];
|
|
4365
|
+
const internalRpcRejectionError = {
|
|
4366
|
+
type: TransactionErrorType.REJECTED_BY_USER,
|
|
4367
|
+
internalLabel: "EVM: REJECTED: CODE -32603",
|
|
4368
|
+
};
|
|
4369
|
+
const USER_REJECTED_CODE = "4001";
|
|
4370
|
+
const isUserRejectionMessage = (message) => message !== undefined &&
|
|
4371
|
+
userRejectionMessagePatterns.some((pattern) => pattern.test(message));
|
|
4372
|
+
const isInternalRpcRejection = ({ code, message, dataCode, dataMessage, causeMessage, }) => code != undefined &&
|
|
4373
|
+
code.toString() === INTERNAL_RPC_ERROR_CODE &&
|
|
4374
|
+
(dataCode?.toString() === USER_REJECTED_CODE ||
|
|
4375
|
+
[message, dataMessage, causeMessage].some(isUserRejectionMessage));
|
|
4376
|
+
// @solana/web3.js SendTransactionError carries no code; its message starts
|
|
4377
|
+
// with the preflight failure text.
|
|
4378
|
+
const messagePatternErrors = [
|
|
4379
|
+
{
|
|
4380
|
+
pattern: /^(Simulation failed|Transaction simulation failed)/i,
|
|
4381
|
+
error: {
|
|
4382
|
+
type: TransactionErrorType.CALL_EXCEPTION,
|
|
4383
|
+
internalLabel: "SOL: Transaction simulation failed",
|
|
4384
|
+
},
|
|
4385
|
+
},
|
|
4386
|
+
];
|
|
4387
|
+
const matchMessagePattern = (message) => message === undefined
|
|
4388
|
+
? undefined
|
|
4389
|
+
: messagePatternErrors.find(({ pattern }) => pattern.test(message))?.error;
|
|
4326
4390
|
/**
|
|
4327
4391
|
* Detects if an error is a user rejection based on normalized error structure
|
|
4328
4392
|
*/
|
|
4329
4393
|
const isUserRejectionError = (normalizedError) => {
|
|
4330
4394
|
const { code, message } = normalizedError;
|
|
4395
|
+
if (isInternalRpcRejection(normalizedError))
|
|
4396
|
+
return true;
|
|
4331
4397
|
// Check if the error matches any known rejection patterns from transactionErrorCode
|
|
4332
4398
|
return Object.entries(transactionErrorCode).some(([key, value]) => {
|
|
4333
4399
|
if (value.type !== TransactionErrorType.REJECTED_BY_USER)
|
|
@@ -4348,6 +4414,8 @@ const isUserRejectionError = (normalizedError) => {
|
|
|
4348
4414
|
*/
|
|
4349
4415
|
const getTransactionError = (error) => {
|
|
4350
4416
|
const normalizedError = normalizeError(error);
|
|
4417
|
+
if (isInternalRpcRejection(normalizedError))
|
|
4418
|
+
return internalRpcRejectionError;
|
|
4351
4419
|
if (isUserRejectionError(normalizedError)) {
|
|
4352
4420
|
// Return the specific rejection error if we can find it
|
|
4353
4421
|
if (normalizedError.code) {
|
|
@@ -4364,10 +4432,12 @@ const getTransactionError = (error) => {
|
|
|
4364
4432
|
}
|
|
4365
4433
|
if (normalizedError.code) {
|
|
4366
4434
|
return (transactionErrorCode[normalizedError.code.toString()] ||
|
|
4435
|
+
matchMessagePattern(normalizedError.message) ||
|
|
4367
4436
|
transactionErrorCode.UNKNOWN);
|
|
4368
4437
|
}
|
|
4369
4438
|
if (normalizedError.message) {
|
|
4370
4439
|
return (transactionErrorCode[normalizedError.message] ||
|
|
4440
|
+
matchMessagePattern(normalizedError.message) ||
|
|
4371
4441
|
transactionErrorCode.UNKNOWN);
|
|
4372
4442
|
}
|
|
4373
4443
|
return transactionErrorCode.UNKNOWN;
|
|
@@ -21646,14 +21716,71 @@ const isSolanaAddressValid = (address) => {
|
|
|
21646
21716
|
};
|
|
21647
21717
|
const deserializeSolanaTransaction = (transactionBuffer) => {
|
|
21648
21718
|
// Squid can return legacy Solana transactions (ITS) or versioned transactions
|
|
21649
|
-
// (Jupiter/Chainflip). Deserialize once to detect the payload type.
|
|
21650
|
-
// transactions need to be converted to Transaction because their blockhash is
|
|
21651
|
-
// mutable and must be refreshed before signing.
|
|
21719
|
+
// (Jupiter/Chainflip). Deserialize once to detect the payload type.
|
|
21652
21720
|
const versionedTransaction = VersionedTransaction.deserialize(transactionBuffer);
|
|
21653
21721
|
return versionedTransaction.version === "legacy"
|
|
21654
21722
|
? Transaction.from(transactionBuffer)
|
|
21655
21723
|
: versionedTransaction;
|
|
21656
21724
|
};
|
|
21725
|
+
const isSignedTransaction = (transaction) => transaction instanceof Transaction
|
|
21726
|
+
? transaction.signatures.some(({ signature }) => signature !== null)
|
|
21727
|
+
: transaction.signatures.some((signature) => signature.some((byte) => byte !== 0));
|
|
21728
|
+
const getTransactionBlockhash = (transaction) => transaction instanceof Transaction
|
|
21729
|
+
? transaction.recentBlockhash
|
|
21730
|
+
: transaction.message.recentBlockhash;
|
|
21731
|
+
const setTransactionBlockhash = (transaction, blockhash) => {
|
|
21732
|
+
if (transaction instanceof Transaction) {
|
|
21733
|
+
transaction.recentBlockhash = blockhash;
|
|
21734
|
+
}
|
|
21735
|
+
else {
|
|
21736
|
+
transaction.message.recentBlockhash = blockhash;
|
|
21737
|
+
}
|
|
21738
|
+
};
|
|
21739
|
+
// Squid builds the transaction server-side, so its blockhash can expire before
|
|
21740
|
+
// the wallet approves it. Pre-signed transactions keep their blockhash: a new
|
|
21741
|
+
// one would invalidate their signatures.
|
|
21742
|
+
const resolveBlockhash = async (transaction, connection) => {
|
|
21743
|
+
const latestBlockhash = await connection.getLatestBlockhash();
|
|
21744
|
+
if (!isSignedTransaction(transaction)) {
|
|
21745
|
+
setTransactionBlockhash(transaction, latestBlockhash.blockhash);
|
|
21746
|
+
return latestBlockhash;
|
|
21747
|
+
}
|
|
21748
|
+
const blockhash = getTransactionBlockhash(transaction);
|
|
21749
|
+
if (!blockhash) {
|
|
21750
|
+
throw new Error("Signed transaction has no blockhash");
|
|
21751
|
+
}
|
|
21752
|
+
const { value: isValid } = await connection.isBlockhashValid(blockhash);
|
|
21753
|
+
if (!isValid) {
|
|
21754
|
+
throw new SolanaTransactionError(SOLANA_BLOCKHASH_EXPIRED_CODE, "Transaction blockhash expired; request a new route");
|
|
21755
|
+
}
|
|
21756
|
+
// The kept blockhash is older than the latest one, so the latest expiry
|
|
21757
|
+
// height is an upper bound: confirmation never gives up too early.
|
|
21758
|
+
return {
|
|
21759
|
+
blockhash,
|
|
21760
|
+
lastValidBlockHeight: latestBlockhash.lastValidBlockHeight,
|
|
21761
|
+
};
|
|
21762
|
+
};
|
|
21763
|
+
const assertConfirmed = (signature, { err }) => {
|
|
21764
|
+
if (err) {
|
|
21765
|
+
throw new SolanaTransactionError(SOLANA_ON_CHAIN_ERROR_CODE, `Solana transaction failed on chain: ${JSON.stringify(err)}`, signature);
|
|
21766
|
+
}
|
|
21767
|
+
};
|
|
21768
|
+
const SWAP_SEND_OPTIONS = {
|
|
21769
|
+
skipPreflight: false,
|
|
21770
|
+
maxRetries: 2,
|
|
21771
|
+
preflightCommitment: "confirmed",
|
|
21772
|
+
};
|
|
21773
|
+
// Wallets that submit the transaction themselves (Phantom) run their own
|
|
21774
|
+
// preflight and hide its failure behind a generic error. Sign only and submit
|
|
21775
|
+
// through our connection so RPC errors stay visible.
|
|
21776
|
+
const sendSolanaTransaction = async (signer, connection, transaction) => {
|
|
21777
|
+
if (!signer.signTransaction) {
|
|
21778
|
+
return signer.sendTransaction(transaction, connection, SWAP_SEND_OPTIONS);
|
|
21779
|
+
}
|
|
21780
|
+
const signed = await signer.signTransaction(transaction);
|
|
21781
|
+
const raw = signed.serialize();
|
|
21782
|
+
return connection.sendRawTransaction(raw, SWAP_SEND_OPTIONS);
|
|
21783
|
+
};
|
|
21657
21784
|
/**
|
|
21658
21785
|
* Execute a Solana swap transaction
|
|
21659
21786
|
* This will be used for the swap flow - Using Jupiter Dex under the hood
|
|
@@ -21666,21 +21793,15 @@ const executeSolanaSwap = async ({ route, signer, connection, onSigned, }) => {
|
|
|
21666
21793
|
const swapTransactionBuf = Buffer.from(swapRequest, "base64");
|
|
21667
21794
|
const transaction = deserializeSolanaTransaction(swapTransactionBuf);
|
|
21668
21795
|
try {
|
|
21669
|
-
const
|
|
21670
|
-
|
|
21671
|
-
// ITS legacy transactions arrive with the placeholder blockhash
|
|
21672
|
-
// 11111111111111111111111111111111.
|
|
21673
|
-
// Refresh it right before signing so the submitted transaction
|
|
21674
|
-
// uses a valid blockhash. Versioned transactions are not mutable here.
|
|
21675
|
-
transaction.recentBlockhash = latestBlockhash.blockhash;
|
|
21676
|
-
}
|
|
21677
|
-
const signature = await signer.sendTransaction(transaction, connection);
|
|
21796
|
+
const { blockhash, lastValidBlockHeight } = await resolveBlockhash(transaction, connection);
|
|
21797
|
+
const signature = await sendSolanaTransaction(signer, connection, transaction);
|
|
21678
21798
|
onSigned?.(signature);
|
|
21679
|
-
await connection.confirmTransaction({
|
|
21799
|
+
const { value } = await connection.confirmTransaction({
|
|
21680
21800
|
signature,
|
|
21681
|
-
blockhash
|
|
21682
|
-
lastValidBlockHeight
|
|
21801
|
+
blockhash,
|
|
21802
|
+
lastValidBlockHeight,
|
|
21683
21803
|
});
|
|
21804
|
+
assertConfirmed(signature, value);
|
|
21684
21805
|
return signature;
|
|
21685
21806
|
}
|
|
21686
21807
|
catch (error) {
|
|
@@ -21745,11 +21866,12 @@ const executeSolanaTransfer = async ({ amount, target, signer, connection, sourc
|
|
|
21745
21866
|
// Trigger callback for UI purposes (show loading state)
|
|
21746
21867
|
onSigned?.(signature);
|
|
21747
21868
|
// Wait for transaction confirmation
|
|
21748
|
-
await connection.confirmTransaction({
|
|
21869
|
+
const { value } = await connection.confirmTransaction({
|
|
21749
21870
|
signature,
|
|
21750
21871
|
blockhash,
|
|
21751
21872
|
lastValidBlockHeight,
|
|
21752
21873
|
});
|
|
21874
|
+
assertConfirmed(signature, value);
|
|
21753
21875
|
return signature;
|
|
21754
21876
|
};
|
|
21755
21877
|
|
|
@@ -23678,7 +23800,7 @@ const filterViewableTokens = (tokens, config, direction) => {
|
|
|
23678
23800
|
};
|
|
23679
23801
|
const getSecretNetworkBalances = async (chainData, cosmosAddress, squidTokens, keplrTypeWallet) => {
|
|
23680
23802
|
const squidSecretTokens = squidTokens.filter((t) => t.chainId === CHAIN_IDS.SECRET);
|
|
23681
|
-
const { fetchAllSecretBalances } = await import('./secretService-
|
|
23803
|
+
const { fetchAllSecretBalances } = await import('./secretService-BBTgxmnG.js');
|
|
23682
23804
|
return fetchAllSecretBalances(chainData, cosmosAddress, squidSecretTokens, keplrTypeWallet);
|
|
23683
23805
|
};
|
|
23684
23806
|
function getTokenAssetsKey(token) {
|
|
@@ -23829,8 +23951,9 @@ async function addEthereumChain({ chain, provider, }) {
|
|
|
23829
23951
|
console.debug("Error adding chain:", error);
|
|
23830
23952
|
}
|
|
23831
23953
|
}
|
|
23954
|
+
const isEvmAddressValid = (address) => !!address && isAddress(address);
|
|
23832
23955
|
const parseEvmAddress = (address) => {
|
|
23833
|
-
if (
|
|
23956
|
+
if (isEvmAddressValid(address)) {
|
|
23834
23957
|
return address;
|
|
23835
23958
|
}
|
|
23836
23959
|
};
|
|
@@ -28079,7 +28202,7 @@ function useSolana() {
|
|
|
28079
28202
|
};
|
|
28080
28203
|
}
|
|
28081
28204
|
const useSolanaConnection = () => {
|
|
28082
|
-
const connectionRef = useRef(new Connection(SOLANA_RPC_URL));
|
|
28205
|
+
const connectionRef = useRef(new Connection(SOLANA_RPC_URL, "confirmed"));
|
|
28083
28206
|
return connectionRef.current;
|
|
28084
28207
|
};
|
|
28085
28208
|
|
|
@@ -28105,7 +28228,7 @@ function useStellarWallets() {
|
|
|
28105
28228
|
try {
|
|
28106
28229
|
const { allowAllModules: initializeAllModules } = await import('@creit.tech/stellar-wallets-kit');
|
|
28107
28230
|
const { LedgerModule } = await import('@creit.tech/stellar-wallets-kit/modules/ledger.module.mjs');
|
|
28108
|
-
const { formatStellarWallet } = await import('./stellarService.client-
|
|
28231
|
+
const { formatStellarWallet } = await import('./stellarService.client-DlQku8Rs.js');
|
|
28109
28232
|
const modules = [...initializeAllModules(), new LedgerModule()];
|
|
28110
28233
|
const promises = modules.map(async (module) => {
|
|
28111
28234
|
const isAvailable = await module.isAvailable();
|
|
@@ -30819,18 +30942,24 @@ const DEFAULT_REFRESH_INTERVAL_MS$1 = 15000;
|
|
|
30819
30942
|
const useEvmBalance = ({ chain, token, userAddress, enabled = true, refreshIntervalMs = DEFAULT_REFRESH_INTERVAL_MS$1, }) => {
|
|
30820
30943
|
const { isChainTypeConnected } = useWallet();
|
|
30821
30944
|
const isNativeToken = token?.address.toLowerCase() === nativeEvmTokenAddress.toLowerCase();
|
|
30822
|
-
const
|
|
30945
|
+
const evmAddress = parseEvmAddress(userAddress);
|
|
30946
|
+
const tokenAddress = parseEvmAddress(token?.address);
|
|
30947
|
+
const isEvmChain = chain?.chainType === ChainType.EVM;
|
|
30948
|
+
const chainId = isEvmChain ? Number(chain.chainId) : undefined;
|
|
30949
|
+
const isEvmConnected = isChainTypeConnected(ChainType.EVM);
|
|
30950
|
+
const isNativeQueryEnabled = enabled && isEvmChain && isEvmConnected && !!evmAddress && isNativeToken;
|
|
30951
|
+
const isErc20QueryEnabled = enabled &&
|
|
30952
|
+
isEvmChain &&
|
|
30953
|
+
isEvmConnected &&
|
|
30954
|
+
!!evmAddress &&
|
|
30955
|
+
!!tokenAddress &&
|
|
30956
|
+
!isNativeToken;
|
|
30823
30957
|
// Only fetch using useBalance if it's a native token
|
|
30824
30958
|
const { data: nativeBalance, isLoading: isNativeTokenLoading } = useBalance({
|
|
30825
|
-
address:
|
|
30826
|
-
chainId
|
|
30959
|
+
address: evmAddress,
|
|
30960
|
+
chainId,
|
|
30827
30961
|
query: {
|
|
30828
|
-
enabled:
|
|
30829
|
-
!!userAddress &&
|
|
30830
|
-
isNativeToken &&
|
|
30831
|
-
!!chain &&
|
|
30832
|
-
chain.chainType === ChainType.EVM &&
|
|
30833
|
-
isChainTypeConnected(chain.chainType),
|
|
30962
|
+
enabled: isNativeQueryEnabled,
|
|
30834
30963
|
refetchInterval: refreshIntervalMs,
|
|
30835
30964
|
retry: 2,
|
|
30836
30965
|
},
|
|
@@ -30838,23 +30967,20 @@ const useEvmBalance = ({ chain, token, userAddress, enabled = true, refreshInter
|
|
|
30838
30967
|
// Only fetch using useReadContract if it's not a native token
|
|
30839
30968
|
// This is temporary, because of wagmi error: https://github.com/wevm/wagmi/issues/4353
|
|
30840
30969
|
const { data: erc20Balance, isLoading: isErc20Loading } = useReadContract({
|
|
30841
|
-
address:
|
|
30970
|
+
address: tokenAddress,
|
|
30842
30971
|
abi: erc20Abi,
|
|
30843
30972
|
functionName: "balanceOf",
|
|
30844
|
-
args: [
|
|
30845
|
-
chainId
|
|
30973
|
+
args: evmAddress ? [evmAddress] : undefined,
|
|
30974
|
+
chainId,
|
|
30846
30975
|
query: {
|
|
30847
|
-
enabled:
|
|
30848
|
-
enabled &&
|
|
30849
|
-
!!userAddress &&
|
|
30850
|
-
!isNativeToken,
|
|
30976
|
+
enabled: isErc20QueryEnabled,
|
|
30851
30977
|
refetchInterval: refreshIntervalMs,
|
|
30852
30978
|
retry: 2,
|
|
30853
30979
|
},
|
|
30854
30980
|
});
|
|
30855
30981
|
if (isNativeToken) {
|
|
30856
30982
|
return {
|
|
30857
|
-
isLoading: isNativeTokenLoading,
|
|
30983
|
+
isLoading: isNativeQueryEnabled && isNativeTokenLoading,
|
|
30858
30984
|
balance: nativeBalance
|
|
30859
30985
|
? formatBNToReadable(nativeBalance.value, nativeBalance.decimals)
|
|
30860
30986
|
: "0",
|
|
@@ -30864,11 +30990,16 @@ const useEvmBalance = ({ chain, token, userAddress, enabled = true, refreshInter
|
|
|
30864
30990
|
balance: erc20Balance && token
|
|
30865
30991
|
? formatBNToReadable(erc20Balance, token.decimals)
|
|
30866
30992
|
: "0",
|
|
30867
|
-
isLoading: isErc20Loading,
|
|
30993
|
+
isLoading: isErc20QueryEnabled && isErc20Loading,
|
|
30868
30994
|
};
|
|
30869
30995
|
};
|
|
30870
30996
|
const useCosmosBalance = ({ chain, token, userAddress, enabled = true, refreshIntervalMs = DEFAULT_REFRESH_INTERVAL_MS$1, }) => {
|
|
30871
30997
|
const { isConnected } = useCosmosContext();
|
|
30998
|
+
const isQueryEnabled = !!isConnected &&
|
|
30999
|
+
enabled &&
|
|
31000
|
+
!!token &&
|
|
31001
|
+
chain?.chainType === ChainType.COSMOS &&
|
|
31002
|
+
isWalletAddressValid(chain, userAddress);
|
|
30872
31003
|
const { data: balance = "0", isLoading } = useQuery({
|
|
30873
31004
|
queryKey: keys().balance(chain?.chainId, token?.address, userAddress),
|
|
30874
31005
|
queryFn: async () => {
|
|
@@ -30881,17 +31012,17 @@ const useCosmosBalance = ({ chain, token, userAddress, enabled = true, refreshIn
|
|
|
30881
31012
|
const balanceBn = await getCosmosTokenBalance(chain, userAddress, token.address);
|
|
30882
31013
|
return formatBNToReadable(balanceBn, token.decimals);
|
|
30883
31014
|
},
|
|
30884
|
-
enabled:
|
|
30885
|
-
enabled &&
|
|
30886
|
-
!!userAddress &&
|
|
30887
|
-
!!token &&
|
|
30888
|
-
chain?.chainType === ChainType.COSMOS,
|
|
31015
|
+
enabled: isQueryEnabled,
|
|
30889
31016
|
refetchInterval: refreshIntervalMs,
|
|
30890
31017
|
retry: 2,
|
|
30891
31018
|
});
|
|
30892
|
-
return { balance, isLoading };
|
|
31019
|
+
return { balance, isLoading: isQueryEnabled && isLoading };
|
|
30893
31020
|
};
|
|
30894
31021
|
const useSolanaBalance = ({ chain, token, userAddress, enabled = true, refreshIntervalMs = DEFAULT_REFRESH_INTERVAL_MS$1, }) => {
|
|
31022
|
+
const isQueryEnabled = enabled &&
|
|
31023
|
+
!!token &&
|
|
31024
|
+
chain?.chainType === ChainType.SOLANA &&
|
|
31025
|
+
isWalletAddressValid(chain, userAddress);
|
|
30895
31026
|
const { data: balance = "0", isLoading } = useQuery({
|
|
30896
31027
|
queryKey: keys().balance(chain?.chainId, token?.address, userAddress),
|
|
30897
31028
|
queryFn: async () => {
|
|
@@ -30900,14 +31031,11 @@ const useSolanaBalance = ({ chain, token, userAddress, enabled = true, refreshIn
|
|
|
30900
31031
|
const balanceBn = await getSolanaTokenBalance(userAddress, token.address);
|
|
30901
31032
|
return formatBNToReadable(balanceBn, token.decimals);
|
|
30902
31033
|
},
|
|
30903
|
-
enabled:
|
|
30904
|
-
!!userAddress &&
|
|
30905
|
-
!!token &&
|
|
30906
|
-
chain?.chainType === ChainType.SOLANA,
|
|
31034
|
+
enabled: isQueryEnabled,
|
|
30907
31035
|
refetchInterval: refreshIntervalMs,
|
|
30908
31036
|
retry: 2,
|
|
30909
31037
|
});
|
|
30910
|
-
return { balance, isLoading };
|
|
31038
|
+
return { balance, isLoading: isQueryEnabled && isLoading };
|
|
30911
31039
|
};
|
|
30912
31040
|
// TODO: implement fetching balances for all bitcoin tokens
|
|
30913
31041
|
const useBitcoinBalance = ({ userAddress, chain, }) => {
|
|
@@ -31040,11 +31168,14 @@ function useNativeTokenForChain(chain) {
|
|
|
31040
31168
|
|
|
31041
31169
|
const useEvmNativeBalance = ({ address, chain, }) => {
|
|
31042
31170
|
const { isChainTypeConnected } = useWallet();
|
|
31171
|
+
const isEvmChain = chain?.chainType === ChainType.EVM;
|
|
31172
|
+
const evmAddress = parseEvmAddress(address);
|
|
31173
|
+
const isQueryEnabled = isEvmChain && !!evmAddress && isChainTypeConnected(ChainType.EVM);
|
|
31043
31174
|
const { data: nativeEvmBalance, isLoading } = useBalance({
|
|
31044
|
-
address:
|
|
31045
|
-
chainId: Number(chain
|
|
31175
|
+
address: evmAddress,
|
|
31176
|
+
chainId: isEvmChain ? Number(chain.chainId) : undefined,
|
|
31046
31177
|
query: {
|
|
31047
|
-
enabled:
|
|
31178
|
+
enabled: isQueryEnabled,
|
|
31048
31179
|
refetchInterval: 10000,
|
|
31049
31180
|
staleTime: 5000,
|
|
31050
31181
|
refetchOnWindowFocus: true,
|
|
@@ -31068,7 +31199,7 @@ const useEvmNativeBalance = ({ address, chain, }) => {
|
|
|
31068
31199
|
}, [nativeEvmBalance?.decimals, nativeEvmBalance?.value, chain?.chainId]);
|
|
31069
31200
|
return {
|
|
31070
31201
|
balance,
|
|
31071
|
-
isLoading,
|
|
31202
|
+
isLoading: isQueryEnabled && isLoading,
|
|
31072
31203
|
};
|
|
31073
31204
|
};
|
|
31074
31205
|
const useCosmosNativeBalance = ({ address, chain, }) => {
|
|
@@ -31122,13 +31253,14 @@ const useBitcoinNativeBalance = ({ chain, address, }) => {
|
|
|
31122
31253
|
};
|
|
31123
31254
|
const useSolanaNativeBalance = ({ chain, address, }) => {
|
|
31124
31255
|
const { nativeToken } = useNativeTokenForChain(chain);
|
|
31256
|
+
const isQueryEnabled = nativeToken?.decimals != null &&
|
|
31257
|
+
chain?.chainType === ChainType.SOLANA &&
|
|
31258
|
+
isWalletAddressValid(chain, address);
|
|
31125
31259
|
const { data: rawBalance, isLoading } = useQuery(keys().balance(chain?.chainId, nativeToken?.address, address), async () => {
|
|
31126
31260
|
const balance = await getSolanaNativeBalance(address);
|
|
31127
31261
|
return formatBNToReadable(balance, nativeToken.decimals);
|
|
31128
31262
|
}, {
|
|
31129
|
-
enabled:
|
|
31130
|
-
nativeToken?.decimals != null &&
|
|
31131
|
-
chain?.chainType === ChainType.SOLANA,
|
|
31263
|
+
enabled: isQueryEnabled,
|
|
31132
31264
|
refetchInterval: 40000,
|
|
31133
31265
|
staleTime: 20000,
|
|
31134
31266
|
refetchOnWindowFocus: true,
|
|
@@ -31144,7 +31276,7 @@ const useSolanaNativeBalance = ({ chain, address, }) => {
|
|
|
31144
31276
|
}, [nativeToken?.decimals, rawBalance]);
|
|
31145
31277
|
return {
|
|
31146
31278
|
balance,
|
|
31147
|
-
isLoading,
|
|
31279
|
+
isLoading: isQueryEnabled && isLoading,
|
|
31148
31280
|
};
|
|
31149
31281
|
};
|
|
31150
31282
|
const useSuiNativeBalance = ({ address, chain, }) => {
|
|
@@ -31552,7 +31684,7 @@ function hederaWalletConnect(parameters) {
|
|
|
31552
31684
|
const optionalChains = config.chains.map((x) => x.id);
|
|
31553
31685
|
if (!optionalChains.length)
|
|
31554
31686
|
return;
|
|
31555
|
-
const { EthereumProvider } = await import('./index.es-
|
|
31687
|
+
const { EthereumProvider } = await import('./index.es-CeXN3P4q.js');
|
|
31556
31688
|
const rawProvider = await EthereumProvider.init({
|
|
31557
31689
|
...restParameters,
|
|
31558
31690
|
disableProviderPing: true,
|
|
@@ -31896,7 +32028,10 @@ function useHederaTokenAssociations({ address, chain, token }) {
|
|
|
31896
32028
|
token,
|
|
31897
32029
|
});
|
|
31898
32030
|
},
|
|
31899
|
-
enabled:
|
|
32031
|
+
enabled: isEvmAddressValid(address) &&
|
|
32032
|
+
!!publicClient &&
|
|
32033
|
+
chain?.chainId === CHAIN_IDS.HEDERA &&
|
|
32034
|
+
token?.chainId === CHAIN_IDS.HEDERA,
|
|
31900
32035
|
});
|
|
31901
32036
|
return {
|
|
31902
32037
|
isTokenAssociated,
|
|
@@ -32009,7 +32144,9 @@ function useStellarAccountActivation({ address, chain, token, }) {
|
|
|
32009
32144
|
reserveBaseBn: accountReserveBase,
|
|
32010
32145
|
};
|
|
32011
32146
|
},
|
|
32012
|
-
enabled: !!address &&
|
|
32147
|
+
enabled: !!address &&
|
|
32148
|
+
chain?.chainType === ChainType.STELLAR &&
|
|
32149
|
+
isStellarAddressValid(address),
|
|
32013
32150
|
refetchInterval: DEFAULT_REFETCH_INTERVAL$2,
|
|
32014
32151
|
refetchOnWindowFocus: true,
|
|
32015
32152
|
});
|
|
@@ -39103,7 +39240,9 @@ function useXrplTrustLine({ address, chain, token, amount }) {
|
|
|
39103
39240
|
const xrplClient = await getClient(chain);
|
|
39104
39241
|
return xrplClient.accountActivatedInfo(address);
|
|
39105
39242
|
},
|
|
39106
|
-
enabled: !!address &&
|
|
39243
|
+
enabled: !!address &&
|
|
39244
|
+
chain?.chainType === ChainType.XRPL &&
|
|
39245
|
+
isXrplAddressValid(address),
|
|
39107
39246
|
refetchInterval: DEFAULT_REFETCH_INTERVAL,
|
|
39108
39247
|
refetchOnWindowFocus: true,
|
|
39109
39248
|
});
|
|
@@ -39244,5 +39383,5 @@ const SquidProvider = ({ children, config, placeholder, }) => {
|
|
|
39244
39383
|
React.createElement(CosmosProvider, null, children))))))))))) : (placeholder);
|
|
39245
39384
|
};
|
|
39246
39385
|
|
|
39247
|
-
export { useWalletStore as $, AxelarStatusResponseType as A, useHederaAccountActivation as B, CHAIN_IDS as C, DEFAULT_LOCALE as D, useHederaTokenAssociations as E, useKeyboardNavigation as F, useSquidQueryClient as G, HistoryTxType as H, useSquid as I, useStellarAccountActivation as J, useStellarTrustLine as K, useAddressBookStore as L, useAssetsColorsStore as M, Nr as N, useFavoriteTokensStore as O, useHistoryStore as P, QueryKeys as Q, useSendTransactionStore as R, SquidStatusErrorType as S, TransactionErrorType as T, useConfigStore as U, useSquidStore as V, Wo as W, XamanXrplNetwork as X, useSwapRoutePersistStore as Y, useTransactionStore as Z, ConnectingWalletStatus as _, WindowWalletFlag as a, useAvailableQuotes as a$, useDepositAddress as a0, useSwap as a1, buildUrlSearchParamsFromSwapEvent as a2, parseInitialAssetsFromUrl as a3, useUrlSwapParams as a4, useAllConnectedWalletBalances as a5, useAllTokensWithBalanceForChainType as a6, useCosmosBalance as a7, useEvmBalance as a8, useMultiChainBalance as a9, useRouteWarnings as aA, useSendTransactionStatus as aB, useSwapTransactionStatus as aC, useAvatar as aD, useHistory as aE, useDebouncedValue as aF, useAddToken as aG, useAutoConnect as aH, useEnsDataForAddress as aI, useEnsSearch as aJ, useGnosisContext as aK, useIsSameAddressAndGnosisContext as aL, useIntegratorContext as aM, useMultiChainWallet as aN, useSigner as aO, useWallet as aP, useWallets as aQ, useXrplTrustLine as aR, TX_STATUS_CONSTANTS as aS, FINAL_TRANSACTION_STATUSES as aT, useGetFiatQuote as aU, useGetOnRampConfig as aV, useExecuteFiatQuote as aW, useFiatOnRampTxStatus as aX, useFiatTransactions as aY, useCurrencyDetails as aZ, useCountryDetails as a_, useMultipleTokenPrices as aa, useBitcoinNativeBalance as ab, useCosmosNativeBalance as ac, useEvmNativeBalance as ad, useNativeBalance as ae, useSolanaNativeBalance as af, useStellarNativeBalance as ag, useSuiNativeBalance as ah, useXrplNativeBalance as ai, useNativeTokenForChain as aj, useSingleTokenPrice as ak, useSourceChainGasToken as al, useSquidTokens as am, useHistoricalData as an, useTokensData as ao, useEstimateSendTransaction as ap, useSendTransaction as aq, useSendTransactionGas as ar, useAllTransactionsStatus as as, useApproval as at, useDepositTransactionStatus as au, useEstimate as av, useEstimatePriceImpact as aw, useExecuteTransaction as ax, useGetRoute as ay, useGetRouteWrapper as az, DEFAULT_ROUTE_REFETCH_INTERVAL as b, addEthereumChain as b$, useRecommendedQuote as b0, useGetOnrampPaymentTypes as b1, useSuggestedFiatAmounts as b2, SquidProvider as b3, EnsService as b4, getXummClient as b5, isXamanXAppContext as b6, getQueryHeaders as b7, getStatusCode as b8, is404Error as b9, randomIntFromInterval as bA, getTokensForChain as bB, getFirstAvailableChainId as bC, fetchHighestBalanceToken as bD, getInitialOrDefaultTokenAddressForChain as bE, getInitialTokenAddressForChain as bF, filterTokensForDestination as bG, getInitialChainIdFromConfig as bH, getCosmosKey as bI, getKeysSettled as bJ, getAllKeysForSupportedCosmosChains as bK, isCosmosAddressValid as bL, getCosmosSigningClient as bM, getCosmosChainInfosObject as bN, connectCosmosWallet as bO, isFallbackAddressNeeded as bP, suggestChainOrThrow as bQ, normalizeError as bR, transactionErrorCode as bS, isUserRejectionError as bT, getTransactionError as bU, handleTransactionErrorEvents as bV, isSwapRouteError as bW, isStatusError as bX, createQuoteRequestParamsHash as bY, WidgetEvents as bZ, EvmNetworkNotSupportedErrorCode as b_, assetsBaseUrl as ba, shareSubgraphId as bb, sortTokensBySharedSubgraphIds as bc, getSupportedChainIdsForDirection as bd, filterChains as be, filterTokens as bf, getTokenImage as bg, getNewSwapParamsFromInput as bh, sortAllTokens as bi, findToken as bj, findNativeToken as bk, normalizeIbcAddress as bl, groupTokensBySymbol as bm, groupTokensByChainId as bn, filterViewableTokens as bo, getSecretNetworkBalances as bp, getTokenAssetsKey as bq, fetchAssetsColors as br, isSupportedChainType as bs, initializeSquidData as bt, isEmptyObject as bu, normalizeTokenSymbol as bv, areTokenSymbolsCompatible as bw, isEvmosChain as bx, resolveChainIdFromAsset as by, getConfigWithDefaults as bz, chainTypeToNativeTokenAddressMap as c,
|
|
39248
|
-
//# sourceMappingURL=index-
|
|
39386
|
+
export { useWalletStore as $, AxelarStatusResponseType as A, useHederaAccountActivation as B, CHAIN_IDS as C, DEFAULT_LOCALE as D, useHederaTokenAssociations as E, useKeyboardNavigation as F, useSquidQueryClient as G, HistoryTxType as H, useSquid as I, useStellarAccountActivation as J, useStellarTrustLine as K, useAddressBookStore as L, useAssetsColorsStore as M, Nr as N, useFavoriteTokensStore as O, useHistoryStore as P, QueryKeys as Q, useSendTransactionStore as R, SquidStatusErrorType as S, TransactionErrorType as T, useConfigStore as U, useSquidStore as V, Wo as W, XamanXrplNetwork as X, useSwapRoutePersistStore as Y, useTransactionStore as Z, ConnectingWalletStatus as _, WindowWalletFlag as a, useAvailableQuotes as a$, useDepositAddress as a0, useSwap as a1, buildUrlSearchParamsFromSwapEvent as a2, parseInitialAssetsFromUrl as a3, useUrlSwapParams as a4, useAllConnectedWalletBalances as a5, useAllTokensWithBalanceForChainType as a6, useCosmosBalance as a7, useEvmBalance as a8, useMultiChainBalance as a9, useRouteWarnings as aA, useSendTransactionStatus as aB, useSwapTransactionStatus as aC, useAvatar as aD, useHistory as aE, useDebouncedValue as aF, useAddToken as aG, useAutoConnect as aH, useEnsDataForAddress as aI, useEnsSearch as aJ, useGnosisContext as aK, useIsSameAddressAndGnosisContext as aL, useIntegratorContext as aM, useMultiChainWallet as aN, useSigner as aO, useWallet as aP, useWallets as aQ, useXrplTrustLine as aR, TX_STATUS_CONSTANTS as aS, FINAL_TRANSACTION_STATUSES as aT, useGetFiatQuote as aU, useGetOnRampConfig as aV, useExecuteFiatQuote as aW, useFiatOnRampTxStatus as aX, useFiatTransactions as aY, useCurrencyDetails as aZ, useCountryDetails as a_, useMultipleTokenPrices as aa, useBitcoinNativeBalance as ab, useCosmosNativeBalance as ac, useEvmNativeBalance as ad, useNativeBalance as ae, useSolanaNativeBalance as af, useStellarNativeBalance as ag, useSuiNativeBalance as ah, useXrplNativeBalance as ai, useNativeTokenForChain as aj, useSingleTokenPrice as ak, useSourceChainGasToken as al, useSquidTokens as am, useHistoricalData as an, useTokensData as ao, useEstimateSendTransaction as ap, useSendTransaction as aq, useSendTransactionGas as ar, useAllTransactionsStatus as as, useApproval as at, useDepositTransactionStatus as au, useEstimate as av, useEstimatePriceImpact as aw, useExecuteTransaction as ax, useGetRoute as ay, useGetRouteWrapper as az, DEFAULT_ROUTE_REFETCH_INTERVAL as b, addEthereumChain as b$, useRecommendedQuote as b0, useGetOnrampPaymentTypes as b1, useSuggestedFiatAmounts as b2, SquidProvider as b3, EnsService as b4, getXummClient as b5, isXamanXAppContext as b6, getQueryHeaders as b7, getStatusCode as b8, is404Error as b9, randomIntFromInterval as bA, getTokensForChain as bB, getFirstAvailableChainId as bC, fetchHighestBalanceToken as bD, getInitialOrDefaultTokenAddressForChain as bE, getInitialTokenAddressForChain as bF, filterTokensForDestination as bG, getInitialChainIdFromConfig as bH, getCosmosKey as bI, getKeysSettled as bJ, getAllKeysForSupportedCosmosChains as bK, isCosmosAddressValid as bL, getCosmosSigningClient as bM, getCosmosChainInfosObject as bN, connectCosmosWallet as bO, isFallbackAddressNeeded as bP, suggestChainOrThrow as bQ, normalizeError as bR, transactionErrorCode as bS, isUserRejectionError as bT, getTransactionError as bU, handleTransactionErrorEvents as bV, isSwapRouteError as bW, isStatusError as bX, createQuoteRequestParamsHash as bY, WidgetEvents as bZ, EvmNetworkNotSupportedErrorCode as b_, assetsBaseUrl as ba, shareSubgraphId as bb, sortTokensBySharedSubgraphIds as bc, getSupportedChainIdsForDirection as bd, filterChains as be, filterTokens as bf, getTokenImage as bg, getNewSwapParamsFromInput as bh, sortAllTokens as bi, findToken as bj, findNativeToken as bk, normalizeIbcAddress as bl, groupTokensBySymbol as bm, groupTokensByChainId as bn, filterViewableTokens as bo, getSecretNetworkBalances as bp, getTokenAssetsKey as bq, fetchAssetsColors as br, isSupportedChainType as bs, initializeSquidData as bt, isEmptyObject as bu, normalizeTokenSymbol as bv, areTokenSymbolsCompatible as bw, isEvmosChain as bx, resolveChainIdFromAsset as by, getConfigWithDefaults as bz, chainTypeToNativeTokenAddressMap as c, getSendTxStatusRefetchInterval as c$, isEvmAddressValid as c0, parseEvmAddress as c1, formatEvmWallet as c2, filterWagmiConnector as c3, waitForReceiptWithRetry as c4, getUserCountry as c5, getCountryData as c6, getCurrencyData as c7, adaptiveRound as c8, getSuggestedAmountsForCurrency as c9, isStellarToken as cA, isStellarIssuedToken as cB, getStellarHorizonApiUrl as cC, isValidIssuedAsset as cD, isValidHorizonAsset as cE, formatTransactionHistoryDate as cF, getAxelarExplorerTxUrl as cG, getSourceExplorerTxUrl as cH, getMainExplorerUrl as cI, formatDistance as cJ, formatSeconds as cK, formatSwapTxStatusResponseForStorage as cL, simplifyRouteAction as cM, fetchSwapTransactionStatus as cN, compareTransactionIds as cO, isCoralBridgeAction as cP, isActionCompletedOnSourceTx as cQ, sleep as cR, isChainflipDepositRoute as cS, isChainflipBridgeTransaction as cT, isOnChainTxData as cU, isDepositAddressDirectTransferRoute as cV, getHistoryTransactionId as cW, getStepStatuses as cX, getHalfSuccessState as cY, getStepsInfos as cZ, getSwapTxStatusRefetchInterval as c_, HederaExtensionHelper as ca, convertHederaAccountIdToEvmAddress as cb, convertEvmAddressToHederaAccountId as cc, scaleHbarToWei as cd, scaleWeiToHbar as ce, parseToBigInt as cf, roundNumericValue as cg, formatUnitsRounded as ch, formatTokenAmount as ci, formatUsdAmount as cj, trimExtraDecimals as ck, getNumericValue as cl, cleanAmount as cm, convertTokenAmountToUSD as cn, convertUSDToTokenAmount as co, calculateTotal24hChange as cp, getRouteExpiry as cq, searchTokens as cr, filterSolanaWallets as cs, isSolanaAddressValid as ct, executeSolanaSwap as cu, executeSolanaTransfer as cv, isStellarAddressValid as cw, getStellarNetwork as cx, stellarAddressToScVal as cy, getStellarTrustLineAsset as cz, definedInWindow as d, chainflipMultihopBridgeType as d0, getBridgeType as d1, getTransactionStatus as d2, getTransactionEndStatus as d3, isHistoryTransactionPending as d4, isHistoryTransactionFailed as d5, isHistoryTransactionWarning as d6, isHistoryTransactionEnded as d7, formatHash as d8, isWalletAddressValid as d9, redirectToExtensionsStore as da, populateWallets as db, buildFallbackWallets as dc, getDefaultChain as dd, sortWallets as de, areSameAddress as df, sortAddressBook as dg, calculateTotalUsdBalanceUSD as dh, addTokenToWallet as di, isEvmChainNotSupportedError as dj, getWalletSupportedChainTypes as dk, getConnectorForChainType as dl, walletSupportsChainType as dm, connectWallet as dn, cancelConnectWallet as dp, isProblematicConnector as dq, mergeWallets as dr, isXionSmartContractAddress as ds, isXrplAddressValid as dt, buildXrplTrustSetTx as du, getXrplNetwork as dv, parseXrplPaymentTx as dw, parseXrplTokenAddress as dx, er as e, formatBNToReadable as f, chainTypeToZeroAddressMap as g, destinationAddressResetValue as h, fallbackAddressResetValue as i, nativeCantonTokenAddress as j, nativeCosmosTokenAddress as k, nativeEvmTokenAddress as l, nativeSolanaTokenAddress as m, nativeBitcoinTokenAddress as n, nativeStellarTokenAddress as o, nativeSuiTokenAddress as p, nativeXrplTokenAddress as q, CosmosProvider as r, SendTransactionStatus as s, TransactionStatus as t, useCosmosContext as u, useTrackSearchEmpty as v, walletIconBaseUrl as w, useSquidChains as x, useClient as y, useCosmosForChain as z };
|
|
39387
|
+
//# sourceMappingURL=index-DkBrtnan.js.map
|