@rhinestone/deposit-modal 0.13.0 → 0.14.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.
Files changed (57) hide show
  1. package/README.md +43 -2
  2. package/bridge-transcript.json +653 -0
  3. package/dist/ClaimModal-IKTJU43Y.cjs +13 -0
  4. package/dist/ClaimModal-SEKNWRMA.mjs +13 -0
  5. package/dist/{DepositModalReown-YNNHLAV2.cjs → DepositModalReown-46LPVFB6.cjs} +16 -15
  6. package/dist/{DepositModalReown-3H75G3XQ.mjs → DepositModalReown-Q2JMLT47.mjs} +6 -5
  7. package/dist/WithdrawModal-5ICGD4HJ.mjs +12 -0
  8. package/dist/WithdrawModal-VP6PMIRO.cjs +12 -0
  9. package/dist/{chunk-GACIGCSN.cjs → chunk-6KG642KH.cjs} +1 -1
  10. package/dist/{chunk-RAADLTSW.cjs → chunk-7ICSHJFE.cjs} +179 -138
  11. package/dist/{chunk-COCBCQQC.mjs → chunk-7SR7ENVJ.mjs} +46 -5
  12. package/dist/{chunk-OLCD75JK.mjs → chunk-CFKC77SV.mjs} +451 -131
  13. package/dist/{chunk-EOMT5LKX.mjs → chunk-IN77XSWO.mjs} +526 -3
  14. package/dist/{chunk-FZ5FZFIG.mjs → chunk-K4H6TGBE.mjs} +1 -1
  15. package/dist/{chunk-DSIZNRWA.mjs → chunk-KTUVSKR4.mjs} +979 -360
  16. package/dist/{chunk-HOGZKHHY.cjs → chunk-LZFRL2AL.cjs} +3 -3
  17. package/dist/{chunk-7N77GIP4.cjs → chunk-MTFJSE52.cjs} +465 -171
  18. package/dist/{chunk-LTMMETAB.mjs → chunk-PKML3XVS.mjs} +404 -110
  19. package/dist/{chunk-ZMT4ATHR.cjs → chunk-V2OBGLJD.cjs} +564 -41
  20. package/dist/{chunk-XYJFEN5D.mjs → chunk-WUJIKCFU.mjs} +1 -1
  21. package/dist/{chunk-CVGNCUVU.cjs → chunk-X2IPAPXU.cjs} +22 -13
  22. package/dist/{chunk-2G2EIN4A.cjs → chunk-YCQZJQO6.cjs} +1272 -653
  23. package/dist/{chunk-5NUIKYSF.cjs → chunk-YWMWI7PZ.cjs} +458 -138
  24. package/dist/{chunk-YREVFB64.mjs → chunk-ZEO6ADM3.mjs} +16 -7
  25. package/dist/claim.cjs +6 -6
  26. package/dist/claim.d.cts +3 -3
  27. package/dist/claim.d.ts +3 -3
  28. package/dist/claim.mjs +5 -5
  29. package/dist/constants.cjs +2 -2
  30. package/dist/constants.d.cts +1 -1
  31. package/dist/constants.d.ts +1 -1
  32. package/dist/constants.mjs +1 -1
  33. package/dist/deposit.cjs +6 -6
  34. package/dist/deposit.d.cts +2 -2
  35. package/dist/deposit.d.ts +2 -2
  36. package/dist/deposit.mjs +5 -5
  37. package/dist/embed.cjs +310 -102
  38. package/dist/embed.d.cts +7 -1
  39. package/dist/embed.d.ts +7 -1
  40. package/dist/embed.mjs +285 -77
  41. package/dist/index.cjs +9 -9
  42. package/dist/index.d.cts +1 -1
  43. package/dist/index.d.ts +1 -1
  44. package/dist/index.mjs +8 -8
  45. package/dist/types-Bho4OA03.d.ts +982 -0
  46. package/dist/types-DP_3KwlD.d.cts +982 -0
  47. package/dist/withdraw.cjs +5 -5
  48. package/dist/withdraw.d.cts +3 -3
  49. package/dist/withdraw.d.ts +3 -3
  50. package/dist/withdraw.mjs +4 -4
  51. package/package.json +28 -7
  52. package/dist/ClaimModal-CREZO27I.mjs +0 -11
  53. package/dist/ClaimModal-JRIA32U2.cjs +0 -11
  54. package/dist/WithdrawModal-NVRX44IZ.mjs +0 -10
  55. package/dist/WithdrawModal-YYSBPCJJ.cjs +0 -10
  56. package/dist/types-B89I8_8H.d.ts +0 -638
  57. package/dist/types-nnDR4tqA.d.cts +0 -638
@@ -24,7 +24,7 @@ import {
24
24
  tokenAmountToNumber,
25
25
  useExplorerTxUrl,
26
26
  useLatestRef
27
- } from "./chunk-EOMT5LKX.mjs";
27
+ } from "./chunk-IN77XSWO.mjs";
28
28
  import {
29
29
  NATIVE_TOKEN_ADDRESS,
30
30
  SOLANA_MAINNET_CAIP2,
@@ -97,6 +97,32 @@ function warnRemovedProps(component, props) {
97
97
  }
98
98
  }
