@rhinestone/deposit-modal 0.11.1 → 0.12.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.
Files changed (45) hide show
  1. package/dist/{DepositModalReown-YGB73NMW.cjs → DepositModalReown-CH6FUTCR.cjs} +17 -17
  2. package/dist/{DepositModalReown-MO5QDLIT.mjs → DepositModalReown-SXAXHYTN.mjs} +7 -7
  3. package/dist/{chunk-SSQ27YFB.cjs → chunk-2BOEUV6B.cjs} +543 -540
  4. package/dist/{chunk-CWGUBFJL.mjs → chunk-2K44IE3V.mjs} +18 -23
  5. package/dist/{chunk-53IFZGSF.mjs → chunk-3STTWRAN.mjs} +0 -10
  6. package/dist/{chunk-MZ53PDIX.mjs → chunk-4ZXQPFNU.mjs} +1 -1
  7. package/dist/{chunk-ZQR36NCV.cjs → chunk-65MLWUQD.cjs} +95 -100
  8. package/dist/{chunk-JPRV36DT.cjs → chunk-75DVGSAX.cjs} +2 -2
  9. package/dist/{chunk-4FTI3GTB.cjs → chunk-DMYA7U53.cjs} +1 -1
  10. package/dist/{chunk-HUHBNYD3.cjs → chunk-FKHPVLJY.cjs} +81 -81
  11. package/dist/{chunk-YELNYILK.mjs → chunk-KPWB2JAX.mjs} +287 -284
  12. package/dist/{chunk-V6T7LORJ.mjs → chunk-NHGFU3WC.mjs} +1 -1
  13. package/dist/{chunk-URFSTNRS.mjs → chunk-O2TQLD4I.mjs} +1 -1
  14. package/dist/{chunk-OWYPKCYD.mjs → chunk-O4AXBFHU.mjs} +4 -4
  15. package/dist/{chunk-TENL4H64.cjs → chunk-O7BCVQ6L.cjs} +4 -14
  16. package/dist/{chunk-5746YXKC.mjs → chunk-PVWZN66D.mjs} +6 -6
  17. package/dist/{chunk-EIWOVX53.mjs → chunk-TQWEGW3A.mjs} +3 -3
  18. package/dist/{chunk-FVUXJ3RP.cjs → chunk-TYBMAUGH.cjs} +3 -3
  19. package/dist/{chunk-ZRIRCIQM.cjs → chunk-UGK4JRK6.cjs} +62 -62
  20. package/dist/{chunk-LQGYPM5B.cjs → chunk-ZLCY33FQ.cjs} +79 -79
  21. package/dist/claim.cjs +6 -6
  22. package/dist/claim.d.cts +2 -2
  23. package/dist/claim.d.ts +2 -2
  24. package/dist/claim.mjs +5 -5
  25. package/dist/constants.cjs +3 -3
  26. package/dist/constants.d.cts +1 -1
  27. package/dist/constants.d.ts +1 -1
  28. package/dist/constants.mjs +2 -2
  29. package/dist/deposit.cjs +8 -8
  30. package/dist/deposit.d.cts +2 -2
  31. package/dist/deposit.d.ts +2 -2
  32. package/dist/deposit.mjs +7 -7
  33. package/dist/index.cjs +10 -10
  34. package/dist/index.d.cts +1 -1
  35. package/dist/index.d.ts +1 -1
  36. package/dist/index.mjs +9 -9
  37. package/dist/polymarket.cjs +5 -5
  38. package/dist/polymarket.mjs +2 -2
  39. package/dist/{types-CsGa-HxD.d.cts → types-BO4iP6fG.d.cts} +0 -1
  40. package/dist/{types-DdS8OySJ.d.ts → types-oFblf65g.d.ts} +0 -1
  41. package/dist/withdraw.cjs +6 -6
  42. package/dist/withdraw.d.cts +2 -2
  43. package/dist/withdraw.d.ts +2 -2
  44. package/dist/withdraw.mjs +5 -5
  45. package/package.json +1 -1
