@rhinestone/deposit-modal 0.10.0 → 0.11.1
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-MTWT6Y66.mjs → DepositModalReown-MO5QDLIT.mjs} +96 -26
- package/dist/{DepositModalReown-S3DSFXTX.cjs → DepositModalReown-YGB73NMW.cjs} +97 -27
- package/dist/caip-D8aRWdEY.d.cts +40 -0
- package/dist/caip-D8aRWdEY.d.ts +40 -0
- package/dist/{chunk-NF4NBRUP.cjs → chunk-4FTI3GTB.cjs} +1 -1
- package/dist/{chunk-A223BLVC.mjs → chunk-53IFZGSF.mjs} +177 -21
- package/dist/{chunk-VDGT6NZQ.mjs → chunk-5746YXKC.mjs} +14 -31
- package/dist/{chunk-7TV7GLJB.mjs → chunk-CWGUBFJL.mjs} +763 -169
- package/dist/{chunk-LR7MKHYV.mjs → chunk-EIWOVX53.mjs} +27 -25
- package/dist/{chunk-VTVOHNXM.cjs → chunk-FVUXJ3RP.cjs} +3 -3
- package/dist/{chunk-A42XAHIB.cjs → chunk-HUHBNYD3.cjs} +84 -101
- package/dist/{chunk-YEBXUUH3.cjs → chunk-JPRV36DT.cjs} +2 -2
- package/dist/{chunk-UMCDZJMG.cjs → chunk-LQGYPM5B.cjs} +96 -94
- package/dist/{chunk-ILT2PITN.mjs → chunk-MZ53PDIX.mjs} +1 -1
- package/dist/{chunk-5NJYW5FT.mjs → chunk-OWYPKCYD.mjs} +12 -9
- package/dist/{chunk-W4YAOJPG.cjs → chunk-SSQ27YFB.cjs} +625 -568
- package/dist/{chunk-H577RJN5.cjs → chunk-TENL4H64.cjs} +186 -30
- package/dist/{chunk-5OEWGJR4.mjs → chunk-URFSTNRS.mjs} +1 -1
- package/dist/{chunk-KW32UBUQ.mjs → chunk-V6T7LORJ.mjs} +1 -1
- package/dist/{chunk-MHIOMTMM.mjs → chunk-YELNYILK.mjs} +391 -334
- package/dist/{chunk-PUJHXHRA.cjs → chunk-ZQR36NCV.cjs} +845 -251
- package/dist/{chunk-DEF767BA.cjs → chunk-ZRIRCIQM.cjs} +66 -63
- package/dist/claim.cjs +6 -6
- package/dist/claim.d.cts +3 -2
- package/dist/claim.d.ts +3 -2
- package/dist/claim.mjs +5 -5
- package/dist/{caip-523Zrc3r.d.cts → constants-FuzG3h4m.d.cts} +1 -18
- package/dist/{caip-523Zrc3r.d.ts → constants-FuzG3h4m.d.ts} +1 -18
- package/dist/constants.cjs +5 -3
- package/dist/constants.d.cts +3 -2
- package/dist/constants.d.ts +3 -2
- package/dist/constants.mjs +4 -2
- package/dist/deposit.cjs +8 -8
- package/dist/deposit.d.cts +3 -2
- package/dist/deposit.d.ts +3 -2
- package/dist/deposit.mjs +7 -7
- package/dist/index.cjs +12 -10
- package/dist/index.d.cts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.mjs +11 -9
- package/dist/polymarket.cjs +5 -5
- package/dist/polymarket.mjs +2 -2
- package/dist/{types-C0SGf-21.d.cts → types-CsGa-HxD.d.cts} +10 -3
- package/dist/{types-C0SGf-21.d.ts → types-DdS8OySJ.d.ts} +10 -3
- package/dist/withdraw.cjs +6 -6
- package/dist/withdraw.d.cts +3 -2
- package/dist/withdraw.d.ts +3 -2
- package/dist/withdraw.mjs +5 -5
- package/package.json +1 -1
|
@@ -6,9 +6,13 @@ function toEvmCaip2(chainId) {
|
|
|
6
6
|
}
|
|
7
7
|
function targetChainToCaip2(targetChain) {
|
|
8
8
|
if (targetChain === "solana") return SOLANA_MAINNET_CAIP2;
|
|
9
|
-
if (targetChain
|
|
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
|
+
}
|
|
12
16
|
function parseEvmChainId(value) {
|
|
13
17
|
if (typeof value === "number" && Number.isFinite(value)) {
|
|
14
18
|
return value;
|
|
@@ -27,6 +31,13 @@ function isHyperCoreCaip2(value) {
|
|
|
27
31
|
}
|
|
28
32
|
var HYPERCORE_CHAIN_ID = 1337;
|
|
29
33
|
var HYPERCORE_MAINNET_CAIP2 = "hypercore:mainnet";
|
|
34
|
+
var HYPERCORE_SPOT_CAIP2 = "hypercore:spot";
|
|
35
|
+
function targetChainToChainId(targetChain) {
|
|
36
|
+
return isHyperCoreDestination(targetChain) ? "hypercore" : targetChain;
|
|
37
|
+
}
|
|
38
|
+
function isHyperCoreDestination(targetChain) {
|
|
39
|
+
return targetChain === HYPERCORE_SPOT_CAIP2 || targetChain === HYPERCORE_CHAIN_ID;
|
|
40
|
+
}
|
|
30
41
|
var HYPERCORE_USDC_ADDRESS = "0xb88339CB7199b77E23DB6E890353E22632Ba630f";
|
|
31
42
|
var HYPERCORE_USDT0_ADDRESS = "0xB8CE59FC3717ada4C02eaDF9682A9e934F625ebb";
|
|
32
43
|
var HYPERCORE_SOURCE_TOKENS = [
|
|
@@ -35,7 +46,7 @@ var HYPERCORE_SOURCE_TOKENS = [
|
|
|
35
46
|
];
|
|
36
47
|
var HYPERCORE_MIN_DEPOSIT_USD = 1;
|
|
37
48
|
function isVirtualDestination(targetChain) {
|
|
38
|
-
return targetChain === "solana" || targetChain
|
|
49
|
+
return targetChain === "solana" || isHyperCoreDestination(targetChain);
|
|
39
50
|
}
|
|
40
51
|
|
|
41
52
|
// src/core/solana-tokens.ts
|
|
@@ -81,6 +92,29 @@ import {
|
|
|
81
92
|
soneium,
|
|
82
93
|
unichain
|
|
83
94
|
} from "viem/chains";
|
|
95
|
+
|
|
96
|
+
// src/core/runtime-chain-meta.ts
|
|
97
|
+
var byChainId = /* @__PURE__ */ new Map();
|
|
98
|
+
function setRuntimeChainMeta(entries) {
|
|
99
|
+
for (const entry of entries) {
|
|
100
|
+
byChainId.set(entry.chainId, {
|
|
101
|
+
name: entry.name,
|
|
102
|
+
iconUrl: entry.iconUrl,
|
|
103
|
+
nativeSymbol: entry.nativeSymbol
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
function getRuntimeNativeSymbol(chainId) {
|
|
108
|
+
return byChainId.get(chainId)?.nativeSymbol;
|
|
109
|
+
}
|
|
110
|
+
function getRuntimeChainName(chainId) {
|
|
111
|
+
return byChainId.get(chainId)?.name;
|
|
112
|
+
}
|
|
113
|
+
function getRuntimeChainIconUrl(chainId) {
|
|
114
|
+
return byChainId.get(chainId)?.iconUrl;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// src/core/icons.ts
|
|
84
118
|
var ICON_CDN = "https://s3.rhinestone.dev";
|
|
85
119
|
var CHAIN_ICON_SLUGS = {
|
|
86
120
|
[mainnet.id]: "mainnet",
|
|
@@ -96,7 +130,13 @@ var CHAIN_ICON_SLUGS = {
|
|
|
96
130
|
[hyperliquid.id]: "hypeevm",
|
|
97
131
|
[monad.id]: "monad",
|
|
98
132
|
[unichain.id]: "unichain",
|
|
99
|
-
[katana.id]: "katana"
|
|
133
|
+
[katana.id]: "katana",
|
|
134
|
+
// Live deposit sources that predate this map being catalog-backed. Kept as
|
|
135
|
+
// plain ids rather than viem imports: this is the FALLBACK for chains the
|
|
136
|
+
// backend has not annotated with `iconUrl` yet, so it should not grow a
|
|
137
|
+
// build-time dependency on a chain definition to name a file.
|
|
138
|
+
43114: "avalanche",
|
|
139
|
+
4663: "robinhood"
|
|
100
140
|
};
|
|
101
141
|
function cdnIconUrl(dir, slug) {
|
|
102
142
|
return `${ICON_CDN}/${dir}/${slug}.svg`;
|
|
@@ -113,12 +153,18 @@ function getChainIcon(chainId) {
|
|
|
113
153
|
if (chainId === "hypercore" || chainId === HYPERCORE_CHAIN_ID) {
|
|
114
154
|
return CHAIN_ICONS[hyperliquid.id];
|
|
115
155
|
}
|
|
116
|
-
return CHAIN_ICONS[chainId];
|
|
156
|
+
return CHAIN_ICONS[chainId] ?? getRuntimeChainIconUrl(chainId);
|
|
117
157
|
}
|
|
118
158
|
var ICON_SLUG_ALIASES = {
|
|
119
159
|
"usdc.e": "usdc",
|
|
120
160
|
wsol: "sol",
|
|
121
|
-
xdai: "dai"
|
|
161
|
+
xdai: "dai",
|
|
162
|
+
// A wrapped token is the same asset and the CDN hosts only the underlying
|
|
163
|
+
// mark, so these fall back to it rather than to a text badge. `weth` is the
|
|
164
|
+
// one the deposit flow offers on nearly every chain, and it has been showing
|
|
165
|
+
// as text since the icons moved to the CDN.
|
|
166
|
+
weth: "eth",
|
|
167
|
+
wavax: "avax"
|
|
122
168
|
};
|
|
123
169
|
function tokenIconUrl(symbol) {
|
|
124
170
|
const key = symbol.toLowerCase().replace(/₮/g, "t");
|
|
@@ -146,6 +192,70 @@ import {
|
|
|
146
192
|
soneium as soneium2,
|
|
147
193
|
unichain as unichain2
|
|
148
194
|
} from "viem/chains";
|
|
195
|
+
|
|
196
|
+
// src/core/runtime-token-meta.ts
|
|
197
|
+
var bySymbol = /* @__PURE__ */ new Map();
|
|
198
|
+
var byAddress = /* @__PURE__ */ new Map();
|
|
199
|
+
var symbolsByChain = /* @__PURE__ */ new Map();
|
|
200
|
+
function symbolKey(chainId, symbol) {
|
|
201
|
+
return `${chainId}:${symbol.trim().toUpperCase()}`;
|
|
202
|
+
}
|
|
203
|
+
function addressKey(chainId, address) {
|
|
204
|
+
return `${chainId}:${address.toLowerCase()}`;
|
|
205
|
+
}
|
|
206
|
+
function setRuntimeTokens(tokens) {
|
|
207
|
+
for (const token of tokens) {
|
|
208
|
+
const sKey = symbolKey(token.chainId, token.symbol);
|
|
209
|
+
if (!bySymbol.has(sKey)) {
|
|
210
|
+
bySymbol.set(sKey, token);
|
|
211
|
+
const list = symbolsByChain.get(token.chainId);
|
|
212
|
+
if (list) list.push(token.symbol);
|
|
213
|
+
else symbolsByChain.set(token.chainId, [token.symbol]);
|
|
214
|
+
}
|
|
215
|
+
byAddress.set(addressKey(token.chainId, token.address), token);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
function publishShortlistTokens(shortlist) {
|
|
219
|
+
const tokens = [];
|
|
220
|
+
for (const [chainKey, entries] of Object.entries(shortlist)) {
|
|
221
|
+
const chainId = Number(chainKey);
|
|
222
|
+
if (!Number.isInteger(chainId)) continue;
|
|
223
|
+
for (const entry of entries) {
|
|
224
|
+
if (!/^0x[a-fA-F0-9]{40}$/.test(entry.address)) continue;
|
|
225
|
+
tokens.push({
|
|
226
|
+
chainId,
|
|
227
|
+
symbol: entry.symbol,
|
|
228
|
+
address: entry.address,
|
|
229
|
+
decimals: entry.decimals
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
setRuntimeTokens(tokens);
|
|
234
|
+
}
|
|
235
|
+
function getRuntimeToken(chainId, symbol) {
|
|
236
|
+
return bySymbol.get(symbolKey(chainId, symbol));
|
|
237
|
+
}
|
|
238
|
+
function getRuntimeTokenByAddress(chainId, address) {
|
|
239
|
+
return byAddress.get(addressKey(chainId, address));
|
|
240
|
+
}
|
|
241
|
+
function getRuntimeTokenSymbols(chainId) {
|
|
242
|
+
return symbolsByChain.get(chainId) ?? [];
|
|
243
|
+
}
|
|
244
|
+
function findRuntimeDecimalsByAddress(address) {
|
|
245
|
+
return findByAddress(address)?.decimals;
|
|
246
|
+
}
|
|
247
|
+
function findRuntimeSymbolByAddress(address) {
|
|
248
|
+
return findByAddress(address)?.symbol;
|
|
249
|
+
}
|
|
250
|
+
function findByAddress(address) {
|
|
251
|
+
const suffix = `:${address.toLowerCase()}`;
|
|
252
|
+
for (const [key, token] of byAddress) {
|
|
253
|
+
if (key.endsWith(suffix)) return token;
|
|
254
|
+
}
|
|
255
|
+
return void 0;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
// src/core/constants.ts
|
|
149
259
|
var NATIVE_TOKEN_ADDRESS = "0x0000000000000000000000000000000000000000";
|
|
150
260
|
var ALL_CHAINS_BY_ID = {
|
|
151
261
|
[mainnet2.id]: mainnet2,
|
|
@@ -520,13 +630,14 @@ function normalizeTokenSymbol(symbol) {
|
|
|
520
630
|
return trimmed.toUpperCase();
|
|
521
631
|
}
|
|
522
632
|
function isSymbolSupportedOnChain(symbol, chainId) {
|
|
633
|
+
const normalized = normalizeTokenSymbol(symbol);
|
|
523
634
|
const symbols = SUPPORTED_TOKENS_BY_CHAIN[chainId];
|
|
524
|
-
if (
|
|
525
|
-
return
|
|
635
|
+
if (symbols?.includes(normalized)) return true;
|
|
636
|
+
return getRuntimeToken(chainId, normalized) !== void 0;
|
|
526
637
|
}
|
|
527
638
|
function getTokenFromRegistry(chainId, symbol) {
|
|
528
639
|
const chainEntry = chainRegistry[String(chainId)];
|
|
529
|
-
if (!chainEntry) return
|
|
640
|
+
if (!chainEntry) return runtimeToken(chainId, normalizeTokenSymbol(symbol));
|
|
530
641
|
const normalized = normalizeTokenSymbol(symbol);
|
|
531
642
|
const token = chainEntry.tokens.find(
|
|
532
643
|
(t) => t.symbol.toUpperCase() === normalized
|
|
@@ -534,7 +645,11 @@ function getTokenFromRegistry(chainId, symbol) {
|
|
|
534
645
|
if (token) {
|
|
535
646
|
return { address: token.address, decimals: token.decimals };
|
|
536
647
|
}
|
|
537
|
-
return
|
|
648
|
+
return runtimeToken(chainId, normalized);
|
|
649
|
+
}
|
|
650
|
+
function runtimeToken(chainId, symbol) {
|
|
651
|
+
const token = getRuntimeToken(chainId, symbol);
|
|
652
|
+
return token ? { address: token.address, decimals: token.decimals } : void 0;
|
|
538
653
|
}
|
|
539
654
|
function getUsdcAddress(chainId) {
|
|
540
655
|
const token = getTokenFromRegistry(chainId, "USDC");
|
|
@@ -565,8 +680,9 @@ function getTokenDecimals(symbol, chainId) {
|
|
|
565
680
|
return token?.decimals ?? 18;
|
|
566
681
|
}
|
|
567
682
|
function getTargetTokenSymbolsForChain(chainId) {
|
|
568
|
-
const symbols = SUPPORTED_TOKENS_BY_CHAIN[chainId]
|
|
569
|
-
return [...symbols];
|
|
683
|
+
const symbols = SUPPORTED_TOKENS_BY_CHAIN[chainId];
|
|
684
|
+
if (symbols?.length) return [...symbols];
|
|
685
|
+
return getRuntimeTokenSymbols(chainId);
|
|
570
686
|
}
|
|
571
687
|
function getSupportedTokenSymbolsForChain(chainId) {
|
|
572
688
|
return getTargetTokenSymbolsForChain(chainId);
|
|
@@ -587,7 +703,13 @@ function isSupportedTokenAddressForChain(token, chainId) {
|
|
|
587
703
|
return expected.address.toLowerCase() === normalized;
|
|
588
704
|
}
|
|
589
705
|
function getSupportedTargetTokens(chainId) {
|
|
590
|
-
|
|
706
|
+
return toTokenOptions(getSupportedTokenSymbolsForChain(chainId), chainId);
|
|
707
|
+
}
|
|
708
|
+
function getBundledTargetTokens(chainId) {
|
|
709
|
+
const symbols = SUPPORTED_TOKENS_BY_CHAIN[chainId];
|
|
710
|
+
return symbols?.length ? toTokenOptions([...symbols], chainId) : [];
|
|
711
|
+
}
|
|
712
|
+
function toTokenOptions(symbols, chainId) {
|
|
591
713
|
const options = [];
|
|
592
714
|
for (const symbol of symbols) {
|
|
593
715
|
const address = getTokenAddress(symbol, chainId);
|
|
@@ -620,7 +742,11 @@ function findTokenDecimals(token, chainId) {
|
|
|
620
742
|
);
|
|
621
743
|
if (found) return found.decimals;
|
|
622
744
|
}
|
|
623
|
-
|
|
745
|
+
if (chainId) {
|
|
746
|
+
const onChain = getRuntimeTokenByAddress(chainId, normalized);
|
|
747
|
+
if (onChain) return onChain.decimals;
|
|
748
|
+
}
|
|
749
|
+
return findRuntimeDecimalsByAddress(normalized);
|
|
624
750
|
}
|
|
625
751
|
function getTokenDecimalsByAddress(token, chainId) {
|
|
626
752
|
return findTokenDecimals(token, chainId) ?? 18;
|
|
@@ -652,7 +778,10 @@ var NATIVE_SYMBOL_BY_CHAIN = {
|
|
|
652
778
|
[hyperliquid2.id]: "HYPE"
|
|
653
779
|
};
|
|
654
780
|
function getNativeSymbol(chainId) {
|
|
655
|
-
|
|
781
|
+
if (chainId == null) return "ETH";
|
|
782
|
+
const bundled = NATIVE_SYMBOL_BY_CHAIN[chainId];
|
|
783
|
+
if (bundled) return bundled;
|
|
784
|
+
return getRuntimeNativeSymbol(chainId) ?? "ETH";
|
|
656
785
|
}
|
|
657
786
|
function getTokenSymbol(token, chainId) {
|
|
658
787
|
const normalized = token.toLowerCase();
|
|
@@ -674,13 +803,17 @@ function getTokenSymbol(token, chainId) {
|
|
|
674
803
|
);
|
|
675
804
|
if (found) return found.symbol;
|
|
676
805
|
}
|
|
677
|
-
|
|
806
|
+
if (chainId) {
|
|
807
|
+
const onChain = getRuntimeTokenByAddress(chainId, normalized);
|
|
808
|
+
if (onChain) return onChain.symbol;
|
|
809
|
+
}
|
|
810
|
+
return findRuntimeSymbolByAddress(normalized) ?? "Token";
|
|
678
811
|
}
|
|
679
812
|
function getTargetTokenSymbol(token, chain) {
|
|
680
813
|
if (chain === "solana") {
|
|
681
814
|
return getSolanaTokenByMint(String(token))?.symbol ?? "Token";
|
|
682
815
|
}
|
|
683
|
-
return getTokenSymbol(token, chain);
|
|
816
|
+
return getTokenSymbol(token, resolveDisplayChainId(chain));
|
|
684
817
|
}
|
|
685
818
|
function isStablecoinSymbol(symbol) {
|
|
686
819
|
return /^(usdc|usdt|usdt0|dai|usd)$/i.test(symbol);
|
|
@@ -717,17 +850,30 @@ function getChainName(chainId) {
|
|
|
717
850
|
if (chain) return chain.name;
|
|
718
851
|
const chainEntry = chainRegistry[String(id)];
|
|
719
852
|
if (chainEntry) return chainEntry.name;
|
|
853
|
+
const runtimeName = getRuntimeChainName(id);
|
|
854
|
+
if (runtimeName) return runtimeName;
|
|
720
855
|
return `Chain ${id}`;
|
|
721
856
|
}
|
|
722
857
|
function getChainBadge(chainId) {
|
|
723
858
|
if (chainId === "solana") {
|
|
724
859
|
return { shortLabel: "SOL", color: "#9945FF", bg: "#F3EEFF" };
|
|
725
860
|
}
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
861
|
+
const id = resolveDisplayChainId(chainId);
|
|
862
|
+
const curated = CHAIN_BADGES[id];
|
|
863
|
+
if (curated) return curated;
|
|
864
|
+
const name = getRuntimeChainName(id);
|
|
865
|
+
if (!name) {
|
|
866
|
+
return { shortLabel: "Net", color: "#64748B", bg: "#F1F5F9" };
|
|
867
|
+
}
|
|
868
|
+
return { shortLabel: name, ...badgeColorsFor(name) };
|
|
869
|
+
}
|
|
870
|
+
function badgeColorsFor(name) {
|
|
871
|
+
let hash = 0;
|
|
872
|
+
for (let i = 0; i < name.length; i++) {
|
|
873
|
+
hash = hash * 31 + name.charCodeAt(i) | 0;
|
|
874
|
+
}
|
|
875
|
+
const hue = Math.abs(hash) % 360;
|
|
876
|
+
return { color: `hsl(${hue} 55% 38%)`, bg: `hsl(${hue} 70% 95%)` };
|
|
731
877
|
}
|
|
732
878
|
function getExplorerUrl(chainId) {
|
|
733
879
|
if (chainId === "solana") return "https://solscan.io";
|
|
@@ -748,13 +894,18 @@ function getExplorerName(chainId) {
|
|
|
748
894
|
}
|
|
749
895
|
|
|
750
896
|
export {
|
|
897
|
+
SOLANA_MAINNET_CAIP2,
|
|
751
898
|
toEvmCaip2,
|
|
752
899
|
targetChainToCaip2,
|
|
900
|
+
targetChainToAccountKey,
|
|
753
901
|
parseEvmChainId,
|
|
754
902
|
isSolanaCaip2,
|
|
755
903
|
isHyperCoreCaip2,
|
|
756
904
|
HYPERCORE_CHAIN_ID,
|
|
757
905
|
HYPERCORE_MAINNET_CAIP2,
|
|
906
|
+
HYPERCORE_SPOT_CAIP2,
|
|
907
|
+
targetChainToChainId,
|
|
908
|
+
isHyperCoreDestination,
|
|
758
909
|
HYPERCORE_USDC_ADDRESS,
|
|
759
910
|
HYPERCORE_USDT0_ADDRESS,
|
|
760
911
|
HYPERCORE_SOURCE_TOKENS,
|
|
@@ -764,12 +915,16 @@ export {
|
|
|
764
915
|
getSolanaTokenBySymbol,
|
|
765
916
|
getSolanaTokenByMint,
|
|
766
917
|
isNativeSol,
|
|
918
|
+
setRuntimeChainMeta,
|
|
919
|
+
setRuntimeTokens,
|
|
920
|
+
publishShortlistTokens,
|
|
767
921
|
ICON_CDN,
|
|
768
922
|
cdnIconUrl,
|
|
769
923
|
getChainIcon,
|
|
770
924
|
tokenIconUrl,
|
|
771
925
|
getTokenIcon,
|
|
772
926
|
NATIVE_TOKEN_ADDRESS,
|
|
927
|
+
CHAIN_DISPLAY_ORDER,
|
|
773
928
|
CHAIN_BY_ID,
|
|
774
929
|
SOURCE_CHAINS,
|
|
775
930
|
SUPPORTED_CHAINS,
|
|
@@ -785,6 +940,7 @@ export {
|
|
|
785
940
|
getSupportedChainIds,
|
|
786
941
|
isSupportedTokenAddressForChain,
|
|
787
942
|
getSupportedTargetTokens,
|
|
943
|
+
getBundledTargetTokens,
|
|
788
944
|
findTokenDecimals,
|
|
789
945
|
getTokenDecimalsByAddress,
|
|
790
946
|
findChainIdForToken,
|
|
@@ -21,20 +21,20 @@ import {
|
|
|
21
21
|
quoteFeeGroups,
|
|
22
22
|
quoteFeeRow,
|
|
23
23
|
resolveTokenDisplay,
|
|
24
|
-
rpcUrlFor,
|
|
25
24
|
tokenAmountToNumber,
|
|
25
|
+
useExplorerTxUrl,
|
|
26
26
|
useLatestRef
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-CWGUBFJL.mjs";
|
|
28
28
|
import {
|
|
29
|
-
CHAIN_BY_ID,
|
|
30
29
|
NATIVE_TOKEN_ADDRESS,
|
|
31
30
|
cdnIconUrl,
|
|
32
31
|
getChainIcon,
|
|
33
32
|
getChainName,
|
|
34
|
-
|
|
33
|
+
targetChainToAccountKey,
|
|
35
34
|
targetChainToCaip2,
|
|
35
|
+
targetChainToChainId,
|
|
36
36
|
toEvmCaip2
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-53IFZGSF.mjs";
|
|
38
38
|
|
|
39
39
|
// src/core/removed-props.ts
|
|
40
40
|
var MANAGED_ACCOUNT_REMOVALS = {
|
|
@@ -884,6 +884,7 @@ function ProcessingStep({
|
|
|
884
884
|
const onDepositCompleteRef = useLatestRef(onDepositComplete);
|
|
885
885
|
const onDepositFailedRef = useLatestRef(onDepositFailed);
|
|
886
886
|
const onErrorRef = useLatestRef(onError);
|
|
887
|
+
const explorerTxUrl = useExplorerTxUrl();
|
|
887
888
|
const initialTerminalEventRef = useRef2(null);
|
|
888
889
|
const [state, setState] = useState4(() => {
|
|
889
890
|
if (directTransfer) return { type: "complete" };
|
|
@@ -1222,8 +1223,9 @@ function ProcessingStep({
|
|
|
1222
1223
|
const displaySourceChain = sourceDetails.chainId ?? sourceChain;
|
|
1223
1224
|
const displaySourceToken = sourceDetails.token ?? sourceToken;
|
|
1224
1225
|
const displayAmount = sourceDetails.amount ?? amount;
|
|
1225
|
-
const
|
|
1226
|
-
const
|
|
1226
|
+
const targetChainId = targetChainToChainId(targetChain);
|
|
1227
|
+
const sourceExplorerUrl = explorerTxUrl(displaySourceChain, txHash);
|
|
1228
|
+
const destExplorerUrl = destinationTxHash ? explorerTxUrl(targetChainId, destinationTxHash) : null;
|
|
1227
1229
|
const sourceDisplay = (() => {
|
|
1228
1230
|
const resolved = resolveTokenDisplay(displaySourceToken, displaySourceChain, {
|
|
1229
1231
|
symbol: providedSourceSymbol ?? (displaySourceChain === "solana" ? "SOL" : "Token"),
|
|
@@ -1240,7 +1242,7 @@ function ProcessingStep({
|
|
|
1240
1242
|
const eventDestination = getEventDestinationDetails(lastEvent);
|
|
1241
1243
|
const targetDisplay = resolveTokenDisplay(
|
|
1242
1244
|
eventDestination.token ?? targetToken,
|
|
1243
|
-
eventDestination.chainId ??
|
|
1245
|
+
eventDestination.chainId ?? targetChainId,
|
|
1244
1246
|
// Dapp deposits default to USDC targets; mirror the source symbol last so
|
|
1245
1247
|
// unresolvable same-token routes still label sensibly.
|
|
1246
1248
|
{ symbol: providedSourceSymbol ?? "USDC" }
|
|
@@ -1255,7 +1257,7 @@ function ProcessingStep({
|
|
|
1255
1257
|
symbol: sourceDisplay.symbol
|
|
1256
1258
|
},
|
|
1257
1259
|
{
|
|
1258
|
-
chainId: eventDestination.chainId ??
|
|
1260
|
+
chainId: eventDestination.chainId ?? targetChainId,
|
|
1259
1261
|
address: eventDestination.token ?? targetToken,
|
|
1260
1262
|
symbol: targetDisplay.symbol
|
|
1261
1263
|
}
|
|
@@ -1303,9 +1305,9 @@ function ProcessingStep({
|
|
|
1303
1305
|
void delayPhaseId;
|
|
1304
1306
|
void hasEscalatedDelay;
|
|
1305
1307
|
const sourceChainIcon = getChainIcon(displaySourceChain);
|
|
1306
|
-
const targetChainIcon = getChainIcon(
|
|
1308
|
+
const targetChainIcon = getChainIcon(targetChainId);
|
|
1307
1309
|
const sourceChainName = getChainName(displaySourceChain);
|
|
1308
|
-
const targetChainName = getChainName(
|
|
1310
|
+
const targetChainName = getChainName(targetChainId);
|
|
1309
1311
|
const timerText = formatTimer(elapsedSeconds);
|
|
1310
1312
|
const feeSponsored = uiConfig?.feeSponsored ?? false;
|
|
1311
1313
|
const feeTooltip = uiConfig?.feeTooltip ?? (feeSponsored ? "Network fees are sponsored for this deposit." : "Network fees apply.");
|
|
@@ -1556,24 +1558,6 @@ function ProcessingStep({
|
|
|
1556
1558
|
] });
|
|
1557
1559
|
}
|
|
1558
1560
|
|
|
1559
|
-
// src/core/public-client.ts
|
|
1560
|
-
import { createPublicClient, http } from "viem";
|
|
1561
|
-
var clientCache = /* @__PURE__ */ new Map();
|
|
1562
|
-
function getPublicClient(chainId, rpcUrls) {
|
|
1563
|
-
const url = rpcUrlFor(rpcUrls, chainId);
|
|
1564
|
-
const cacheKey = `${chainId}|${url ?? ""}`;
|
|
1565
|
-
let client = clientCache.get(cacheKey);
|
|
1566
|
-
if (!client) {
|
|
1567
|
-
const chain = CHAIN_BY_ID[chainId];
|
|
1568
|
-
client = createPublicClient({
|
|
1569
|
-
chain,
|
|
1570
|
-
transport: http(url)
|
|
1571
|
-
});
|
|
1572
|
-
clientCache.set(cacheKey, client);
|
|
1573
|
-
}
|
|
1574
|
-
return client;
|
|
1575
|
-
}
|
|
1576
|
-
|
|
1577
1561
|
// src/core/account-setup.ts
|
|
1578
1562
|
import { concat, isAddress, keccak256, toHex } from "viem";
|
|
1579
1563
|
var SetupError = class extends Error {
|
|
@@ -1607,7 +1591,7 @@ function deriveAccountSalt(input) {
|
|
|
1607
1591
|
return keccak256(
|
|
1608
1592
|
concat([
|
|
1609
1593
|
keccak256(toHex(normalizeKeyToken(input.recipient) ?? "")),
|
|
1610
|
-
keccak256(toHex(
|
|
1594
|
+
keccak256(toHex(targetChainToAccountKey(input.targetChain))),
|
|
1611
1595
|
keccak256(toHex(normalizeKeyToken(input.targetToken) ?? ""))
|
|
1612
1596
|
])
|
|
1613
1597
|
);
|
|
@@ -1773,7 +1757,6 @@ export {
|
|
|
1773
1757
|
fetchTokenPriceUsd,
|
|
1774
1758
|
useTokenPrices,
|
|
1775
1759
|
ProcessingStep,
|
|
1776
|
-
getPublicClient,
|
|
1777
1760
|
SetupError,
|
|
1778
1761
|
deriveAccountSalt,
|
|
1779
1762
|
computeRequestKey,
|