@rhinestone/deposit-modal 0.14.1 → 0.16.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 (70) hide show
  1. package/README.md +26 -24
  2. package/bridge-transcript.json +14 -0
  3. package/dist/{DepositModalReown-GAD45GIC.cjs → DepositModalReown-IFN6YLZJ.cjs} +20 -22
  4. package/dist/{DepositModalReown-2EVV64OA.mjs → DepositModalReown-R7UROJPJ.mjs} +5 -7
  5. package/dist/WithdrawModal-SZEAI473.cjs +11 -0
  6. package/dist/WithdrawModal-XKSSHVEJ.mjs +11 -0
  7. package/dist/{caip-D8aRWdEY.d.cts → caip-BMi-9t09.d.cts} +27 -3
  8. package/dist/{caip-D8aRWdEY.d.ts → caip-BMi-9t09.d.ts} +27 -3
  9. package/dist/{chunk-A6JPBMYY.cjs → chunk-24N4KMJX.cjs} +234 -115
  10. package/dist/{chunk-LMG46EP2.mjs → chunk-3HCCR54R.mjs} +1 -1
  11. package/dist/{chunk-AQVJUXSG.cjs → chunk-5CM3ZQ5U.cjs} +1 -1
  12. package/dist/chunk-EA5CE2UZ.mjs +7599 -0
  13. package/dist/{chunk-VUATPOWJ.mjs → chunk-EAGMY3QE.mjs} +74 -17
  14. package/dist/{chunk-5Q5CSVKF.mjs → chunk-F6ROQ6RJ.mjs} +215 -517
  15. package/dist/{chunk-RN5VKWI6.mjs → chunk-FTWKAJGN.mjs} +1 -1
  16. package/dist/chunk-H4O22O7Y.cjs +7599 -0
  17. package/dist/{chunk-GZ4GQ5MC.mjs → chunk-HMB2XQGD.mjs} +172 -53
  18. package/dist/{chunk-DW2EQA2U.cjs → chunk-LVCD6RHF.cjs} +2 -2
  19. package/dist/{chunk-4KCSH4T3.cjs → chunk-OY5N3E6L.cjs} +86 -29
  20. package/dist/{chunk-NQMC5VKQ.cjs → chunk-V466XQSG.cjs} +551 -853
  21. package/dist/{constants-DBrWhJWE.d.cts → constants-BT4ctuHo.d.cts} +7 -6
  22. package/dist/{constants-DBrWhJWE.d.ts → constants-D21ZdNOP.d.ts} +7 -6
  23. package/dist/constants.cjs +3 -3
  24. package/dist/constants.d.cts +3 -3
  25. package/dist/constants.d.ts +3 -3
  26. package/dist/constants.mjs +2 -2
  27. package/dist/deposit.cjs +6 -8
  28. package/dist/deposit.d.cts +3 -3
  29. package/dist/deposit.d.ts +3 -3
  30. package/dist/deposit.mjs +5 -7
  31. package/dist/embed.cjs +130 -80
  32. package/dist/embed.d.cts +3 -9
  33. package/dist/embed.d.ts +3 -9
  34. package/dist/embed.mjs +112 -62
  35. package/dist/index.cjs +8 -11
  36. package/dist/index.d.cts +3 -5
  37. package/dist/index.d.ts +3 -5
  38. package/dist/index.mjs +10 -13
  39. package/dist/polymarket.cjs +6 -6
  40. package/dist/polymarket.mjs +2 -2
  41. package/dist/server.d.cts +2 -2
  42. package/dist/server.d.ts +2 -2
  43. package/dist/styles.css +147 -100
  44. package/dist/{types-DP_3KwlD.d.cts → types-B9SbZQIG.d.ts} +145 -108
  45. package/dist/{types-Bho4OA03.d.ts → types-SwGGf0eH.d.cts} +145 -108
  46. package/dist/withdraw.cjs +5 -6
  47. package/dist/withdraw.d.cts +33 -5
  48. package/dist/withdraw.d.ts +33 -5
  49. package/dist/withdraw.mjs +4 -5
  50. package/package.json +6 -37
  51. package/dist/ClaimModal-GDFENSLV.mjs +0 -13
  52. package/dist/ClaimModal-L3FUBI5U.cjs +0 -13
  53. package/dist/WithdrawModal-FAQH35NG.cjs +0 -12
  54. package/dist/WithdrawModal-IKUHF5CF.mjs +0 -12
  55. package/dist/chunk-4J5ADVIN.cjs +0 -1848
  56. package/dist/chunk-62UCV2LG.cjs +0 -81
  57. package/dist/chunk-7AZFT2MV.cjs +0 -163
  58. package/dist/chunk-HAQOFI3D.cjs +0 -3699
  59. package/dist/chunk-QACOOLOE.mjs +0 -1062
  60. package/dist/chunk-R5UQ3TN4.mjs +0 -81
  61. package/dist/chunk-UX35GYLM.mjs +0 -3699
  62. package/dist/chunk-VALXN5IO.mjs +0 -163
  63. package/dist/chunk-XCTRKCNM.mjs +0 -1848
  64. package/dist/chunk-YP7QVKQ6.cjs +0 -1062
  65. package/dist/claim.cjs +0 -11
  66. package/dist/claim.d.cts +0 -17
  67. package/dist/claim.d.ts +0 -17
  68. package/dist/claim.mjs +0 -11
  69. package/dist/modal-ui-state-OD1RmKkK.d.cts +0 -30
  70. package/dist/modal-ui-state-OD1RmKkK.d.ts +0 -30
@@ -1,5 +1,19 @@
1
+ import { D as DisplayChainId, d as TargetChain } from './caip-BMi-9t09.cjs';
1
2
  import { TypedDataDefinition, Address, Hex, WalletClient, PublicClient, Chain } from 'viem';
2
- import { T as TargetChain } from './caip-D8aRWdEY.js';
3
+
4
+ /**
5
+ * Consumer-supplied RPC URL overrides, scoped to a single modal instance (see
6
+ * {@link RpcUrlsProvider}). Threaded into every client the modal builds — EVM
7
+ * public clients (`public-client.ts`), the wallet adapter's transports
8
+ * (`reown.tsx`), and the Solana connection (`solana.ts`).
9
+ *
10
+ * Keyed by the same `number | "solana"` chain identifier the rest of the modal
11
+ * uses (see `core/constants.ts`), so a single `rpcUrls` prop covers every
12
+ * chain — EVM mainnets, Polygon (137, also feeds Polymarket reads), HyperEVM
13
+ * (999), and Solana.
14
+ */
15
+ type ChainKey = number | "solana";
16
+ type RpcUrlMap = Partial<Record<ChainKey, string>>;
3
17
 
