@rhinestone/deposit-modal 0.1.66 → 0.1.67

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 (34) hide show
  1. package/dist/{DepositModalReown-RXIVPSEE.mjs → DepositModalReown-EYIV6APK.mjs} +3 -3
  2. package/dist/{DepositModalReown-WFXQKZDH.cjs → DepositModalReown-UPYZN2XA.cjs} +4 -4
  3. package/dist/{WithdrawModalReown-MME7VSKX.mjs → WithdrawModalReown-6VYKKKJN.mjs} +3 -3
  4. package/dist/{WithdrawModalReown-PXS44GZO.cjs → WithdrawModalReown-WHPQDJJJ.cjs} +4 -4
  5. package/dist/{chunk-CULXRW6U.mjs → chunk-5FDIQNJJ.mjs} +22 -19
  6. package/dist/{chunk-JZWCK7C3.cjs → chunk-FLVSQDP4.cjs} +98 -91
  7. package/dist/{chunk-FWGLRTWF.mjs → chunk-IUW3SJQT.mjs} +61 -54
  8. package/dist/{chunk-75LRORPO.cjs → chunk-LTLFJPHO.cjs} +106 -103
  9. package/dist/{chunk-R6U6BHCV.cjs → chunk-MUWVDVY4.cjs} +13 -1
  10. package/dist/{chunk-JDO7QPPH.mjs → chunk-NFE5ZLD3.mjs} +786 -392
  11. package/dist/{chunk-CIXHTOO3.mjs → chunk-SDZKKUCJ.mjs} +13 -1
  12. package/dist/{chunk-5GN4QU67.cjs → chunk-UDKZWFCM.cjs} +842 -448
  13. package/dist/constants.cjs +2 -2
  14. package/dist/constants.mjs +1 -1
  15. package/dist/deposit.cjs +4 -4
  16. package/dist/deposit.d.cts +2 -2
  17. package/dist/deposit.d.ts +2 -2
  18. package/dist/deposit.mjs +3 -3
  19. package/dist/index.cjs +5 -5
  20. package/dist/index.d.cts +1 -1
  21. package/dist/index.d.ts +1 -1
  22. package/dist/index.mjs +4 -4
  23. package/dist/reown.cjs +5 -5
  24. package/dist/reown.d.cts +1 -1
  25. package/dist/reown.d.ts +1 -1
  26. package/dist/reown.mjs +4 -4
  27. package/dist/styles.css +264 -33
  28. package/dist/{types-ymKENnUK.d.ts → types-DGQzvl6v.d.ts} +11 -1
  29. package/dist/{types-DjaZ9sa8.d.cts → types-DJ1fzNC7.d.cts} +11 -1
  30. package/dist/withdraw.cjs +4 -4
  31. package/dist/withdraw.d.cts +2 -2
  32. package/dist/withdraw.d.ts +2 -2
  33. package/dist/withdraw.mjs +3 -3
  34. package/package.json +5 -5
@@ -8,7 +8,7 @@ import {
8
8
  getTokenDecimalsByAddress,
9
9
  getTokenIcon,
10
10
  getTokenSymbol
11
- } from "./chunk-CIXHTOO3.mjs";
11
+ } from "./chunk-SDZKKUCJ.mjs";
12
12
 
13
13
  // src/components/ui/Modal.tsx
14
14
  import {
@@ -1023,13 +1023,14 @@ function ExternalLinkIcon() {
1023
1023
  ] });
1024
1024
  }