@@ -1,23 +1,20 @@
1
1
  import {
2
2
  SERVICE_HEADERS
3
- } from "./chunk-URFSTNRS.mjs";
3
+ } from "./chunk-O2TQLD4I.mjs";
4
4
  import {
5
5
  CHAIN_BY_ID,
6
6
  CHAIN_DISPLAY_ORDER,
7
7
  HYPERCORE_CHAIN_ID,
8
8
  HYPERCORE_MAINNET_CAIP2,
9
9
  HYPERCORE_SOURCE_TOKENS,
10
+ HYPERCORE_SPOT_CAIP2,
10
11
  ICON_CDN,
11
12
  NATIVE_TOKEN_ADDRESS,
12
13
  SOLANA_MAINNET_CAIP2,
13
- SOURCE_CHAINS,
14
14
  findTokenDecimals,
15
- getBundledTargetTokens,
16
15
  getChainName,
17
16
  getExplorerTxUrl,
18
17
  getSolanaTokenByMint,
19
- getSupportedChainIds,
20
- getSupportedTargetTokens,
21
18
  getTokenAddress,
22
19
  getTokenDecimalsByAddress,
23
20
  getTokenSymbol,
@@ -30,7 +27,7 @@ import {
30
27
  setRuntimeTokens,
31
28
  toEvmCaip2,
32
29
  tokenIconUrl
33
- } from "./chunk-53IFZGSF.mjs";
30
+ } from "./chunk-3STTWRAN.mjs";
34
31
 
35
32
  // src/components/ui/Modal.tsx