4
18
  /**
5
19
  * Public config shape exposed on DepositModalProps. Each provider defaults to
@@ -39,8 +53,9 @@ interface SignRecoveryPayload {
39
53
  */
40
54
  signer: Address;
41
55
  /**
42
- * The chain the deposit is on, and therefore the chain the signature is
43
- * verified against.
56
+ * The chain the signature is verified against: the deposit's DESTINATION
57
+ * chain, where the recipient wallet lives. Not the source chain the refund
58
+ * pays out on — the processor verifies on the target and never falls back.
44
59
  *
45
60
  * Load-bearing for a smart account: ERC-1271 and ERC-6492 verification are
46
61
  * per-chain, so a signature produced against the wrong one is well formed,
@@ -70,21 +85,15 @@ type SignRecovery = (payload: SignRecoveryPayload) => Promise<Hex>;
70
85
  type RecoveryErrorCode = "DEPOSIT_NOT_RECOVERABLE" | "RECOVERY_UNSUPPORTED" | "SIGNATURE_INVALID" | "VERIFICATION_UNAVAILABLE" | "REFUND_RECONCILIATION_REQUIRED" | "REFUND_FAILED";
71
86
 
72
87
  /**
73
- * Consumer-supplied RPC URL overrides, scoped to a single modal instance (see
74
- * {@link RpcUrlsProvider}). Threaded into every client the modal builds — EVM
75
- * public clients (`public-client.ts`), the wallet adapter's transports
76
- * (`reown.tsx`), and the Solana connection (`solana.ts`).
77
- *
78
- * Keyed by the same `number | "solana"` chain identifier the rest of the modal
79
- * uses (see `core/constants.ts`), so a single `rpcUrls` prop covers every
80
- * chain — EVM mainnets, Polygon (137, also feeds Polymarket reads), HyperEVM
81
- * (999), and Solana.
88
+ * How a `GET /deposits` row reads on screen, and which rows are on screen at
89
+ * all. Shared rather than private to the history panel: the header's status dot
90
+ * derives from the same rows the panel lists, and a second copy of either
91
+ * answer would let the badge and the list disagree.
82
92
  */
83
- type ChainKey = number | "solana";
84
- type RpcUrlMap = Partial<Record<ChainKey, string>>;
93
+ type HistoryStatus = "pending" | "processing" | "completed" | "failed" | "refunded" | "spam";
85
94
 
86
95
  type Caip2ChainId = `eip155:${number}` | `solana:${string}`;
