@rhinestone/deposit-modal 0.3.0-alpha.14 → 0.3.0-alpha.16

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.
Files changed (35) hide show
  1. package/dist/{DepositModalReown-4I47KSPN.cjs → DepositModalReown-QRLLANTS.cjs} +7 -7
  2. package/dist/{DepositModalReown-DIUIB3MU.mjs → DepositModalReown-THU2QG76.mjs} +4 -4
  3. package/dist/{WithdrawModalReown-Y3NRAKXJ.cjs → WithdrawModalReown-PHWLYDZQ.cjs} +7 -7
  4. package/dist/{WithdrawModalReown-WRUEALDP.mjs → WithdrawModalReown-SSRJNUGZ.mjs} +4 -4
  5. package/dist/{constants-DqVn968d.d.ts → caip-CrQ2KKU-.d.cts} +11 -1
  6. package/dist/{constants-DqVn968d.d.cts → caip-CrQ2KKU-.d.ts} +11 -1
  7. package/dist/{chunk-SZIYS42B.mjs → chunk-6YRDD462.mjs} +63 -3
  8. package/dist/{chunk-N4XRQPVA.cjs → chunk-7W5M6WEE.cjs} +226 -203
  9. package/dist/{chunk-JTMGFWXO.mjs → chunk-E2K7XWMN.mjs} +2 -2
  10. package/dist/{chunk-2NUXDEEO.cjs → chunk-G5YDICEN.cjs} +93 -93
  11. package/dist/{chunk-7JIDIX27.cjs → chunk-MILJQWPT.cjs} +73 -13
  12. package/dist/{chunk-VD4WTEHP.mjs → chunk-PAK3NUGY.mjs} +5 -5
  13. package/dist/{chunk-3CYGTYMY.cjs → chunk-PXQBJMNF.cjs} +526 -451
  14. package/dist/{chunk-JTULAFMU.cjs → chunk-UD6QUZJS.cjs} +5 -5
  15. package/dist/{chunk-XG474KUR.mjs → chunk-YX3I7C2R.mjs} +101 -26
  16. package/dist/{chunk-4ZN726P5.mjs → chunk-Z7OJPEV2.mjs} +258 -235
  17. package/dist/constants.cjs +6 -2
  18. package/dist/constants.d.cts +1 -1
  19. package/dist/constants.d.ts +1 -1
  20. package/dist/constants.mjs +5 -1
  21. package/dist/deposit.cjs +4 -4
  22. package/dist/deposit.d.cts +2 -2
  23. package/dist/deposit.d.ts +2 -2
  24. package/dist/deposit.mjs +3 -3
  25. package/dist/index.cjs +9 -5
  26. package/dist/index.d.cts +2 -2
  27. package/dist/index.d.ts +2 -2
  28. package/dist/index.mjs +8 -4
  29. package/dist/{types-C8i2ebY1.d.cts → types-cXr3j4NV.d.cts} +26 -0
  30. package/dist/{types-C8i2ebY1.d.ts → types-cXr3j4NV.d.ts} +26 -0
  31. package/dist/withdraw.cjs +4 -4
  32. package/dist/withdraw.d.cts +2 -2
  33. package/dist/withdraw.d.ts +2 -2
  34. package/dist/withdraw.mjs +3 -3
  35. package/package.json +1 -1
