@rhinestone/deposit-modal 0.13.0 → 0.14.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 (57) hide show
  1. package/README.md +47 -12
  2. package/bridge-transcript.json +653 -0
  3. package/dist/ClaimModal-GDFENSLV.mjs +13 -0
  4. package/dist/ClaimModal-L3FUBI5U.cjs +13 -0
  5. package/dist/{DepositModalReown-3H75G3XQ.mjs → DepositModalReown-2EVV64OA.mjs} +30 -27
  6. package/dist/{DepositModalReown-YNNHLAV2.cjs → DepositModalReown-GAD45GIC.cjs} +77 -74
  7. package/dist/WithdrawModal-FAQH35NG.cjs +12 -0
  8. package/dist/WithdrawModal-IKUHF5CF.mjs +12 -0
  9. package/dist/{chunk-RAADLTSW.cjs → chunk-4J5ADVIN.cjs} +184 -139
  10. package/dist/{chunk-DSIZNRWA.mjs → chunk-5Q5CSVKF.mjs} +1049 -388
  11. package/dist/{chunk-HOGZKHHY.cjs → chunk-62UCV2LG.cjs} +3 -3
  12. package/dist/{chunk-CVGNCUVU.cjs → chunk-7AZFT2MV.cjs} +22 -13
  13. package/dist/{chunk-7N77GIP4.cjs → chunk-A6JPBMYY.cjs} +465 -171
  14. package/dist/{chunk-GACIGCSN.cjs → chunk-AQVJUXSG.cjs} +1 -1
  15. package/dist/{chunk-LTMMETAB.mjs → chunk-GZ4GQ5MC.mjs} +404 -110
  16. package/dist/{chunk-ZMT4ATHR.cjs → chunk-HAQOFI3D.cjs} +594 -41
  17. package/dist/{chunk-FZ5FZFIG.mjs → chunk-LMG46EP2.mjs} +1 -1
  18. package/dist/{chunk-2G2EIN4A.cjs → chunk-NQMC5VKQ.cjs} +1343 -682
  19. package/dist/{chunk-OLCD75JK.mjs → chunk-QACOOLOE.mjs} +451 -131
  20. package/dist/{chunk-XYJFEN5D.mjs → chunk-R5UQ3TN4.mjs} +1 -1
  21. package/dist/{chunk-EOMT5LKX.mjs → chunk-UX35GYLM.mjs} +556 -3
  22. package/dist/{chunk-YREVFB64.mjs → chunk-VALXN5IO.mjs} +16 -7
  23. package/dist/{chunk-COCBCQQC.mjs → chunk-XCTRKCNM.mjs} +51 -6
  24. package/dist/{chunk-5NUIKYSF.cjs → chunk-YP7QVKQ6.cjs} +458 -138
  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 +29 -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
package/README.md CHANGED
@@ -18,18 +18,12 @@ docs.
18
18
  npm install @rhinestone/deposit-modal viem wagmi @tanstack/react-query
19
19
  ```
20
20
 
21
- Add Reown only if you want the modal to connect the wallet itself — these are
22
- optional peers, so skip them when you pass your own `walletClient` or run a flow
23
- with no wallet:
21
+ Add the built-in Reown wallet stack only when you pass `reownAppId`. All five
22
+ packages are optional peers, so skip them when you pass your own `walletClient`
23
+ or run a flow with no wallet:
24
24
 
25
25
  ```bash
26
- npm install @reown/appkit @reown/appkit-adapter-wagmi
27
- ```
28
-
29
- For Solana sources or destinations:
30
-
31
- ```bash
32
- npm install @reown/appkit-adapter-solana @solana/web3.js @solana/spl-token
26
+ npm install @reown/appkit @reown/appkit-adapter-wagmi @reown/appkit-adapter-solana @solana/web3.js @solana/spl-token
33
27
  ```
34
28
 
35
29
  ### Content Security Policy
@@ -50,6 +44,17 @@ console error pointing at the CSP. Hosts without an explicit `img-src` (or with
50
44
  > sufficient. They now come from the CDN, which drops ~20 kB (brotli) from the
51
45
  > bundle and gives every Rhinestone surface one source of truth.
52
46
 
47
+ All three modals also post session analytics to Rhinestone (see
48
+ [Analytics](#analytics)), so a host with an explicit `connect-src` must allow the
49
+ orchestrator alongside its own proxy:
50
+
51
+ ```
52
+ connect-src 'self' https://v1.orchestrator.rhinestone.dev;
53
+ ```
54
+
55
+ A blocked origin is reported on `onEvent` as an `analytics_ingest_failure`, not
56
+ surfaced to the user.
57
+
53
58
  ## Example
54
59
 
55
60
  ```tsx
@@ -296,10 +301,40 @@ Flow: user picks Fund from Exchange → backend returns supported exchanges + lo
296
301
  | ----------------------- | --------- | ------- | --------------------------------------------------------------------------------------------------------------------------- |
297
302
  | `enableExchangeConnect` | `boolean` | `false` | Show the "Fund from Exchange" row. Requires backend Swapped keys. Needs no wallet. Can be combined with `enableFiatOnramp`. |
298
303
 
304
+ ## Analytics
305
+
306
+ `onEvent` receives the deposit, withdraw and claim funnels as a session-scoped
307
+ stream:
308
+ every event carries the session id, the modal, the widget version and a snapshot
309
+ of the session's configuration.
310
+
311
+ The same events are also sent to Rhinestone, batched, in the background, and
312
+ flushed when the modal closes or the page goes away. Delivery never affects the
313
+ flow and never changes what `onEvent` receives. Sessions are attributed to your
314
+ project through a short-lived token minted at `POST /analytics/ingest-token` on
315
+ your proxy, once per session as the session starts; a proxy that does not
316
+ forward that route still collects, just unattributed.
317
+
318
+ | Prop | Type | Default | Description |
319
+ | ------------------------ | --------- | ------- | --------------------------------------------------------------- |
320
+ | `enableAnalyticsIngest` | `boolean` | `true` | Set `false` to stop sending analytics to Rhinestone. `onEvent` is unaffected. |
321
+
322
+ When a batch cannot be delivered, `onEvent` receives one
323
+ `analytics_ingest_failure` per distinct reason per session, naming the reason
324
+ (`network` — which includes a CSP block — `rejected`, `conflict`,
325
+ `unauthorized`, `throttled`, `unavailable`, `token_unavailable`, `unsupported`),
326
+ the HTTP status when there was one, and how many events the session has lost so
327
+ far.
328
+
299
329
  ## Upgrading
300
330
 
301
- Upgrading from 0.8.x is a breaking change on both modals. See
302
- [`MIGRATION.md`](./MIGRATION.md), or the same guide
331
+ Upgrading from 0.13.x changes what `onEvent` delivers: the deposit events are
332
+ replaced by a method-aware taxonomy, the five flat claim events are replaced by
333
+ a claim funnel, and every event gains a session envelope. A claim-only
334
+ integration now posts analytics too, so it needs the `connect-src` above.
335
+ Upgrading from 0.8.x is a breaking change on both modals.
336
+
337
+ See [`MIGRATION.md`](./MIGRATION.md), or the same guide
303
338
  [in the docs](https://docs.rhinestone.dev/deposits/widget/migration).
304
339
 
305
340
  ## Contributing