87
- type ChainId = number | "solana" | "hypercore" | Caip2ChainId;
96
+ type ChainId = DisplayChainId | Caip2ChainId;
88
97
  interface DepositModalTheme {
89
98
  /**
90
99
  * Absent means light, unconditionally — never "follow the OS". `"system"` is
@@ -286,13 +295,39 @@ interface DepositModalProps {
286
295
  */
287
296
  enableExchangeConnect?: boolean;
288
297
  onRequestConnect?: () => void;
298
+ /**
299
+ * Signs a refund for a failed deposit the user recovers from its history
300
+ * row. Supply it to offer recovery; omit it and history behaves exactly as it
301
+ * does today — a failed row expands to its cause and details with no action.
302
+ *
303
+ * The processor verifies the signature against the deposit's `recipient`, on
304
+ * the deposit's DESTINATION chain, so return whatever that address's own
305
+ * verifier accepts there:
306
+ * - **embedded EOA** (Privy, Turnkey, Dynamic) — `signTypedData`, raw 65-byte
307
+ * result.
308
+ * - **deployed smart account** — a signature valid under its ERC-1271
309
+ * `isValidSignature`. A raw owner signature is usually not enough; a Safe,
310
+ * for one, expects its own message wrapping, so go through your account SDK.
311
+ * - **undeployed smart account** — wrap per ERC-6492 so it can be verified
312
+ * counterfactually. `SignatureErc6492.wrap` from `ox/erc6492` does this and
313
+ * ships with viem already.
314
+ *
315
+ * Throwing (or returning nothing) is treated as the user declining, which is
316
+ * retryable.
317
+ */
318
+ signRecovery?: SignRecovery;
289
319
  theme?: DepositModalTheme;
290
320
  uiConfig?: DepositModalUIConfig;
291
321
  className?: string;
292
322
  onReady?: () => void;
293
323
  /** Discriminated stream of deposit lifecycle transitions. */
294
324
  onLifecycle?: (event: DepositLifecycleEvent) => void;
295
- onEvent?: (event: DepositAnalyticsEvent | AnalyticsIngestFailureEvent) => void;
325
+ /**
326
+ * Funnel telemetry. Also delivers `ClaimAnalyticsEvent`: a recovery started
327
+ * from history opens a claim session inside this modal, and a host that logs
328
+ * events would otherwise go blind exactly where funds are being recovered.
329
+ */
330
+ onEvent?: (event: DepositAnalyticsEvent | ClaimAnalyticsEvent | AnalyticsIngestFailureEvent) => void;
296
331
  onError?: (data: ErrorEventData) => void;
297
332
  /**
298
333
  * Send session analytics to Rhinestone in addition to `onEvent`. Default:
@@ -370,7 +405,8 @@ interface WithdrawModalProps {
370
405
  onReady?: () => void;
371
406
  /** Discriminated stream of withdraw lifecycle transitions. */
372
407
  onLifecycle?: (event: WithdrawLifecycleEvent) => void;
373
- onEvent?: (event: WithdrawAnalyticsEvent | AnalyticsIngestFailureEvent) => void;
408
+ /** Claim events included, on the same terms as the deposit modal's. */
409
+ onEvent?: (event: WithdrawAnalyticsEvent | ClaimAnalyticsEvent | AnalyticsIngestFailureEvent) => void;
374
410
  onError?: (data: ErrorEventData) => void;
375
411
  /**
376
412
  * Send session analytics to Rhinestone in addition to `onEvent`. Default:
@@ -379,80 +415,31 @@ interface WithdrawModalProps {
379
415
  enableAnalyticsIngest?: boolean;
380
416
  /** @internal Rhinestone's own dev verification. Not a supported prop. */
381
417
  analyticsIngestUrl?: string;
382
- debug?: boolean;
383
- }
384
- /**
385
- * Self-service recovery modal. Returns a failed or rejected deposit's
386
- * source-chain funds to an address the user names. The deposit is looked up by
387
- * transaction hash.
388
- *
389
- * The user's own wallet authorizes it: the deposit's `recipient` — the in-app
390
- * wallet the funds were headed to — signs an EIP-712 struct naming the deposit and
391
- * the destination, and the processor verifies that signature against the same
392
- * `recipient` before moving anything. Your app needs no backend and no shared
393
- * secret; the request goes from the browser through your `deposit-widget-proxy`,
394
- * which adds only the project API key.
395
- *
396
- * Note the signer is the recipient, not the deposit account — deposit accounts are
397
- * service-owned and cannot sign for themselves.
398
- */
399
- interface ClaimModalProps {
400
418
  /**
401
- * Signs the recovery authorization. Called with the exact typed data to sign and
402
- * the `signer` address whose signature the processor will verify — the deposit's
403
- * `recipient`.
419
+ * Signs a refund for a failed deposit the user recovers from a history row.
420
+ * Supply it to offer recovery; omit it and the panel is read-only — a failed
421
+ * row expands to its cause and details with no action.
422
+ *
423
+ * History here is the WITHDRAWAL DESTINATION's, so the signer is an address
424
+ * the user typed into the form rather than a wallet your app issued. Omit
425
+ * this prop unless your users can sign for the addresses they withdraw to.
404
426
  *
405
- * Return whatever that address's own verifier accepts:
427
+ * The processor verifies the signature against the deposit's `recipient`, on
428
+ * the deposit's DESTINATION chain, so return whatever that address's own
429
+ * verifier accepts there:
406
430
  * - **embedded EOA** (Privy, Turnkey, Dynamic) — `signTypedData`, raw 65-byte
407
431
  * result.
408
432
  * - **deployed smart account** — a signature valid under its ERC-1271
409
- * `isValidSignature`. A raw owner signature is usually not enough; a Safe, for
410
- * one, expects its own message wrapping, so go through your account SDK.
433
+ * `isValidSignature`. A raw owner signature is usually not enough; a Safe,
434
+ * for one, expects its own message wrapping, so go through your account SDK.
411
435
  * - **undeployed smart account** — wrap per ERC-6492 so it can be verified
412
436
  * counterfactually. `SignatureErc6492.wrap` from `ox/erc6492` does this and
413
437
  * ships with viem already.
414
438
  *
415
439
  * Throwing (or returning nothing) is treated as the user declining, which is
416
440
  * retryable.
417
- *
418
- * If your users can't sign — a lost embedded wallet, or a recipient your app
419
- * controls rather than the user — use `createRefundHandler` from
420
- * `@rhinestone/deposit-modal/server` against your own backend instead, and drive
421
- * your own UI. That path authorizes on your say-so rather than a signature.
422
- */
423
- signRecovery: SignRecovery;
424
- isOpen: boolean;
425
- onClose: () => void;
426
- inline?: boolean;
427
- closeOnOverlayClick?: boolean;
428
- backendUrl: string;
429
- rpcUrls?: RpcUrlMap;
430
- /** Optional prefills for the lookup form and destination. */
431
- defaultTxHash?: string;
432
- /**
433
- * Prefills the refund destination. Left empty otherwise — the modal
434
- * deliberately does NOT default to the deposit's sender, because returning
435
- * funds to an exchange's hot wallet can lose them.
436
- *
437
- * Matches `refundDestination` on `RefundAuthorization` in `./server`, which
438
- * is the authoritative version: this one only seeds the field and the user can
439
- * edit it. Not related to the deposit's `recipient`.
440
441
  */
441
- defaultRefundDestination?: Address;
442
- theme?: DepositModalTheme;
443
- uiConfig?: DepositModalUIConfig;
444
- className?: string;
445
- onReady?: () => void;
446
- onLifecycle?: (event: ClaimLifecycleEvent) => void;
447
- onEvent?: (event: ClaimAnalyticsEvent | AnalyticsIngestFailureEvent) => void;
448
- onError?: (data: ErrorEventData) => void;
449
- /**
450
- * Sends claim session analytics to Rhinestone in addition to `onEvent`.
451
- * Defaults to on; `false` turns collection off entirely.
452
- */
453
- enableAnalyticsIngest?: boolean;
454
- /** @internal Rhinestone's own dev verification. Not a supported prop. */
455
- analyticsIngestUrl?: string;
442
+ signRecovery?: SignRecovery;
456
443
  debug?: boolean;
457
444
  }
458
445
  interface AssetOption {
@@ -553,30 +540,6 @@ type WithdrawLifecycleEvent =
553
540
  txHash: Hex;
554
541
  error?: string;
555
542
  };
556
- type ClaimLifecycleEvent = {
557
- type: "lookup";
558
- txHash: string;
559
- matches: number;
560
- } | {
561
- type: "refund_requested";
562
- account: Address;
563
- /** Where the funds were asked to go, on the source chain. */
564
- destination: Address;
565
- chain: number;
566
- } | {
567
- type: "complete";
568
- txHash: string;
569
- account: Address;
570
- destination: Address;
571
- chain: number;
572
- token: string;
573
- amount: string;
574
- } | {
575
- type: "failed";
576
- /** HTTP status from the refund endpoint; 0 if it was unreachable. */
577
- status?: number;
578
- error?: string;
579
- };
580
543
  type DepositFundingMethod = "wallet" | "transfer" | "fiat_onramp" | "exchange_connect" | "asset_migration";
581
544
  type DepositWalletIntegration = "modal_connected" | "host_supplied" | "none";
582
545
  interface DepositAnalyticsSessionProperties {
@@ -649,6 +612,57 @@ interface AnalyticsEventEnvelope<Modal extends "deposit" | "withdraw" | "claim",
649
612
  timestamp: string;
650
613
  session_properties: SessionProperties;
651
614
  }