@@ -1,4 +1,38 @@
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; }// src/core/solana-tokens.ts
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; }// src/core/caip.ts
2
+ var SOLANA_MAINNET_GENESIS = "5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp";
3
+ var SOLANA_MAINNET_CAIP2 = `solana:${SOLANA_MAINNET_GENESIS}`;
4
+ function toEvmCaip2(chainId) {
5
+ return `eip155:${chainId}`;
6
+ }
7
+ function targetChainToCaip2(targetChain) {
8
+ return targetChain === "solana" ? SOLANA_MAINNET_CAIP2 : toEvmCaip2(targetChain);
9
+ }
10
+ function parseEvmChainId(value) {
11
+ if (typeof value === "number" && Number.isFinite(value)) {
12
+ return value;
13
+ }
14
+ if (typeof value !== "string") return null;
15
+ const match = value.match(/^eip155:(\d+)$/);
16
+ if (!_optionalChain([match, 'optionalAccess', _ => _[1]])) return null;
17
+ const parsed = Number.parseInt(match[1], 10);
18
+ return Number.isFinite(parsed) ? parsed : null;
19
+ }
20
+ function isSolanaCaip2(value) {
21
+ return typeof value === "string" && value.startsWith("solana:");
22
+ }
23
+ var HYPERCORE_CHAIN_ID = 1337;
24
+ var HYPERCORE_USDC_ADDRESS = "0xb88339CB7199b77E23DB6E890353E22632Ba630f";
25
+ var HYPERCORE_MIN_DEPOSIT_USD = 1;
26
+ function isVirtualDestination(targetChain) {
27
+ return targetChain === "solana" || targetChain === HYPERCORE_CHAIN_ID;
28
+ }
29
+ function isContractBytecode(code) {
30
+ if (!code || code === "0x") return false;
31
+ if (code.toLowerCase().startsWith("0xef0100")) return false;
32
+ return true;
33
+ }
34
+
35
+ // src/core/solana-tokens.ts
2
36
  var SOLANA_TOKENS = [
3
37
  { symbol: "SOL", mint: "native", decimals: 9 },
4
38
  {
@@ -67,6 +101,7 @@ var SOLANA_CHAIN_ICON = SOL_BADGE_SVG;
67
101
  var SOLANA_TOKEN_ICON = SOL_BADGE_SVG;
68
102
  function getChainIcon(chainId) {
69
103
  if (chainId === "solana") return SOLANA_CHAIN_ICON;
104
+ if (chainId === HYPERCORE_CHAIN_ID) return CHAIN_ICONS[_chains.hyperliquid.id];
70
105
  return CHAIN_ICONS[chainId];
71
106
  }
72
107
  function getTokenIcon(symbol) {
@@ -303,6 +338,13 @@ var chainRegistry = {
303
338
  decimals: 6
304
339
  }
305
340
  ]
341
+ },
342
+ // HyperCore (virtual chain 1337) is a USDC-only deposit *destination*. It has
343
+ // no viem chain / RPC, so it lives only here for name + token resolution —
344
+ // deliberately absent from the source-chain matrices above.
345
+ [HYPERCORE_CHAIN_ID]: {
346
+ name: "HyperCore",
347
+ tokens: [{ symbol: "USDC", address: HYPERCORE_USDC_ADDRESS, decimals: 6 }]
306
348
  }
307
349
  };
