@0xsquid/react-hooks 8.13.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-8RIq6GyB.js → index-BjIX7utV.js} +246 -89
- package/dist/index-BjIX7utV.js.map +1 -0
- package/dist/{index-BVneqIL5.js → index-DkBrtnan.js} +246 -90
- package/dist/index-DkBrtnan.js.map +1 -0
- package/dist/{index.es-CnV3EYrQ.js → index.es-BQULJYpe.js} +2 -2
- package/dist/{index.es-CnV3EYrQ.js.map → index.es-BQULJYpe.js.map} +1 -1
- package/dist/{index.es-Bm5GQH70.js → index.es-CeXN3P4q.js} +2 -2
- package/dist/{index.es-Bm5GQH70.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-D8ySaXvX.js → secretService-BBTgxmnG.js} +2 -2
- package/dist/{secretService-D8ySaXvX.js.map → secretService-BBTgxmnG.js.map} +1 -1
- package/dist/{secretService-C6GiPeC8.js → secretService-BebOsCud.js} +2 -2
- package/dist/{secretService-C6GiPeC8.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-DkBWS3eX.js → stellarService.client-B6_2UV4u.js} +2 -2
- package/dist/{stellarService.client-DkBWS3eX.js.map → stellarService.client-B6_2UV4u.js.map} +1 -1
- package/dist/{stellarService.client-IiUZ6NO6.js → stellarService.client-DlQku8Rs.js} +2 -2
- package/dist/{stellarService.client-IiUZ6NO6.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 +5 -3
- package/dist/index-8RIq6GyB.js.map +0 -1
- package/dist/index-BVneqIL5.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) {
|
|
@@ -1610,7 +1623,7 @@ var _setCacheAdd = setCacheAdd$1;
|
|
|
1610
1623
|
* @name has
|
|
1611
1624
|
* @memberOf SetCache
|
|
1612
1625
|
* @param {*} value The value to search for.
|
|
1613
|
-
* @returns {
|
|
1626
|
+
* @returns {boolean} Returns `true` if `value` is found, else `false`.
|
|
1614
1627
|
*/
|
|
1615
1628
|
|
|
1616
1629
|
function setCacheHas$1(value) {
|
|
@@ -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;
|
|
@@ -10330,16 +10400,16 @@ bn.exports;
|
|
|
10330
10400
|
var w = this.words[i];
|
|
10331
10401
|
var word = (((w << off) | carry) & 0xffffff).toString(16);
|
|
10332
10402
|
carry = (w >>> (24 - off)) & 0xffffff;
|
|
10333
|
-
if (carry !== 0 || i !== this.length - 1) {
|
|
10334
|
-
out = zeros[6 - word.length] + word + out;
|
|
10335
|
-
} else {
|
|
10336
|
-
out = word + out;
|
|
10337
|
-
}
|
|
10338
10403
|
off += 2;
|
|
10339
10404
|
if (off >= 26) {
|
|
10340
10405
|
off -= 26;
|
|
10341
10406
|
i--;
|
|
10342
10407
|
}
|
|
10408
|
+
if (carry !== 0 || i !== this.length - 1) {
|
|
10409
|
+
out = zeros[6 - word.length] + word + out;
|
|
10410
|
+
} else {
|
|
10411
|
+
out = word + out;
|
|
10412
|
+
}
|
|
10343
10413
|
}
|
|
10344
10414
|
if (carry !== 0) {
|
|
10345
10415
|
out = carry.toString(16) + out;
|
|
@@ -10706,6 +10776,12 @@ bn.exports;
|
|
|
10706
10776
|
// Handle the residue
|
|
10707
10777
|
if (bitsLeft > 0) {
|
|
10708
10778
|
this.words[i] = ~this.words[i] & (0x3ffffff >> (26 - bitsLeft));
|
|
10779
|
+
i++;
|
|
10780
|
+
}
|
|
10781
|
+
|
|
10782
|
+
// Clear words above the requested width so the result stays below 2 ** width
|
|
10783
|
+
for (; i < this.length; i++) {
|
|
10784
|
+
this.words[i] = 0;
|
|
10709
10785
|
}
|
|
10710
10786
|
|
|
10711
10787
|
// And remove leading zeroes
|
|
@@ -11799,6 +11875,10 @@ bn.exports;
|
|
|
11799
11875
|
this.words[i] = carry;
|
|
11800
11876
|
this.length++;
|
|
11801
11877
|
}
|
|
11878
|
+
if (num === 0) {
|
|
11879
|
+
this.length = 1;
|
|
11880
|
+
this._normSign();
|
|
11881
|
+
}
|
|
11802
11882
|
|
|
11803
11883
|
return this;
|
|
11804
11884
|
};
|
|
@@ -12004,6 +12084,11 @@ bn.exports;
|
|
|
12004
12084
|
this.words[this.length - 1] &= mask;
|
|
12005
12085
|
}
|
|
12006
12086
|
|
|
12087
|
+
if (this.length === 0) {
|
|
12088
|
+
this.words[0] = 0;
|
|
12089
|
+
this.length = 1;
|
|
12090
|
+
}
|
|
12091
|
+
|
|
12007
12092
|
return this.strip();
|
|
12008
12093
|
};
|
|
12009
12094
|
|
|
@@ -12330,17 +12415,19 @@ bn.exports;
|
|
|
12330
12415
|
// Fast case - exact division
|
|
12331
12416
|
if (dm.mod.isZero()) return dm.div;
|
|
12332
12417
|
|
|
12333
|
-
var mod = dm.
|
|
12418
|
+
var mod = dm.mod.abs();
|
|
12334
12419
|
|
|
12335
|
-
var half = num.
|
|
12336
|
-
var r2 = num.
|
|
12420
|
+
var half = num.abs().iushrn(1);
|
|
12421
|
+
var r2 = num.words[0] & 1;
|
|
12337
12422
|
var cmp = mod.cmp(half);
|
|
12338
12423
|
|
|
12339
12424
|
// Round down
|
|
12340
12425
|
if (cmp < 0 || r2 === 1 && cmp === 0) return dm.div;
|
|
12341
12426
|
|
|
12342
|
-
// Round up
|
|
12343
|
-
|
|
12427
|
+
// Round up, away from zero
|
|
12428
|
+
var up = new BN(1);
|
|
12429
|
+
up.negative = this.negative ^ num.negative;
|
|
12430
|
+
return dm.div.iadd(up);
|
|
12344
12431
|
};
|
|
12345
12432
|
|
|
12346
12433
|
BN.prototype.modn = function modn (num) {
|
|
@@ -21629,14 +21716,71 @@ const isSolanaAddressValid = (address) => {
|
|
|
21629
21716
|
};
|
|
21630
21717
|
const deserializeSolanaTransaction = (transactionBuffer) => {
|
|
21631
21718
|
// Squid can return legacy Solana transactions (ITS) or versioned transactions
|
|
21632
|
-
// (Jupiter/Chainflip). Deserialize once to detect the payload type.
|
|
21633
|
-
// transactions need to be converted to Transaction because their blockhash is
|
|
21634
|
-
// mutable and must be refreshed before signing.
|
|
21719
|
+
// (Jupiter/Chainflip). Deserialize once to detect the payload type.
|
|
21635
21720
|
const versionedTransaction = VersionedTransaction.deserialize(transactionBuffer);
|
|
21636
21721
|
return versionedTransaction.version === "legacy"
|
|
21637
21722
|
? Transaction.from(transactionBuffer)
|
|
21638
21723
|
: versionedTransaction;
|
|
21639
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
|
+
};
|
|
21640
21784
|
/**
|
|
21641
21785
|
* Execute a Solana swap transaction
|
|
21642
21786
|
* This will be used for the swap flow - Using Jupiter Dex under the hood
|
|
@@ -21649,21 +21793,15 @@ const executeSolanaSwap = async ({ route, signer, connection, onSigned, }) => {
|
|
|
21649
21793
|
const swapTransactionBuf = Buffer.from(swapRequest, "base64");
|
|
21650
21794
|
const transaction = deserializeSolanaTransaction(swapTransactionBuf);
|
|
21651
21795
|
try {
|
|
21652
|
-
const
|
|
21653
|
-
|
|
21654
|
-
// ITS legacy transactions arrive with the placeholder blockhash
|
|
21655
|
-
// 11111111111111111111111111111111.
|
|
21656
|
-
// Refresh it right before signing so the submitted transaction
|
|
21657
|
-
// uses a valid blockhash. Versioned transactions are not mutable here.
|
|
21658
|
-
transaction.recentBlockhash = latestBlockhash.blockhash;
|
|
21659
|
-
}
|
|
21660
|
-
const signature = await signer.sendTransaction(transaction, connection);
|
|
21796
|
+
const { blockhash, lastValidBlockHeight } = await resolveBlockhash(transaction, connection);
|
|
21797
|
+
const signature = await sendSolanaTransaction(signer, connection, transaction);
|
|
21661
21798
|
onSigned?.(signature);
|
|
21662
|
-
await connection.confirmTransaction({
|
|
21799
|
+
const { value } = await connection.confirmTransaction({
|
|
21663
21800
|
signature,
|
|
21664
|
-
blockhash
|
|
21665
|
-
lastValidBlockHeight
|
|
21801
|
+
blockhash,
|
|
21802
|
+
lastValidBlockHeight,
|
|
21666
21803
|
});
|
|
21804
|
+
assertConfirmed(signature, value);
|
|
21667
21805
|
return signature;
|
|
21668
21806
|
}
|
|
21669
21807
|
catch (error) {
|
|
@@ -21728,11 +21866,12 @@ const executeSolanaTransfer = async ({ amount, target, signer, connection, sourc
|
|
|
21728
21866
|
// Trigger callback for UI purposes (show loading state)
|
|
21729
21867
|
onSigned?.(signature);
|
|
21730
21868
|
// Wait for transaction confirmation
|
|
21731
|
-
await connection.confirmTransaction({
|
|
21869
|
+
const { value } = await connection.confirmTransaction({
|
|
21732
21870
|
signature,
|
|
21733
21871
|
blockhash,
|
|
21734
21872
|
lastValidBlockHeight,
|
|
21735
21873
|
});
|
|
21874
|
+
assertConfirmed(signature, value);
|
|
21736
21875
|
return signature;
|
|
21737
21876
|
};
|
|
21738
21877
|
|
|
@@ -23661,7 +23800,7 @@ const filterViewableTokens = (tokens, config, direction) => {
|
|
|
23661
23800
|
};
|
|
23662
23801
|
const getSecretNetworkBalances = async (chainData, cosmosAddress, squidTokens, keplrTypeWallet) => {
|
|
23663
23802
|
const squidSecretTokens = squidTokens.filter((t) => t.chainId === CHAIN_IDS.SECRET);
|
|
23664
|
-
const { fetchAllSecretBalances } = await import('./secretService-
|
|
23803
|
+
const { fetchAllSecretBalances } = await import('./secretService-BBTgxmnG.js');
|
|
23665
23804
|
return fetchAllSecretBalances(chainData, cosmosAddress, squidSecretTokens, keplrTypeWallet);
|
|
23666
23805
|
};
|
|
23667
23806
|
function getTokenAssetsKey(token) {
|
|
@@ -23812,8 +23951,9 @@ async function addEthereumChain({ chain, provider, }) {
|
|
|
23812
23951
|
console.debug("Error adding chain:", error);
|
|
23813
23952
|
}
|
|
23814
23953
|
}
|
|
23954
|
+
const isEvmAddressValid = (address) => !!address && isAddress(address);
|
|
23815
23955
|
const parseEvmAddress = (address) => {
|
|
23816
|
-
if (
|
|
23956
|
+
if (isEvmAddressValid(address)) {
|
|
23817
23957
|
return address;
|
|
23818
23958
|
}
|
|
23819
23959
|
};
|
|
@@ -28062,7 +28202,7 @@ function useSolana() {
|
|
|
28062
28202
|
};
|
|
28063
28203
|
}
|
|
28064
28204
|
const useSolanaConnection = () => {
|
|
28065
|
-
const connectionRef = useRef(new Connection(SOLANA_RPC_URL));
|
|
28205
|
+
const connectionRef = useRef(new Connection(SOLANA_RPC_URL, "confirmed"));
|
|
28066
28206
|
return connectionRef.current;
|
|
28067
28207
|
};
|
|
28068
28208
|
|
|
@@ -28088,7 +28228,7 @@ function useStellarWallets() {
|
|
|
28088
28228
|
try {
|
|
28089
28229
|
const { allowAllModules: initializeAllModules } = await import('@creit.tech/stellar-wallets-kit');
|
|
28090
28230
|
const { LedgerModule } = await import('@creit.tech/stellar-wallets-kit/modules/ledger.module.mjs');
|
|
28091
|
-
const { formatStellarWallet } = await import('./stellarService.client-
|
|
28231
|
+
const { formatStellarWallet } = await import('./stellarService.client-DlQku8Rs.js');
|
|
28092
28232
|
const modules = [...initializeAllModules(), new LedgerModule()];
|
|
28093
28233
|
const promises = modules.map(async (module) => {
|
|
28094
28234
|
const isAvailable = await module.isAvailable();
|
|
@@ -30802,18 +30942,24 @@ const DEFAULT_REFRESH_INTERVAL_MS$1 = 15000;
|
|
|
30802
30942
|
const useEvmBalance = ({ chain, token, userAddress, enabled = true, refreshIntervalMs = DEFAULT_REFRESH_INTERVAL_MS$1, }) => {
|
|
30803
30943
|
const { isChainTypeConnected } = useWallet();
|
|
30804
30944
|
const isNativeToken = token?.address.toLowerCase() === nativeEvmTokenAddress.toLowerCase();
|
|
30805
|
-
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;
|
|
30806
30957
|
// Only fetch using useBalance if it's a native token
|
|
30807
30958
|
const { data: nativeBalance, isLoading: isNativeTokenLoading } = useBalance({
|
|
30808
|
-
address:
|
|
30809
|
-
chainId
|
|
30959
|
+
address: evmAddress,
|
|
30960
|
+
chainId,
|
|
30810
30961
|
query: {
|
|
30811
|
-
enabled:
|
|
30812
|
-
!!userAddress &&
|
|
30813
|
-
isNativeToken &&
|
|
30814
|
-
!!chain &&
|
|
30815
|
-
chain.chainType === ChainType.EVM &&
|
|
30816
|
-
isChainTypeConnected(chain.chainType),
|
|
30962
|
+
enabled: isNativeQueryEnabled,
|
|
30817
30963
|
refetchInterval: refreshIntervalMs,
|
|
30818
30964
|
retry: 2,
|
|
30819
30965
|
},
|
|
@@ -30821,23 +30967,20 @@ const useEvmBalance = ({ chain, token, userAddress, enabled = true, refreshInter
|
|
|
30821
30967
|
// Only fetch using useReadContract if it's not a native token
|
|
30822
30968
|
// This is temporary, because of wagmi error: https://github.com/wevm/wagmi/issues/4353
|
|
30823
30969
|
const { data: erc20Balance, isLoading: isErc20Loading } = useReadContract({
|
|
30824
|
-
address:
|
|
30970
|
+
address: tokenAddress,
|
|
30825
30971
|
abi: erc20Abi,
|
|
30826
30972
|
functionName: "balanceOf",
|
|
30827
|
-
args: [
|
|
30828
|
-
chainId
|
|
30973
|
+
args: evmAddress ? [evmAddress] : undefined,
|
|
30974
|
+
chainId,
|
|
30829
30975
|
query: {
|
|
30830
|
-
enabled:
|
|
30831
|
-
enabled &&
|
|
30832
|
-
!!userAddress &&
|
|
30833
|
-
!isNativeToken,
|
|
30976
|
+
enabled: isErc20QueryEnabled,
|
|
30834
30977
|
refetchInterval: refreshIntervalMs,
|
|
30835
30978
|
retry: 2,
|
|
30836
30979
|
},
|
|
30837
30980
|
});
|
|
30838
30981
|
if (isNativeToken) {
|
|
30839
30982
|
return {
|
|
30840
|
-
isLoading: isNativeTokenLoading,
|
|
30983
|
+
isLoading: isNativeQueryEnabled && isNativeTokenLoading,
|
|
30841
30984
|
balance: nativeBalance
|
|
30842
30985
|
? formatBNToReadable(nativeBalance.value, nativeBalance.decimals)
|
|
30843
30986
|
: "0",
|
|
@@ -30847,11 +30990,16 @@ const useEvmBalance = ({ chain, token, userAddress, enabled = true, refreshInter
|
|
|
30847
30990
|
balance: erc20Balance && token
|
|
30848
30991
|
? formatBNToReadable(erc20Balance, token.decimals)
|
|
30849
30992
|
: "0",
|
|
30850
|
-
isLoading: isErc20Loading,
|
|
30993
|
+
isLoading: isErc20QueryEnabled && isErc20Loading,
|
|
30851
30994
|
};
|
|
30852
30995
|
};
|
|
30853
30996
|
const useCosmosBalance = ({ chain, token, userAddress, enabled = true, refreshIntervalMs = DEFAULT_REFRESH_INTERVAL_MS$1, }) => {
|
|
30854
30997
|
const { isConnected } = useCosmosContext();
|
|
30998
|
+
const isQueryEnabled = !!isConnected &&
|
|
30999
|
+
enabled &&
|
|
31000
|
+
!!token &&
|
|
31001
|
+
chain?.chainType === ChainType.COSMOS &&
|
|
31002
|
+
isWalletAddressValid(chain, userAddress);
|
|
30855
31003
|
const { data: balance = "0", isLoading } = useQuery({
|
|
30856
31004
|
queryKey: keys().balance(chain?.chainId, token?.address, userAddress),
|
|
30857
31005
|
queryFn: async () => {
|
|
@@ -30864,17 +31012,17 @@ const useCosmosBalance = ({ chain, token, userAddress, enabled = true, refreshIn
|
|
|
30864
31012
|
const balanceBn = await getCosmosTokenBalance(chain, userAddress, token.address);
|
|
30865
31013
|
return formatBNToReadable(balanceBn, token.decimals);
|
|
30866
31014
|
},
|
|
30867
|
-
enabled:
|
|
30868
|
-
enabled &&
|
|
30869
|
-
!!userAddress &&
|
|
30870
|
-
!!token &&
|
|
30871
|
-
chain?.chainType === ChainType.COSMOS,
|
|
31015
|
+
enabled: isQueryEnabled,
|
|
30872
31016
|
refetchInterval: refreshIntervalMs,
|
|
30873
31017
|
retry: 2,
|
|
30874
31018
|
});
|
|
30875
|
-
return { balance, isLoading };
|
|
31019
|
+
return { balance, isLoading: isQueryEnabled && isLoading };
|
|
30876
31020
|
};
|
|
30877
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);
|
|
30878
31026
|
const { data: balance = "0", isLoading } = useQuery({
|
|
30879
31027
|
queryKey: keys().balance(chain?.chainId, token?.address, userAddress),
|
|
30880
31028
|
queryFn: async () => {
|
|
@@ -30883,14 +31031,11 @@ const useSolanaBalance = ({ chain, token, userAddress, enabled = true, refreshIn
|
|
|
30883
31031
|
const balanceBn = await getSolanaTokenBalance(userAddress, token.address);
|
|
30884
31032
|
return formatBNToReadable(balanceBn, token.decimals);
|
|
30885
31033
|
},
|
|
30886
|
-
enabled:
|
|
30887
|
-
!!userAddress &&
|
|
30888
|
-
!!token &&
|
|
30889
|
-
chain?.chainType === ChainType.SOLANA,
|
|
31034
|
+
enabled: isQueryEnabled,
|
|
30890
31035
|
refetchInterval: refreshIntervalMs,
|
|
30891
31036
|
retry: 2,
|
|
30892
31037
|
});
|
|
30893
|
-
return { balance, isLoading };
|
|
31038
|
+
return { balance, isLoading: isQueryEnabled && isLoading };
|
|
30894
31039
|
};
|
|
30895
31040
|
// TODO: implement fetching balances for all bitcoin tokens
|
|
30896
31041
|
const useBitcoinBalance = ({ userAddress, chain, }) => {
|
|
@@ -31023,11 +31168,14 @@ function useNativeTokenForChain(chain) {
|
|
|
31023
31168
|
|
|
31024
31169
|
const useEvmNativeBalance = ({ address, chain, }) => {
|
|
31025
31170
|
const { isChainTypeConnected } = useWallet();
|
|
31171
|
+
const isEvmChain = chain?.chainType === ChainType.EVM;
|
|
31172
|
+
const evmAddress = parseEvmAddress(address);
|
|
31173
|
+
const isQueryEnabled = isEvmChain && !!evmAddress && isChainTypeConnected(ChainType.EVM);
|
|
31026
31174
|
const { data: nativeEvmBalance, isLoading } = useBalance({
|
|
31027
|
-
address:
|
|
31028
|
-
chainId: Number(chain
|
|
31175
|
+
address: evmAddress,
|
|
31176
|
+
chainId: isEvmChain ? Number(chain.chainId) : undefined,
|
|
31029
31177
|
query: {
|
|
31030
|
-
enabled:
|
|
31178
|
+
enabled: isQueryEnabled,
|
|
31031
31179
|
refetchInterval: 10000,
|
|
31032
31180
|
staleTime: 5000,
|
|
31033
31181
|
refetchOnWindowFocus: true,
|
|
@@ -31051,7 +31199,7 @@ const useEvmNativeBalance = ({ address, chain, }) => {
|
|
|
31051
31199
|
}, [nativeEvmBalance?.decimals, nativeEvmBalance?.value, chain?.chainId]);
|
|
31052
31200
|
return {
|
|
31053
31201
|
balance,
|
|
31054
|
-
isLoading,
|
|
31202
|
+
isLoading: isQueryEnabled && isLoading,
|
|
31055
31203
|
};
|
|
31056
31204
|
};
|
|
31057
31205
|
const useCosmosNativeBalance = ({ address, chain, }) => {
|
|
@@ -31105,13 +31253,14 @@ const useBitcoinNativeBalance = ({ chain, address, }) => {
|
|
|
31105
31253
|
};
|
|
31106
31254
|
const useSolanaNativeBalance = ({ chain, address, }) => {
|
|
31107
31255
|
const { nativeToken } = useNativeTokenForChain(chain);
|
|
31256
|
+
const isQueryEnabled = nativeToken?.decimals != null &&
|
|
31257
|
+
chain?.chainType === ChainType.SOLANA &&
|
|
31258
|
+
isWalletAddressValid(chain, address);
|
|
31108
31259
|
const { data: rawBalance, isLoading } = useQuery(keys().balance(chain?.chainId, nativeToken?.address, address), async () => {
|
|
31109
31260
|
const balance = await getSolanaNativeBalance(address);
|
|
31110
31261
|
return formatBNToReadable(balance, nativeToken.decimals);
|
|
31111
31262
|
}, {
|
|
31112
|
-
enabled:
|
|
31113
|
-
nativeToken?.decimals != null &&
|
|
31114
|
-
chain?.chainType === ChainType.SOLANA,
|
|
31263
|
+
enabled: isQueryEnabled,
|
|
31115
31264
|
refetchInterval: 40000,
|
|
31116
31265
|
staleTime: 20000,
|
|
31117
31266
|
refetchOnWindowFocus: true,
|
|
@@ -31127,7 +31276,7 @@ const useSolanaNativeBalance = ({ chain, address, }) => {
|
|
|
31127
31276
|
}, [nativeToken?.decimals, rawBalance]);
|
|
31128
31277
|
return {
|
|
31129
31278
|
balance,
|
|
31130
|
-
isLoading,
|
|
31279
|
+
isLoading: isQueryEnabled && isLoading,
|
|
31131
31280
|
};
|
|
31132
31281
|
};
|
|
31133
31282
|
const useSuiNativeBalance = ({ address, chain, }) => {
|
|
@@ -31535,7 +31684,7 @@ function hederaWalletConnect(parameters) {
|
|
|
31535
31684
|
const optionalChains = config.chains.map((x) => x.id);
|
|
31536
31685
|
if (!optionalChains.length)
|
|
31537
31686
|
return;
|
|
31538
|
-
const { EthereumProvider } = await import('./index.es-
|
|
31687
|
+
const { EthereumProvider } = await import('./index.es-CeXN3P4q.js');
|
|
31539
31688
|
const rawProvider = await EthereumProvider.init({
|
|
31540
31689
|
...restParameters,
|
|
31541
31690
|
disableProviderPing: true,
|
|
@@ -31879,7 +32028,10 @@ function useHederaTokenAssociations({ address, chain, token }) {
|
|
|
31879
32028
|
token,
|
|
31880
32029
|
});
|
|
31881
32030
|
},
|
|
31882
|
-
enabled:
|
|
32031
|
+
enabled: isEvmAddressValid(address) &&
|
|
32032
|
+
!!publicClient &&
|
|
32033
|
+
chain?.chainId === CHAIN_IDS.HEDERA &&
|
|
32034
|
+
token?.chainId === CHAIN_IDS.HEDERA,
|
|
31883
32035
|
});
|
|
31884
32036
|
return {
|
|
31885
32037
|
isTokenAssociated,
|
|
@@ -31992,7 +32144,9 @@ function useStellarAccountActivation({ address, chain, token, }) {
|
|
|
31992
32144
|
reserveBaseBn: accountReserveBase,
|
|
31993
32145
|
};
|
|
31994
32146
|
},
|
|
31995
|
-
enabled: !!address &&
|
|
32147
|
+
enabled: !!address &&
|
|
32148
|
+
chain?.chainType === ChainType.STELLAR &&
|
|
32149
|
+
isStellarAddressValid(address),
|
|
31996
32150
|
refetchInterval: DEFAULT_REFETCH_INTERVAL$2,
|
|
31997
32151
|
refetchOnWindowFocus: true,
|
|
31998
32152
|
});
|
|
@@ -39086,7 +39240,9 @@ function useXrplTrustLine({ address, chain, token, amount }) {
|
|
|
39086
39240
|
const xrplClient = await getClient(chain);
|
|
39087
39241
|
return xrplClient.accountActivatedInfo(address);
|
|
39088
39242
|
},
|
|
39089
|
-
enabled: !!address &&
|
|
39243
|
+
enabled: !!address &&
|
|
39244
|
+
chain?.chainType === ChainType.XRPL &&
|
|
39245
|
+
isXrplAddressValid(address),
|
|
39090
39246
|
refetchInterval: DEFAULT_REFETCH_INTERVAL,
|
|
39091
39247
|
refetchOnWindowFocus: true,
|
|
39092
39248
|
});
|
|
@@ -39227,5 +39383,5 @@ const SquidProvider = ({ children, config, placeholder, }) => {
|
|
|
39227
39383
|
React.createElement(CosmosProvider, null, children))))))))))) : (placeholder);
|
|
39228
39384
|
};
|
|
39229
39385
|
|
|
39230
|
-
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,
|
|
39231
|
-
//# 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
|