@rhinestone/deposit-modal 0.9.1 → 0.10.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-JUJI7UHE.mjs → DepositModalReown-MTWT6Y66.mjs} +5 -5
- package/dist/{DepositModalReown-YQSO4SVY.cjs → DepositModalReown-S3DSFXTX.cjs} +9 -9
- package/dist/{chunk-7OQO6JDC.mjs → chunk-5NJYW5FT.mjs} +3 -3
- package/dist/{chunk-QLZ5RZTA.mjs → chunk-5OEWGJR4.mjs} +1 -1
- package/dist/{chunk-WUQZYQRK.mjs → chunk-7TV7GLJB.mjs} +62 -1
- package/dist/{chunk-EEEQZOTJ.cjs → chunk-A42XAHIB.cjs} +66 -66
- package/dist/{chunk-SQOEHQNT.cjs → chunk-DEF767BA.cjs} +52 -52
- package/dist/{chunk-AYWEWI47.mjs → chunk-KW32UBUQ.mjs} +1 -1
- package/dist/{chunk-QGXAAFHU.mjs → chunk-LR7MKHYV.mjs} +2 -2
- package/dist/{chunk-N3OHR3T2.mjs → chunk-MHIOMTMM.mjs} +227 -24
- package/dist/{chunk-XJE5MRY4.cjs → chunk-NF4NBRUP.cjs} +1 -1
- package/dist/{chunk-6U2H3R3T.cjs → chunk-PUJHXHRA.cjs} +108 -47
- package/dist/{chunk-ITFRTPGF.cjs → chunk-UMCDZJMG.cjs} +57 -57
- package/dist/{chunk-GYEUZSQP.mjs → chunk-VDGT6NZQ.mjs} +1 -1
- package/dist/{chunk-EAUF7SGM.cjs → chunk-VTVOHNXM.cjs} +3 -3
- package/dist/{chunk-VQJHYWAE.cjs → chunk-W4YAOJPG.cjs} +570 -367
- package/dist/claim.cjs +5 -5
- package/dist/claim.mjs +4 -4
- package/dist/constants.cjs +2 -2
- package/dist/constants.d.cts +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/constants.mjs +1 -1
- package/dist/deposit.cjs +6 -6
- package/dist/deposit.mjs +5 -5
- package/dist/index.cjs +8 -8
- package/dist/index.mjs +7 -7
- package/dist/styles.css +14 -0
- package/dist/withdraw.cjs +5 -5
- package/dist/withdraw.mjs +4 -4
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); 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 _chunkNF4NBRUPcjs = require('./chunk-NF4NBRUP.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
@@ -913,7 +913,7 @@ function createDepositService(baseUrl, options) {
|
|
|
913
913
|
try {
|
|
914
914
|
const response = await fetch(apiUrl("/qr/tokens"), {
|
|
915
915
|
method: "GET",
|
|
916
|
-
headers:
|
|
916
|
+
headers: _chunkNF4NBRUPcjs.SERVICE_HEADERS
|
|
917
917
|
});
|
|
918
918
|
if (!response.ok) {
|
|
919
919
|
debugLog(debug, scope, "getTopTokens:unavailable", {
|
|
@@ -968,7 +968,7 @@ function createDepositService(baseUrl, options) {
|
|
|
968
968
|
});
|
|
969
969
|
const response = await fetch(url, {
|
|
970
970
|
method: "POST",
|
|
971
|
-
headers:
|
|
971
|
+
headers: _chunkNF4NBRUPcjs.SERVICE_HEADERS,
|
|
972
972
|
body: JSON.stringify({ account: params })
|
|
973
973
|
});
|
|
974
974
|
if (!response.ok) {
|
|
@@ -1001,7 +1001,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1001
1001
|
debugLog(debug, scope, "fetchPortfolio:request", { url, address });
|
|
1002
1002
|
const response = await fetch(url, {
|
|
1003
1003
|
method: "GET",
|
|
1004
|
-
headers:
|
|
1004
|
+
headers: _chunkNF4NBRUPcjs.SERVICE_HEADERS
|
|
1005
1005
|
});
|
|
1006
1006
|
if (!response.ok) {
|
|
1007
1007
|
const error = await response.json().catch(() => ({ error: "Unknown error" }));
|
|
@@ -1048,7 +1048,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1048
1048
|
debugLog(debug, scope, "fetchSolanaPortfolio:request", { url, address });
|
|
1049
1049
|
const response = await fetch(url, {
|
|
1050
1050
|
method: "GET",
|
|
1051
|
-
headers:
|
|
1051
|
+
headers: _chunkNF4NBRUPcjs.SERVICE_HEADERS
|
|
1052
1052
|
});
|
|
1053
1053
|
if (!response.ok) {
|
|
1054
1054
|
const error = await response.json().catch(() => ({ error: "Unknown error" }));
|
|
@@ -1078,7 +1078,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1078
1078
|
debugLog(debug, scope, "checkAccount:request", { url, address });
|
|
1079
1079
|
const response = await fetch(url, {
|
|
1080
1080
|
method: "GET",
|
|
1081
|
-
headers:
|
|
1081
|
+
headers: _chunkNF4NBRUPcjs.SERVICE_HEADERS
|
|
1082
1082
|
});
|
|
1083
1083
|
if (!response.ok) {
|
|
1084
1084
|
const error = await response.json().catch(() => ({ error: "Unknown error" }));
|
|
@@ -1113,7 +1113,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1113
1113
|
);
|
|
1114
1114
|
const response = await fetch(url, {
|
|
1115
1115
|
method: "GET",
|
|
1116
|
-
headers:
|
|
1116
|
+
headers: _chunkNF4NBRUPcjs.SERVICE_HEADERS,
|
|
1117
1117
|
cache: "no-store"
|
|
1118
1118
|
});
|
|
1119
1119
|
if (!response.ok) {
|
|
@@ -1141,7 +1141,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1141
1141
|
);
|
|
1142
1142
|
const response = await fetch(url, {
|
|
1143
1143
|
method: "GET",
|
|
1144
|
-
headers:
|
|
1144
|
+
headers: _chunkNF4NBRUPcjs.SERVICE_HEADERS,
|
|
1145
1145
|
cache: "no-store"
|
|
1146
1146
|
});
|
|
1147
1147
|
if (!response.ok) {
|
|
@@ -1165,7 +1165,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1165
1165
|
);
|
|
1166
1166
|
const response = await fetch(url, {
|
|
1167
1167
|
method: "GET",
|
|
1168
|
-
headers:
|
|
1168
|
+
headers: _chunkNF4NBRUPcjs.SERVICE_HEADERS,
|
|
1169
1169
|
cache: "no-store"
|
|
1170
1170
|
});
|
|
1171
1171
|
if (!response.ok) {
|
|
@@ -1184,6 +1184,67 @@ function createDepositService(baseUrl, options) {
|
|
|
1184
1184
|
});
|
|
1185
1185
|
return { lastEvent };
|
|
1186
1186
|
},
|
|
1187
|
+
async getPositions(address) {
|
|
1188
|
+
const url = apiUrl(`/positions/${address}`);
|
|
1189
|
+
debugLog(debug, scope, "getPositions:request", { url, address });
|
|
1190
|
+
const response = await fetch(url, { headers: _chunkNF4NBRUPcjs.SERVICE_HEADERS });
|
|
1191
|
+
if (!response.ok) {
|
|
1192
|
+
const error = await response.json().catch(() => ({ error: "Unknown error" }));
|
|
1193
|
+
debugError(debug, scope, "getPositions:failed", error, {
|
|
1194
|
+
status: response.status,
|
|
1195
|
+
address
|
|
1196
|
+
});
|
|
1197
|
+
throw new Error(
|
|
1198
|
+
error.error || `Position lookup failed: ${response.status}`
|
|
1199
|
+
);
|
|
1200
|
+
}
|
|
1201
|
+
const result = await response.json();
|
|
1202
|
+
debugLog(debug, scope, "getPositions:success", {
|
|
1203
|
+
address,
|
|
1204
|
+
count: _nullishCoalesce(_optionalChain([result, 'access', _30 => _30.positions, 'optionalAccess', _31 => _31.length]), () => ( 0)),
|
|
1205
|
+
totalUsd: result.totalUsd,
|
|
1206
|
+
failures: _optionalChain([result, 'access', _32 => _32.failures, 'optionalAccess', _33 => _33.map, 'call', _34 => _34((f) => f.venue)])
|
|
1207
|
+
});
|
|
1208
|
+
return result;
|
|
1209
|
+
},
|
|
1210
|
+
async prepareUnwind(params) {
|
|
1211
|
+
const { address, account, market, chainId, asset, amount } = params;
|
|
1212
|
+
const url = apiUrl(`/positions/${address}/unwind`);
|
|
1213
|
+
debugLog(debug, scope, "prepareUnwind:request", {
|
|
1214
|
+
url,
|
|
1215
|
+
address,
|
|
1216
|
+
account,
|
|
1217
|
+
market,
|
|
1218
|
+
chainId,
|
|
1219
|
+
asset,
|
|
1220
|
+
amount
|
|
1221
|
+
});
|
|
1222
|
+
const response = await fetch(url, {
|
|
1223
|
+
method: "POST",
|
|
1224
|
+
headers: _chunkNF4NBRUPcjs.SERVICE_HEADERS,
|
|
1225
|
+
body: JSON.stringify({ account, market, chainId, asset, amount })
|
|
1226
|
+
});
|
|
1227
|
+
if (!response.ok) {
|
|
1228
|
+
const error = await response.json().catch(() => ({ error: "Unknown error" }));
|
|
1229
|
+
debugError(debug, scope, "prepareUnwind:failed", error, {
|
|
1230
|
+
status: response.status,
|
|
1231
|
+
address,
|
|
1232
|
+
market,
|
|
1233
|
+
asset
|
|
1234
|
+
});
|
|
1235
|
+
throw new Error(
|
|
1236
|
+
error.error || `Unwind preparation failed: ${response.status}`
|
|
1237
|
+
);
|
|
1238
|
+
}
|
|
1239
|
+
const result = await response.json();
|
|
1240
|
+
debugLog(debug, scope, "prepareUnwind:success", {
|
|
1241
|
+
address,
|
|
1242
|
+
amount: result.amount,
|
|
1243
|
+
isFullExit: result.isFullExit,
|
|
1244
|
+
recipient: result.recipient
|
|
1245
|
+
});
|
|
1246
|
+
return result;
|
|
1247
|
+
},
|
|
1187
1248
|
async submitPolymarketWithdraw(params) {
|
|
1188
1249
|
const { depositWallet, owner, nonce, deadline, calls, signature } = params;
|
|
1189
1250
|
const url = apiUrl(`/polymarket/withdraw`);
|
|
@@ -1196,7 +1257,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1196
1257
|
});
|
|
1197
1258
|
const response = await fetch(url, {
|
|
1198
1259
|
method: "POST",
|
|
1199
|
-
headers:
|
|
1260
|
+
headers: _chunkNF4NBRUPcjs.SERVICE_HEADERS,
|
|
1200
1261
|
body: JSON.stringify({
|
|
1201
1262
|
depositWallet,
|
|
1202
1263
|
owner,
|
|
@@ -1220,7 +1281,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1220
1281
|
const result = await response.json();
|
|
1221
1282
|
debugLog(debug, scope, "submitPolymarketWithdraw:success", {
|
|
1222
1283
|
depositWallet,
|
|
1223
|
-
txHash: _optionalChain([result, 'optionalAccess',
|
|
1284
|
+
txHash: _optionalChain([result, 'optionalAccess', _35 => _35.txHash]) ? shortRef(result.txHash) : void 0
|
|
1224
1285
|
});
|
|
1225
1286
|
return result;
|
|
1226
1287
|
},
|
|
@@ -1238,7 +1299,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1238
1299
|
});
|
|
1239
1300
|
const response = await fetch(url, {
|
|
1240
1301
|
method: "GET",
|
|
1241
|
-
headers:
|
|
1302
|
+
headers: _chunkNF4NBRUPcjs.SERVICE_HEADERS,
|
|
1242
1303
|
cache: "no-store"
|
|
1243
1304
|
});
|
|
1244
1305
|
if (!response.ok) {
|
|
@@ -1255,8 +1316,8 @@ function createDepositService(baseUrl, options) {
|
|
|
1255
1316
|
);
|
|
1256
1317
|
}
|
|
1257
1318
|
const data = await response.json();
|
|
1258
|
-
const deposits = Array.isArray(_optionalChain([data, 'optionalAccess',
|
|
1259
|
-
const nextCursor = _nullishCoalesce(_nullishCoalesce(_optionalChain([data, 'optionalAccess',
|
|
1319
|
+
const deposits = Array.isArray(_optionalChain([data, 'optionalAccess', _36 => _36.deposits])) ? data.deposits : [];
|
|
1320
|
+
const nextCursor = _nullishCoalesce(_nullishCoalesce(_optionalChain([data, 'optionalAccess', _37 => _37.nextCursor]), () => ( _optionalChain([data, 'optionalAccess', _38 => _38.next_cursor]))), () => ( null));
|
|
1260
1321
|
debugLog(debug, scope, "fetchDepositHistory:success", {
|
|
1261
1322
|
recipient: shortRef(params.recipient),
|
|
1262
1323
|
count: deposits.length,
|
|
@@ -1269,8 +1330,8 @@ function createDepositService(baseUrl, options) {
|
|
|
1269
1330
|
const token = _chunkH577RJN5cjs.getSolanaTokenByMint.call(void 0, params.destinationToken);
|
|
1270
1331
|
return {
|
|
1271
1332
|
hasLiquidity: true,
|
|
1272
|
-
symbol: _nullishCoalesce(_optionalChain([token, 'optionalAccess',
|
|
1273
|
-
decimals: _nullishCoalesce(_optionalChain([token, 'optionalAccess',
|
|
1333
|
+
symbol: _nullishCoalesce(_optionalChain([token, 'optionalAccess', _39 => _39.symbol]), () => ( "Token")),
|
|
1334
|
+
decimals: _nullishCoalesce(_optionalChain([token, 'optionalAccess', _40 => _40.decimals]), () => ( 9)),
|
|
1274
1335
|
unlimited: true,
|
|
1275
1336
|
maxAmount: null
|
|
1276
1337
|
};
|
|
@@ -1291,7 +1352,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1291
1352
|
});
|
|
1292
1353
|
const response = await fetch(url, {
|
|
1293
1354
|
method: "GET",
|
|
1294
|
-
headers:
|
|
1355
|
+
headers: _chunkNF4NBRUPcjs.SERVICE_HEADERS,
|
|
1295
1356
|
cache: "no-store"
|
|
1296
1357
|
});
|
|
1297
1358
|
if (!response.ok) {
|
|
@@ -1336,7 +1397,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1336
1397
|
try {
|
|
1337
1398
|
const response = await fetch(url, {
|
|
1338
1399
|
method: "POST",
|
|
1339
|
-
headers:
|
|
1400
|
+
headers: _chunkNF4NBRUPcjs.SERVICE_HEADERS,
|
|
1340
1401
|
body: JSON.stringify(body),
|
|
1341
1402
|
cache: "no-store"
|
|
1342
1403
|
});
|
|
@@ -1373,7 +1434,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1373
1434
|
try {
|
|
1374
1435
|
const response = await fetch(url, {
|
|
1375
1436
|
method: "GET",
|
|
1376
|
-
headers:
|
|
1437
|
+
headers: _chunkNF4NBRUPcjs.SERVICE_HEADERS,
|
|
1377
1438
|
cache: "no-store"
|
|
1378
1439
|
});
|
|
1379
1440
|
if (!response.ok) {
|
|
@@ -1403,7 +1464,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1403
1464
|
try {
|
|
1404
1465
|
const response = await fetch(url, {
|
|
1405
1466
|
method: "GET",
|
|
1406
|
-
headers:
|
|
1467
|
+
headers: _chunkNF4NBRUPcjs.SERVICE_HEADERS,
|
|
1407
1468
|
cache: "no-store"
|
|
1408
1469
|
});
|
|
1409
1470
|
if (!response.ok) {
|
|
@@ -1428,7 +1489,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1428
1489
|
});
|
|
1429
1490
|
const response = await fetch(url, {
|
|
1430
1491
|
method: "POST",
|
|
1431
|
-
headers:
|
|
1492
|
+
headers: _chunkNF4NBRUPcjs.SERVICE_HEADERS,
|
|
1432
1493
|
body: JSON.stringify(params)
|
|
1433
1494
|
});
|
|
1434
1495
|
if (!response.ok) {
|
|
@@ -1460,7 +1521,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1460
1521
|
});
|
|
1461
1522
|
const response = await fetch(url, {
|
|
1462
1523
|
method: "POST",
|
|
1463
|
-
headers:
|
|
1524
|
+
headers: _chunkNF4NBRUPcjs.SERVICE_HEADERS,
|
|
1464
1525
|
body: JSON.stringify(params)
|
|
1465
1526
|
});
|
|
1466
1527
|
if (!response.ok) {
|
|
@@ -1497,7 +1558,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1497
1558
|
debugLog(debug, scope, "getSwappedConnectExchanges:request");
|
|
1498
1559
|
const response = await fetch(url, {
|
|
1499
1560
|
method: "GET",
|
|
1500
|
-
headers:
|
|
1561
|
+
headers: _chunkNF4NBRUPcjs.SERVICE_HEADERS,
|
|
1501
1562
|
cache: "no-store"
|
|
1502
1563
|
});
|
|
1503
1564
|
if (!response.ok) {
|
|
@@ -1550,7 +1611,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1550
1611
|
try {
|
|
1551
1612
|
const response = await fetch(url, {
|
|
1552
1613
|
method: "GET",
|
|
1553
|
-
headers:
|
|
1614
|
+
headers: _chunkNF4NBRUPcjs.SERVICE_HEADERS,
|
|
1554
1615
|
cache: "no-store"
|
|
1555
1616
|
});
|
|
1556
1617
|
if (!response.ok) {
|
|
@@ -1626,7 +1687,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1626
1687
|
try {
|
|
1627
1688
|
const response = await fetch(url, {
|
|
1628
1689
|
method: "GET",
|
|
1629
|
-
headers:
|
|
1690
|
+
headers: _chunkNF4NBRUPcjs.SERVICE_HEADERS,
|
|
1630
1691
|
cache: "no-store"
|
|
1631
1692
|
});
|
|
1632
1693
|
if (!response.ok) {
|
|
@@ -1653,7 +1714,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1653
1714
|
);
|
|
1654
1715
|
const response = await fetch(url, {
|
|
1655
1716
|
method: "GET",
|
|
1656
|
-
headers:
|
|
1717
|
+
headers: _chunkNF4NBRUPcjs.SERVICE_HEADERS,
|
|
1657
1718
|
cache: "no-store"
|
|
1658
1719
|
});
|
|
1659
1720
|
if (!response.ok) return null;
|
|
@@ -1694,16 +1755,16 @@ function createDepositService(baseUrl, options) {
|
|
|
1694
1755
|
}
|
|
1695
1756
|
function normalizeDirectPortfolio(data) {
|
|
1696
1757
|
const rawTokens = _nullishCoalesce(_nullishCoalesce(extractArray(data, "tokens"), () => ( extractArray(
|
|
1697
|
-
_optionalChain([data, 'optionalAccess',
|
|
1758
|
+
_optionalChain([data, 'optionalAccess', _41 => _41.data]),
|
|
1698
1759
|
"tokens"
|
|
1699
1760
|
))), () => ( []));
|
|
1700
|
-
const totalUsd = _nullishCoalesce(_nullishCoalesce(extractNumber(data, "totalUsd"), () => ( extractNumber(_optionalChain([data, 'optionalAccess',
|
|
1761
|
+
const totalUsd = _nullishCoalesce(_nullishCoalesce(extractNumber(data, "totalUsd"), () => ( extractNumber(_optionalChain([data, 'optionalAccess', _42 => _42.data]), "totalUsd"))), () => ( 0));
|
|
1701
1762
|
const tokens = rawTokens.map((token) => normalizeDirectToken(token)).filter((token) => Boolean(token));
|
|
1702
1763
|
return { tokens, totalUsd };
|
|
1703
1764
|
}
|
|
1704
1765
|
function extractOrchestratorPortfolio(data) {
|
|
1705
1766
|
const portfolio = _nullishCoalesce(extractArray(data, "portfolio"), () => ( extractArray(
|
|
1706
|
-
_optionalChain([data, 'optionalAccess',
|
|
1767
|
+
_optionalChain([data, 'optionalAccess', _43 => _43.data]),
|
|
1707
1768
|
"portfolio"
|
|
1708
1769
|
)));
|
|
1709
1770
|
if (!portfolio || !Array.isArray(portfolio)) return null;
|
|
@@ -1714,7 +1775,7 @@ function normalizeOrchestratorPortfolio(data) {
|
|
|
1714
1775
|
for (const tokenData of data.portfolio || []) {
|
|
1715
1776
|
const chainBalances = _nullishCoalesce(_nullishCoalesce(tokenData.tokenChainBalance, () => ( tokenData.chainBalances)), () => ( []));
|
|
1716
1777
|
for (const chainBalance of chainBalances) {
|
|
1717
|
-
const unlocked = _nullishCoalesce(_optionalChain([chainBalance, 'access',
|
|
1778
|
+
const unlocked = _nullishCoalesce(_optionalChain([chainBalance, 'access', _44 => _44.balance, 'optionalAccess', _45 => _45.unlocked]), () => ( "0"));
|
|
1718
1779
|
const normalizedName = tokenData.tokenName.trim();
|
|
1719
1780
|
const isNativeSymbol = normalizedName.toUpperCase() === "ETH" || normalizedName.toUpperCase() === "ETHER";
|
|
1720
1781
|
const tokenAddress = _nullishCoalesce(_nullishCoalesce(chainBalance.tokenAddress, () => ( extractTokenAddress(tokenData, chainBalance.chainId))), () => ( _chunkH577RJN5cjs.getTokenAddress.call(void 0, tokenData.tokenName, chainBalance.chainId)));
|
|
@@ -1753,7 +1814,7 @@ function normalizeDirectToken(token) {
|
|
|
1753
1814
|
const registryChainId = typeof chainId === "number" ? chainId : chainId === "hypercore" ? _chunkH577RJN5cjs.HYPERCORE_CHAIN_ID : void 0;
|
|
1754
1815
|
const symbol = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(extractString(token, "symbol"), () => ( extractString(token, "tokenSymbol"))), () => ( extractString(token, "tokenName"))), () => ( extractString(token, "name")));
|
|
1755
1816
|
if (!symbol) return null;
|
|
1756
|
-
const balanceValue = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(extractString(token, "balance"), () => ( extractString(token, "amount"))), () => ( extractString(token, "value"))), () => ( extractString(token, "rawBalance"))), () => ( _optionalChain([extractNumber, 'call',
|
|
1817
|
+
const balanceValue = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(extractString(token, "balance"), () => ( extractString(token, "amount"))), () => ( extractString(token, "value"))), () => ( extractString(token, "rawBalance"))), () => ( _optionalChain([extractNumber, 'call', _46 => _46(token, "balance"), 'optionalAccess', _47 => _47.toString, 'call', _48 => _48()]))), () => ( _optionalChain([extractNumber, 'call', _49 => _49(token, "amount"), 'optionalAccess', _50 => _50.toString, 'call', _51 => _51()]))), () => ( _optionalChain([extractNumber, 'call', _52 => _52(token, "value"), 'optionalAccess', _53 => _53.toString, 'call', _54 => _54()]))), () => ( _optionalChain([extractNumber, 'call', _55 => _55(token, "rawBalance"), 'optionalAccess', _56 => _56.toString, 'call', _57 => _57()])));
|
|
1757
1818
|
if (!balanceValue) return null;
|
|
1758
1819
|
const address = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(extractString(token, "address"), () => ( extractString(token, "tokenAddress"))), () => ( extractString(
|
|
1759
1820
|
token.token,
|
|
@@ -1778,7 +1839,7 @@ function normalizeDirectToken(token) {
|
|
|
1778
1839
|
}
|
|
1779
1840
|
function extractTokenAddress(tokenData, chainId) {
|
|
1780
1841
|
const token = tokenData;
|
|
1781
|
-
return _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(token.tokenAddress, () => ( token.address)), () => ( _optionalChain([token, 'access',
|
|
1842
|
+
return _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(token.tokenAddress, () => ( token.address)), () => ( _optionalChain([token, 'access', _58 => _58.addresses, 'optionalAccess', _59 => _59[chainId]]))), () => ( _optionalChain([token, 'access', _60 => _60.token, 'optionalAccess', _61 => _61.address]))), () => ( _optionalChain([token, 'access', _62 => _62.token, 'optionalAccess', _63 => _63.addresses, 'optionalAccess', _64 => _64[chainId]])));
|
|
1782
1843
|
}
|
|
1783
1844
|
function extractArray(data, key) {
|
|
1784
1845
|
if (!data || typeof data !== "object") return null;
|
|
@@ -1912,15 +1973,15 @@ function resolveTokenDisplay(token, chain, fallback) {
|
|
|
1912
1973
|
const decimals = _chunkH577RJN5cjs.findTokenDecimals.call(void 0, token, chain);
|
|
1913
1974
|
if (symbol !== "Token" || decimals !== void 0) {
|
|
1914
1975
|
return {
|
|
1915
|
-
symbol: symbol !== "Token" ? symbol : _nullishCoalesce(_optionalChain([fallback, 'optionalAccess',
|
|
1916
|
-
decimals: _nullishCoalesce(decimals, () => ( _optionalChain([fallback, 'optionalAccess',
|
|
1976
|
+
symbol: symbol !== "Token" ? symbol : _nullishCoalesce(_optionalChain([fallback, 'optionalAccess', _65 => _65.symbol]), () => ( symbol)),
|
|
1977
|
+
decimals: _nullishCoalesce(decimals, () => ( _optionalChain([fallback, 'optionalAccess', _66 => _66.decimals])))
|
|
1917
1978
|
};
|
|
1918
1979
|
}
|
|
1919
1980
|
}
|
|
1920
1981
|
}
|
|
1921
1982
|
return {
|
|
1922
|
-
symbol: _nullishCoalesce(_optionalChain([fallback, 'optionalAccess',
|
|
1923
|
-
decimals: _optionalChain([fallback, 'optionalAccess',
|
|
1983
|
+
symbol: _nullishCoalesce(_optionalChain([fallback, 'optionalAccess', _67 => _67.symbol]), () => ( "Token")),
|
|
1984
|
+
decimals: _optionalChain([fallback, 'optionalAccess', _68 => _68.decimals])
|
|
1924
1985
|
};
|
|
1925
1986
|
}
|
|
1926
1987
|
function maxFractionDigitsFor(symbol) {
|
|
@@ -2018,7 +2079,7 @@ function formatReceiveEstimate(params) {
|
|
|
2018
2079
|
// src/core/rpc.ts
|
|
2019
2080
|
|
|
2020
2081
|
function rpcUrlFor(rpcUrls, chain) {
|
|
2021
|
-
const url = _optionalChain([rpcUrls, 'optionalAccess',
|
|
2082
|
+
const url = _optionalChain([rpcUrls, 'optionalAccess', _69 => _69[chain], 'optionalAccess', _70 => _70.trim, 'call', _71 => _71()]);
|
|
2022
2083
|
return url ? url : void 0;
|
|
2023
2084
|
}
|
|
2024
2085
|
var RpcUrlsContext = _react.createContext.call(void 0, void 0);
|
|
@@ -2028,7 +2089,7 @@ function useRpcUrls() {
|
|
|
2028
2089
|
}
|
|
2029
2090
|
function rpcUrlsKey(rpcUrls) {
|
|
2030
2091
|
if (!rpcUrls) return "";
|
|
2031
|
-
return Object.entries(rpcUrls).map(([chain, url]) => [chain, _nullishCoalesce(_optionalChain([url, 'optionalAccess',
|
|
2092
|
+
return Object.entries(rpcUrls).map(([chain, url]) => [chain, _nullishCoalesce(_optionalChain([url, 'optionalAccess', _72 => _72.trim, 'call', _73 => _73()]), () => ( ""))]).filter(([, url]) => url !== "").map(([chain, url]) => `${chain}=${url}`).sort().join("|");
|
|
2032
2093
|
}
|
|
2033
2094
|
function useStableRpcUrls(rpcUrls) {
|
|
2034
2095
|
const key = rpcUrlsKey(rpcUrls);
|
|
@@ -2137,19 +2198,19 @@ var CUSTOM_PRIMARY_VARS = [
|
|
|
2137
2198
|
function applyTheme(element, theme) {
|
|
2138
2199
|
if (!element) return;
|
|
2139
2200
|
const parent = element.parentElement;
|
|
2140
|
-
const targets = _optionalChain([parent, 'optionalAccess',
|
|
2141
|
-
if (_optionalChain([theme, 'optionalAccess',
|
|
2201
|
+
const targets = _optionalChain([parent, 'optionalAccess', _74 => _74.classList, 'access', _75 => _75.contains, 'call', _76 => _76("rs-modal-content")]) ? [element, parent] : [element];
|
|
2202
|
+
if (_optionalChain([theme, 'optionalAccess', _77 => _77.mode])) {
|
|
2142
2203
|
for (const t of targets) t.setAttribute("data-theme", theme.mode);
|
|
2143
2204
|
} else {
|
|
2144
2205
|
for (const t of targets) t.removeAttribute("data-theme");
|
|
2145
2206
|
}
|
|
2146
|
-
if (_optionalChain([theme, 'optionalAccess',
|
|
2207
|
+
if (_optionalChain([theme, 'optionalAccess', _78 => _78.fontColor])) {
|
|
2147
2208
|
setVar(targets, "--rs-foreground", theme.fontColor);
|
|
2148
2209
|
}
|
|
2149
|
-
if (_optionalChain([theme, 'optionalAccess',
|
|
2210
|
+
if (_optionalChain([theme, 'optionalAccess', _79 => _79.iconColor])) {
|
|
2150
2211
|
setVar(targets, "--rs-icon", theme.iconColor);
|
|
2151
2212
|
}
|
|
2152
|
-
if (_optionalChain([theme, 'optionalAccess',
|
|
2213
|
+
if (_optionalChain([theme, 'optionalAccess', _80 => _80.ctaColor])) {
|
|
2153
2214
|
const derived = deriveCustomPrimary(theme.ctaColor);
|
|
2154
2215
|
if (derived) {
|
|
2155
2216
|
setVar(targets, "--rs-primary", derived.base);
|
|
@@ -2174,18 +2235,18 @@ function applyTheme(element, theme) {
|
|
|
2174
2235
|
}
|
|
2175
2236
|
} else {
|
|
2176
2237
|
for (const v of CUSTOM_PRIMARY_VARS) clearVar(targets, v);
|
|
2177
|
-
if (_optionalChain([theme, 'optionalAccess',
|
|
2238
|
+
if (_optionalChain([theme, 'optionalAccess', _81 => _81.ctaHoverColor])) {
|
|
2178
2239
|
setVar(targets, "--rs-primary-hover", theme.ctaHoverColor);
|
|
2179
2240
|
}
|
|
2180
2241
|
}
|
|
2181
|
-
if (_optionalChain([theme, 'optionalAccess',
|
|
2242
|
+
if (_optionalChain([theme, 'optionalAccess', _82 => _82.borderColor])) {
|
|
2182
2243
|
setVar(targets, "--rs-border", theme.borderColor);
|
|
2183
2244
|
setVar(targets, "--rs-border-surface", theme.borderColor);
|
|
2184
2245
|
}
|
|
2185
|
-
if (_optionalChain([theme, 'optionalAccess',
|
|
2246
|
+
if (_optionalChain([theme, 'optionalAccess', _83 => _83.backgroundColor])) {
|
|
2186
2247
|
setVar(targets, "--rs-background", theme.backgroundColor);
|
|
2187
2248
|
}
|
|
2188
|
-
if (_optionalChain([theme, 'optionalAccess',
|
|
2249
|
+
if (_optionalChain([theme, 'optionalAccess', _84 => _84.radius])) {
|
|
2189
2250
|
const scale = RADIUS_SCALE[theme.radius];
|
|
2190
2251
|
setVar(targets, "--rs-radius-sm", scale.sm);
|
|
2191
2252
|
setVar(targets, "--rs-radius-md", scale.md);
|