615
+ /**
616
+ * Which state the history entry point's dot was in when the panel was opened.
617
+ * `none` is the quiet state, reported as a value rather than by omission.
618
+ */
619
+ type HistoryAnalyticsBadge = "needs_you" | "progress" | "none";
620
+ /** Which of history's two entries a recovery attempt started from. */
621
+ type HistoryClaimEntrySource = "history_row" | "history_fallback";
622
+ /**
623
+ * The history surface reports on the session of the modal the user is in, under
624
+ * mirrored names — so a deposit and a withdraw visit are the same measurement
625
+ * of the same panel. Every event of one visit carries its `history_visit_id`;
626
+ * a close and reopen is a second visit with a different one.
627
+ *
628
+ * `deposit_id` is the join key into the claim stream. Amounts, tokens,
629
+ * recipients and searched transaction hashes are deliberately absent.
630
+ */
631
+ type HistoryAnalyticsPayloads<Modal extends "deposit" | "withdraw", Step> = {
632
+ type: `${Modal}_modal_history_open`;
633
+ history_visit_id: string;
634
+ /** The host funnel step history was opened from; null before one opened. */
635
+ step: Step | null;
636
+ badge: HistoryAnalyticsBadge;
637
+ badge_count: number;
638
+ }
639
+ /** One per deposit per visit: a row expanded twice still counts once. */
640
+ | {
641
+ type: `${Modal}_modal_history_row_view`;
642
+ history_visit_id: string;
643
+ deposit_id: string;
644
+ status: HistoryStatus;
645
+ recoverable: boolean;
646
+ /** 0-based index in the list as displayed. */
647
+ position: number;
648
+ } | {
649
+ type: `${Modal}_modal_history_load_more`;
650
+ history_visit_id: string;
651
+ /** 1-based press count within the visit. */
652
+ page: number;
653
+ /** Rows on screen before the press. */
654
+ loaded_rows: number;
655
+ } | {
656
+ type: `${Modal}_modal_history_fallback_open`;
657
+ history_visit_id: string;
658
+ claim_attempt_id: string;
659
+ } | {
660
+ type: `${Modal}_modal_history_recovery_start`;
661
+ history_visit_id: string;
662
+ claim_attempt_id: string;
663
+ entry_source: HistoryClaimEntrySource;
664
+ deposit_id: string;
665
+ };
652
666
  type DepositAnalyticsSharedStep = "account_setup" | "funding_method_home";
653
667
  type DepositAnalyticsWalletStep = "wallet_connect" | "wallet_source_asset" | "wallet_source_token" | "wallet_amount" | "wallet_review" | "wallet_submit" | "wallet_processing";
654
668
  type DepositAnalyticsTransferStep = "transfer_source_selection" | "transfer_address_shown" | "transfer_copy" | "transfer_fee_amount" | "transfer_fee_review" | "transfer_tracking";
@@ -785,7 +799,7 @@ type DepositAnalyticsCommonEventPayload = {
785
799
  source: DepositAnalyticsCloseSource;
786
800
  step: DepositAnalyticsStep | null;
787
801
  after_handoff: boolean;
788
- };
802
+ } | HistoryAnalyticsPayloads<"deposit", DepositAnalyticsStep>;
789
803
  /**
790
804
  * Method-aware deposit telemetry. UI outcomes describe only what the widget
791
805
  * observed and must not be treated as backend fulfilment truth.
@@ -869,7 +883,9 @@ type WithdrawAnalyticsEventPayload = {
869
883
  step: WithdrawAnalyticsStep | null;
870
884
  after_handoff: boolean;
871
885
  same_route?: boolean;
872
- };
886
+ } | (HistoryAnalyticsPayloads<"withdraw", WithdrawAnalyticsStep> & {
887
+ same_route?: boolean;
888
+ });
873
889
  type WithdrawAnalyticsEvent = WithdrawAnalyticsEventPayload & AnalyticsEventEnvelope<"withdraw", WithdrawAnalyticsSessionProperties>;
874
890
  /**
875
891
  * `submit` is the async boundary the review CTA opens rather than a screen of
@@ -879,8 +895,28 @@ type ClaimAnalyticsStep = "lookup" | "select" | "review" | "submit";
879
895
  /** Every reason has a call site in the claim flow; none is aspirational. */
880
896
  type ClaimAnalyticsFailureReason = RoutableAnalyticsReason<"lookup_transaction_hash_invalid" | "lookup_failed" | "lookup_no_deposits_found" | "lookup_no_eligible_deposits" | "refund_destination_invalid" | "recovery_deposit_data_incomplete" | "signature_rejected" | "signature_invalid" | "recovery_deposit_not_recoverable" | "recovery_unsupported" | "signature_verification_unavailable" | "refund_reconciliation_required" | "refund_failed" | "refund_service_unreachable" | "modal_close_refused_in_flight">;
881
897
  type ClaimAnalyticsAbandonmentReason = "back" | "modal_close";
882
- type ClaimAnalyticsCloseSource = "header_button" | "escape" | "overlay" | "host_controlled" | "success_done" | "failure_cancel";
898
+ type ClaimAnalyticsCloseSource = "header_button" | "escape" | "overlay" | "host_controlled" | "success_done" | "failure_cancel"
899
+ /** The labelled control back to the history list a recovery was started from. */
900
+ | "history_back";
883
901
  type ClaimAnalyticsUiOutcome = "completed" | "failed";
902
+ /**
903
+ * Where a claim attempt was entered from. Present on every claim session, the
904
+ * standalone modal's included: segmenting on a value that is there keeps a
905
+ * standalone claim distinguishable from an older widget that reports nothing.
906
+ */
907
+ type ClaimAnalyticsEntrySource = "standalone" | HistoryClaimEntrySource;
908
+ /**
909
+ * What ties a claim attempt back to the history visit that produced it. Carried
910
+ * on every event of the attempt rather than in `session_properties`, which the
911
+ * ingest contract compares for equality across a session.
912
+ */
913
+ interface ClaimAnalyticsCorrelation {
914
+ entry_source: ClaimAnalyticsEntrySource;
915
+ /** The deposit or withdraw session the attempt was started inside. */
916
+ source_session_id?: string;
917
+ history_visit_id?: string;
918
+ claim_attempt_id?: string;
919
+ }
884
920
  /**
885
921
  * Claim funnel telemetry. Identities enter the stream only once a lookup has
886
922
  * matched a backend deposit row: the hash the user searched for, the refund
@@ -892,7 +928,8 @@ type ClaimAnalyticsUiOutcome = "completed" | "failed";
892
928
  * no hash, never an empty string: `deposit_id` is the join key, and a blank
893
929
  * identity would join to nothing while looking like one that does.
894
930
  */
