@rhinestone/deposit-modal 0.11.0 → 0.12.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/{DepositModalReown-6RVLEM3B.mjs → DepositModalReown-MVVRUXO4.mjs} +7 -7
- package/dist/{DepositModalReown-TXTLVZIQ.cjs → DepositModalReown-PZXHTPIS.cjs} +17 -17
- package/dist/{chunk-VRNRRN2U.mjs → chunk-2AMRKYJ4.mjs} +4 -4
- package/dist/{chunk-JYKMR6QI.cjs → chunk-2PQ34KU3.cjs} +3 -3
- package/dist/{chunk-TENL4H64.cjs → chunk-4R2ZHSDQ.cjs} +4 -9
- package/dist/{chunk-XVKBCDZI.cjs → chunk-4SRVZRZF.cjs} +1 -1
- package/dist/{chunk-MZ53PDIX.mjs → chunk-53IGTENZ.mjs} +1 -1
- package/dist/{chunk-ITAYM7SB.mjs → chunk-5IP67CL5.mjs} +45 -17
- package/dist/{chunk-HCQWFL3A.cjs → chunk-6ZJTZ7DS.cjs} +81 -80
- package/dist/{chunk-BLJMYCBF.cjs → chunk-BK54FZAE.cjs} +83 -83
- package/dist/{chunk-G4FVZQOM.mjs → chunk-EUIPQ3T4.mjs} +7 -7
- package/dist/{chunk-QRR3Y7EK.mjs → chunk-GZNMBZHY.mjs} +1 -1
- package/dist/{chunk-NPSC5R22.cjs → chunk-LBJFACLH.cjs} +125 -97
- package/dist/{chunk-7RNEYPI4.cjs → chunk-LTPVHQXJ.cjs} +555 -549
- package/dist/{chunk-TRD2FCAR.mjs → chunk-Q5MFRAWD.mjs} +417 -411
- package/dist/{chunk-WLDTBKRA.mjs → chunk-QF5T6HXC.mjs} +5 -4
- package/dist/{chunk-DYTRG4C7.mjs → chunk-RMYUE6HJ.mjs} +1 -1
- package/dist/{chunk-GWA6GFTI.cjs → chunk-WZJMJFP7.cjs} +62 -62
- package/dist/{chunk-JPRV36DT.cjs → chunk-XJB3VG4C.cjs} +2 -2
- package/dist/{chunk-53IFZGSF.mjs → chunk-YR43AAX5.mjs} +0 -5
- package/dist/claim.cjs +6 -6
- package/dist/claim.d.cts +2 -2
- package/dist/claim.d.ts +2 -2
- package/dist/claim.mjs +5 -5
- package/dist/constants.cjs +3 -3
- package/dist/constants.d.cts +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/constants.mjs +2 -2
- package/dist/deposit.cjs +8 -8
- package/dist/deposit.d.cts +2 -2
- package/dist/deposit.d.ts +2 -2
- package/dist/deposit.mjs +7 -7
- package/dist/index.cjs +10 -10
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +9 -9
- package/dist/polymarket.cjs +5 -5
- package/dist/polymarket.mjs +2 -2
- package/dist/{types-C7wag_iL.d.cts → types-BO4iP6fG.d.cts} +6 -1
- package/dist/{types-D4b6Cjox.d.ts → types-oFblf65g.d.ts} +6 -1
- package/dist/withdraw.cjs +6 -6
- package/dist/withdraw.d.cts +2 -2
- package/dist/withdraw.d.ts +2 -2
- package/dist/withdraw.mjs +5 -5
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunk4SRVZRZFcjs = require('./chunk-4SRVZRZF.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
@@ -26,11 +26,7 @@ var _chunkXVKBCDZIcjs = require('./chunk-XVKBCDZI.cjs');
|
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
var _chunkTENL4H64cjs = require('./chunk-TENL4H64.cjs');
|
|
29
|
+
var _chunk4R2ZHSDQcjs = require('./chunk-4R2ZHSDQ.cjs');
|
|
34
30
|
|
|
35
31
|
// src/components/ui/Modal.tsx
|
|
36
32
|
|
|
@@ -336,7 +332,7 @@ function preconnectIconCdn() {
|
|
|
336
332
|
const link = document.createElement("link");
|
|
337
333
|
link.id = "rs-icon-cdn-preconnect";
|
|
338
334
|
link.rel = "preconnect";
|
|
339
|
-
link.href =
|
|
335
|
+
link.href = _chunk4R2ZHSDQcjs.ICON_CDN;
|
|
340
336
|
link.crossOrigin = "anonymous";
|
|
341
337
|
document.head.appendChild(link);
|
|
342
338
|
}
|
|
@@ -554,7 +550,7 @@ function parseChain(caip2, value) {
|
|
|
554
550
|
// `parseEvmChainId` returns null for `solana:`/`tron:`/`hypercore:` keys,
|
|
555
551
|
// which is the intended answer — those chains have no numeric id, and the
|
|
556
552
|
// modal addresses them by their CAIP-2 string or a sentinel.
|
|
557
|
-
chainId:
|
|
553
|
+
chainId: _chunk4R2ZHSDQcjs.parseEvmChainId.call(void 0, caip2),
|
|
558
554
|
name,
|
|
559
555
|
testnet,
|
|
560
556
|
deposit,
|
|
@@ -586,9 +582,9 @@ function parseChainCatalog(body) {
|
|
|
586
582
|
return { all, byCaip2, byChainId };
|
|
587
583
|
}
|
|
588
584
|
function catalogKeyForChain(chainId) {
|
|
589
|
-
if (chainId === "solana") return
|
|
590
|
-
if (chainId === "hypercore" || chainId ===
|
|
591
|
-
return
|
|
585
|
+
if (chainId === "solana") return _chunk4R2ZHSDQcjs.SOLANA_MAINNET_CAIP2;
|
|
586
|
+
if (chainId === "hypercore" || chainId === _chunk4R2ZHSDQcjs.HYPERCORE_CHAIN_ID) {
|
|
587
|
+
return _chunk4R2ZHSDQcjs.HYPERCORE_MAINNET_CAIP2;
|
|
592
588
|
}
|
|
593
589
|
return chainId;
|
|
594
590
|
}
|
|
@@ -843,6 +839,11 @@ var SwappedConnectFeeChangedError = class extends Error {
|
|
|
843
839
|
function parseExchangeFeeBps(value) {
|
|
844
840
|
return typeof value === "number" && Number.isInteger(value) && value >= 0 && value <= 1e4 ? value : void 0;
|
|
845
841
|
}
|
|
842
|
+
var UNSUPPORTED_CONNECT_EXCHANGES = /* @__PURE__ */ new Set(["kraken", "htx"]);
|
|
843
|
+
var SUPPORTED_CONNECT_EXCHANGE_COUNT = 7;
|
|
844
|
+
function isSupportedConnectExchange(exchange) {
|
|
845
|
+
return !UNSUPPORTED_CONNECT_EXCHANGES.has(exchange.connection.toLowerCase());
|
|
846
|
+
}
|
|
846
847
|
function resolveAppFeeBps(appFees, sourceChainCaip2, sourceToken) {
|
|
847
848
|
const override = _optionalChain([appFees, 'optionalAccess', _6 => _6.tokens, 'optionalAccess', _7 => _7[sourceChainCaip2], 'optionalAccess', _8 => _8[sourceToken.toLowerCase()]]);
|
|
848
849
|
const bps = _nullishCoalesce(_nullishCoalesce(override, () => ( _optionalChain([appFees, 'optionalAccess', _9 => _9.feeBps]))), () => ( 0));
|
|
@@ -888,7 +889,7 @@ function createDepositService(baseUrl, options) {
|
|
|
888
889
|
try {
|
|
889
890
|
const response = await fetch(apiUrl("/qr/tokens"), {
|
|
890
891
|
method: "GET",
|
|
891
|
-
headers:
|
|
892
|
+
headers: _chunk4SRVZRZFcjs.SERVICE_HEADERS
|
|
892
893
|
});
|
|
893
894
|
if (!response.ok) {
|
|
894
895
|
debugLog(debug, scope, "getTopTokens:unavailable", {
|
|
@@ -915,7 +916,7 @@ function createDepositService(baseUrl, options) {
|
|
|
915
916
|
try {
|
|
916
917
|
const response = await fetch(apiUrl("/chains"), {
|
|
917
918
|
method: "GET",
|
|
918
|
-
headers:
|
|
919
|
+
headers: _chunk4SRVZRZFcjs.SERVICE_HEADERS
|
|
919
920
|
});
|
|
920
921
|
if (!response.ok) {
|
|
921
922
|
debugLog(debug, scope, "getChains:unavailable", {
|
|
@@ -969,7 +970,7 @@ function createDepositService(baseUrl, options) {
|
|
|
969
970
|
});
|
|
970
971
|
const response = await fetch(url, {
|
|
971
972
|
method: "POST",
|
|
972
|
-
headers:
|
|
973
|
+
headers: _chunk4SRVZRZFcjs.SERVICE_HEADERS,
|
|
973
974
|
body: JSON.stringify({ account: params })
|
|
974
975
|
});
|
|
975
976
|
if (!response.ok) {
|
|
@@ -1002,7 +1003,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1002
1003
|
debugLog(debug, scope, "fetchPortfolio:request", { url, address });
|
|
1003
1004
|
const response = await fetch(url, {
|
|
1004
1005
|
method: "GET",
|
|
1005
|
-
headers:
|
|
1006
|
+
headers: _chunk4SRVZRZFcjs.SERVICE_HEADERS
|
|
1006
1007
|
});
|
|
1007
1008
|
if (!response.ok) {
|
|
1008
1009
|
const error = await response.json().catch(() => ({ error: "Unknown error" }));
|
|
@@ -1049,7 +1050,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1049
1050
|
debugLog(debug, scope, "fetchSolanaPortfolio:request", { url, address });
|
|
1050
1051
|
const response = await fetch(url, {
|
|
1051
1052
|
method: "GET",
|
|
1052
|
-
headers:
|
|
1053
|
+
headers: _chunk4SRVZRZFcjs.SERVICE_HEADERS
|
|
1053
1054
|
});
|
|
1054
1055
|
if (!response.ok) {
|
|
1055
1056
|
const error = await response.json().catch(() => ({ error: "Unknown error" }));
|
|
@@ -1079,7 +1080,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1079
1080
|
debugLog(debug, scope, "checkAccount:request", { url, address });
|
|
1080
1081
|
const response = await fetch(url, {
|
|
1081
1082
|
method: "GET",
|
|
1082
|
-
headers:
|
|
1083
|
+
headers: _chunk4SRVZRZFcjs.SERVICE_HEADERS
|
|
1083
1084
|
});
|
|
1084
1085
|
if (!response.ok) {
|
|
1085
1086
|
const error = await response.json().catch(() => ({ error: "Unknown error" }));
|
|
@@ -1114,7 +1115,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1114
1115
|
);
|
|
1115
1116
|
const response = await fetch(url, {
|
|
1116
1117
|
method: "GET",
|
|
1117
|
-
headers:
|
|
1118
|
+
headers: _chunk4SRVZRZFcjs.SERVICE_HEADERS,
|
|
1118
1119
|
cache: "no-store"
|
|
1119
1120
|
});
|
|
1120
1121
|
if (!response.ok) {
|
|
@@ -1142,7 +1143,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1142
1143
|
);
|
|
1143
1144
|
const response = await fetch(url, {
|
|
1144
1145
|
method: "GET",
|
|
1145
|
-
headers:
|
|
1146
|
+
headers: _chunk4SRVZRZFcjs.SERVICE_HEADERS,
|
|
1146
1147
|
cache: "no-store"
|
|
1147
1148
|
});
|
|
1148
1149
|
if (!response.ok) {
|
|
@@ -1166,7 +1167,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1166
1167
|
);
|
|
1167
1168
|
const response = await fetch(url, {
|
|
1168
1169
|
method: "GET",
|
|
1169
|
-
headers:
|
|
1170
|
+
headers: _chunk4SRVZRZFcjs.SERVICE_HEADERS,
|
|
1170
1171
|
cache: "no-store"
|
|
1171
1172
|
});
|
|
1172
1173
|
if (!response.ok) {
|
|
@@ -1188,7 +1189,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1188
1189
|
async getPositions(address) {
|
|
1189
1190
|
const url = apiUrl(`/positions/${address}`);
|
|
1190
1191
|
debugLog(debug, scope, "getPositions:request", { url, address });
|
|
1191
|
-
const response = await fetch(url, { headers:
|
|
1192
|
+
const response = await fetch(url, { headers: _chunk4SRVZRZFcjs.SERVICE_HEADERS });
|
|
1192
1193
|
if (!response.ok) {
|
|
1193
1194
|
const error = await response.json().catch(() => ({ error: "Unknown error" }));
|
|
1194
1195
|
debugError(debug, scope, "getPositions:failed", error, {
|
|
@@ -1222,7 +1223,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1222
1223
|
});
|
|
1223
1224
|
const response = await fetch(url, {
|
|
1224
1225
|
method: "POST",
|
|
1225
|
-
headers:
|
|
1226
|
+
headers: _chunk4SRVZRZFcjs.SERVICE_HEADERS,
|
|
1226
1227
|
body: JSON.stringify({ account, market, chainId, asset, amount })
|
|
1227
1228
|
});
|
|
1228
1229
|
if (!response.ok) {
|
|
@@ -1258,7 +1259,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1258
1259
|
});
|
|
1259
1260
|
const response = await fetch(url, {
|
|
1260
1261
|
method: "POST",
|
|
1261
|
-
headers:
|
|
1262
|
+
headers: _chunk4SRVZRZFcjs.SERVICE_HEADERS,
|
|
1262
1263
|
body: JSON.stringify({
|
|
1263
1264
|
depositWallet,
|
|
1264
1265
|
owner,
|
|
@@ -1300,7 +1301,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1300
1301
|
});
|
|
1301
1302
|
const response = await fetch(url, {
|
|
1302
1303
|
method: "GET",
|
|
1303
|
-
headers:
|
|
1304
|
+
headers: _chunk4SRVZRZFcjs.SERVICE_HEADERS,
|
|
1304
1305
|
cache: "no-store"
|
|
1305
1306
|
});
|
|
1306
1307
|
if (!response.ok) {
|
|
@@ -1327,8 +1328,8 @@ function createDepositService(baseUrl, options) {
|
|
|
1327
1328
|
return { deposits, nextCursor };
|
|
1328
1329
|
},
|
|
1329
1330
|
async checkLiquidity(params) {
|
|
1330
|
-
if (
|
|
1331
|
-
const token =
|
|
1331
|
+
if (_chunk4R2ZHSDQcjs.isSolanaCaip2.call(void 0, params.destinationChainId) || params.destinationChainId === "solana") {
|
|
1332
|
+
const token = _chunk4R2ZHSDQcjs.getSolanaTokenByMint.call(void 0, params.destinationToken);
|
|
1332
1333
|
return {
|
|
1333
1334
|
hasLiquidity: true,
|
|
1334
1335
|
symbol: _nullishCoalesce(_optionalChain([token, 'optionalAccess', _40 => _40.symbol]), () => ( "Token")),
|
|
@@ -1338,7 +1339,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1338
1339
|
};
|
|
1339
1340
|
}
|
|
1340
1341
|
const searchParams = new URLSearchParams({
|
|
1341
|
-
sourceChainId:
|
|
1342
|
+
sourceChainId: _chunk4R2ZHSDQcjs.toEvmCaip2.call(void 0, params.sourceChainId),
|
|
1342
1343
|
sourceToken: params.sourceToken,
|
|
1343
1344
|
destinationChainId: params.destinationChainId,
|
|
1344
1345
|
destinationToken: params.destinationToken,
|
|
@@ -1353,7 +1354,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1353
1354
|
});
|
|
1354
1355
|
const response = await fetch(url, {
|
|
1355
1356
|
method: "GET",
|
|
1356
|
-
headers:
|
|
1357
|
+
headers: _chunk4SRVZRZFcjs.SERVICE_HEADERS,
|
|
1357
1358
|
cache: "no-store"
|
|
1358
1359
|
});
|
|
1359
1360
|
if (!response.ok) {
|
|
@@ -1385,7 +1386,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1385
1386
|
const body = {
|
|
1386
1387
|
account: params.account,
|
|
1387
1388
|
// HyperCore has its own CAIP-2 namespace — never the eip155 placeholder.
|
|
1388
|
-
sourceChainId: params.sourceChainId === "hypercore" ?
|
|
1389
|
+
sourceChainId: params.sourceChainId === "hypercore" ? _chunk4R2ZHSDQcjs.HYPERCORE_MAINNET_CAIP2 : `eip155:${params.sourceChainId}`,
|
|
1389
1390
|
sourceToken: params.sourceToken,
|
|
1390
1391
|
amount: params.amount
|
|
1391
1392
|
};
|
|
@@ -1398,7 +1399,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1398
1399
|
try {
|
|
1399
1400
|
const response = await fetch(url, {
|
|
1400
1401
|
method: "POST",
|
|
1401
|
-
headers:
|
|
1402
|
+
headers: _chunk4SRVZRZFcjs.SERVICE_HEADERS,
|
|
1402
1403
|
body: JSON.stringify(body),
|
|
1403
1404
|
cache: "no-store"
|
|
1404
1405
|
});
|
|
@@ -1435,7 +1436,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1435
1436
|
try {
|
|
1436
1437
|
const response = await fetch(url, {
|
|
1437
1438
|
method: "GET",
|
|
1438
|
-
headers:
|
|
1439
|
+
headers: _chunk4SRVZRZFcjs.SERVICE_HEADERS,
|
|
1439
1440
|
cache: "no-store"
|
|
1440
1441
|
});
|
|
1441
1442
|
if (!response.ok) {
|
|
@@ -1465,7 +1466,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1465
1466
|
try {
|
|
1466
1467
|
const response = await fetch(url, {
|
|
1467
1468
|
method: "GET",
|
|
1468
|
-
headers:
|
|
1469
|
+
headers: _chunk4SRVZRZFcjs.SERVICE_HEADERS,
|
|
1469
1470
|
cache: "no-store"
|
|
1470
1471
|
});
|
|
1471
1472
|
if (!response.ok) {
|
|
@@ -1490,7 +1491,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1490
1491
|
});
|
|
1491
1492
|
const response = await fetch(url, {
|
|
1492
1493
|
method: "POST",
|
|
1493
|
-
headers:
|
|
1494
|
+
headers: _chunk4SRVZRZFcjs.SERVICE_HEADERS,
|
|
1494
1495
|
body: JSON.stringify(params)
|
|
1495
1496
|
});
|
|
1496
1497
|
if (!response.ok) {
|
|
@@ -1522,7 +1523,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1522
1523
|
});
|
|
1523
1524
|
const response = await fetch(url, {
|
|
1524
1525
|
method: "POST",
|
|
1525
|
-
headers:
|
|
1526
|
+
headers: _chunk4SRVZRZFcjs.SERVICE_HEADERS,
|
|
1526
1527
|
body: JSON.stringify(params)
|
|
1527
1528
|
});
|
|
1528
1529
|
if (!response.ok) {
|
|
@@ -1559,7 +1560,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1559
1560
|
debugLog(debug, scope, "getSwappedConnectExchanges:request");
|
|
1560
1561
|
const response = await fetch(url, {
|
|
1561
1562
|
method: "GET",
|
|
1562
|
-
headers:
|
|
1563
|
+
headers: _chunk4SRVZRZFcjs.SERVICE_HEADERS,
|
|
1563
1564
|
cache: "no-store"
|
|
1564
1565
|
});
|
|
1565
1566
|
if (!response.ok) {
|
|
@@ -1594,7 +1595,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1594
1595
|
throw new Error("Swapped Connect exchanges: malformed response");
|
|
1595
1596
|
}
|
|
1596
1597
|
return {
|
|
1597
|
-
exchanges,
|
|
1598
|
+
exchanges: exchanges.filter(isSupportedConnectExchange),
|
|
1598
1599
|
fetchedAt: body.fetchedAt,
|
|
1599
1600
|
expiresAt: body.expiresAt,
|
|
1600
1601
|
stale: body.stale === true ? true : void 0,
|
|
@@ -1612,7 +1613,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1612
1613
|
try {
|
|
1613
1614
|
const response = await fetch(url, {
|
|
1614
1615
|
method: "GET",
|
|
1615
|
-
headers:
|
|
1616
|
+
headers: _chunk4SRVZRZFcjs.SERVICE_HEADERS,
|
|
1616
1617
|
cache: "no-store"
|
|
1617
1618
|
});
|
|
1618
1619
|
if (!response.ok) {
|
|
@@ -1698,7 +1699,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1698
1699
|
try {
|
|
1699
1700
|
const response = await fetch(url, {
|
|
1700
1701
|
method: "GET",
|
|
1701
|
-
headers:
|
|
1702
|
+
headers: _chunk4SRVZRZFcjs.SERVICE_HEADERS,
|
|
1702
1703
|
cache: "no-store"
|
|
1703
1704
|
});
|
|
1704
1705
|
if (!response.ok) {
|
|
@@ -1725,7 +1726,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1725
1726
|
);
|
|
1726
1727
|
const response = await fetch(url, {
|
|
1727
1728
|
method: "GET",
|
|
1728
|
-
headers:
|
|
1729
|
+
headers: _chunk4SRVZRZFcjs.SERVICE_HEADERS,
|
|
1729
1730
|
cache: "no-store"
|
|
1730
1731
|
});
|
|
1731
1732
|
if (!response.ok) return null;
|
|
@@ -1789,14 +1790,14 @@ function normalizeOrchestratorPortfolio(data) {
|
|
|
1789
1790
|
const unlocked = _nullishCoalesce(_optionalChain([chainBalance, 'access', _45 => _45.balance, 'optionalAccess', _46 => _46.unlocked]), () => ( "0"));
|
|
1790
1791
|
const normalizedName = tokenData.tokenName.trim();
|
|
1791
1792
|
const isNativeSymbol = normalizedName.toUpperCase() === "ETH" || normalizedName.toUpperCase() === "ETHER";
|
|
1792
|
-
const tokenAddress = _nullishCoalesce(_nullishCoalesce(chainBalance.tokenAddress, () => ( extractTokenAddress(tokenData, chainBalance.chainId))), () => (
|
|
1793
|
-
const resolvedTokenAddress = isNativeSymbol ?
|
|
1793
|
+
const tokenAddress = _nullishCoalesce(_nullishCoalesce(chainBalance.tokenAddress, () => ( extractTokenAddress(tokenData, chainBalance.chainId))), () => ( _chunk4R2ZHSDQcjs.getTokenAddress.call(void 0, tokenData.tokenName, chainBalance.chainId)));
|
|
1794
|
+
const resolvedTokenAddress = isNativeSymbol ? _chunk4R2ZHSDQcjs.NATIVE_TOKEN_ADDRESS : tokenAddress;
|
|
1794
1795
|
if (!resolvedTokenAddress) {
|
|
1795
1796
|
continue;
|
|
1796
1797
|
}
|
|
1797
|
-
const registrySymbol =
|
|
1798
|
+
const registrySymbol = _chunk4R2ZHSDQcjs.getTokenSymbol.call(void 0, resolvedTokenAddress, chainBalance.chainId);
|
|
1798
1799
|
const symbol = registrySymbol !== "Token" ? registrySymbol : normalizedName || "Token";
|
|
1799
|
-
const decimals = registrySymbol !== "Token" ?
|
|
1800
|
+
const decimals = registrySymbol !== "Token" ? _chunk4R2ZHSDQcjs.getTokenDecimalsByAddress.call(void 0, resolvedTokenAddress, chainBalance.chainId) : _nullishCoalesce(tokenData.tokenDecimals, () => ( 18));
|
|
1800
1801
|
tokens.push({
|
|
1801
1802
|
chainId: chainBalance.chainId,
|
|
1802
1803
|
address: resolvedTokenAddress,
|
|
@@ -1816,13 +1817,13 @@ function normalizeOrchestratorPortfolio(data) {
|
|
|
1816
1817
|
function normalizeDirectToken(token) {
|
|
1817
1818
|
const rawChainId = _nullishCoalesce(extractNumber(token, "chainId"), () => ( extractNumber(token.chain, "id")));
|
|
1818
1819
|
const rawChainString = _nullishCoalesce(extractString(token, "chainId"), () => ( extractString(token.chain, "id")));
|
|
1819
|
-
const chainId = _nullishCoalesce(rawChainId, () => ( (rawChainString ?
|
|
1820
|
+
const chainId = _nullishCoalesce(rawChainId, () => ( (rawChainString ? _chunk4R2ZHSDQcjs.isSolanaCaip2.call(void 0, rawChainString) || rawChainString.toLowerCase() === "solana" ? "solana" : (
|
|
1820
1821
|
// HyperCore (`hypercore:mainnet`) is a non-EVM source; keep its USDC
|
|
1821
1822
|
// instead of dropping it as an unparseable chain string.
|
|
1822
|
-
|
|
1823
|
+
_chunk4R2ZHSDQcjs.isHyperCoreCaip2.call(void 0, rawChainString) || rawChainString.toLowerCase() === "hypercore" ? "hypercore" : _chunk4R2ZHSDQcjs.parseEvmChainId.call(void 0, rawChainString)
|
|
1823
1824
|
) : null)));
|
|
1824
1825
|
if (chainId === null) return null;
|
|
1825
|
-
const registryChainId = typeof chainId === "number" ? chainId : chainId === "hypercore" ?
|
|
1826
|
+
const registryChainId = typeof chainId === "number" ? chainId : chainId === "hypercore" ? _chunk4R2ZHSDQcjs.HYPERCORE_CHAIN_ID : void 0;
|
|
1826
1827
|
const symbol = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(extractString(token, "symbol"), () => ( extractString(token, "tokenSymbol"))), () => ( extractString(token, "tokenName"))), () => ( extractString(token, "name")));
|
|
1827
1828
|
if (!symbol) return null;
|
|
1828
1829
|
const balanceValue = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(extractString(token, "balance"), () => ( extractString(token, "amount"))), () => ( extractString(token, "value"))), () => ( extractString(token, "rawBalance"))), () => ( _optionalChain([extractNumber, 'call', _47 => _47(token, "balance"), 'optionalAccess', _48 => _48.toString, 'call', _49 => _49()]))), () => ( _optionalChain([extractNumber, 'call', _50 => _50(token, "amount"), 'optionalAccess', _51 => _51.toString, 'call', _52 => _52()]))), () => ( _optionalChain([extractNumber, 'call', _53 => _53(token, "value"), 'optionalAccess', _54 => _54.toString, 'call', _55 => _55()]))), () => ( _optionalChain([extractNumber, 'call', _56 => _56(token, "rawBalance"), 'optionalAccess', _57 => _57.toString, 'call', _58 => _58()])));
|
|
@@ -1830,14 +1831,14 @@ function normalizeDirectToken(token) {
|
|
|
1830
1831
|
const address = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(extractString(token, "address"), () => ( extractString(token, "tokenAddress"))), () => ( extractString(
|
|
1831
1832
|
token.token,
|
|
1832
1833
|
"address"
|
|
1833
|
-
))), () => ( (registryChainId !== void 0 ?
|
|
1834
|
+
))), () => ( (registryChainId !== void 0 ? _chunk4R2ZHSDQcjs.getTokenAddress.call(void 0, symbol, registryChainId) : void 0)));
|
|
1834
1835
|
if (!address) return null;
|
|
1835
1836
|
const balanceUsd = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(extractNumber(token, "balanceUsd"), () => ( extractNumber(token, "usdValue"))), () => ( extractNumber(token, "valueUsd"))), () => ( extractNumericString(token, "balanceUsd"))), () => ( extractNumericString(token, "usdValue"))), () => ( extractNumericString(token, "valueUsd"))), () => ( 0));
|
|
1836
1837
|
const isSolanaToken = chainId === "solana";
|
|
1837
|
-
const registrySymbol = isSolanaToken ? "Token" :
|
|
1838
|
+
const registrySymbol = isSolanaToken ? "Token" : _chunk4R2ZHSDQcjs.getTokenSymbol.call(void 0, address, registryChainId);
|
|
1838
1839
|
const resolvedSymbol = isSolanaToken ? symbol : registrySymbol !== "Token" ? registrySymbol : symbol;
|
|
1839
1840
|
const backendDecimals = _nullishCoalesce(extractNumber(token, "decimals"), () => ( extractNumber(token, "tokenDecimals")));
|
|
1840
|
-
const resolvedDecimals = !isSolanaToken && registrySymbol !== "Token" ?
|
|
1841
|
+
const resolvedDecimals = !isSolanaToken && registrySymbol !== "Token" ? _chunk4R2ZHSDQcjs.getTokenDecimalsByAddress.call(void 0, address, registryChainId) : _nullishCoalesce(backendDecimals, () => ( 18));
|
|
1841
1842
|
return {
|
|
1842
1843
|
chainId,
|
|
1843
1844
|
address,
|
|
@@ -1925,7 +1926,7 @@ function getPublicClient(chainId, rpcUrls) {
|
|
|
1925
1926
|
const cacheKey = `${chainId}|${_nullishCoalesce(url, () => ( ""))}`;
|
|
1926
1927
|
let client = clientCache.get(cacheKey);
|
|
1927
1928
|
if (!client) {
|
|
1928
|
-
const chain = _nullishCoalesce(
|
|
1929
|
+
const chain = _nullishCoalesce(_chunk4R2ZHSDQcjs.CHAIN_BY_ID[chainId], () => ( runtimeChainById.get(chainId)));
|
|
1929
1930
|
client = _viem.createPublicClient.call(void 0, {
|
|
1930
1931
|
chain,
|
|
1931
1932
|
transport: _viem.http.call(void 0, url)
|
|
@@ -2068,7 +2069,7 @@ function peekRuntimeChains(backendUrl, overrides) {
|
|
|
2068
2069
|
return _nullishCoalesce(resolvedChainsByKey.get(runtimeChainsKey(backendUrl, overrides)), () => ( null));
|
|
2069
2070
|
}
|
|
2070
2071
|
function publishCatalogTokens(catalog) {
|
|
2071
|
-
|
|
2072
|
+
_chunk4R2ZHSDQcjs.setRuntimeTokens.call(void 0,
|
|
2072
2073
|
catalog.all.flatMap(
|
|
2073
2074
|
(chain) => chain.chainId === null || !Array.isArray(chain.supportedTokens) ? [] : chain.supportedTokens.map((token) => ({
|
|
2074
2075
|
chainId: chain.chainId,
|
|
@@ -2080,11 +2081,11 @@ function publishCatalogTokens(catalog) {
|
|
|
2080
2081
|
);
|
|
2081
2082
|
}
|
|
2082
2083
|
function publishRuntimeChainMeta(catalog) {
|
|
2083
|
-
|
|
2084
|
+
_chunk4R2ZHSDQcjs.setRuntimeChainMeta.call(void 0,
|
|
2084
2085
|
catalog.all.flatMap((chain) => {
|
|
2085
2086
|
const ids = [];
|
|
2086
2087
|
if (chain.chainId !== null) ids.push(chain.chainId);
|
|
2087
|
-
if (chain.caip2 ===
|
|
2088
|
+
if (chain.caip2 === _chunk4R2ZHSDQcjs.HYPERCORE_MAINNET_CAIP2) ids.push(_chunk4R2ZHSDQcjs.HYPERCORE_CHAIN_ID);
|
|
2088
2089
|
return ids.map((chainId) => ({
|
|
2089
2090
|
chainId,
|
|
2090
2091
|
name: chain.name,
|
|
@@ -2130,7 +2131,7 @@ function useCatalogChain(chainId) {
|
|
|
2130
2131
|
function useDepositChainIds() {
|
|
2131
2132
|
const { catalog } = useChainCatalog();
|
|
2132
2133
|
return _react.useMemo.call(void 0, () => {
|
|
2133
|
-
if (!catalog) return
|
|
2134
|
+
if (!catalog) return [];
|
|
2134
2135
|
const ids = catalog.all.filter(
|
|
2135
2136
|
(c) => c.deposit && c.vmType === "evm" && c.chainId !== null && // `/chains` enumerates testnets; the bundled list never did, and a
|
|
2136
2137
|
// production picker offering Sepolia next to Ethereum is a way to
|
|
@@ -2139,8 +2140,8 @@ function useDepositChainIds() {
|
|
|
2139
2140
|
!c.testnet
|
|
2140
2141
|
).map((c) => c.chainId);
|
|
2141
2142
|
const rank = (id) => {
|
|
2142
|
-
const i =
|
|
2143
|
-
return i === -1 ?
|
|
2143
|
+
const i = _chunk4R2ZHSDQcjs.CHAIN_DISPLAY_ORDER.indexOf(id);
|
|
2144
|
+
return i === -1 ? _chunk4R2ZHSDQcjs.CHAIN_DISPLAY_ORDER.length : i;
|
|
2144
2145
|
};
|
|
2145
2146
|
return ids.map((id, i) => ({ id, i })).sort((a, b) => rank(a.id) - rank(b.id) || a.i - b.i).map(({ id }) => id);
|
|
2146
2147
|
}, [catalog]);
|
|
@@ -2148,14 +2149,10 @@ function useDepositChainIds() {
|
|
|
2148
2149
|
function useDestinationChains() {
|
|
2149
2150
|
const { catalog } = useChainCatalog();
|
|
2150
2151
|
return _react.useMemo.call(void 0, () => {
|
|
2151
|
-
if (!catalog)
|
|
2152
|
-
return _chunkTENL4H64cjs.SOURCE_CHAINS.filter(
|
|
2153
|
-
(chain) => _chunkTENL4H64cjs.getSupportedTargetTokens.call(void 0, chain.id).length > 0
|
|
2154
|
-
).map((chain) => ({ id: chain.id, name: chain.name }));
|
|
2155
|
-
}
|
|
2152
|
+
if (!catalog) return [];
|
|
2156
2153
|
const rank = (id) => {
|
|
2157
|
-
const i =
|
|
2158
|
-
return i === -1 ?
|
|
2154
|
+
const i = _chunk4R2ZHSDQcjs.CHAIN_DISPLAY_ORDER.indexOf(id);
|
|
2155
|
+
return i === -1 ? _chunk4R2ZHSDQcjs.CHAIN_DISPLAY_ORDER.length : i;
|
|
2159
2156
|
};
|
|
2160
2157
|
return catalog.all.filter(
|
|
2161
2158
|
(c) => c.destination && c.vmType === "evm" && c.chainId !== null && !c.testnet
|
|
@@ -2166,18 +2163,16 @@ function useTargetTokens() {
|
|
|
2166
2163
|
const { catalog, shortlist } = useChainCatalog();
|
|
2167
2164
|
return _react.useMemo.call(void 0, () => {
|
|
2168
2165
|
return (chainId) => {
|
|
2169
|
-
const bundled = _chunkTENL4H64cjs.getBundledTargetTokens.call(void 0, chainId);
|
|
2170
|
-
if (bundled.length > 0) return bundled;
|
|
2171
2166
|
const fromShortlist = _optionalChain([shortlist, 'optionalAccess', _90 => _90[String(chainId)]]);
|
|
2172
|
-
if (
|
|
2167
|
+
if (fromShortlist) {
|
|
2173
2168
|
return fromShortlist.map((token) => ({
|
|
2174
2169
|
symbol: token.symbol,
|
|
2175
2170
|
address: token.address,
|
|
2176
2171
|
decimals: token.decimals
|
|
2177
2172
|
}));
|
|
2178
2173
|
}
|
|
2179
|
-
const entry = _optionalChain([catalog, 'optionalAccess',
|
|
2180
|
-
return Array.isArray(_optionalChain([entry, 'optionalAccess',
|
|
2174
|
+
const entry = _optionalChain([catalog, 'optionalAccess', _91 => _91.byChainId, 'access', _92 => _92.get, 'call', _93 => _93(chainId)]);
|
|
2175
|
+
return Array.isArray(_optionalChain([entry, 'optionalAccess', _94 => _94.supportedTokens])) ? entry.supportedTokens.map((token) => ({
|
|
2181
2176
|
symbol: token.symbol,
|
|
2182
2177
|
address: token.address,
|
|
2183
2178
|
decimals: token.decimals
|
|
@@ -2197,10 +2192,10 @@ function useChainName() {
|
|
|
2197
2192
|
const { catalog } = useChainCatalog();
|
|
2198
2193
|
return _react.useMemo.call(void 0, () => {
|
|
2199
2194
|
return (chainId) => {
|
|
2200
|
-
if (!catalog) return
|
|
2195
|
+
if (!catalog) return _chunk4R2ZHSDQcjs.getChainName.call(void 0, chainId);
|
|
2201
2196
|
const key = catalogKeyForChain(chainId);
|
|
2202
2197
|
const entry = typeof key === "number" ? catalog.byChainId.get(key) : catalog.byCaip2.get(key);
|
|
2203
|
-
return _nullishCoalesce(_optionalChain([entry, 'optionalAccess',
|
|
2198
|
+
return _nullishCoalesce(_optionalChain([entry, 'optionalAccess', _95 => _95.name]), () => ( _chunk4R2ZHSDQcjs.getChainName.call(void 0, chainId)));
|
|
2204
2199
|
};
|
|
2205
2200
|
}, [catalog]);
|
|
2206
2201
|
}
|
|
@@ -2208,10 +2203,10 @@ function useExplorerTxUrl() {
|
|
|
2208
2203
|
const { catalog } = useChainCatalog();
|
|
2209
2204
|
return _react.useMemo.call(void 0, () => {
|
|
2210
2205
|
return (chainId, txHash) => {
|
|
2211
|
-
if (chainId === "hypercore") return
|
|
2206
|
+
if (chainId === "hypercore") return _chunk4R2ZHSDQcjs.getExplorerTxUrl.call(void 0, chainId, txHash);
|
|
2212
2207
|
const key = catalog ? catalogKeyForChain(chainId) : void 0;
|
|
2213
|
-
const entry = key === void 0 ? void 0 : typeof key === "number" ? _optionalChain([catalog, 'optionalAccess',
|
|
2214
|
-
return _nullishCoalesce(catalogExplorerTxUrl(entry, txHash), () => (
|
|
2208
|
+
const entry = key === void 0 ? void 0 : typeof key === "number" ? _optionalChain([catalog, 'optionalAccess', _96 => _96.byChainId, 'access', _97 => _97.get, 'call', _98 => _98(key)]) : _optionalChain([catalog, 'optionalAccess', _99 => _99.byCaip2, 'access', _100 => _100.get, 'call', _101 => _101(key)]);
|
|
2209
|
+
return _nullishCoalesce(catalogExplorerTxUrl(entry, txHash), () => ( _chunk4R2ZHSDQcjs.getExplorerTxUrl.call(void 0, chainId, txHash)));
|
|
2215
2210
|
};
|
|
2216
2211
|
}, [catalog]);
|
|
2217
2212
|
}
|
|
@@ -2269,7 +2264,7 @@ function ChainCatalogProvider({
|
|
|
2269
2264
|
setShortlist(null);
|
|
2270
2265
|
service.getTopTokens().then((tokens) => {
|
|
2271
2266
|
if (!active || !tokens) return;
|
|
2272
|
-
|
|
2267
|
+
_chunk4R2ZHSDQcjs.publishShortlistTokens.call(void 0, tokens);
|
|
2273
2268
|
setShortlist(tokens);
|
|
2274
2269
|
});
|
|
2275
2270
|
return () => {
|
|
@@ -2421,7 +2416,7 @@ function TokenIcon({ symbol, className, fallback }) {
|
|
|
2421
2416
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2422
2417
|
CdnIcon,
|
|
2423
2418
|
{
|
|
2424
|
-
src:
|
|
2419
|
+
src: _chunk4R2ZHSDQcjs.tokenIconUrl.call(void 0, symbol),
|
|
2425
2420
|
className: `rs-token-icon ${_nullishCoalesce(className, () => ( ""))}`.trimEnd(),
|
|
2426
2421
|
fallback
|
|
2427
2422
|
}
|
|
@@ -2445,6 +2440,22 @@ function isUnsupportedChainSwitchError(error) {
|
|
|
2445
2440
|
const message = (error instanceof Error ? error.message : String(error)).toLowerCase();
|
|
2446
2441
|
return name === "SwitchChainNotSupportedError" || message.includes("does not support programmatic chain switching") || message.includes("switch chain not supported") || message.includes("method not found") || message.includes("does not exist") || message.includes("is not available");
|
|
2447
2442
|
}
|
|
2443
|
+
var OPAQUE_REVERT_REASONS = [
|
|
2444
|
+
"unexpected error",
|
|
2445
|
+
"internal error",
|
|
2446
|
+
"unknown error",
|
|
2447
|
+
"internal json-rpc error"
|
|
2448
|
+
];
|
|
2449
|
+
var DETAIL_SECTION_HEADINGS = [
|
|
2450
|
+
"Request Arguments:",
|
|
2451
|
+
"Raw Call Arguments:",
|
|
2452
|
+
"Request body:",
|
|
2453
|
+
"Contract Call:",
|
|
2454
|
+
"Docs:",
|
|
2455
|
+
"Details:",
|
|
2456
|
+
"Version:",
|
|
2457
|
+
"URL:"
|
|
2458
|
+
];
|
|
2448
2459
|
function formatUserError(raw) {
|
|
2449
2460
|
const lower = raw.toLowerCase();
|
|
2450
2461
|
if (lower.includes("user rejected") || lower.includes("user denied")) {
|
|
@@ -2456,6 +2467,22 @@ function formatUserError(raw) {
|
|
|
2456
2467
|
if (lower.includes("nonce too low") || lower.includes("nonce too high")) {
|
|
2457
2468
|
return "Transaction conflict \u2014 please try again";
|
|
2458
2469
|
}
|
|
2470
|
+
const revertMarker = "reverted with the following reason:";
|
|
2471
|
+
const revertIdx = lower.indexOf(revertMarker);
|
|
2472
|
+
const revertReason = revertIdx === -1 ? null : _nullishCoalesce(raw.slice(revertIdx + revertMarker.length).split(/\n[^\S\n]*\n/)[0].split("\n").map((line) => line.trim()).find(
|
|
2473
|
+
(line) => line.length > 0 && !DETAIL_SECTION_HEADINGS.some(
|
|
2474
|
+
(heading) => line.startsWith(heading)
|
|
2475
|
+
)
|
|
2476
|
+
), () => ( ""));
|
|
2477
|
+
if (revertReason !== null) {
|
|
2478
|
+
const reasonLower = revertReason.toLowerCase();
|
|
2479
|
+
if (reasonLower.includes("execution reverted")) {
|
|
2480
|
+
return "Transaction would fail on-chain";
|
|
2481
|
+
}
|
|
2482
|
+
if (revertReason === "" || revertReason === "0x" || OPAQUE_REVERT_REASONS.some((opaque) => reasonLower.includes(opaque))) {
|
|
2483
|
+
return "Your wallet couldn't send the transaction \u2014 please try again";
|
|
2484
|
+
}
|
|
2485
|
+
}
|
|
2459
2486
|
if (lower.includes("execution reverted")) {
|
|
2460
2487
|
return "Transaction would fail on-chain";
|
|
2461
2488
|
}
|
|
@@ -2474,7 +2501,7 @@ function formatUserError(raw) {
|
|
|
2474
2501
|
if (lower.includes("rate limit") || lower.includes("429")) {
|
|
2475
2502
|
return "Rate limited \u2014 please try again shortly";
|
|
2476
2503
|
}
|
|
2477
|
-
let cleaned = raw;
|
|
2504
|
+
let cleaned = revertReason || raw;
|
|
2478
2505
|
const stripMarkers = [
|
|
2479
2506
|
"\n\nRequest Arguments:",
|
|
2480
2507
|
"\nRaw Call Arguments:",
|
|
@@ -2522,29 +2549,29 @@ var EVM_ADDRESS_RE = /^0x[a-fA-F0-9]{40}$/;
|
|
|
2522
2549
|
function resolveTokenDisplay(token, chain, fallback) {
|
|
2523
2550
|
if (token !== void 0) {
|
|
2524
2551
|
if (chain === "solana") {
|
|
2525
|
-
const solanaToken =
|
|
2552
|
+
const solanaToken = _chunk4R2ZHSDQcjs.getSolanaTokenByMint.call(void 0, token);
|
|
2526
2553
|
if (solanaToken) {
|
|
2527
2554
|
return { symbol: solanaToken.symbol, decimals: solanaToken.decimals };
|
|
2528
2555
|
}
|
|
2529
2556
|
} else if (chain === "hypercore") {
|
|
2530
|
-
const t =
|
|
2557
|
+
const t = _chunk4R2ZHSDQcjs.HYPERCORE_SOURCE_TOKENS.find(
|
|
2531
2558
|
(x) => x.address.toLowerCase() === token.toLowerCase()
|
|
2532
2559
|
);
|
|
2533
2560
|
if (t) return { symbol: t.symbol, decimals: t.decimals };
|
|
2534
2561
|
} else if (EVM_ADDRESS_RE.test(token)) {
|
|
2535
|
-
const symbol =
|
|
2536
|
-
const decimals =
|
|
2562
|
+
const symbol = _chunk4R2ZHSDQcjs.getTokenSymbol.call(void 0, token, chain);
|
|
2563
|
+
const decimals = _chunk4R2ZHSDQcjs.findTokenDecimals.call(void 0, token, chain);
|
|
2537
2564
|
if (symbol !== "Token" || decimals !== void 0) {
|
|
2538
2565
|
return {
|
|
2539
|
-
symbol: symbol !== "Token" ? symbol : _nullishCoalesce(_optionalChain([fallback, 'optionalAccess',
|
|
2540
|
-
decimals: _nullishCoalesce(decimals, () => ( _optionalChain([fallback, 'optionalAccess',
|
|
2566
|
+
symbol: symbol !== "Token" ? symbol : _nullishCoalesce(_optionalChain([fallback, 'optionalAccess', _102 => _102.symbol]), () => ( symbol)),
|
|
2567
|
+
decimals: _nullishCoalesce(decimals, () => ( _optionalChain([fallback, 'optionalAccess', _103 => _103.decimals])))
|
|
2541
2568
|
};
|
|
2542
2569
|
}
|
|
2543
2570
|
}
|
|
2544
2571
|
}
|
|
2545
2572
|
return {
|
|
2546
|
-
symbol: _nullishCoalesce(_optionalChain([fallback, 'optionalAccess',
|
|
2547
|
-
decimals: _optionalChain([fallback, 'optionalAccess',
|
|
2573
|
+
symbol: _nullishCoalesce(_optionalChain([fallback, 'optionalAccess', _104 => _104.symbol]), () => ( "Token")),
|
|
2574
|
+
decimals: _optionalChain([fallback, 'optionalAccess', _105 => _105.decimals])
|
|
2548
2575
|
};
|
|
2549
2576
|
}
|
|
2550
2577
|
function maxFractionDigitsFor(symbol) {
|
|
@@ -2582,13 +2609,13 @@ function priceUsdFor(symbol, prices) {
|
|
|
2582
2609
|
}
|
|
2583
2610
|
function isRecognizedToken(address, chain) {
|
|
2584
2611
|
if (address === void 0 || chain === void 0) return false;
|
|
2585
|
-
if (chain === "solana") return
|
|
2612
|
+
if (chain === "solana") return _chunk4R2ZHSDQcjs.getSolanaTokenByMint.call(void 0, address) !== void 0;
|
|
2586
2613
|
if (chain === "hypercore") {
|
|
2587
|
-
return
|
|
2614
|
+
return _chunk4R2ZHSDQcjs.HYPERCORE_SOURCE_TOKENS.some(
|
|
2588
2615
|
(t) => t.address.toLowerCase() === address.toLowerCase()
|
|
2589
2616
|
);
|
|
2590
2617
|
}
|
|
2591
|
-
return EVM_ADDRESS_RE.test(address) &&
|
|
2618
|
+
return EVM_ADDRESS_RE.test(address) && _chunk4R2ZHSDQcjs.isRegistryTokenOnChain.call(void 0, address, chain);
|
|
2592
2619
|
}
|
|
2593
2620
|
function estimateReceiveAmount(params) {
|
|
2594
2621
|
const {
|
|
@@ -2741,19 +2768,19 @@ var CUSTOM_PRIMARY_VARS = [
|
|
|
2741
2768
|
function applyTheme(element, theme) {
|
|
2742
2769
|
if (!element) return;
|
|
2743
2770
|
const parent = element.parentElement;
|
|
2744
|
-
const targets = _optionalChain([parent, 'optionalAccess',
|
|
2745
|
-
if (_optionalChain([theme, 'optionalAccess',
|
|
2771
|
+
const targets = _optionalChain([parent, 'optionalAccess', _106 => _106.classList, 'access', _107 => _107.contains, 'call', _108 => _108("rs-modal-content")]) ? [element, parent] : [element];
|
|
2772
|
+
if (_optionalChain([theme, 'optionalAccess', _109 => _109.mode])) {
|
|
2746
2773
|
for (const t of targets) t.setAttribute("data-theme", theme.mode);
|
|
2747
2774
|
} else {
|
|
2748
2775
|
for (const t of targets) t.removeAttribute("data-theme");
|
|
2749
2776
|
}
|
|
2750
|
-
if (_optionalChain([theme, 'optionalAccess',
|
|
2777
|
+
if (_optionalChain([theme, 'optionalAccess', _110 => _110.fontColor])) {
|
|
2751
2778
|
setVar(targets, "--rs-foreground", theme.fontColor);
|
|
2752
2779
|
}
|
|
2753
|
-
if (_optionalChain([theme, 'optionalAccess',
|
|
2780
|
+
if (_optionalChain([theme, 'optionalAccess', _111 => _111.iconColor])) {
|
|
2754
2781
|
setVar(targets, "--rs-icon", theme.iconColor);
|
|
2755
2782
|
}
|
|
2756
|
-
if (_optionalChain([theme, 'optionalAccess',
|
|
2783
|
+
if (_optionalChain([theme, 'optionalAccess', _112 => _112.ctaColor])) {
|
|
2757
2784
|
const derived = deriveCustomPrimary(theme.ctaColor);
|
|
2758
2785
|
if (derived) {
|
|
2759
2786
|
setVar(targets, "--rs-primary", derived.base);
|
|
@@ -2778,18 +2805,18 @@ function applyTheme(element, theme) {
|
|
|
2778
2805
|
}
|
|
2779
2806
|
} else {
|
|
2780
2807
|
for (const v of CUSTOM_PRIMARY_VARS) clearVar(targets, v);
|
|
2781
|
-
if (_optionalChain([theme, 'optionalAccess',
|
|
2808
|
+
if (_optionalChain([theme, 'optionalAccess', _113 => _113.ctaHoverColor])) {
|
|
2782
2809
|
setVar(targets, "--rs-primary-hover", theme.ctaHoverColor);
|
|
2783
2810
|
}
|
|
2784
2811
|
}
|
|
2785
|
-
if (_optionalChain([theme, 'optionalAccess',
|
|
2812
|
+
if (_optionalChain([theme, 'optionalAccess', _114 => _114.borderColor])) {
|
|
2786
2813
|
setVar(targets, "--rs-border", theme.borderColor);
|
|
2787
2814
|
setVar(targets, "--rs-border-surface", theme.borderColor);
|
|
2788
2815
|
}
|
|
2789
|
-
if (_optionalChain([theme, 'optionalAccess',
|
|
2816
|
+
if (_optionalChain([theme, 'optionalAccess', _115 => _115.backgroundColor])) {
|
|
2790
2817
|
setVar(targets, "--rs-background", theme.backgroundColor);
|
|
2791
2818
|
}
|
|
2792
|
-
if (_optionalChain([theme, 'optionalAccess',
|
|
2819
|
+
if (_optionalChain([theme, 'optionalAccess', _116 => _116.radius])) {
|
|
2793
2820
|
const scale = RADIUS_SCALE[theme.radius];
|
|
2794
2821
|
setVar(targets, "--rs-radius-sm", scale.sm);
|
|
2795
2822
|
setVar(targets, "--rs-radius-md", scale.md);
|
|
@@ -2887,4 +2914,5 @@ function checkBackendUrl(component, backendUrl) {
|
|
|
2887
2914
|
|
|
2888
2915
|
|
|
2889
2916
|
|
|
2890
|
-
|
|
2917
|
+
|
|
2918
|
+
exports.Modal = Modal; exports.WalletIcon = WalletIcon; exports.ExternalLinkIcon = ExternalLinkIcon; exports.CheckIcon = CheckIcon; exports.TransferCryptoIcon = TransferCryptoIcon; exports.ChevronRightIcon = ChevronRightIcon; exports.ChevronLeftIcon = ChevronLeftIcon; exports.ChevronDownIcon = ChevronDownIcon; exports.CloseIcon = CloseIcon; exports.HandCoinsIcon = HandCoinsIcon; exports.CoinsIcon = CoinsIcon; exports.HistoryIcon = HistoryIcon; exports.InfoIcon = InfoIcon; exports.CopyIcon = CopyIcon; exports.ArrowUpRightIcon = ArrowUpRightIcon; exports.AlertTriangleIcon = AlertTriangleIcon; exports.PercentIcon = PercentIcon; exports.ClockIcon = ClockIcon; exports.PlusCircleIcon = PlusCircleIcon; exports.CircleArrowOutUpLeftIcon = CircleArrowOutUpLeftIcon; exports.CardIcon = CardIcon; exports.BankIcon = BankIcon; exports.UnplugIcon = UnplugIcon; exports.MigrateAssetsIcon = MigrateAssetsIcon; exports.AppleIcon = AppleIcon; exports.BodyHeader = BodyHeader; exports.CdnIcon = CdnIcon; exports.PoweredBy = PoweredBy; exports.Spinner = Spinner; exports.catalogKeyForChain = catalogKeyForChain; exports.debugLog = debugLog; exports.debugError = debugError; exports.getAssetId = getAssetId; exports.chainIdsByValue = chainIdsByValue; exports.portfolioToAssets = portfolioToAssets; exports.isNativeAsset = isNativeAsset; exports.formatFeeUsd = formatFeeUsd; exports.quoteFeeRow = quoteFeeRow; exports.quoteFeeGroups = quoteFeeGroups; exports.SwappedConnectFeeChangedError = SwappedConnectFeeChangedError; exports.SUPPORTED_CONNECT_EXCHANGE_COUNT = SUPPORTED_CONNECT_EXCHANGE_COUNT; exports.resolveAppFeeBps = resolveAppFeeBps; exports.createDepositService = createDepositService; exports.rpcUrlFor = rpcUrlFor; exports.RpcUrlsProvider = RpcUrlsProvider; exports.useRpcUrls = useRpcUrls; exports.useStableRpcUrls = useStableRpcUrls; exports.getPublicClient = getPublicClient; exports.peekRuntimeChains = peekRuntimeChains; exports.primeRuntimeChains = primeRuntimeChains; exports.useChainCatalog = useChainCatalog; exports.useCatalogChain = useCatalogChain; exports.useDepositChainIds = useDepositChainIds; exports.useDestinationChains = useDestinationChains; exports.useTargetTokens = useTargetTokens; exports.useIsDepositChain = useIsDepositChain; exports.useChainName = useChainName; exports.useExplorerTxUrl = useExplorerTxUrl; exports.ChainCatalogProvider = ChainCatalogProvider; exports.useLatestRef = useLatestRef; exports.Button = Button; exports.Callout = Callout; exports.TokenIcon = TokenIcon; exports.currencyFormatter = currencyFormatter; exports.tokenFormatter = tokenFormatter; exports.isUnsupportedChainSwitchError = isUnsupportedChainSwitchError; exports.formatUserError = formatUserError; exports.resolveTokenDisplay = resolveTokenDisplay; exports.formatTokenAmount = formatTokenAmount; exports.tokenAmountToNumber = tokenAmountToNumber; exports.formatRawTokenAmount = formatRawTokenAmount; exports.isDisplayStablecoinSymbol = isDisplayStablecoinSymbol; exports.isRecognizedToken = isRecognizedToken; exports.estimateReceiveAmount = estimateReceiveAmount; exports.formatQuotedReceive = formatQuotedReceive; exports.formatReceiveEstimate = formatReceiveEstimate; exports.applyTheme = applyTheme; exports.checkBackendUrl = checkBackendUrl;
|