99
99
 
100
+ // src/core/analytics-target.ts
101
+ var HEX_TOKEN = /^0x(?:[0-9a-f]{32}|[0-9a-f]{40})$/i;
102
+ var BASE58_TOKEN = /^[1-9A-HJ-NP-Za-km-z]{32,44}$/;
103
+ function analyticsTargetProperties(input) {
104
+ const properties = {};
105
+ const chain = resolveChain(input.targetChain);
106
+ const token = resolveToken(input.targetToken);
107
+ if (chain) properties.target_chain = chain;
108
+ if (token) properties.target_token = token;
109
+ return properties;
110
+ }
111
+ function resolveChain(targetChain) {
112
+ if (targetChain === void 0) return void 0;
113
+ if (typeof targetChain === "number" && !(targetChain > 0 && Number.isInteger(targetChain))) {
114
+ return void 0;
115
+ }
116
+ return targetChainToCaip2(targetChain);
117
+ }
118
+ function resolveToken(targetToken) {
119
+ const raw = targetToken?.trim();
120
+ if (!raw) return void 0;
121
+ if (HEX_TOKEN.test(raw)) return raw.toLowerCase();
122
+ if (BASE58_TOKEN.test(raw)) return raw;
123
+ return raw.toLowerCase() === "native" ? "native" : void 0;
124
+ }
125
+
100
126
  // src/core/submission-uncertainty.ts
101
127
  var MARKER = "__rhinestoneSubmissionUncertain";
102
128
  function markSubmissionUncertain(error) {
@@ -885,6 +911,7 @@ function ProcessingStep({
885
911
  onRetry,
886
912
  onDepositComplete,
887
913
  onDepositFailed,
914
+ onSourceTransactionObserved,
888
915
  onError
889
916
  }) {
890
917
  const startTimeRef = useRef2(Date.now());
@@ -1257,6 +1284,11 @@ function ProcessingStep({
1257
1284
  const targetChainId = targetChainToChainId(targetChain);
1258
1285
  const settledSourceTxHash = lastEvent?.data?.source?.transactionHash;
1259
1286
  const sourceExplorerHash = settledSourceTxHash ?? (sourceTxHashPending ? null : sourceTxHash);
1287
+ useEffect3(() => {
1288
+ if (sourceTxHashPending && settledSourceTxHash) {
1289
+ onSourceTransactionObserved?.(settledSourceTxHash);
1290
+ }
1291
+ }, [onSourceTransactionObserved, settledSourceTxHash, sourceTxHashPending]);
1260
1292
  const sourceExplorerUrl = sourceExplorerHash ? explorerTxUrl(displaySourceChain, sourceExplorerHash) : null;
1261
1293
  const destExplorerUrl = destinationTxHash ? explorerTxUrl(targetChainId, destinationTxHash) : null;
1262
1294
  const sourceDisplay = (() => {
@@ -1405,7 +1437,7 @@ function ProcessingStep({
1405
1437
  feesTooltip,
1406
1438
  newLabel: `New ${flowNoun}`,
1407
1439
  onNewDeposit,
1408
- onClose
1440
+ onClose: onClose ? () => onClose("success_done") : void 0
1409
1441
  }
1410
1442
  );
1411
1443
  }
@@ -1580,10 +1612,18 @@ function ProcessingStep({
1580
1612
  "New ",
1581
1613
  flowNoun
1582
1614
  ] }),
1583
- onClose && /* @__PURE__ */ jsx5(Button, { onClick: onClose, fullWidth: true, children: "Done" })
1615
+ onClose && /* @__PURE__ */ jsx5(Button, { onClick: () => onClose("success_done"), fullWidth: true, children: "Done" })
1584
1616
  ] }),
1585
1617
  isFailed && /* @__PURE__ */ jsxs4("div", { className: "rs-screen-button-row", children: [
1586
- onClose && /* @__PURE__ */ jsx5(Button, { variant: "outline", onClick: onClose, fullWidth: true, children: "Cancel" }),
1618
+ onClose && /* @__PURE__ */ jsx5(
1619
+ Button,
1620
+ {
1621
+ variant: "outline",
1622
+ onClick: () => onClose("failure_cancel"),
1623
+ fullWidth: true,
1624
+ children: "Cancel"
1625
+ }
1626
+ ),
1587
1627
  handleRetry && /* @__PURE__ */ jsx5(Button, { onClick: handleRetry, fullWidth: true, children: "Try again" })
1588
1628
  ] })
1589
1629
  ] }),
@@ -1799,5 +1839,6 @@ export {
1799
1839
  computeIsCacheable,
1800
1840
  readDedupedAccountSetupResult,
1801
1841
  runAccountSetupDeduped,
1802
- warnRemovedProps
1842
+ warnRemovedProps,
1843
+ analyticsTargetProperties
1803
1844
  };