36
33
  import {
@@ -72,12 +69,7 @@ function Modal({
72
69
  }, [isOpen]);
73
70
  useEffect(() => {
74
71
  if (isOpen && contentRef.current) {
75
- const focusable = getFocusableElements(contentRef.current);
76
- if (focusable.length > 0) {
77
- focusable[0].focus();
78
- } else {
79
- contentRef.current.focus();
80
- }
72
+ contentRef.current.focus();
81
73
  }
82
74
  }, [isOpen]);
83
75
  useEffect(() => {
@@ -102,7 +94,7 @@ function Modal({
102
94
  const firstElement = focusable[0];
103
95
  const lastElement = focusable[focusable.length - 1];
104
96
  if (event.shiftKey) {
105
- if (document.activeElement === firstElement) {
97
+ if (document.activeElement === firstElement || document.activeElement === contentRef.current) {
106
98
  event.preventDefault();
107
99
  lastElement.focus();
108
100
  }
@@ -583,8 +575,17 @@ function parseChainCatalog(body) {
583
575
  if (chain.chainId !== null) byChainId.set(chain.chainId, chain);
584
576
  }
585
577
  if (all.length === 0) return null;
578
+ aliasHyperCoreOrigin(byCaip2, all);
586
579
  return { all, byCaip2, byChainId };
587
580
  }
581
+ function aliasHyperCoreOrigin(byCaip2, all) {
582
+ const origin = all.find((c) => isHyperCoreCaip2(c.caip2) && c.deposit) ?? all.find((c) => isHyperCoreCaip2(c.caip2));
583
+ if (!origin) return;
584
+ byCaip2.set(HYPERCORE_MAINNET_CAIP2, origin);
585
+ if (!byCaip2.has(HYPERCORE_SPOT_CAIP2)) {
586
+ byCaip2.set(HYPERCORE_SPOT_CAIP2, origin);
587
+ }
588
+ }
588
589
  function catalogKeyForChain(chainId) {
589
590
  if (chainId === "solana") return SOLANA_MAINNET_CAIP2;
590
591
  if (chainId === "hypercore" || chainId === HYPERCORE_CHAIN_ID) {
@@ -2089,7 +2090,7 @@ function publishRuntimeChainMeta(catalog) {
2089
2090
  catalog.all.flatMap((chain) => {
2090
2091
  const ids = [];
2091
2092
  if (chain.chainId !== null) ids.push(chain.chainId);
2092
- if (chain.caip2 === HYPERCORE_MAINNET_CAIP2) ids.push(HYPERCORE_CHAIN_ID);
2093
+ if (isHyperCoreCaip2(chain.caip2)) ids.push(HYPERCORE_CHAIN_ID);
2093
2094
  return ids.map((chainId) => ({
2094
2095
  chainId,
2095
2096
  name: chain.name,
@@ -2135,7 +2136,7 @@ function useCatalogChain(chainId) {
2135
2136
  function useDepositChainIds() {
2136
2137
  const { catalog } = useChainCatalog();
2137
2138
  return useMemo2(() => {
2138
- if (!catalog) return getSupportedChainIds();
2139
+ if (!catalog) return [];
2139
2140
  const ids = catalog.all.filter(
2140
2141
  (c) => c.deposit && c.vmType === "evm" && c.chainId !== null && // `/chains` enumerates testnets; the bundled list never did, and a
2141
2142
  // production picker offering Sepolia next to Ethereum is a way to
@@ -2153,11 +2154,7 @@ function useDepositChainIds() {
2153
2154
  function useDestinationChains() {
2154
2155
  const { catalog } = useChainCatalog();
2155
2156
  return useMemo2(() => {
2156
- if (!catalog) {
2157
- return SOURCE_CHAINS.filter(
2158
- (chain) => getSupportedTargetTokens(chain.id).length > 0
2159
- ).map((chain) => ({ id: chain.id, name: chain.name }));
2160
- }
2157
+ if (!catalog) return [];
2161
2158
  const rank = (id) => {
2162
2159
  const i = CHAIN_DISPLAY_ORDER.indexOf(id);
2163
2160
  return i === -1 ? CHAIN_DISPLAY_ORDER.length : i;
@@ -2171,10 +2168,8 @@ function useTargetTokens() {
2171
2168
  const { catalog, shortlist } = useChainCatalog();
2172
2169
  return useMemo2(() => {
2173
2170
  return (chainId) => {
2174
- const bundled = getBundledTargetTokens(chainId);
2175
- if (bundled.length > 0) return bundled;
2176
2171
  const fromShortlist = shortlist?.[String(chainId)];
2177
- if (fromShortlist?.length) {
2172
+ if (fromShortlist) {
2178
2173
  return fromShortlist.map((token) => ({
2179
2174
  symbol: token.symbol,
2180
2175
  address: token.address,
@@ -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;
@@ -705,10 +701,6 @@ function isSupportedTokenAddressForChain(token, chainId) {
705
701
  function getSupportedTargetTokens(chainId) {
706
702
  return toTokenOptions(getSupportedTokenSymbolsForChain(chainId), chainId);
707
703
  }
708
- function getBundledTargetTokens(chainId) {
709
- const symbols = SUPPORTED_TOKENS_BY_CHAIN[chainId];
710
- return symbols?.length ? toTokenOptions([...symbols], chainId) : [];
711
- }
712
704
  function toTokenOptions(symbols, chainId) {
713
705
  const options = [];
714
706
  for (const symbol of symbols) {
@@ -897,7 +889,6 @@ export {
897
889
  SOLANA_MAINNET_CAIP2,
898
890
  toEvmCaip2,
899
891
  targetChainToCaip2,
900
- targetChainToAccountKey,
901
892
  parseEvmChainId,
902
893
  isSolanaCaip2,
903
894
  isHyperCoreCaip2,
@@ -940,7 +931,6 @@ export {
940
931
  getSupportedChainIds,
941
932
  isSupportedTokenAddressForChain,
942
933
  getSupportedTargetTokens,
943
- getBundledTargetTokens,
944
934
  findTokenDecimals,
945
935
  getTokenDecimalsByAddress,
946
936
  findChainIdForToken,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  cdnIconUrl
3
- } from "./chunk-53IFZGSF.mjs";
3
+ } from "./chunk-3STTWRAN.mjs";
4
4
 
5
5
  // src/core/dapp-imports/polymarket/constants.ts
6
6
  var POLYMARKET_POLYGON_CHAIN_ID = 137;