895
- type ClaimAnalyticsEventPayload = {
931
+ type ClaimAnalyticsEventPayload = ClaimAnalyticsEventDetail & Partial<ClaimAnalyticsCorrelation>;
932
+ type ClaimAnalyticsEventDetail = {
896
933
  type: "claim_modal_open";
897
934
  } | {
898
935
  type: "claim_modal_step_open";
@@ -979,4 +1016,4 @@ interface AnalyticsIngestFailureEvent {
979
1016
  }
980
1017
  type ModalAnalyticsEvent = DepositAnalyticsEvent | WithdrawAnalyticsEvent | ClaimAnalyticsEvent | AnalyticsIngestFailureEvent;
981
1018
 
982
- export type { WithdrawAnalyticsCloseSource as $, AnalyticsEventEnvelope as A, DepositAnalyticsStep as B, ChainId as C, DepositAnalyticsAbandonmentReason as D, DepositAnalyticsTransferStep as E, DepositAnalyticsUiOutcome as F, DepositAnalyticsWalletStep as G, DepositAssetMigrationMethodIdentifiers as H, DepositCompleteEventData as I, DepositExchangeConnectMethodIdentifiers as J, DepositFailedEventData as K, DepositFiatOnrampMethodIdentifiers as L, DepositFundingMethod as M, DepositLifecycleEvent as N, DepositModalProps as O, DepositModalTheme as P, DepositModalUIConfig as Q, DepositSubmittedEventData as R, DepositTransferHandoffIdentifiers as S, DepositWalletIntegration as T, DepositWalletMethodIdentifiers as U, ErrorEventData as V, FiatMethodsConfig as W, ModalAnalyticsEvent as X, OutputTokenRule as Y, RpcUrlMap as Z, WithdrawAnalyticsAbandonmentReason as _, AnalyticsIngestFailureEvent as a, WithdrawAnalyticsEvent as a0, WithdrawAnalyticsEventPayload as a1, WithdrawAnalyticsFailureReason as a2, WithdrawAnalyticsSessionProperties as a3, WithdrawAnalyticsStep as a4, WithdrawAnalyticsUiOutcome as a5, WithdrawCompleteEventData as a6, WithdrawFailedEventData as a7, WithdrawLifecycleEvent as a8, WithdrawModalProps as a9, WithdrawSubmittedEventData as aa, WithdrawTransferRequest as ab, RecoveryErrorCode as ac, SignRecovery as ad, SignRecoveryPayload as ae, AnalyticsIngestFailureReason as b, AnalyticsReasonFamily as c, AssetMigrationsConfig as d, AssetOption as e, ClaimAnalyticsAbandonmentReason as f, ClaimAnalyticsCloseSource as g, ClaimAnalyticsEvent as h, ClaimAnalyticsEventPayload as i, ClaimAnalyticsFailureReason as j, ClaimAnalyticsSessionProperties as k, ClaimAnalyticsStep as l, ClaimAnalyticsUiOutcome as m, ClaimLifecycleEvent as n, ClaimModalProps as o, ConnectedEventData as p, DepositAnalyticsCloseSource as q, DepositAnalyticsCorrelator as r, DepositAnalyticsEvent as s, DepositAnalyticsEventPayload as t, DepositAnalyticsExchangeStep as u, DepositAnalyticsFailureReason as v, DepositAnalyticsFiatStep as w, DepositAnalyticsMigrationStep as x, DepositAnalyticsSessionProperties as y, DepositAnalyticsSharedStep as z };
1019
+ export type { OutputTokenRule as $, AnalyticsEventEnvelope as A, DepositAnalyticsStep as B, ChainId as C, DepositAnalyticsAbandonmentReason as D, DepositAnalyticsTransferStep as E, DepositAnalyticsUiOutcome as F, DepositAnalyticsWalletStep as G, DepositAssetMigrationMethodIdentifiers as H, DepositCompleteEventData as I, DepositExchangeConnectMethodIdentifiers as J, DepositFailedEventData as K, DepositFiatOnrampMethodIdentifiers as L, DepositFundingMethod as M, DepositLifecycleEvent as N, DepositModalProps as O, DepositModalTheme as P, DepositModalUIConfig as Q, DepositSubmittedEventData as R, DepositTransferHandoffIdentifiers as S, DepositWalletIntegration as T, DepositWalletMethodIdentifiers as U, ErrorEventData as V, FiatMethodsConfig as W, HistoryAnalyticsBadge as X, HistoryClaimEntrySource as Y, HistoryStatus as Z, ModalAnalyticsEvent as _, AnalyticsIngestFailureEvent as a, RecoveryErrorCode as a0, RpcUrlMap as a1, SignRecovery as a2, SignRecoveryPayload as a3, WithdrawAnalyticsAbandonmentReason as a4, WithdrawAnalyticsCloseSource as a5, WithdrawAnalyticsEvent as a6, WithdrawAnalyticsEventPayload as a7, WithdrawAnalyticsFailureReason as a8, WithdrawAnalyticsSessionProperties as a9, WithdrawAnalyticsStep as aa, WithdrawAnalyticsUiOutcome as ab, WithdrawCompleteEventData as ac, WithdrawFailedEventData as ad, WithdrawLifecycleEvent as ae, WithdrawModalProps as af, WithdrawSubmittedEventData as ag, WithdrawTransferRequest as ah, AnalyticsIngestFailureReason as b, AnalyticsReasonFamily as c, AssetMigrationsConfig as d, AssetOption as e, ClaimAnalyticsAbandonmentReason as f, ClaimAnalyticsCloseSource as g, ClaimAnalyticsCorrelation as h, ClaimAnalyticsEntrySource as i, ClaimAnalyticsEvent as j, ClaimAnalyticsEventPayload as k, ClaimAnalyticsFailureReason as l, ClaimAnalyticsSessionProperties as m, ClaimAnalyticsStep as n, ClaimAnalyticsUiOutcome as o, ConnectedEventData as p, DepositAnalyticsCloseSource as q, DepositAnalyticsCorrelator as r, DepositAnalyticsEvent as s, DepositAnalyticsEventPayload as t, DepositAnalyticsExchangeStep as u, DepositAnalyticsFailureReason as v, DepositAnalyticsFiatStep as w, DepositAnalyticsMigrationStep as x, DepositAnalyticsSessionProperties as y, DepositAnalyticsSharedStep as z };
package/dist/withdraw.cjs CHANGED
@@ -1,10 +1,9 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkA6JPBMYYcjs = require('./chunk-A6JPBMYY.cjs');
4
- require('./chunk-4J5ADVIN.cjs');
5
- require('./chunk-HAQOFI3D.cjs');
6
- require('./chunk-AQVJUXSG.cjs');
7
- require('./chunk-4KCSH4T3.cjs');
3
+ var _chunk24N4KMJXcjs = require('./chunk-24N4KMJX.cjs');
4
+ require('./chunk-H4O22O7Y.cjs');
5
+ require('./chunk-5CM3ZQ5U.cjs');
6
+ require('./chunk-OY5N3E6L.cjs');
8
7
 
9
8
 
10
- exports.WithdrawModal = _chunkA6JPBMYYcjs.WithdrawModal;
9
+ exports.WithdrawModal = _chunk24N4KMJXcjs.WithdrawModal;
@@ -1,9 +1,37 @@
1
1
  import * as react from 'react';
2
- import { a9 as WithdrawModalProps } from './types-DP_3KwlD.cjs';
3
- export { A as AnalyticsEventEnvelope, a as AnalyticsIngestFailureEvent, b as AnalyticsIngestFailureReason, c as AnalyticsReasonFamily, e as AssetOption, p as ConnectedEventData, V as ErrorEventData, Z as RpcUrlMap, _ as WithdrawAnalyticsAbandonmentReason, $ as WithdrawAnalyticsCloseSource, a0 as WithdrawAnalyticsEvent, a1 as WithdrawAnalyticsEventPayload, a2 as WithdrawAnalyticsFailureReason, a3 as WithdrawAnalyticsSessionProperties, a4 as WithdrawAnalyticsStep, a5 as WithdrawAnalyticsUiOutcome, a6 as WithdrawCompleteEventData, a7 as WithdrawFailedEventData, aa as WithdrawSubmittedEventData, ab as WithdrawTransferRequest } from './types-DP_3KwlD.cjs';
4
- import { M as ModalUiState } from './modal-ui-state-OD1RmKkK.cjs';
2
+ import { af as WithdrawModalProps } from './types-SwGGf0eH.cjs';
3
+ export { A as AnalyticsEventEnvelope, a as AnalyticsIngestFailureEvent, b as AnalyticsIngestFailureReason, c as AnalyticsReasonFamily, e as AssetOption, f as ClaimAnalyticsAbandonmentReason, g as ClaimAnalyticsCloseSource, h as ClaimAnalyticsCorrelation, i as ClaimAnalyticsEntrySource, j as ClaimAnalyticsEvent, k as ClaimAnalyticsEventPayload, l as ClaimAnalyticsFailureReason, m as ClaimAnalyticsSessionProperties, n as ClaimAnalyticsStep, o as ClaimAnalyticsUiOutcome, p as ConnectedEventData, V as ErrorEventData, X as HistoryAnalyticsBadge, Y as HistoryClaimEntrySource, Z as HistoryStatus, a0 as RecoveryErrorCode, a1 as RpcUrlMap, a2 as SignRecovery, a3 as SignRecoveryPayload, a4 as WithdrawAnalyticsAbandonmentReason, a5 as WithdrawAnalyticsCloseSource, a6 as WithdrawAnalyticsEvent, a7 as WithdrawAnalyticsEventPayload, a8 as WithdrawAnalyticsFailureReason, a9 as WithdrawAnalyticsSessionProperties, aa as WithdrawAnalyticsStep, ab as WithdrawAnalyticsUiOutcome, ac as WithdrawCompleteEventData, ad as WithdrawFailedEventData, ag as WithdrawSubmittedEventData, ah as WithdrawTransferRequest } from './types-SwGGf0eH.cjs';
4
+ import './caip-BMi-9t09.cjs';
5
5
  import 'viem';
6
- import './caip-D8aRWdEY.cjs';
6
+
7
+ /**
8
+ * What a flow is showing, for a surface that draws its own chrome around it.
9
+ *
10
+ * Every modal reports the same shape, because the thing consuming it — a
11
+ * native sheet that owns dismissal — needs the same three answers whichever
12
+ * product is running: what screen is this, can you go back, and would closing
13
+ * now lose something.
14
+ *
15
+ * Its own module so the withdraw and claim modals can report it without
16
+ * importing anything from the deposit one. They are separate chunks on
17
+ * purpose.
18
+ */
19
+ interface ModalUiState {
20
+ /** The flow's own step name. Stable enough for a sheet title or telemetry;
21
+ * never something to branch payment logic on. */
22
+ screen: string;
23
+ /** The page's back action, or absent when it has nowhere to go. */
24
+ back?: () => void;
25
+ /**
26
+ * The user has committed and the flow is mid-submit.
27
+ *
28
+ * Its own field rather than a screen, because the screen does not change:
29
+ * the gasless deposit path hands the signature to the backend and waits
30
+ * there, with the wallet request already cleared, and this page the only
31
+ * thing tracking a deposit that may already be processing.
32
+ */
33
+ submitting: boolean;
34
+ }
7
35
 
8
36
  /**
9
37
  * Not part of `WithdrawModalProps`: the native embed is the only consumer, and
@@ -12,6 +40,6 @@ import './caip-D8aRWdEY.cjs';
12
40
  interface WithdrawModalInternalProps {
13
41
  onUiState?: (state: ModalUiState) => void;
14
42
  }
15
- declare function WithdrawModal({ accountAddress, sourceChain: sourceChainProp, sourceToken, targetChain: targetChainProp, targetToken, recipient, defaultAmount, isOpen, onClose, inline, closeOnOverlayClick, backendUrl, rpcUrls: rpcUrlsProp, forceRegister, onSendTransaction, theme, uiConfig, className, onReady, onLifecycle, onEvent, onError, enableAnalyticsIngest, analyticsIngestUrl, debug, onUiState, ...removedProps }: WithdrawModalProps & WithdrawModalInternalProps): react.JSX.Element;
43
+ declare function WithdrawModal({ accountAddress, sourceChain: sourceChainProp, sourceToken, targetChain: targetChainProp, targetToken, recipient, defaultAmount, isOpen, onClose, inline, closeOnOverlayClick, backendUrl, rpcUrls: rpcUrlsProp, forceRegister, onSendTransaction, theme, uiConfig, className, onReady, onLifecycle, onEvent, onError, enableAnalyticsIngest, analyticsIngestUrl, signRecovery, debug, onUiState, ...removedProps }: WithdrawModalProps & WithdrawModalInternalProps): react.JSX.Element;
16
44
 
17
45
  export { WithdrawModal, WithdrawModalProps };
@@ -1,9 +1,37 @@
1
1
  import * as react from 'react';
2
- import { a9 as WithdrawModalProps } from './types-Bho4OA03.js';
3
- export { A as AnalyticsEventEnvelope, a as AnalyticsIngestFailureEvent, b as AnalyticsIngestFailureReason, c as AnalyticsReasonFamily, e as AssetOption, p as ConnectedEventData, V as ErrorEventData, Z as RpcUrlMap, _ as WithdrawAnalyticsAbandonmentReason, $ as WithdrawAnalyticsCloseSource, a0 as WithdrawAnalyticsEvent, a1 as WithdrawAnalyticsEventPayload, a2 as WithdrawAnalyticsFailureReason, a3 as WithdrawAnalyticsSessionProperties, a4 as WithdrawAnalyticsStep, a5 as WithdrawAnalyticsUiOutcome, a6 as WithdrawCompleteEventData, a7 as WithdrawFailedEventData, aa as WithdrawSubmittedEventData, ab as WithdrawTransferRequest } from './types-Bho4OA03.js';
4
- import { M as ModalUiState } from './modal-ui-state-OD1RmKkK.js';
2
+ import { af as WithdrawModalProps } from './types-B9SbZQIG.js';
3
+ export { A as AnalyticsEventEnvelope, a as AnalyticsIngestFailureEvent, b as AnalyticsIngestFailureReason, c as AnalyticsReasonFamily, e as AssetOption, f as ClaimAnalyticsAbandonmentReason, g as ClaimAnalyticsCloseSource, h as ClaimAnalyticsCorrelation, i as ClaimAnalyticsEntrySource, j as ClaimAnalyticsEvent, k as ClaimAnalyticsEventPayload, l as ClaimAnalyticsFailureReason, m as ClaimAnalyticsSessionProperties, n as ClaimAnalyticsStep, o as ClaimAnalyticsUiOutcome, p as ConnectedEventData, V as ErrorEventData, X as HistoryAnalyticsBadge, Y as HistoryClaimEntrySource, Z as HistoryStatus, a0 as RecoveryErrorCode, a1 as RpcUrlMap, a2 as SignRecovery, a3 as SignRecoveryPayload, a4 as WithdrawAnalyticsAbandonmentReason, a5 as WithdrawAnalyticsCloseSource, a6 as WithdrawAnalyticsEvent, a7 as WithdrawAnalyticsEventPayload, a8 as WithdrawAnalyticsFailureReason, a9 as WithdrawAnalyticsSessionProperties, aa as WithdrawAnalyticsStep, ab as WithdrawAnalyticsUiOutcome, ac as WithdrawCompleteEventData, ad as WithdrawFailedEventData, ag as WithdrawSubmittedEventData, ah as WithdrawTransferRequest } from './types-B9SbZQIG.js';
4
+ import './caip-BMi-9t09.js';
5
5
  import 'viem';
6
- import './caip-D8aRWdEY.js';
6
+
7
+ /**
8
+ * What a flow is showing, for a surface that draws its own chrome around it.
9
+ *
10
+ * Every modal reports the same shape, because the thing consuming it — a
11
+ * native sheet that owns dismissal — needs the same three answers whichever
12
+ * product is running: what screen is this, can you go back, and would closing
13
+ * now lose something.
14
+ *
15
+ * Its own module so the withdraw and claim modals can report it without
16
+ * importing anything from the deposit one. They are separate chunks on
17
+ * purpose.
18
+ */
19
+ interface ModalUiState {
20
+ /** The flow's own step name. Stable enough for a sheet title or telemetry;
21
+ * never something to branch payment logic on. */
22
+ screen: string;
23
+ /** The page's back action, or absent when it has nowhere to go. */
24
+ back?: () => void;
25
+ /**
26
+ * The user has committed and the flow is mid-submit.
27
+ *
28
+ * Its own field rather than a screen, because the screen does not change:
29
+ * the gasless deposit path hands the signature to the backend and waits
30
+ * there, with the wallet request already cleared, and this page the only
31
+ * thing tracking a deposit that may already be processing.
32
+ */
33
+ submitting: boolean;
34
+ }
7
35
 
8
36
  /**
9
37
  * Not part of `WithdrawModalProps`: the native embed is the only consumer, and
@@ -12,6 +40,6 @@ import './caip-D8aRWdEY.js';
12
40
  interface WithdrawModalInternalProps {
13
41
  onUiState?: (state: ModalUiState) => void;
14
42
  }
15
- declare function WithdrawModal({ accountAddress, sourceChain: sourceChainProp, sourceToken, targetChain: targetChainProp, targetToken, recipient, defaultAmount, isOpen, onClose, inline, closeOnOverlayClick, backendUrl, rpcUrls: rpcUrlsProp, forceRegister, onSendTransaction, theme, uiConfig, className, onReady, onLifecycle, onEvent, onError, enableAnalyticsIngest, analyticsIngestUrl, debug, onUiState, ...removedProps }: WithdrawModalProps & WithdrawModalInternalProps): react.JSX.Element;
43
+ declare function WithdrawModal({ accountAddress, sourceChain: sourceChainProp, sourceToken, targetChain: targetChainProp, targetToken, recipient, defaultAmount, isOpen, onClose, inline, closeOnOverlayClick, backendUrl, rpcUrls: rpcUrlsProp, forceRegister, onSendTransaction, theme, uiConfig, className, onReady, onLifecycle, onEvent, onError, enableAnalyticsIngest, analyticsIngestUrl, signRecovery, debug, onUiState, ...removedProps }: WithdrawModalProps & WithdrawModalInternalProps): react.JSX.Element;
16
44
 
17
45
  export { WithdrawModal, WithdrawModalProps };
package/dist/withdraw.mjs CHANGED
@@ -1,10 +1,9 @@
1
1
  import {
2
2
  WithdrawModal
3
- } from "./chunk-GZ4GQ5MC.mjs";
4
- import "./chunk-XCTRKCNM.mjs";
5
- import "./chunk-UX35GYLM.mjs";
6
- import "./chunk-LMG46EP2.mjs";
7
- import "./chunk-VUATPOWJ.mjs";
3
+ } from "./chunk-HMB2XQGD.mjs";
4
+ import "./chunk-EA5CE2UZ.mjs";
5
+ import "./chunk-3HCCR54R.mjs";
6
+ import "./chunk-EAGMY3QE.mjs";
8
7
  export {
9
8
  WithdrawModal
10
9
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rhinestone/deposit-modal",
3
- "version": "0.14.1",
3
+ "version": "0.16.0",
4
4
  "description": "React modal component for Rhinestone cross-chain deposits",
5
5
  "author": "Rhinestone <dev@rhinestone.wtf>",
6
6
  "bugs": {
@@ -41,16 +41,6 @@
41
41
  "default": "./dist/withdraw.cjs"
42
42
  }
43
43
  },
44
- "./claim": {
45
- "import": {
46
- "types": "./dist/claim.d.ts",
47
- "default": "./dist/claim.mjs"
48
- },
49
- "require": {
50
- "types": "./dist/claim.d.cts",
51
- "default": "./dist/claim.cjs"
52
- }
53
- },
54
44
  "./embed": {
55
45
  "import": {
56
46
  "types": "./dist/embed.d.ts",
@@ -109,7 +99,6 @@
109
99
  "clean": "rm -rf dist",
110
100
  "typecheck": "tsc --noEmit",
111
101
  "test": "vitest run",
112
- "test:live": "./scripts/live-seam.sh",
113
102
  "test:watch": "vitest",
114
103
  "test:coverage": "vitest run --coverage",
115
104
  "prepublishOnly": "bun run clean && bun run build && bun run typecheck",
@@ -182,7 +171,7 @@
182
171
  {
183
172
  "name": "Total Bundle (Everything)",
184
173
  "path": "dist/index.mjs",
185
- "limit": "93.3 kB",
174
+ "limit": "96.5 kB",
186
175
  "ignore": [
187
176
  "react",
188
177
  "react-dom",
@@ -199,9 +188,9 @@
199
188
  ]
200
189
  },
201
190
  {
202
- "name": "Native Embed (all three modes)",
191
+ "name": "Native Embed (deposit & withdraw)",
203
192
  "path": "dist/embed.mjs",
204
- "limit": "99.6 kB",
193
+ "limit": "103.5 kB",
205
194
  "ignore": [
206
195
  "react",
207
196
  "react-dom",
@@ -221,7 +210,7 @@
221
210
  "name": "Deposit & Withdraw Modals Only",
222
211
  "path": "dist/index.mjs",
223
212
  "import": "{ DepositModal, WithdrawModal }",
224
- "limit": "88.7 kB",
213
+ "limit": "96 kB",
225
214
  "ignore": [
226
215
  "react",
227
216
  "react-dom",
@@ -240,7 +229,7 @@
240
229
  {
241
230
  "name": "Withdraw Modal Only",
242
231
  "path": "dist/withdraw.mjs",
243
- "limit": "35.7 kB",
232
+ "limit": "45 kB",
244
233
  "ignore": [
245
234
  "react",
246
235
  "react-dom",
@@ -263,26 +252,6 @@
263
252
  "ignore": [
264
253
  "viem"
265
254
  ]
266
- },
267
- {
268
- "name": "Claim Modal Only",
269
- "path": "dist/claim.mjs",
270
- "import": "{ ClaimModal }",
271
- "limit": "25.8 kB",
272
- "ignore": [
273
- "react",
274
- "react-dom",
275
- "viem",
276
- "wagmi",
277
- "@tanstack/react-query",
278
- "@reown/appkit",
279
- "@reown/appkit-adapter-wagmi",
280
- "@walletconnect/ethereum-provider",
281
- "@coinbase/wallet-sdk",
282
- "@metamask/sdk",
283
- "porto",
284
- "porto/internal"
285
- ]
286
255
  }
287
256
  ],
288
257
  "keywords": [
@@ -1,13 +0,0 @@
1
- import {
2
- ClaimModal,
3
- buildClaimAnalyticsSessionProperties
4
- } from "./chunk-QACOOLOE.mjs";
5
- import "./chunk-VALXN5IO.mjs";
6
- import "./chunk-R5UQ3TN4.mjs";
7
- import "./chunk-UX35GYLM.mjs";
8
- import "./chunk-LMG46EP2.mjs";
9
- import "./chunk-VUATPOWJ.mjs";
10
- export {
11
- ClaimModal,
12
- buildClaimAnalyticsSessionProperties
13
- };
@@ -1,13 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
-
3
-
4
- var _chunkYP7QVKQ6cjs = require('./chunk-YP7QVKQ6.cjs');
5
- require('./chunk-7AZFT2MV.cjs');
6
- require('./chunk-62UCV2LG.cjs');
7
- require('./chunk-HAQOFI3D.cjs');
8
- require('./chunk-AQVJUXSG.cjs');
9
- require('./chunk-4KCSH4T3.cjs');
10
-
11
-
12
-
13
- exports.ClaimModal = _chunkYP7QVKQ6cjs.ClaimModal; exports.buildClaimAnalyticsSessionProperties = _chunkYP7QVKQ6cjs.buildClaimAnalyticsSessionProperties;
@@ -1,12 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
-
3
-
4
- var _chunkA6JPBMYYcjs = require('./chunk-A6JPBMYY.cjs');
5
- require('./chunk-4J5ADVIN.cjs');
6
- require('./chunk-HAQOFI3D.cjs');
7
- require('./chunk-AQVJUXSG.cjs');
8
- require('./chunk-4KCSH4T3.cjs');
9
-
10
-
11
-
12
- exports.WithdrawModal = _chunkA6JPBMYYcjs.WithdrawModal; exports.buildWithdrawAnalyticsSessionProperties = _chunkA6JPBMYYcjs.buildWithdrawAnalyticsSessionProperties;