1025
1025
  function TransferIcon() {
1026
- return /* @__PURE__ */ jsx4("svg", { viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ jsx4(
1026
+ return /* @__PURE__ */ jsx4("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", children: /* @__PURE__ */ jsx4(
1027
1027
  "path",
1028
1028
  {
1029
- fillRule: "evenodd",
1030
- clipRule: "evenodd",
1031
- d: "M9.99256 0.0706115C10.2112 0.195503 10.3185 0.457071 10.2527 0.704513L8.80705 6.13519H14.0826C14.2993 6.13519 14.4954 6.26695 14.5818 6.47064C14.6682 6.67433 14.6284 6.91113 14.4805 7.07349L6.85913 15.4396C6.68832 15.6271 6.41472 15.6711 6.19607 15.5462C5.97742 15.4213 5.87009 15.1598 5.93595 14.9123L7.38158 9.48164H2.10607C1.8893 9.48164 1.69319 9.34988 1.60679 9.14619C1.5204 8.9425 1.56019 8.7057 1.7081 8.54334L9.32949 0.177204C9.5003 -0.0102968 9.77391 -0.0542802 9.99256 0.0706115Z",
1032
- fill: "currentColor"
1029
+ d: "M6.18056 9.99924H10V13.8187M3.13264 9.99924H3.125M6.95208 13.8187H6.94444M10.0076 16.8742H10M16.8826 9.99924H16.875M3.125 13.8187H4.27083M12.6736 9.99924H14.2014M3.125 16.8742H6.94444M10 2.36035V6.94369M14.2778 16.8742H15.6528C16.0806 16.8742 16.2945 16.8742 16.4579 16.791C16.6016 16.7177 16.7185 16.6009 16.7917 16.4572C16.875 16.2937 16.875 16.0798 16.875 15.652V14.277C16.875 13.8492 16.875 13.6353 16.7917 13.4719C16.7185 13.3282 16.6016 13.2113 16.4579 13.1381C16.2945 13.0548 16.0806 13.0548 15.6528 13.0548H14.2778C13.85 13.0548 13.6361 13.0548 13.4726 13.1381C13.3289 13.2113 13.2121 13.3282 13.1388 13.4719C13.0556 13.6353 13.0556 13.8492 13.0556 14.277V15.652C13.0556 16.0798 13.0556 16.2937 13.1388 16.4572C13.2121 16.6009 13.3289 16.7177 13.4726 16.791C13.6361 16.8742 13.85 16.8742 14.2778 16.8742ZM14.2778 6.94369H15.6528C16.0806 6.94369 16.2945 6.94369 16.4579 6.86043C16.6016 6.78719 16.7185 6.67033 16.7917 6.52659C16.875 6.36319 16.875 6.14928 16.875 5.72146V4.34646C16.875 3.91864 16.875 3.70474 16.7917 3.54133C16.7185 3.3976 16.6016 3.28074 16.4579 3.2075C16.2945 3.12424 16.0806 3.12424 15.6528 3.12424H14.2778C13.85 3.12424 13.6361 3.12424 13.4726 3.2075C13.3289 3.28074 13.2121 3.3976 13.1388 3.54133C13.0556 3.70474 13.0556 3.91864 13.0556 4.34646V5.72146C13.0556 6.14928 13.0556 6.36319 13.1388 6.52659C13.2121 6.67033 13.3289 6.78719 13.4726 6.86043C13.6361 6.94369 13.85 6.94369 14.2778 6.94369ZM4.34722 6.94369H5.72222C6.15004 6.94369 6.36395 6.94369 6.52735 6.86043C6.67109 6.78719 6.78795 6.67033 6.86119 6.52659C6.94444 6.36319 6.94444 6.14928 6.94444 5.72146V4.34646C6.94444 3.91864 6.94444 3.70474 6.86119 3.54133C6.78795 3.3976 6.67109 3.28074 6.52735 3.2075C6.36395 3.12424 6.15004 3.12424 5.72222 3.12424H4.34722C3.9194 3.12424 3.7055 3.12424 3.54209 3.2075C3.39836 3.28074 3.2815 3.3976 3.20826 3.54133C3.125 3.70474 3.125 3.91864 3.125 4.34646V5.72146C3.125 6.14928 3.125 6.36319 3.20826 6.52659C3.2815 6.67033 3.39836 6.78719 3.54209 6.86043C3.7055 6.94369 3.9194 6.94369 4.34722 6.94369Z",
1030
+ stroke: "currentColor",
1031
+ strokeWidth: "1.5",
1032
+ strokeLinecap: "round",
1033
+ strokeLinejoin: "round"
1033
1034
  }
1034
1035
  ) });
1035
1036
  }
@@ -1102,7 +1103,7 @@ function ConnectStep({
1102
1103
  {
1103
1104
  src: option.icon,
1104
1105
  alt: option.label,
1105
- style: { width: 18, height: 18, borderRadius: 4 }
1106
+ style: { width: 24, height: 24, borderRadius: 6 }
1106
1107
  }
1107
1108
  ) : rowIcon(option.kind)
1108
1109
  }
@@ -1591,6 +1592,18 @@ function ProcessingStep({
1591
1592
  const pollIntervalRef = useRef3(INITIAL_POLL_INTERVAL);
1592
1593
  const pollTimeoutRef = useRef3(null);
1593
1594
  const escalatedDelayRef = useRef3(false);
1595
+ const processingContextRef = useLatestRef({
1596
+ amount,
1597
+ sourceChain,
1598
+ sourceToken,
1599
+ targetChain,
1600
+ targetToken,
1601
+ waitForFinalTx,
1602
+ hasPostBridgeActions
1603
+ });
1604
+ const onDepositCompleteRef = useLatestRef(onDepositComplete);
1605
+ const onDepositFailedRef = useLatestRef(onDepositFailed);
1606
+ const onErrorRef = useLatestRef(onError);
1594
1607
  const [state, setState] = useState(
1595
1608
  directTransfer ? { type: "complete" } : { type: "processing" }
1596
1609
  );
@@ -1616,23 +1629,20 @@ function ProcessingStep({
1616
1629
  txHash,
1617
1630
  flowLabel
1618
1631
  });
1619
- onDepositComplete?.(txHash, void 0, {
1620
- amount,
1621
- sourceChain,
1622
- sourceToken,
1623
- targetChain,
1624
- targetToken
1632
+ const context = processingContextRef.current;
1633
+ onDepositCompleteRef.current?.(txHash, void 0, {
1634
+ amount: context.amount,
1635
+ sourceChain: context.sourceChain,
1636
+ sourceToken: context.sourceToken,
1637
+ targetChain: context.targetChain,
1638
+ targetToken: context.targetToken
1625
1639
  });
1626
1640
  }, [
1627
- amount,
1628
1641
  debug,
1629
1642
  directTransfer,
1630
1643
  flowLabel,
1631
- onDepositComplete,
1632
- sourceChain,
1633
- sourceToken,
1634
- targetChain,
1635
- targetToken,
1644
+ onDepositCompleteRef,
1645
+ processingContextRef,
1636
1646
  txHash
1637
1647
  ]);
1638
1648
  useEffect3(() => {
@@ -1688,7 +1698,7 @@ function ProcessingStep({
1688
1698
  });
1689
1699
  }
1690
1700
  if (!isMounted) return;
1691
- const awaitingPostBridgeSwap = waitForFinalTx && hasPostBridgeActions;
1701
+ const awaitingPostBridgeSwap = processingContextRef.current.waitForFinalTx && processingContextRef.current.hasPostBridgeActions;
1692
1702
  if (eventForCurrentTx?.type === "post-bridge-swap-complete") {
1693
1703
  setState({ type: "complete", lastEvent: eventForCurrentTx });
1694
1704
  const swapTxHash = eventForCurrentTx.data?.swap?.transactionHash;
@@ -1697,12 +1707,13 @@ function ProcessingStep({
1697
1707
  destinationTxHash: swapTxHash,
1698
1708
  event: eventForCurrentTx.type
1699
1709
  });
1700
- onDepositComplete?.(txHash, swapTxHash, {
1701
- amount,
1702
- sourceChain,
1703
- sourceToken,
1704
- targetChain,
1705
- targetToken
1710
+ const context = processingContextRef.current;
1711
+ onDepositCompleteRef.current?.(txHash, swapTxHash, {
1712
+ amount: context.amount,
1713
+ sourceChain: context.sourceChain,
1714
+ sourceToken: context.sourceToken,
1715
+ targetChain: context.targetChain,
1716
+ targetToken: context.targetToken
1706
1717
  });
1707
1718
  return;
1708
1719
  }
@@ -1718,7 +1729,7 @@ function ProcessingStep({
1718
1729
  message: formatted.message,
1719
1730
  code: formatted.code
1720
1731
  });
1721
- onDepositFailed?.(txHash, formatted.message);
1732
+ onDepositFailedRef.current?.(txHash, formatted.message);
1722
1733
  return;
1723
1734
  }
1724
1735
  if (eventForCurrentTx?.type === "bridge-complete" && !awaitingPostBridgeSwap) {
@@ -1729,12 +1740,13 @@ function ProcessingStep({
1729
1740
  destinationTxHash: destinationTxHash2,
1730
1741
  event: eventForCurrentTx.type
1731
1742
  });
1732
- onDepositComplete?.(txHash, destinationTxHash2, {
1733
- amount,
1734
- sourceChain,
1735
- sourceToken,
1736
- targetChain,
1737
- targetToken
1743
+ const context = processingContextRef.current;
1744
+ onDepositCompleteRef.current?.(txHash, destinationTxHash2, {
1745
+ amount: context.amount,
1746
+ sourceChain: context.sourceChain,
1747
+ sourceToken: context.sourceToken,
1748
+ targetChain: context.targetChain,
1749
+ targetToken: context.targetToken
1738
1750
  });
1739
1751
  return;
1740
1752
  }
@@ -1744,12 +1756,13 @@ function ProcessingStep({
1744
1756
  txHash,
1745
1757
  event: eventForCurrentTx.type
1746
1758
  });
1747
- onDepositComplete?.(txHash, void 0, {
1748
- amount,
1749
- sourceChain,
1750
- sourceToken,
1751
- targetChain,
1752
- targetToken
1759
+ const context = processingContextRef.current;
1760
+ onDepositCompleteRef.current?.(txHash, void 0, {
1761
+ amount: context.amount,
1762
+ sourceChain: context.sourceChain,
1763
+ sourceToken: context.sourceToken,
1764
+ targetChain: context.targetChain,
1765
+ targetToken: context.targetToken
1753
1766
  });
1754
1767
  return;
1755
1768
  }
@@ -1765,7 +1778,7 @@ function ProcessingStep({
1765
1778
  message: formatted.message,
1766
1779
  code: formatted.code
1767
1780
  });
1768
- onDepositFailed?.(txHash, formatted.message);
1781
+ onDepositFailedRef.current?.(txHash, formatted.message);
1769
1782
  return;
1770
1783
  }
1771
1784
  if (eventForCurrentTx?.type === "error") {
@@ -1779,7 +1792,7 @@ function ProcessingStep({
1779
1792
  txHash,
1780
1793
  message: errorMessage
1781
1794
  });
1782
- onDepositFailed?.(txHash, errorMessage);
1795
+ onDepositFailedRef.current?.(txHash, errorMessage);
1783
1796
  return;
1784
1797
  }
1785
1798
  setState((previous) => ({
@@ -1817,21 +1830,15 @@ function ProcessingStep({
1817
1830
  }
1818
1831
  };
1819
1832
  }, [
1820
- amount,
1821
1833
  debug,
1822
1834
  directTransfer,
1823
- hasPostBridgeActions,
1824
- onDepositComplete,
1825
- onDepositFailed,
1835
+ onDepositCompleteRef,
1836
+ onDepositFailedRef,
1837
+ processingContextRef,
1826
1838
  service,
1827
1839
  smartAccount,
1828
- sourceChain,
1829
- sourceToken,
1830
1840
  state.type,
1831
- targetChain,
1832
- targetToken,
1833
- txHash,
1834
- waitForFinalTx
1841
+ txHash
1835
1842
  ]);
1836
1843
  useEffect3(() => {
1837
1844
  if (directTransfer || state.type !== "processing") return;
@@ -1844,10 +1851,10 @@ function ProcessingStep({
1844
1851
  txHash,
1845
1852
  timeoutMs: ESCALATED_DELAY_MS
1846
1853
  });
1847
- onError?.(message, "PROCESS_TIMEOUT");
1854
+ onErrorRef.current?.(message, "PROCESS_TIMEOUT");
1848
1855
  }, ESCALATED_DELAY_MS);
1849
1856
  return () => clearTimeout(timeoutId);
1850
- }, [debug, directTransfer, onError, state.type, txHash]);
1857
+ }, [debug, directTransfer, onErrorRef, state.type, txHash]);
1851
1858
  const isComplete = state.type === "complete";
1852
1859
  const isFailed = state.type === "failed";
1853
1860
  const isProcessing = state.type === "processing";
@@ -2206,8 +2213,8 @@ export {
2206
2213
  getEventTxHash,
2207
2214
  isDepositEvent,
2208
2215
  txRefsMatch,
2216
+ useLatestRef,
2209
2217
  ProcessingStep,
2210
2218
  getPublicClient,
2211
- useLatestRef,
2212
2219
  applyTheme
2213
2220
  };