@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,21 +1,21 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DepositModalInner
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-Q5MFRAWD.mjs";
|
|
4
|
+
import "./chunk-QF5T6HXC.mjs";
|
|
5
|
+
import "./chunk-RMYUE6HJ.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-5IP67CL5.mjs";
|
|
13
|
+
import "./chunk-GZNMBZHY.mjs";
|
|
14
|
+
import "./chunk-53IGTENZ.mjs";
|
|
15
15
|
import {
|
|
16
16
|
SUPPORTED_CHAINS,
|
|
17
17
|
getChainName
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-YR43AAX5.mjs";
|
|
19
19
|
|
|
20
20
|
// src/DepositModalReown.tsx
|
|
21
21
|
import { useCallback, useMemo as useMemo2 } from "react";
|
|
@@ -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 _chunkLTPVHQXJcjs = require('./chunk-LTPVHQXJ.cjs');
|
|
4
|
+
require('./chunk-6ZJTZ7DS.cjs');
|
|
5
|
+
require('./chunk-2PQ34KU3.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
13
|
-
require('./chunk-
|
|
14
|
-
require('./chunk-
|
|
12
|
+
var _chunkLBJFACLHcjs = require('./chunk-LBJFACLH.cjs');
|
|
13
|
+
require('./chunk-4SRVZRZF.cjs');
|
|
14
|
+
require('./chunk-XJB3VG4C.cjs');
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var _chunk4R2ZHSDQcjs = require('./chunk-4R2ZHSDQ.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 = _chunk4R2ZHSDQcjs.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, _chunkLBJFACLHcjs.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(_chunkLBJFACLHcjs.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 _chunk4R2ZHSDQcjs.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 = _chunkLBJFACLHcjs.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 = _chunkLBJFACLHcjs.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 = _chunkLBJFACLHcjs.peekRuntimeChains.call(void 0, backendUrl, overrides);
|
|
198
198
|
setState({ ready: primed !== null, chains: _nullishCoalesce(primed, () => ( [])) });
|
|
199
|
-
|
|
199
|
+
_chunkLBJFACLHcjs.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 (_chunkLBJFACLHcjs.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
|
+
_chunkLTPVHQXJcjs.DepositModalInner,
|
|
296
296
|
{
|
|
297
297
|
...props,
|
|
298
298
|
reownWallet: reownWithSolana,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ListRow
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-RMYUE6HJ.mjs";
|
|
4
4
|
import {
|
|
5
5
|
AlertTriangleIcon,
|
|
6
6
|
BodyHeader,
|
|
@@ -28,17 +28,17 @@ import {
|
|
|
28
28
|
useExplorerTxUrl,
|
|
29
29
|
useLatestRef,
|
|
30
30
|
useStableRpcUrls
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-5IP67CL5.mjs";
|
|
32
32
|
import {
|
|
33
33
|
SERVICE_HEADERS
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-GZNMBZHY.mjs";
|
|
35
35
|
import {
|
|
36
36
|
getChainIcon,
|
|
37
37
|
getChainName,
|
|
38
38
|
getTokenDecimalsByAddress,
|
|
39
39
|
getTokenSymbol,
|
|
40
40
|
tokenIconUrl
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-YR43AAX5.mjs";
|
|
42
42
|
|
|
43
43
|
// src/ClaimModal.tsx
|
|
44
44
|
import {
|
|
@@ -1,7 +1,7 @@
|
|
|
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
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkLBJFACLHcjs = require('./chunk-LBJFACLH.cjs');
|
|
5
5
|
|
|
6
6
|
// src/components/ui/ListRow.tsx
|
|
7
7
|
var _jsxruntime = require('react/jsx-runtime');
|
|
@@ -19,7 +19,7 @@ function ListRow({
|
|
|
19
19
|
...props
|
|
20
20
|
}) {
|
|
21
21
|
const inner = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
22
|
-
leadingMedia ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-list-row-leading rs-list-row-leading--media", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
22
|
+
leadingMedia ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-list-row-leading rs-list-row-leading--media", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLBJFACLHcjs.CdnIcon, { src: leadingMedia }) }) : leading ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-list-row-leading", children: leading }) : null,
|
|
23
23
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-list-row-body", children: [
|
|
24
24
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-list-row-text", children: [
|
|
25
25
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-list-row-title", children: title }),
|
|
@@ -39,7 +39,7 @@ function ListRow({
|
|
|
39
39
|
}
|
|
40
40
|
) : meta && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-list-row-meta", children: meta })
|
|
41
41
|
] }),
|
|
42
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-list-row-chevron", children: _nullishCoalesce(trailing, () => ( (disabled ? null : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
42
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-list-row-chevron", children: _nullishCoalesce(trailing, () => ( (disabled ? null : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLBJFACLHcjs.ChevronRightIcon, {})))) })
|
|
43
43
|
] });
|
|
44
44
|
if (action) {
|
|
45
45
|
const handleKey = (e) => {
|
|
@@ -705,10 +705,6 @@ function isSupportedTokenAddressForChain(token, chainId) {
|
|
|
705
705
|
function getSupportedTargetTokens(chainId) {
|
|
706
706
|
return toTokenOptions(getSupportedTokenSymbolsForChain(chainId), chainId);
|
|
707
707
|
}
|
|
708
|
-
function getBundledTargetTokens(chainId) {
|
|
709
|
-
const symbols = SUPPORTED_TOKENS_BY_CHAIN[chainId];
|
|
710
|
-
return _optionalChain([symbols, 'optionalAccess', _23 => _23.length]) ? toTokenOptions([...symbols], chainId) : [];
|
|
711
|
-
}
|
|
712
708
|
function toTokenOptions(symbols, chainId) {
|
|
713
709
|
const options = [];
|
|
714
710
|
for (const symbol of symbols) {
|
|
@@ -811,7 +807,7 @@ function getTokenSymbol(token, chainId) {
|
|
|
811
807
|
}
|
|
812
808
|
function getTargetTokenSymbol(token, chain) {
|
|
813
809
|
if (chain === "solana") {
|
|
814
|
-
return _nullishCoalesce(_optionalChain([getSolanaTokenByMint, 'call',
|
|
810
|
+
return _nullishCoalesce(_optionalChain([getSolanaTokenByMint, 'call', _23 => _23(String(token)), 'optionalAccess', _24 => _24.symbol]), () => ( "Token"));
|
|
815
811
|
}
|
|
816
812
|
return getTokenSymbol(token, resolveDisplayChainId(chain));
|
|
817
813
|
}
|
|
@@ -878,7 +874,7 @@ function badgeColorsFor(name) {
|
|
|
878
874
|
function getExplorerUrl(chainId) {
|
|
879
875
|
if (chainId === "solana") return "https://solscan.io";
|
|
880
876
|
if (chainId === "hypercore") return HYPERCORE_EXPLORER_URL;
|
|
881
|
-
return _optionalChain([CHAIN_BY_ID, 'access',
|
|
877
|
+
return _optionalChain([CHAIN_BY_ID, 'access', _25 => _25[chainId], 'optionalAccess', _26 => _26.blockExplorers, 'optionalAccess', _27 => _27.default, 'optionalAccess', _28 => _28.url]);
|
|
882
878
|
}
|
|
883
879
|
function getExplorerTxUrl(chainId, txHash) {
|
|
884
880
|
if (chainId === "solana") return `https://solscan.io/tx/${txHash}`;
|
|
@@ -890,7 +886,7 @@ function getExplorerTxUrl(chainId, txHash) {
|
|
|
890
886
|
function getExplorerName(chainId) {
|
|
891
887
|
if (chainId === "solana") return "Solscan";
|
|
892
888
|
if (chainId === "hypercore") return "Hyperliquid Explorer";
|
|
893
|
-
return _nullishCoalesce(_optionalChain([CHAIN_BY_ID, 'access',
|
|
889
|
+
return _nullishCoalesce(_optionalChain([CHAIN_BY_ID, 'access', _29 => _29[chainId], 'optionalAccess', _30 => _30.blockExplorers, 'optionalAccess', _31 => _31.default, 'optionalAccess', _32 => _32.name]), () => ( "Explorer"));
|
|
894
890
|
}
|
|
895
891
|
|
|
896
892
|
|
|
@@ -953,5 +949,4 @@ function getExplorerName(chainId) {
|
|
|
953
949
|
|
|
954
950
|
|
|
955
951
|
|
|
956
|
-
|
|
957
|
-
exports.SOLANA_MAINNET_CAIP2 = SOLANA_MAINNET_CAIP2; exports.toEvmCaip2 = toEvmCaip2; exports.targetChainToCaip2 = targetChainToCaip2; exports.targetChainToAccountKey = targetChainToAccountKey; exports.parseEvmChainId = parseEvmChainId; exports.isSolanaCaip2 = isSolanaCaip2; exports.isHyperCoreCaip2 = isHyperCoreCaip2; exports.HYPERCORE_CHAIN_ID = HYPERCORE_CHAIN_ID; exports.HYPERCORE_MAINNET_CAIP2 = HYPERCORE_MAINNET_CAIP2; exports.HYPERCORE_SPOT_CAIP2 = HYPERCORE_SPOT_CAIP2; exports.targetChainToChainId = targetChainToChainId; exports.isHyperCoreDestination = isHyperCoreDestination; exports.HYPERCORE_USDC_ADDRESS = HYPERCORE_USDC_ADDRESS; exports.HYPERCORE_USDT0_ADDRESS = HYPERCORE_USDT0_ADDRESS; exports.HYPERCORE_SOURCE_TOKENS = HYPERCORE_SOURCE_TOKENS; exports.HYPERCORE_MIN_DEPOSIT_USD = HYPERCORE_MIN_DEPOSIT_USD; exports.isVirtualDestination = isVirtualDestination; exports.SOLANA_TOKENS = SOLANA_TOKENS; exports.getSolanaTokenBySymbol = getSolanaTokenBySymbol; exports.getSolanaTokenByMint = getSolanaTokenByMint; exports.isNativeSol = isNativeSol; exports.setRuntimeChainMeta = setRuntimeChainMeta; exports.setRuntimeTokens = setRuntimeTokens; exports.publishShortlistTokens = publishShortlistTokens; exports.ICON_CDN = ICON_CDN; exports.cdnIconUrl = cdnIconUrl; exports.getChainIcon = getChainIcon; exports.tokenIconUrl = tokenIconUrl; exports.getTokenIcon = getTokenIcon; exports.NATIVE_TOKEN_ADDRESS = NATIVE_TOKEN_ADDRESS; exports.CHAIN_DISPLAY_ORDER = CHAIN_DISPLAY_ORDER; exports.CHAIN_BY_ID = CHAIN_BY_ID; exports.SOURCE_CHAINS = SOURCE_CHAINS; exports.SUPPORTED_CHAINS = SUPPORTED_CHAINS; exports.chainRegistry = chainRegistry; exports.getChainId = getChainId; exports.getChainObject = getChainObject; exports.getUsdcAddress = getUsdcAddress; exports.getUsdcDecimals = getUsdcDecimals; exports.getTokenAddress = getTokenAddress; exports.getTokenDecimals = getTokenDecimals; exports.getTargetTokenSymbolsForChain = getTargetTokenSymbolsForChain; exports.getSupportedTokenSymbolsForChain = getSupportedTokenSymbolsForChain; exports.getSupportedChainIds = getSupportedChainIds; exports.isSupportedTokenAddressForChain = isSupportedTokenAddressForChain; exports.getSupportedTargetTokens = getSupportedTargetTokens; exports.getBundledTargetTokens = getBundledTargetTokens; exports.findTokenDecimals = findTokenDecimals; exports.getTokenDecimalsByAddress = getTokenDecimalsByAddress; exports.findChainIdForToken = findChainIdForToken; exports.isRegistryTokenOnChain = isRegistryTokenOnChain; exports.getNativeSymbol = getNativeSymbol; exports.getTokenSymbol = getTokenSymbol; exports.getTargetTokenSymbol = getTargetTokenSymbol; exports.isStablecoinSymbol = isStablecoinSymbol; exports.getChainName = getChainName; exports.getChainBadge = getChainBadge; exports.getExplorerUrl = getExplorerUrl; exports.getExplorerTxUrl = getExplorerTxUrl; exports.getExplorerName = getExplorerName;
|
|
952
|
+
exports.SOLANA_MAINNET_CAIP2 = SOLANA_MAINNET_CAIP2; exports.toEvmCaip2 = toEvmCaip2; exports.targetChainToCaip2 = targetChainToCaip2; exports.targetChainToAccountKey = targetChainToAccountKey; exports.parseEvmChainId = parseEvmChainId; exports.isSolanaCaip2 = isSolanaCaip2; exports.isHyperCoreCaip2 = isHyperCoreCaip2; exports.HYPERCORE_CHAIN_ID = HYPERCORE_CHAIN_ID; exports.HYPERCORE_MAINNET_CAIP2 = HYPERCORE_MAINNET_CAIP2; exports.HYPERCORE_SPOT_CAIP2 = HYPERCORE_SPOT_CAIP2; exports.targetChainToChainId = targetChainToChainId; exports.isHyperCoreDestination = isHyperCoreDestination; exports.HYPERCORE_USDC_ADDRESS = HYPERCORE_USDC_ADDRESS; exports.HYPERCORE_USDT0_ADDRESS = HYPERCORE_USDT0_ADDRESS; exports.HYPERCORE_SOURCE_TOKENS = HYPERCORE_SOURCE_TOKENS; exports.HYPERCORE_MIN_DEPOSIT_USD = HYPERCORE_MIN_DEPOSIT_USD; exports.isVirtualDestination = isVirtualDestination; exports.SOLANA_TOKENS = SOLANA_TOKENS; exports.getSolanaTokenBySymbol = getSolanaTokenBySymbol; exports.getSolanaTokenByMint = getSolanaTokenByMint; exports.isNativeSol = isNativeSol; exports.setRuntimeChainMeta = setRuntimeChainMeta; exports.setRuntimeTokens = setRuntimeTokens; exports.publishShortlistTokens = publishShortlistTokens; exports.ICON_CDN = ICON_CDN; exports.cdnIconUrl = cdnIconUrl; exports.getChainIcon = getChainIcon; exports.tokenIconUrl = tokenIconUrl; exports.getTokenIcon = getTokenIcon; exports.NATIVE_TOKEN_ADDRESS = NATIVE_TOKEN_ADDRESS; exports.CHAIN_DISPLAY_ORDER = CHAIN_DISPLAY_ORDER; exports.CHAIN_BY_ID = CHAIN_BY_ID; exports.SOURCE_CHAINS = SOURCE_CHAINS; exports.SUPPORTED_CHAINS = SUPPORTED_CHAINS; exports.chainRegistry = chainRegistry; exports.getChainId = getChainId; exports.getChainObject = getChainObject; exports.getUsdcAddress = getUsdcAddress; exports.getUsdcDecimals = getUsdcDecimals; exports.getTokenAddress = getTokenAddress; exports.getTokenDecimals = getTokenDecimals; exports.getTargetTokenSymbolsForChain = getTargetTokenSymbolsForChain; exports.getSupportedTokenSymbolsForChain = getSupportedTokenSymbolsForChain; exports.getSupportedChainIds = getSupportedChainIds; exports.isSupportedTokenAddressForChain = isSupportedTokenAddressForChain; exports.getSupportedTargetTokens = getSupportedTargetTokens; exports.findTokenDecimals = findTokenDecimals; exports.getTokenDecimalsByAddress = getTokenDecimalsByAddress; exports.findChainIdForToken = findChainIdForToken; exports.isRegistryTokenOnChain = isRegistryTokenOnChain; exports.getNativeSymbol = getNativeSymbol; exports.getTokenSymbol = getTokenSymbol; exports.getTargetTokenSymbol = getTargetTokenSymbol; exports.isStablecoinSymbol = isStablecoinSymbol; exports.getChainName = getChainName; exports.getChainBadge = getChainBadge; exports.getExplorerUrl = getExplorerUrl; exports.getExplorerTxUrl = getExplorerTxUrl; exports.getExplorerName = getExplorerName;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SERVICE_HEADERS
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-GZNMBZHY.mjs";
|
|
4
4
|
import {
|
|
5
5
|
CHAIN_BY_ID,
|
|
6
6
|
CHAIN_DISPLAY_ORDER,
|
|
@@ -10,14 +10,10 @@ import {
|
|
|
10
10
|
ICON_CDN,
|
|
11
11
|
NATIVE_TOKEN_ADDRESS,
|
|
12
12
|
SOLANA_MAINNET_CAIP2,
|
|
13
|
-
SOURCE_CHAINS,
|
|
14
13
|
findTokenDecimals,
|
|
15
|
-
getBundledTargetTokens,
|
|
16
14
|
getChainName,
|
|
17
15
|
getExplorerTxUrl,
|
|
18
16
|
getSolanaTokenByMint,
|
|
19
|
-
getSupportedChainIds,
|
|
20
|
-
getSupportedTargetTokens,
|
|
21
17
|
getTokenAddress,
|
|
22
18
|
getTokenDecimalsByAddress,
|
|
23
19
|
getTokenSymbol,
|
|
@@ -30,7 +26,7 @@ import {
|
|
|
30
26
|
setRuntimeTokens,
|
|
31
27
|
toEvmCaip2,
|
|
32
28
|
tokenIconUrl
|
|
33
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-YR43AAX5.mjs";
|
|
34
30
|
|
|
35
31
|
// src/components/ui/Modal.tsx
|
|
36
32
|
import {
|
|
@@ -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 = appFees?.tokens?.[sourceChainCaip2]?.[sourceToken.toLowerCase()];
|
|
848
849
|
const bps = override ?? appFees?.feeBps ?? 0;
|
|
@@ -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,
|
|
@@ -2130,7 +2131,7 @@ function useCatalogChain(chainId) {
|
|
|
2130
2131
|
function useDepositChainIds() {
|
|
2131
2132
|
const { catalog } = useChainCatalog();
|
|
2132
2133
|
return useMemo2(() => {
|
|
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
|
|
@@ -2148,11 +2149,7 @@ function useDepositChainIds() {
|
|
|
2148
2149
|
function useDestinationChains() {
|
|
2149
2150
|
const { catalog } = useChainCatalog();
|
|
2150
2151
|
return useMemo2(() => {
|
|
2151
|
-
if (!catalog)
|
|
2152
|
-
return SOURCE_CHAINS.filter(
|
|
2153
|
-
(chain) => getSupportedTargetTokens(chain.id).length > 0
|
|
2154
|
-
).map((chain) => ({ id: chain.id, name: chain.name }));
|
|
2155
|
-
}
|
|
2152
|
+
if (!catalog) return [];
|
|
2156
2153
|
const rank = (id) => {
|
|
2157
2154
|
const i = CHAIN_DISPLAY_ORDER.indexOf(id);
|
|
2158
2155
|
return i === -1 ? CHAIN_DISPLAY_ORDER.length : i;
|
|
@@ -2166,10 +2163,8 @@ function useTargetTokens() {
|
|
|
2166
2163
|
const { catalog, shortlist } = useChainCatalog();
|
|
2167
2164
|
return useMemo2(() => {
|
|
2168
2165
|
return (chainId) => {
|
|
2169
|
-
const bundled = getBundledTargetTokens(chainId);
|
|
2170
|
-
if (bundled.length > 0) return bundled;
|
|
2171
2166
|
const fromShortlist = shortlist?.[String(chainId)];
|
|
2172
|
-
if (fromShortlist
|
|
2167
|
+
if (fromShortlist) {
|
|
2173
2168
|
return fromShortlist.map((token) => ({
|
|
2174
2169
|
symbol: token.symbol,
|
|
2175
2170
|
address: token.address,
|
|
@@ -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 : 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:",
|
|
@@ -2850,6 +2877,7 @@ export {
|
|
|
2850
2877
|
quoteFeeRow,
|
|
2851
2878
|
quoteFeeGroups,
|
|
2852
2879
|
SwappedConnectFeeChangedError,
|
|
2880
|
+
SUPPORTED_CONNECT_EXCHANGE_COUNT,
|
|
2853
2881
|
resolveAppFeeBps,
|
|
2854
2882
|
createDepositService,
|
|
2855
2883
|
rpcUrlFor,
|