@rhinestone/deposit-modal 0.0.0-dev-20260813150128 → 0.0.0-dev-20260813152943
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-TE2VQW6O.cjs → DepositModalReown-CXSINQ65.cjs} +17 -17
- package/dist/{DepositModalReown-7K67XIK7.mjs → DepositModalReown-VIGADVBQ.mjs} +7 -7
- package/dist/{chunk-YR43AAX5.mjs → chunk-3STTWRAN.mjs} +0 -5
- package/dist/{chunk-53IGTENZ.mjs → chunk-4ZXQPFNU.mjs} +1 -1
- package/dist/{chunk-5VB4S57T.cjs → chunk-6SMODXEQ.cjs} +75 -65
- package/dist/{chunk-XJB3VG4C.cjs → chunk-75DVGSAX.cjs} +2 -2
- package/dist/{chunk-CDTLKM3I.mjs → chunk-BTVJHAPJ.mjs} +13 -3
- package/dist/{chunk-HDT32R75.mjs → chunk-DNRDAJ6F.mjs} +3 -3
- package/dist/{chunk-76N6W2AS.cjs → chunk-GRCLBBFM.cjs} +79 -79
- package/dist/{chunk-QD2M7LYK.mjs → chunk-HYZAOWQO.mjs} +1 -1
- package/dist/{chunk-BXB2N2TR.cjs → chunk-IOAJH4C6.cjs} +1 -1
- package/dist/{chunk-4R2ZHSDQ.cjs → chunk-O7BCVQ6L.cjs} +1 -6
- package/dist/{chunk-I6NXHYVX.cjs → chunk-QGCVHV6V.cjs} +3 -3
- package/dist/{chunk-G3SH47YO.mjs → chunk-QZBIQYLK.mjs} +4 -4
- package/dist/{chunk-QUQPQSJE.cjs → chunk-SMX7QCGL.cjs} +78 -79
- package/dist/{chunk-WK5RHWC6.cjs → chunk-SPCCRY4U.cjs} +62 -62
- package/dist/{chunk-MYDCJKJR.mjs → chunk-SRBRPNTW.mjs} +1 -1
- package/dist/{chunk-33BY5PJB.cjs → chunk-WC2KEOJ6.cjs} +378 -378
- package/dist/{chunk-56DPB74F.mjs → chunk-ZF7SBBCE.mjs} +6 -6
- package/dist/{chunk-52ZVEJNI.mjs → chunk-ZH37AK5G.mjs} +3 -4
- package/dist/claim.cjs +6 -6
- 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.mjs +7 -7
- package/dist/index.cjs +10 -10
- package/dist/index.mjs +9 -9
- package/dist/polymarket.cjs +5 -5
- package/dist/polymarket.mjs +2 -2
- package/dist/withdraw.cjs +6 -6
- package/dist/withdraw.mjs +5 -5
- package/package.json +1 -1
|
@@ -1,21 +1,21 @@
|
|
|
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
|
|
4
|
-
require('./chunk-
|
|
5
|
-
require('./chunk-
|
|
3
|
+
var _chunkWC2KEOJ6cjs = require('./chunk-WC2KEOJ6.cjs');
|
|
4
|
+
require('./chunk-SMX7QCGL.cjs');
|
|
5
|
+
require('./chunk-QGCVHV6V.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
13
|
-
require('./chunk-
|
|
14
|
-
require('./chunk-
|
|
12
|
+
var _chunk6SMODXEQcjs = require('./chunk-6SMODXEQ.cjs');
|
|
13
|
+
require('./chunk-IOAJH4C6.cjs');
|
|
14
|
+
require('./chunk-75DVGSAX.cjs');
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var _chunkO7BCVQ6Lcjs = require('./chunk-O7BCVQ6L.cjs');
|
|
19
19
|
|
|
20
20
|
// src/DepositModalReown.tsx
|
|
21
21
|
var _react = require('react');
|
|
@@ -72,7 +72,7 @@ var APPKIT_NETWORK_BY_ID = {
|
|
|
72
72
|
[_networks.katana.id]: _networks.katana,
|
|
73
73
|
[_networks.hyperEvm.id]: _networks.hyperEvm
|
|
74
74
|
};
|
|
75
|
-
var EVM_NETWORKS =
|
|
75
|
+
var EVM_NETWORKS = _chunkO7BCVQ6Lcjs.SUPPORTED_CHAINS.map((chain) => {
|
|
76
76
|
const network = APPKIT_NETWORK_BY_ID[chain.id];
|
|
77
77
|
if (!network) {
|
|
78
78
|
throw new Error(
|
|
@@ -91,14 +91,14 @@ function buildTransports(rpcUrls, networks = EVM_NETWORKS) {
|
|
|
91
91
|
const transports = {};
|
|
92
92
|
for (const network of networks) {
|
|
93
93
|
const id = Number(network.id);
|
|
94
|
-
transports[id] = _viem.http.call(void 0,
|
|
94
|
+
transports[id] = _viem.http.call(void 0, _chunk6SMODXEQcjs.rpcUrlFor.call(void 0, rpcUrls, id));
|
|
95
95
|
}
|
|
96
96
|
return transports;
|
|
97
97
|
}
|
|
98
98
|
function getEvmRpcFingerprint(rpcUrls, networks) {
|
|
99
99
|
return networks.map((network) => {
|
|
100
100
|
const id = Number(network.id);
|
|
101
|
-
return `${id}=${_nullishCoalesce(
|
|
101
|
+
return `${id}=${_nullishCoalesce(_chunk6SMODXEQcjs.rpcUrlFor.call(void 0, rpcUrls, id), () => ( ""))}`;
|
|
102
102
|
}).join("|");
|
|
103
103
|
}
|
|
104
104
|
var cachedAdapter = null;
|
|
@@ -164,7 +164,7 @@ function getOrCreateAdapter(projectId, enableSolana, theme, rpcUrls, runtimeChai
|
|
|
164
164
|
function chainDisplayName(chainId) {
|
|
165
165
|
const runtime = runtimeNetworkById.get(chainId);
|
|
166
166
|
if (runtime) return runtime.name;
|
|
167
|
-
return
|
|
167
|
+
return _chunkO7BCVQ6Lcjs.getChainName.call(void 0, chainId);
|
|
168
168
|
}
|
|
169
169
|
function resolveAppKitNetwork(chainId) {
|
|
170
170
|
return _nullishCoalesce(getAppKitNetwork(chainId), () => ( runtimeNetworkById.get(chainId)));
|
|
@@ -177,7 +177,7 @@ function ReownWalletProvider({
|
|
|
177
177
|
backendUrl,
|
|
178
178
|
children
|
|
179
179
|
}) {
|
|
180
|
-
const rpcUrls =
|
|
180
|
+
const rpcUrls = _chunk6SMODXEQcjs.useStableRpcUrls.call(void 0, rpcUrlsProp);
|
|
181
181
|
const [queryClient] = _react.useState.call(void 0, () => new (0, _reactquery.QueryClient)());
|
|
182
182
|
const overrides = _react.useMemo.call(void 0, () => {
|
|
183
183
|
if (!rpcUrls) return void 0;
|
|
@@ -189,14 +189,14 @@ function ReownWalletProvider({
|
|
|
189
189
|
return out;
|
|
190
190
|
}, [rpcUrls]);
|
|
191
191
|
const [state, setState] = _react.useState.call(void 0, () => {
|
|
192
|
-
const primed =
|
|
192
|
+
const primed = _chunk6SMODXEQcjs.peekRuntimeChains.call(void 0, backendUrl, overrides);
|
|
193
193
|
return { ready: primed !== null, chains: _nullishCoalesce(primed, () => ( [])) };
|
|
194
194
|
});
|
|
195
195
|
_react.useEffect.call(void 0, () => {
|
|
196
196
|
let active = true;
|
|
197
|
-
const primed =
|
|
197
|
+
const primed = _chunk6SMODXEQcjs.peekRuntimeChains.call(void 0, backendUrl, overrides);
|
|
198
198
|
setState({ ready: primed !== null, chains: _nullishCoalesce(primed, () => ( [])) });
|
|
199
|
-
|
|
199
|
+
_chunk6SMODXEQcjs.primeRuntimeChains.call(void 0, backendUrl, overrides).then((chains) => {
|
|
200
200
|
if (active) setState({ ready: true, chains });
|
|
201
201
|
});
|
|
202
202
|
return () => {
|
|
@@ -258,7 +258,7 @@ function useReownWallet() {
|
|
|
258
258
|
await switchChainAsync({ chainId });
|
|
259
259
|
}
|
|
260
260
|
} catch (err) {
|
|
261
|
-
if (
|
|
261
|
+
if (_chunk6SMODXEQcjs.isUnsupportedChainSwitchError.call(void 0, err)) {
|
|
262
262
|
throw new Error(
|
|
263
263
|
`Switch to ${chainDisplayName(chainId)} in your wallet to continue`
|
|
264
264
|
);
|
|
@@ -292,7 +292,7 @@ function DepositModalWithReown(props) {
|
|
|
292
292
|
reown.disconnect();
|
|
293
293
|
}, [reown.disconnect]);
|
|
294
294
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
295
|
-
|
|
295
|
+
_chunkWC2KEOJ6cjs.DepositModalInner,
|
|
296
296
|
{
|
|
297
297
|
...props,
|
|
298
298
|
reownWallet: reownWithSolana,
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DepositModalInner
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-ZF7SBBCE.mjs";
|
|
4
|
+
import "./chunk-ZH37AK5G.mjs";
|
|
5
|
+
import "./chunk-HYZAOWQO.mjs";
|
|
6
6
|
import {
|
|
7
7
|
isUnsupportedChainSwitchError,
|
|
8
8
|
peekRuntimeChains,
|
|
9
9
|
primeRuntimeChains,
|
|
10
10
|
rpcUrlFor,
|
|
11
11
|
useStableRpcUrls
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
12
|
+
} from "./chunk-BTVJHAPJ.mjs";
|
|
13
|
+
import "./chunk-SRBRPNTW.mjs";
|
|
14
|
+
import "./chunk-4ZXQPFNU.mjs";
|
|
15
15
|
import {
|
|
16
16
|
SUPPORTED_CHAINS,
|
|
17
17
|
getChainName
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-3STTWRAN.mjs";
|
|
19
19
|
|
|
20
20
|
// src/DepositModalReown.tsx
|
|
21
21
|
import { useCallback, useMemo as useMemo2 } from "react";
|
|
@@ -9,10 +9,6 @@ function targetChainToCaip2(targetChain) {
|
|
|
9
9
|
if (isHyperCoreDestination(targetChain)) return HYPERCORE_SPOT_CAIP2;
|
|
10
10
|
return toEvmCaip2(targetChain);
|
|
11
11
|
}
|
|
12
|
-
function targetChainToAccountKey(targetChain) {
|
|
13
|
-
if (isHyperCoreDestination(targetChain)) return HYPERCORE_MAINNET_CAIP2;
|
|
14
|
-
return targetChainToCaip2(targetChain);
|
|
15
|
-
}
|
|
16
12
|
function parseEvmChainId(value) {
|
|
17
13
|
if (typeof value === "number" && Number.isFinite(value)) {
|
|
18
14
|
return value;
|
|
@@ -893,7 +889,6 @@ export {
|
|
|
893
889
|
SOLANA_MAINNET_CAIP2,
|
|
894
890
|
toEvmCaip2,
|
|
895
891
|
targetChainToCaip2,
|
|
896
|
-
targetChainToAccountKey,
|
|
897
892
|
parseEvmChainId,
|
|
898
893
|
isSolanaCaip2,
|
|
899
894
|
isHyperCoreCaip2,
|
|
@@ -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 _chunkIOAJH4C6cjs = require('./chunk-IOAJH4C6.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
@@ -26,7 +26,8 @@ var _chunkBXB2N2TRcjs = require('./chunk-BXB2N2TR.cjs');
|
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
|
|
30
|
+
var _chunkO7BCVQ6Lcjs = require('./chunk-O7BCVQ6L.cjs');
|
|
30
31
|
|
|
31
32
|
// src/components/ui/Modal.tsx
|
|
32
33
|
|
|
@@ -332,7 +333,7 @@ function preconnectIconCdn() {
|
|
|
332
333
|
const link = document.createElement("link");
|
|
333
334
|
link.id = "rs-icon-cdn-preconnect";
|
|
334
335
|
link.rel = "preconnect";
|
|
335
|
-
link.href =
|
|
336
|
+
link.href = _chunkO7BCVQ6Lcjs.ICON_CDN;
|
|
336
337
|
link.crossOrigin = "anonymous";
|
|
337
338
|
document.head.appendChild(link);
|
|
338
339
|
}
|
|
@@ -550,7 +551,7 @@ function parseChain(caip2, value) {
|
|
|
550
551
|
// `parseEvmChainId` returns null for `solana:`/`tron:`/`hypercore:` keys,
|
|
551
552
|
// which is the intended answer — those chains have no numeric id, and the
|
|
552
553
|
// modal addresses them by their CAIP-2 string or a sentinel.
|
|
553
|
-
chainId:
|
|
554
|
+
chainId: _chunkO7BCVQ6Lcjs.parseEvmChainId.call(void 0, caip2),
|
|
554
555
|
name,
|
|
555
556
|
testnet,
|
|
556
557
|
deposit,
|
|
@@ -579,12 +580,21 @@ function parseChainCatalog(body) {
|
|
|
579
580
|
if (chain.chainId !== null) byChainId.set(chain.chainId, chain);
|
|
580
581
|
}
|
|
581
582
|
if (all.length === 0) return null;
|
|
583
|
+
aliasHyperCoreOrigin(byCaip2, all);
|
|
582
584
|
return { all, byCaip2, byChainId };
|
|
583
585
|
}
|
|
586
|
+
function aliasHyperCoreOrigin(byCaip2, all) {
|
|
587
|
+
const origin = _nullishCoalesce(all.find((c) => _chunkO7BCVQ6Lcjs.isHyperCoreCaip2.call(void 0, c.caip2) && c.deposit), () => ( all.find((c) => _chunkO7BCVQ6Lcjs.isHyperCoreCaip2.call(void 0, c.caip2))));
|
|
588
|
+
if (!origin) return;
|
|
589
|
+
byCaip2.set(_chunkO7BCVQ6Lcjs.HYPERCORE_MAINNET_CAIP2, origin);
|
|
590
|
+
if (!byCaip2.has(_chunkO7BCVQ6Lcjs.HYPERCORE_SPOT_CAIP2)) {
|
|
591
|
+
byCaip2.set(_chunkO7BCVQ6Lcjs.HYPERCORE_SPOT_CAIP2, origin);
|
|
592
|
+
}
|
|
593
|
+
}
|
|
584
594
|
function catalogKeyForChain(chainId) {
|
|
585
|
-
if (chainId === "solana") return
|
|
586
|
-
if (chainId === "hypercore" || chainId ===
|
|
587
|
-
return
|
|
595
|
+
if (chainId === "solana") return _chunkO7BCVQ6Lcjs.SOLANA_MAINNET_CAIP2;
|
|
596
|
+
if (chainId === "hypercore" || chainId === _chunkO7BCVQ6Lcjs.HYPERCORE_CHAIN_ID) {
|
|
597
|
+
return _chunkO7BCVQ6Lcjs.HYPERCORE_MAINNET_CAIP2;
|
|
588
598
|
}
|
|
589
599
|
return chainId;
|
|
590
600
|
}
|
|
@@ -889,7 +899,7 @@ function createDepositService(baseUrl, options) {
|
|
|
889
899
|
try {
|
|
890
900
|
const response = await fetch(apiUrl("/qr/tokens"), {
|
|
891
901
|
method: "GET",
|
|
892
|
-
headers:
|
|
902
|
+
headers: _chunkIOAJH4C6cjs.SERVICE_HEADERS
|
|
893
903
|
});
|
|
894
904
|
if (!response.ok) {
|
|
895
905
|
debugLog(debug, scope, "getTopTokens:unavailable", {
|
|
@@ -916,7 +926,7 @@ function createDepositService(baseUrl, options) {
|
|
|
916
926
|
try {
|
|
917
927
|
const response = await fetch(apiUrl("/chains"), {
|
|
918
928
|
method: "GET",
|
|
919
|
-
headers:
|
|
929
|
+
headers: _chunkIOAJH4C6cjs.SERVICE_HEADERS
|
|
920
930
|
});
|
|
921
931
|
if (!response.ok) {
|
|
922
932
|
debugLog(debug, scope, "getChains:unavailable", {
|
|
@@ -970,7 +980,7 @@ function createDepositService(baseUrl, options) {
|
|
|
970
980
|
});
|
|
971
981
|
const response = await fetch(url, {
|
|
972
982
|
method: "POST",
|
|
973
|
-
headers:
|
|
983
|
+
headers: _chunkIOAJH4C6cjs.SERVICE_HEADERS,
|
|
974
984
|
body: JSON.stringify({ account: params })
|
|
975
985
|
});
|
|
976
986
|
if (!response.ok) {
|
|
@@ -1003,7 +1013,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1003
1013
|
debugLog(debug, scope, "fetchPortfolio:request", { url, address });
|
|
1004
1014
|
const response = await fetch(url, {
|
|
1005
1015
|
method: "GET",
|
|
1006
|
-
headers:
|
|
1016
|
+
headers: _chunkIOAJH4C6cjs.SERVICE_HEADERS
|
|
1007
1017
|
});
|
|
1008
1018
|
if (!response.ok) {
|
|
1009
1019
|
const error = await response.json().catch(() => ({ error: "Unknown error" }));
|
|
@@ -1050,7 +1060,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1050
1060
|
debugLog(debug, scope, "fetchSolanaPortfolio:request", { url, address });
|
|
1051
1061
|
const response = await fetch(url, {
|
|
1052
1062
|
method: "GET",
|
|
1053
|
-
headers:
|
|
1063
|
+
headers: _chunkIOAJH4C6cjs.SERVICE_HEADERS
|
|
1054
1064
|
});
|
|
1055
1065
|
if (!response.ok) {
|
|
1056
1066
|
const error = await response.json().catch(() => ({ error: "Unknown error" }));
|
|
@@ -1080,7 +1090,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1080
1090
|
debugLog(debug, scope, "checkAccount:request", { url, address });
|
|
1081
1091
|
const response = await fetch(url, {
|
|
1082
1092
|
method: "GET",
|
|
1083
|
-
headers:
|
|
1093
|
+
headers: _chunkIOAJH4C6cjs.SERVICE_HEADERS
|
|
1084
1094
|
});
|
|
1085
1095
|
if (!response.ok) {
|
|
1086
1096
|
const error = await response.json().catch(() => ({ error: "Unknown error" }));
|
|
@@ -1115,7 +1125,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1115
1125
|
);
|
|
1116
1126
|
const response = await fetch(url, {
|
|
1117
1127
|
method: "GET",
|
|
1118
|
-
headers:
|
|
1128
|
+
headers: _chunkIOAJH4C6cjs.SERVICE_HEADERS,
|
|
1119
1129
|
cache: "no-store"
|
|
1120
1130
|
});
|
|
1121
1131
|
if (!response.ok) {
|
|
@@ -1143,7 +1153,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1143
1153
|
);
|
|
1144
1154
|
const response = await fetch(url, {
|
|
1145
1155
|
method: "GET",
|
|
1146
|
-
headers:
|
|
1156
|
+
headers: _chunkIOAJH4C6cjs.SERVICE_HEADERS,
|
|
1147
1157
|
cache: "no-store"
|
|
1148
1158
|
});
|
|
1149
1159
|
if (!response.ok) {
|
|
@@ -1167,7 +1177,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1167
1177
|
);
|
|
1168
1178
|
const response = await fetch(url, {
|
|
1169
1179
|
method: "GET",
|
|
1170
|
-
headers:
|
|
1180
|
+
headers: _chunkIOAJH4C6cjs.SERVICE_HEADERS,
|
|
1171
1181
|
cache: "no-store"
|
|
1172
1182
|
});
|
|
1173
1183
|
if (!response.ok) {
|
|
@@ -1189,7 +1199,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1189
1199
|
async getPositions(address) {
|
|
1190
1200
|
const url = apiUrl(`/positions/${address}`);
|
|
1191
1201
|
debugLog(debug, scope, "getPositions:request", { url, address });
|
|
1192
|
-
const response = await fetch(url, { headers:
|
|
1202
|
+
const response = await fetch(url, { headers: _chunkIOAJH4C6cjs.SERVICE_HEADERS });
|
|
1193
1203
|
if (!response.ok) {
|
|
1194
1204
|
const error = await response.json().catch(() => ({ error: "Unknown error" }));
|
|
1195
1205
|
debugError(debug, scope, "getPositions:failed", error, {
|
|
@@ -1223,7 +1233,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1223
1233
|
});
|
|
1224
1234
|
const response = await fetch(url, {
|
|
1225
1235
|
method: "POST",
|
|
1226
|
-
headers:
|
|
1236
|
+
headers: _chunkIOAJH4C6cjs.SERVICE_HEADERS,
|
|
1227
1237
|
body: JSON.stringify({ account, market, chainId, asset, amount })
|
|
1228
1238
|
});
|
|
1229
1239
|
if (!response.ok) {
|
|
@@ -1259,7 +1269,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1259
1269
|
});
|
|
1260
1270
|
const response = await fetch(url, {
|
|
1261
1271
|
method: "POST",
|
|
1262
|
-
headers:
|
|
1272
|
+
headers: _chunkIOAJH4C6cjs.SERVICE_HEADERS,
|
|
1263
1273
|
body: JSON.stringify({
|
|
1264
1274
|
depositWallet,
|
|
1265
1275
|
owner,
|
|
@@ -1301,7 +1311,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1301
1311
|
});
|
|
1302
1312
|
const response = await fetch(url, {
|
|
1303
1313
|
method: "GET",
|
|
1304
|
-
headers:
|
|
1314
|
+
headers: _chunkIOAJH4C6cjs.SERVICE_HEADERS,
|
|
1305
1315
|
cache: "no-store"
|
|
1306
1316
|
});
|
|
1307
1317
|
if (!response.ok) {
|
|
@@ -1328,8 +1338,8 @@ function createDepositService(baseUrl, options) {
|
|
|
1328
1338
|
return { deposits, nextCursor };
|
|
1329
1339
|
},
|
|
1330
1340
|
async checkLiquidity(params) {
|
|
1331
|
-
if (
|
|
1332
|
-
const token =
|
|
1341
|
+
if (_chunkO7BCVQ6Lcjs.isSolanaCaip2.call(void 0, params.destinationChainId) || params.destinationChainId === "solana") {
|
|
1342
|
+
const token = _chunkO7BCVQ6Lcjs.getSolanaTokenByMint.call(void 0, params.destinationToken);
|
|
1333
1343
|
return {
|
|
1334
1344
|
hasLiquidity: true,
|
|
1335
1345
|
symbol: _nullishCoalesce(_optionalChain([token, 'optionalAccess', _40 => _40.symbol]), () => ( "Token")),
|
|
@@ -1339,7 +1349,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1339
1349
|
};
|
|
1340
1350
|
}
|
|
1341
1351
|
const searchParams = new URLSearchParams({
|
|
1342
|
-
sourceChainId:
|
|
1352
|
+
sourceChainId: _chunkO7BCVQ6Lcjs.toEvmCaip2.call(void 0, params.sourceChainId),
|
|
1343
1353
|
sourceToken: params.sourceToken,
|
|
1344
1354
|
destinationChainId: params.destinationChainId,
|
|
1345
1355
|
destinationToken: params.destinationToken,
|
|
@@ -1354,7 +1364,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1354
1364
|
});
|
|
1355
1365
|
const response = await fetch(url, {
|
|
1356
1366
|
method: "GET",
|
|
1357
|
-
headers:
|
|
1367
|
+
headers: _chunkIOAJH4C6cjs.SERVICE_HEADERS,
|
|
1358
1368
|
cache: "no-store"
|
|
1359
1369
|
});
|
|
1360
1370
|
if (!response.ok) {
|
|
@@ -1386,7 +1396,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1386
1396
|
const body = {
|
|
1387
1397
|
account: params.account,
|
|
1388
1398
|
// HyperCore has its own CAIP-2 namespace — never the eip155 placeholder.
|
|
1389
|
-
sourceChainId: params.sourceChainId === "hypercore" ?
|
|
1399
|
+
sourceChainId: params.sourceChainId === "hypercore" ? _chunkO7BCVQ6Lcjs.HYPERCORE_MAINNET_CAIP2 : `eip155:${params.sourceChainId}`,
|
|
1390
1400
|
sourceToken: params.sourceToken,
|
|
1391
1401
|
amount: params.amount
|
|
1392
1402
|
};
|
|
@@ -1399,7 +1409,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1399
1409
|
try {
|
|
1400
1410
|
const response = await fetch(url, {
|
|
1401
1411
|
method: "POST",
|
|
1402
|
-
headers:
|
|
1412
|
+
headers: _chunkIOAJH4C6cjs.SERVICE_HEADERS,
|
|
1403
1413
|
body: JSON.stringify(body),
|
|
1404
1414
|
cache: "no-store"
|
|
1405
1415
|
});
|
|
@@ -1436,7 +1446,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1436
1446
|
try {
|
|
1437
1447
|
const response = await fetch(url, {
|
|
1438
1448
|
method: "GET",
|
|
1439
|
-
headers:
|
|
1449
|
+
headers: _chunkIOAJH4C6cjs.SERVICE_HEADERS,
|
|
1440
1450
|
cache: "no-store"
|
|
1441
1451
|
});
|
|
1442
1452
|
if (!response.ok) {
|
|
@@ -1466,7 +1476,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1466
1476
|
try {
|
|
1467
1477
|
const response = await fetch(url, {
|
|
1468
1478
|
method: "GET",
|
|
1469
|
-
headers:
|
|
1479
|
+
headers: _chunkIOAJH4C6cjs.SERVICE_HEADERS,
|
|
1470
1480
|
cache: "no-store"
|
|
1471
1481
|
});
|
|
1472
1482
|
if (!response.ok) {
|
|
@@ -1491,7 +1501,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1491
1501
|
});
|
|
1492
1502
|
const response = await fetch(url, {
|
|
1493
1503
|
method: "POST",
|
|
1494
|
-
headers:
|
|
1504
|
+
headers: _chunkIOAJH4C6cjs.SERVICE_HEADERS,
|
|
1495
1505
|
body: JSON.stringify(params)
|
|
1496
1506
|
});
|
|
1497
1507
|
if (!response.ok) {
|
|
@@ -1523,7 +1533,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1523
1533
|
});
|
|
1524
1534
|
const response = await fetch(url, {
|
|
1525
1535
|
method: "POST",
|
|
1526
|
-
headers:
|
|
1536
|
+
headers: _chunkIOAJH4C6cjs.SERVICE_HEADERS,
|
|
1527
1537
|
body: JSON.stringify(params)
|
|
1528
1538
|
});
|
|
1529
1539
|
if (!response.ok) {
|
|
@@ -1560,7 +1570,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1560
1570
|
debugLog(debug, scope, "getSwappedConnectExchanges:request");
|
|
1561
1571
|
const response = await fetch(url, {
|
|
1562
1572
|
method: "GET",
|
|
1563
|
-
headers:
|
|
1573
|
+
headers: _chunkIOAJH4C6cjs.SERVICE_HEADERS,
|
|
1564
1574
|
cache: "no-store"
|
|
1565
1575
|
});
|
|
1566
1576
|
if (!response.ok) {
|
|
@@ -1613,7 +1623,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1613
1623
|
try {
|
|
1614
1624
|
const response = await fetch(url, {
|
|
1615
1625
|
method: "GET",
|
|
1616
|
-
headers:
|
|
1626
|
+
headers: _chunkIOAJH4C6cjs.SERVICE_HEADERS,
|
|
1617
1627
|
cache: "no-store"
|
|
1618
1628
|
});
|
|
1619
1629
|
if (!response.ok) {
|
|
@@ -1699,7 +1709,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1699
1709
|
try {
|
|
1700
1710
|
const response = await fetch(url, {
|
|
1701
1711
|
method: "GET",
|
|
1702
|
-
headers:
|
|
1712
|
+
headers: _chunkIOAJH4C6cjs.SERVICE_HEADERS,
|
|
1703
1713
|
cache: "no-store"
|
|
1704
1714
|
});
|
|
1705
1715
|
if (!response.ok) {
|
|
@@ -1726,7 +1736,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1726
1736
|
);
|
|
1727
1737
|
const response = await fetch(url, {
|
|
1728
1738
|
method: "GET",
|
|
1729
|
-
headers:
|
|
1739
|
+
headers: _chunkIOAJH4C6cjs.SERVICE_HEADERS,
|
|
1730
1740
|
cache: "no-store"
|
|
1731
1741
|
});
|
|
1732
1742
|
if (!response.ok) return null;
|
|
@@ -1790,14 +1800,14 @@ function normalizeOrchestratorPortfolio(data) {
|
|
|
1790
1800
|
const unlocked = _nullishCoalesce(_optionalChain([chainBalance, 'access', _45 => _45.balance, 'optionalAccess', _46 => _46.unlocked]), () => ( "0"));
|
|
1791
1801
|
const normalizedName = tokenData.tokenName.trim();
|
|
1792
1802
|
const isNativeSymbol = normalizedName.toUpperCase() === "ETH" || normalizedName.toUpperCase() === "ETHER";
|
|
1793
|
-
const tokenAddress = _nullishCoalesce(_nullishCoalesce(chainBalance.tokenAddress, () => ( extractTokenAddress(tokenData, chainBalance.chainId))), () => (
|
|
1794
|
-
const resolvedTokenAddress = isNativeSymbol ?
|
|
1803
|
+
const tokenAddress = _nullishCoalesce(_nullishCoalesce(chainBalance.tokenAddress, () => ( extractTokenAddress(tokenData, chainBalance.chainId))), () => ( _chunkO7BCVQ6Lcjs.getTokenAddress.call(void 0, tokenData.tokenName, chainBalance.chainId)));
|
|
1804
|
+
const resolvedTokenAddress = isNativeSymbol ? _chunkO7BCVQ6Lcjs.NATIVE_TOKEN_ADDRESS : tokenAddress;
|
|
1795
1805
|
if (!resolvedTokenAddress) {
|
|
1796
1806
|
continue;
|
|
1797
1807
|
}
|
|
1798
|
-
const registrySymbol =
|
|
1808
|
+
const registrySymbol = _chunkO7BCVQ6Lcjs.getTokenSymbol.call(void 0, resolvedTokenAddress, chainBalance.chainId);
|
|
1799
1809
|
const symbol = registrySymbol !== "Token" ? registrySymbol : normalizedName || "Token";
|
|
1800
|
-
const decimals = registrySymbol !== "Token" ?
|
|
1810
|
+
const decimals = registrySymbol !== "Token" ? _chunkO7BCVQ6Lcjs.getTokenDecimalsByAddress.call(void 0, resolvedTokenAddress, chainBalance.chainId) : _nullishCoalesce(tokenData.tokenDecimals, () => ( 18));
|
|
1801
1811
|
tokens.push({
|
|
1802
1812
|
chainId: chainBalance.chainId,
|
|
1803
1813
|
address: resolvedTokenAddress,
|
|
@@ -1817,13 +1827,13 @@ function normalizeOrchestratorPortfolio(data) {
|
|
|
1817
1827
|
function normalizeDirectToken(token) {
|
|
1818
1828
|
const rawChainId = _nullishCoalesce(extractNumber(token, "chainId"), () => ( extractNumber(token.chain, "id")));
|
|
1819
1829
|
const rawChainString = _nullishCoalesce(extractString(token, "chainId"), () => ( extractString(token.chain, "id")));
|
|
1820
|
-
const chainId = _nullishCoalesce(rawChainId, () => ( (rawChainString ?
|
|
1830
|
+
const chainId = _nullishCoalesce(rawChainId, () => ( (rawChainString ? _chunkO7BCVQ6Lcjs.isSolanaCaip2.call(void 0, rawChainString) || rawChainString.toLowerCase() === "solana" ? "solana" : (
|
|
1821
1831
|
// HyperCore (`hypercore:mainnet`) is a non-EVM source; keep its USDC
|
|
1822
1832
|
// instead of dropping it as an unparseable chain string.
|
|
1823
|
-
|
|
1833
|
+
_chunkO7BCVQ6Lcjs.isHyperCoreCaip2.call(void 0, rawChainString) || rawChainString.toLowerCase() === "hypercore" ? "hypercore" : _chunkO7BCVQ6Lcjs.parseEvmChainId.call(void 0, rawChainString)
|
|
1824
1834
|
) : null)));
|
|
1825
1835
|
if (chainId === null) return null;
|
|
1826
|
-
const registryChainId = typeof chainId === "number" ? chainId : chainId === "hypercore" ?
|
|
1836
|
+
const registryChainId = typeof chainId === "number" ? chainId : chainId === "hypercore" ? _chunkO7BCVQ6Lcjs.HYPERCORE_CHAIN_ID : void 0;
|
|
1827
1837
|
const symbol = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(extractString(token, "symbol"), () => ( extractString(token, "tokenSymbol"))), () => ( extractString(token, "tokenName"))), () => ( extractString(token, "name")));
|
|
1828
1838
|
if (!symbol) return null;
|
|
1829
1839
|
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()])));
|
|
@@ -1831,14 +1841,14 @@ function normalizeDirectToken(token) {
|
|
|
1831
1841
|
const address = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(extractString(token, "address"), () => ( extractString(token, "tokenAddress"))), () => ( extractString(
|
|
1832
1842
|
token.token,
|
|
1833
1843
|
"address"
|
|
1834
|
-
))), () => ( (registryChainId !== void 0 ?
|
|
1844
|
+
))), () => ( (registryChainId !== void 0 ? _chunkO7BCVQ6Lcjs.getTokenAddress.call(void 0, symbol, registryChainId) : void 0)));
|
|
1835
1845
|
if (!address) return null;
|
|
1836
1846
|
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));
|
|
1837
1847
|
const isSolanaToken = chainId === "solana";
|
|
1838
|
-
const registrySymbol = isSolanaToken ? "Token" :
|
|
1848
|
+
const registrySymbol = isSolanaToken ? "Token" : _chunkO7BCVQ6Lcjs.getTokenSymbol.call(void 0, address, registryChainId);
|
|
1839
1849
|
const resolvedSymbol = isSolanaToken ? symbol : registrySymbol !== "Token" ? registrySymbol : symbol;
|
|
1840
1850
|
const backendDecimals = _nullishCoalesce(extractNumber(token, "decimals"), () => ( extractNumber(token, "tokenDecimals")));
|
|
1841
|
-
const resolvedDecimals = !isSolanaToken && registrySymbol !== "Token" ?
|
|
1851
|
+
const resolvedDecimals = !isSolanaToken && registrySymbol !== "Token" ? _chunkO7BCVQ6Lcjs.getTokenDecimalsByAddress.call(void 0, address, registryChainId) : _nullishCoalesce(backendDecimals, () => ( 18));
|
|
1842
1852
|
return {
|
|
1843
1853
|
chainId,
|
|
1844
1854
|
address,
|
|
@@ -1926,7 +1936,7 @@ function getPublicClient(chainId, rpcUrls) {
|
|
|
1926
1936
|
const cacheKey = `${chainId}|${_nullishCoalesce(url, () => ( ""))}`;
|
|
1927
1937
|
let client = clientCache.get(cacheKey);
|
|
1928
1938
|
if (!client) {
|
|
1929
|
-
const chain = _nullishCoalesce(
|
|
1939
|
+
const chain = _nullishCoalesce(_chunkO7BCVQ6Lcjs.CHAIN_BY_ID[chainId], () => ( runtimeChainById.get(chainId)));
|
|
1930
1940
|
client = _viem.createPublicClient.call(void 0, {
|
|
1931
1941
|
chain,
|
|
1932
1942
|
transport: _viem.http.call(void 0, url)
|
|
@@ -2069,7 +2079,7 @@ function peekRuntimeChains(backendUrl, overrides) {
|
|
|
2069
2079
|
return _nullishCoalesce(resolvedChainsByKey.get(runtimeChainsKey(backendUrl, overrides)), () => ( null));
|
|
2070
2080
|
}
|
|
2071
2081
|
function publishCatalogTokens(catalog) {
|
|
2072
|
-
|
|
2082
|
+
_chunkO7BCVQ6Lcjs.setRuntimeTokens.call(void 0,
|
|
2073
2083
|
catalog.all.flatMap(
|
|
2074
2084
|
(chain) => chain.chainId === null || !Array.isArray(chain.supportedTokens) ? [] : chain.supportedTokens.map((token) => ({
|
|
2075
2085
|
chainId: chain.chainId,
|
|
@@ -2081,11 +2091,11 @@ function publishCatalogTokens(catalog) {
|
|
|
2081
2091
|
);
|
|
2082
2092
|
}
|
|
2083
2093
|
function publishRuntimeChainMeta(catalog) {
|
|
2084
|
-
|
|
2094
|
+
_chunkO7BCVQ6Lcjs.setRuntimeChainMeta.call(void 0,
|
|
2085
2095
|
catalog.all.flatMap((chain) => {
|
|
2086
2096
|
const ids = [];
|
|
2087
2097
|
if (chain.chainId !== null) ids.push(chain.chainId);
|
|
2088
|
-
if (
|
|
2098
|
+
if (_chunkO7BCVQ6Lcjs.isHyperCoreCaip2.call(void 0, chain.caip2)) ids.push(_chunkO7BCVQ6Lcjs.HYPERCORE_CHAIN_ID);
|
|
2089
2099
|
return ids.map((chainId) => ({
|
|
2090
2100
|
chainId,
|
|
2091
2101
|
name: chain.name,
|
|
@@ -2140,8 +2150,8 @@ function useDepositChainIds() {
|
|
|
2140
2150
|
!c.testnet
|
|
2141
2151
|
).map((c) => c.chainId);
|
|
2142
2152
|
const rank = (id) => {
|
|
2143
|
-
const i =
|
|
2144
|
-
return i === -1 ?
|
|
2153
|
+
const i = _chunkO7BCVQ6Lcjs.CHAIN_DISPLAY_ORDER.indexOf(id);
|
|
2154
|
+
return i === -1 ? _chunkO7BCVQ6Lcjs.CHAIN_DISPLAY_ORDER.length : i;
|
|
2145
2155
|
};
|
|
2146
2156
|
return ids.map((id, i) => ({ id, i })).sort((a, b) => rank(a.id) - rank(b.id) || a.i - b.i).map(({ id }) => id);
|
|
2147
2157
|
}, [catalog]);
|
|
@@ -2151,8 +2161,8 @@ function useDestinationChains() {
|
|
|
2151
2161
|
return _react.useMemo.call(void 0, () => {
|
|
2152
2162
|
if (!catalog) return [];
|
|
2153
2163
|
const rank = (id) => {
|
|
2154
|
-
const i =
|
|
2155
|
-
return i === -1 ?
|
|
2164
|
+
const i = _chunkO7BCVQ6Lcjs.CHAIN_DISPLAY_ORDER.indexOf(id);
|
|
2165
|
+
return i === -1 ? _chunkO7BCVQ6Lcjs.CHAIN_DISPLAY_ORDER.length : i;
|
|
2156
2166
|
};
|
|
2157
2167
|
return catalog.all.filter(
|
|
2158
2168
|
(c) => c.destination && c.vmType === "evm" && c.chainId !== null && !c.testnet
|
|
@@ -2192,10 +2202,10 @@ function useChainName() {
|
|
|
2192
2202
|
const { catalog } = useChainCatalog();
|
|
2193
2203
|
return _react.useMemo.call(void 0, () => {
|
|
2194
2204
|
return (chainId) => {
|
|
2195
|
-
if (!catalog) return
|
|
2205
|
+
if (!catalog) return _chunkO7BCVQ6Lcjs.getChainName.call(void 0, chainId);
|
|
2196
2206
|
const key = catalogKeyForChain(chainId);
|
|
2197
2207
|
const entry = typeof key === "number" ? catalog.byChainId.get(key) : catalog.byCaip2.get(key);
|
|
2198
|
-
return _nullishCoalesce(_optionalChain([entry, 'optionalAccess', _95 => _95.name]), () => (
|
|
2208
|
+
return _nullishCoalesce(_optionalChain([entry, 'optionalAccess', _95 => _95.name]), () => ( _chunkO7BCVQ6Lcjs.getChainName.call(void 0, chainId)));
|
|
2199
2209
|
};
|
|
2200
2210
|
}, [catalog]);
|
|
2201
2211
|
}
|
|
@@ -2203,10 +2213,10 @@ function useExplorerTxUrl() {
|
|
|
2203
2213
|
const { catalog } = useChainCatalog();
|
|
2204
2214
|
return _react.useMemo.call(void 0, () => {
|
|
2205
2215
|
return (chainId, txHash) => {
|
|
2206
|
-
if (chainId === "hypercore") return
|
|
2216
|
+
if (chainId === "hypercore") return _chunkO7BCVQ6Lcjs.getExplorerTxUrl.call(void 0, chainId, txHash);
|
|
2207
2217
|
const key = catalog ? catalogKeyForChain(chainId) : void 0;
|
|
2208
2218
|
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), () => (
|
|
2219
|
+
return _nullishCoalesce(catalogExplorerTxUrl(entry, txHash), () => ( _chunkO7BCVQ6Lcjs.getExplorerTxUrl.call(void 0, chainId, txHash)));
|
|
2210
2220
|
};
|
|
2211
2221
|
}, [catalog]);
|
|
2212
2222
|
}
|
|
@@ -2264,7 +2274,7 @@ function ChainCatalogProvider({
|
|
|
2264
2274
|
setShortlist(null);
|
|
2265
2275
|
service.getTopTokens().then((tokens) => {
|
|
2266
2276
|
if (!active || !tokens) return;
|
|
2267
|
-
|
|
2277
|
+
_chunkO7BCVQ6Lcjs.publishShortlistTokens.call(void 0, tokens);
|
|
2268
2278
|
setShortlist(tokens);
|
|
2269
2279
|
});
|
|
2270
2280
|
return () => {
|
|
@@ -2416,7 +2426,7 @@ function TokenIcon({ symbol, className, fallback }) {
|
|
|
2416
2426
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2417
2427
|
CdnIcon,
|
|
2418
2428
|
{
|
|
2419
|
-
src:
|
|
2429
|
+
src: _chunkO7BCVQ6Lcjs.tokenIconUrl.call(void 0, symbol),
|
|
2420
2430
|
className: `rs-token-icon ${_nullishCoalesce(className, () => ( ""))}`.trimEnd(),
|
|
2421
2431
|
fallback
|
|
2422
2432
|
}
|
|
@@ -2549,18 +2559,18 @@ var EVM_ADDRESS_RE = /^0x[a-fA-F0-9]{40}$/;
|
|
|
2549
2559
|
function resolveTokenDisplay(token, chain, fallback) {
|
|
2550
2560
|
if (token !== void 0) {
|
|
2551
2561
|
if (chain === "solana") {
|
|
2552
|
-
const solanaToken =
|
|
2562
|
+
const solanaToken = _chunkO7BCVQ6Lcjs.getSolanaTokenByMint.call(void 0, token);
|
|
2553
2563
|
if (solanaToken) {
|
|
2554
2564
|
return { symbol: solanaToken.symbol, decimals: solanaToken.decimals };
|
|
2555
2565
|
}
|
|
2556
2566
|
} else if (chain === "hypercore") {
|
|
2557
|
-
const t =
|
|
2567
|
+
const t = _chunkO7BCVQ6Lcjs.HYPERCORE_SOURCE_TOKENS.find(
|
|
2558
2568
|
(x) => x.address.toLowerCase() === token.toLowerCase()
|
|
2559
2569
|
);
|
|
2560
2570
|
if (t) return { symbol: t.symbol, decimals: t.decimals };
|
|
2561
2571
|
} else if (EVM_ADDRESS_RE.test(token)) {
|
|
2562
|
-
const symbol =
|
|
2563
|
-
const decimals =
|
|
2572
|
+
const symbol = _chunkO7BCVQ6Lcjs.getTokenSymbol.call(void 0, token, chain);
|
|
2573
|
+
const decimals = _chunkO7BCVQ6Lcjs.findTokenDecimals.call(void 0, token, chain);
|
|
2564
2574
|
if (symbol !== "Token" || decimals !== void 0) {
|
|
2565
2575
|
return {
|
|
2566
2576
|
symbol: symbol !== "Token" ? symbol : _nullishCoalesce(_optionalChain([fallback, 'optionalAccess', _102 => _102.symbol]), () => ( symbol)),
|
|
@@ -2609,13 +2619,13 @@ function priceUsdFor(symbol, prices) {
|
|
|
2609
2619
|
}
|
|
2610
2620
|
function isRecognizedToken(address, chain) {
|
|
2611
2621
|
if (address === void 0 || chain === void 0) return false;
|
|
2612
|
-
if (chain === "solana") return
|
|
2622
|
+
if (chain === "solana") return _chunkO7BCVQ6Lcjs.getSolanaTokenByMint.call(void 0, address) !== void 0;
|
|
2613
2623
|
if (chain === "hypercore") {
|
|
2614
|
-
return
|
|
2624
|
+
return _chunkO7BCVQ6Lcjs.HYPERCORE_SOURCE_TOKENS.some(
|
|
2615
2625
|
(t) => t.address.toLowerCase() === address.toLowerCase()
|
|
2616
2626
|
);
|
|
2617
2627
|
}
|
|
2618
|
-
return EVM_ADDRESS_RE.test(address) &&
|
|
2628
|
+
return EVM_ADDRESS_RE.test(address) && _chunkO7BCVQ6Lcjs.isRegistryTokenOnChain.call(void 0, address, chain);
|
|
2619
2629
|
}
|
|
2620
2630
|
function estimateReceiveAmount(params) {
|
|
2621
2631
|
const {
|