308
350
  function getChainId(chain) {
@@ -317,7 +359,7 @@ function getChainObject(chain) {
317
359
  function normalizeTokenSymbol(symbol) {
318
360
  const trimmed = symbol.trim();
319
361
  const wrapped = trimmed.match(/\(([^)]+)\)/);
320
- if (_optionalChain([wrapped, 'optionalAccess', _ => _[1]])) {
362
+ if (_optionalChain([wrapped, 'optionalAccess', _2 => _2[1]])) {
321
363
  return wrapped[1].trim().toUpperCase();
322
364
  }
323
365
  return trimmed.toUpperCase();
@@ -341,11 +383,11 @@ function getTokenFromRegistry(chainId, symbol) {
341
383
  }
342
384
  function getUsdcAddress(chainId) {
343
385
  const token = getTokenFromRegistry(chainId, "USDC");
344
- return _optionalChain([token, 'optionalAccess', _2 => _2.address]);
386
+ return _optionalChain([token, 'optionalAccess', _3 => _3.address]);
345
387
  }
346
388
  function getUsdcDecimals(chainId) {
347
389
  const token = getTokenFromRegistry(chainId, "USDC");
348
- return _nullishCoalesce(_optionalChain([token, 'optionalAccess', _3 => _3.decimals]), () => ( 6));
390
+ return _nullishCoalesce(_optionalChain([token, 'optionalAccess', _4 => _4.decimals]), () => ( 6));
349
391
  }
350
392
  function getTokenAddress(symbol, chainId) {
351
393
  if (symbol.toUpperCase() === "ETH") {
@@ -358,14 +400,14 @@ function getTokenAddress(symbol, chainId) {
358
400
  return void 0;
359
401
  }
360
402
  const token = getTokenFromRegistry(chainId, symbol);
361
- return _optionalChain([token, 'optionalAccess', _4 => _4.address]);
403
+ return _optionalChain([token, 'optionalAccess', _5 => _5.address]);
362
404
  }
363
405
  function getTokenDecimals(symbol, chainId) {
364
406
  if (symbol.toUpperCase() === "ETH") {
365
407
  return 18;
366
408
  }
367
409
  const token = getTokenFromRegistry(chainId, symbol);
368
- return _nullishCoalesce(_optionalChain([token, 'optionalAccess', _5 => _5.decimals]), () => ( 18));
410
+ return _nullishCoalesce(_optionalChain([token, 'optionalAccess', _6 => _6.decimals]), () => ( 18));
369
411
  }
370
412
  function getTargetTokenSymbolsForChain(chainId) {
371
413
  const symbols = _nullishCoalesce(SUPPORTED_TOKENS_BY_CHAIN[chainId], () => ( []));
@@ -403,7 +445,7 @@ function getSupportedTargetTokens(chainId) {
403
445
  }
404
446
  return options;
405
447
  }
406
- function getTokenDecimalsByAddress(token, chainId) {
448
+ function findTokenDecimals(token, chainId) {
407
449
  const normalized = token.toLowerCase();
408
450
  if (normalized === NATIVE_TOKEN_ADDRESS) {
409
451
  return 18;
@@ -423,7 +465,10 @@ function getTokenDecimalsByAddress(token, chainId) {
423
465
  );
424
466
  if (found) return found.decimals;
425
467
  }
426
- return 18;
468
+ return void 0;
469
+ }
470
+ function getTokenDecimalsByAddress(token, chainId) {
471
+ return _nullishCoalesce(findTokenDecimals(token, chainId), () => ( 18));
427
472
  }
428
473
  function findChainIdForToken(address) {
429
474
  const normalized = address.toLowerCase();
@@ -460,7 +505,7 @@ function getTokenSymbol(token, chainId) {
460
505
  }
461
506
  function getTargetTokenSymbol(token, chain) {
462
507
  if (chain === "solana") {
463
- return _nullishCoalesce(_optionalChain([getSolanaTokenByMint, 'call', _6 => _6(String(token)), 'optionalAccess', _7 => _7.symbol]), () => ( "Token"));
508
+ return _nullishCoalesce(_optionalChain([getSolanaTokenByMint, 'call', _7 => _7(String(token)), 'optionalAccess', _8 => _8.symbol]), () => ( "Token"));
464
509
  }
465
510
  return getTokenSymbol(token, chain);
466
511
  }
@@ -479,7 +524,12 @@ var CHAIN_BADGES = {
479
524
  [_chains.sonic.id]: { shortLabel: "Sonic", color: "#5B6DEF", bg: "#EDEFFE" },
480
525
  [_chains.gnosis.id]: { shortLabel: "Gnosis", color: "#3E6957", bg: "#E5F0EB" },
481
526
  [_chains.hyperliquid.id]: { shortLabel: "Hyper", color: "#5BE7C4", bg: "#E5FFF8" },
482
- [_chains.monad.id]: { shortLabel: "Monad", color: "#6E54FF", bg: "#EEEBFF" }
527
+ [_chains.monad.id]: { shortLabel: "Monad", color: "#6E54FF", bg: "#EEEBFF" },
528
+ [HYPERCORE_CHAIN_ID]: {
529
+ shortLabel: "HyperCore",
530
+ color: "#5BE7C4",
531
+ bg: "#E5FFF8"
532
+ }
483
533
  };
484
534
  function getChainName(chainId) {
485
535
  if (chainId === "solana") return "Solana";
@@ -502,7 +552,7 @@ function getChainBadge(chainId) {
502
552
  function getExplorerUrl(chainId) {
503
553
  if (chainId === "solana") return "https://solscan.io";
504
554
  const chain = CHAIN_BY_ID[chainId];
505
- return _optionalChain([chain, 'optionalAccess', _8 => _8.blockExplorers, 'optionalAccess', _9 => _9.default, 'optionalAccess', _10 => _10.url]);
555
+ return _optionalChain([chain, 'optionalAccess', _9 => _9.blockExplorers, 'optionalAccess', _10 => _10.default, 'optionalAccess', _11 => _11.url]);
506
556
  }
507
557
  function getExplorerTxUrl(chainId, txHash) {
508
558
  if (chainId === "solana") return `https://solscan.io/tx/${txHash}`;
@@ -513,7 +563,7 @@ function getExplorerTxUrl(chainId, txHash) {
513
563
  function getExplorerName(chainId) {
514
564
  if (chainId === "solana") return "Solscan";
515
565
  const chain = CHAIN_BY_ID[chainId];
516
- return _nullishCoalesce(_optionalChain([chain, 'optionalAccess', _11 => _11.blockExplorers, 'optionalAccess', _12 => _12.default, 'optionalAccess', _13 => _13.name]), () => ( "Explorer"));
566
+ return _nullishCoalesce(_optionalChain([chain, 'optionalAccess', _12 => _12.blockExplorers, 'optionalAccess', _13 => _13.default, 'optionalAccess', _14 => _14.name]), () => ( "Explorer"));
517
567
  }
518
568
 
519
569
 
@@ -551,4 +601,14 @@ function getExplorerName(chainId) {
551
601
 
552
602
 
553
603
 
554
- exports.SOLANA_TOKENS = SOLANA_TOKENS; exports.getSolanaTokenBySymbol = getSolanaTokenBySymbol; exports.getSolanaTokenByMint = getSolanaTokenByMint; exports.isNativeSol = isNativeSol; exports.getChainIcon = getChainIcon; exports.getTokenIcon = getTokenIcon; exports.DEFAULT_BACKEND_URL = DEFAULT_BACKEND_URL; exports.DEFAULT_SIGNER_ADDRESS = DEFAULT_SIGNER_ADDRESS; exports.NATIVE_TOKEN_ADDRESS = NATIVE_TOKEN_ADDRESS; 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.getTokenDecimalsByAddress = getTokenDecimalsByAddress; exports.findChainIdForToken = findChainIdForToken; exports.getTokenSymbol = getTokenSymbol; exports.getTargetTokenSymbol = getTargetTokenSymbol; exports.isStablecoinSymbol = isStablecoinSymbol; exports.getChainName = getChainName; exports.getChainBadge = getChainBadge; exports.getExplorerUrl = getExplorerUrl; exports.getExplorerTxUrl = getExplorerTxUrl; exports.getExplorerName = getExplorerName;
604
+
605
+
606
+
607
+
608
+
609
+
610
+
611
+
612
+
613
+
614
+ exports.toEvmCaip2 = toEvmCaip2; exports.targetChainToCaip2 = targetChainToCaip2; exports.parseEvmChainId = parseEvmChainId; exports.isSolanaCaip2 = isSolanaCaip2; exports.HYPERCORE_CHAIN_ID = HYPERCORE_CHAIN_ID; exports.HYPERCORE_USDC_ADDRESS = HYPERCORE_USDC_ADDRESS; exports.HYPERCORE_MIN_DEPOSIT_USD = HYPERCORE_MIN_DEPOSIT_USD; exports.isVirtualDestination = isVirtualDestination; exports.isContractBytecode = isContractBytecode; exports.SOLANA_TOKENS = SOLANA_TOKENS; exports.getSolanaTokenBySymbol = getSolanaTokenBySymbol; exports.getSolanaTokenByMint = getSolanaTokenByMint; exports.isNativeSol = isNativeSol; exports.getChainIcon = getChainIcon; exports.getTokenIcon = getTokenIcon; exports.DEFAULT_BACKEND_URL = DEFAULT_BACKEND_URL; exports.DEFAULT_SIGNER_ADDRESS = DEFAULT_SIGNER_ADDRESS; exports.NATIVE_TOKEN_ADDRESS = NATIVE_TOKEN_ADDRESS; 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.getTokenSymbol = getTokenSymbol; exports.getTargetTokenSymbol = getTargetTokenSymbol; exports.isStablecoinSymbol = isStablecoinSymbol; exports.getChainName = getChainName; exports.getChainBadge = getChainBadge; exports.getExplorerUrl = getExplorerUrl; exports.getExplorerTxUrl = getExplorerTxUrl; exports.getExplorerName = getExplorerName;
@@ -29,9 +29,8 @@ import {
29
29
  isNativeAsset,
30
30
  loadSessionOwnerFromStorage,
31
31
  saveSessionOwnerToStorage,
32
- toEvmCaip2,
33
32
  useLatestRef
34
- } from "./chunk-4ZN726P5.mjs";
33
+ } from "./chunk-Z7OJPEV2.mjs";
35
34
  import {
36
35
  DEFAULT_BACKEND_URL,
37
36
  DEFAULT_SIGNER_ADDRESS,
@@ -43,8 +42,9 @@ import {
43
42
  getSupportedTargetTokens,
44
43
  getTokenDecimalsByAddress,
45
44
  getTokenIcon,
46
- getTokenSymbol
47
- } from "./chunk-SZIYS42B.mjs";
45
+ getTokenSymbol,
46
+ toEvmCaip2
47
+ } from "./chunk-6YRDD462.mjs";
48
48
 
49
49
  // src/WithdrawModal.tsx
50
50
  import {
@@ -1494,7 +1494,7 @@ function deriveStepView(step, _registration) {
1494
1494
  // src/WithdrawModal.tsx
1495
1495
  import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
1496
1496
  var ReownWithdrawInner = lazy(
1497
- () => import("./WithdrawModalReown-WRUEALDP.mjs").then((m) => ({
1497
+ () => import("./WithdrawModalReown-SSRJNUGZ.mjs").then((m) => ({
1498
1498
  default: m.WithdrawModalReown
1499
1499
  }))
1500
1500
  );