@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.
- package/README.md +26 -24
- package/bridge-transcript.json +14 -0
- package/dist/{DepositModalReown-GAD45GIC.cjs → DepositModalReown-IFN6YLZJ.cjs} +20 -22
- package/dist/{DepositModalReown-2EVV64OA.mjs → DepositModalReown-R7UROJPJ.mjs} +5 -7
- package/dist/WithdrawModal-SZEAI473.cjs +11 -0
- package/dist/WithdrawModal-XKSSHVEJ.mjs +11 -0
- package/dist/{caip-D8aRWdEY.d.cts → caip-BMi-9t09.d.cts} +27 -3
- package/dist/{caip-D8aRWdEY.d.ts → caip-BMi-9t09.d.ts} +27 -3
- package/dist/{chunk-A6JPBMYY.cjs → chunk-24N4KMJX.cjs} +234 -115
- package/dist/{chunk-LMG46EP2.mjs → chunk-3HCCR54R.mjs} +1 -1
- package/dist/{chunk-AQVJUXSG.cjs → chunk-5CM3ZQ5U.cjs} +1 -1
- package/dist/chunk-EA5CE2UZ.mjs +7599 -0
- package/dist/{chunk-VUATPOWJ.mjs → chunk-EAGMY3QE.mjs} +74 -17
- package/dist/{chunk-5Q5CSVKF.mjs → chunk-F6ROQ6RJ.mjs} +215 -517
- package/dist/{chunk-RN5VKWI6.mjs → chunk-FTWKAJGN.mjs} +1 -1
- package/dist/chunk-H4O22O7Y.cjs +7599 -0
- package/dist/{chunk-GZ4GQ5MC.mjs → chunk-HMB2XQGD.mjs} +172 -53
- package/dist/{chunk-DW2EQA2U.cjs → chunk-LVCD6RHF.cjs} +2 -2
- package/dist/{chunk-4KCSH4T3.cjs → chunk-OY5N3E6L.cjs} +86 -29
- package/dist/{chunk-NQMC5VKQ.cjs → chunk-V466XQSG.cjs} +551 -853
- package/dist/{constants-DBrWhJWE.d.cts → constants-BT4ctuHo.d.cts} +7 -6
- package/dist/{constants-DBrWhJWE.d.ts → constants-D21ZdNOP.d.ts} +7 -6
- package/dist/constants.cjs +3 -3
- package/dist/constants.d.cts +3 -3
- package/dist/constants.d.ts +3 -3
- package/dist/constants.mjs +2 -2
- package/dist/deposit.cjs +6 -8
- package/dist/deposit.d.cts +3 -3
- package/dist/deposit.d.ts +3 -3
- package/dist/deposit.mjs +5 -7
- package/dist/embed.cjs +130 -80
- package/dist/embed.d.cts +3 -9
- package/dist/embed.d.ts +3 -9
- package/dist/embed.mjs +112 -62
- package/dist/index.cjs +8 -11
- package/dist/index.d.cts +3 -5
- package/dist/index.d.ts +3 -5
- package/dist/index.mjs +10 -13
- package/dist/polymarket.cjs +6 -6
- package/dist/polymarket.mjs +2 -2
- package/dist/server.d.cts +2 -2
- package/dist/server.d.ts +2 -2
- package/dist/styles.css +147 -100
- package/dist/{types-DP_3KwlD.d.cts → types-B9SbZQIG.d.ts} +145 -108
- package/dist/{types-Bho4OA03.d.ts → types-SwGGf0eH.d.cts} +145 -108
- package/dist/withdraw.cjs +5 -6
- package/dist/withdraw.d.cts +33 -5
- package/dist/withdraw.d.ts +33 -5
- package/dist/withdraw.mjs +4 -5
- package/package.json +6 -37
- package/dist/ClaimModal-GDFENSLV.mjs +0 -13
- package/dist/ClaimModal-L3FUBI5U.cjs +0 -13
- package/dist/WithdrawModal-FAQH35NG.cjs +0 -12
- package/dist/WithdrawModal-IKUHF5CF.mjs +0 -12
- package/dist/chunk-4J5ADVIN.cjs +0 -1848
- package/dist/chunk-62UCV2LG.cjs +0 -81
- package/dist/chunk-7AZFT2MV.cjs +0 -163
- package/dist/chunk-HAQOFI3D.cjs +0 -3699
- package/dist/chunk-QACOOLOE.mjs +0 -1062
- package/dist/chunk-R5UQ3TN4.mjs +0 -81
- package/dist/chunk-UX35GYLM.mjs +0 -3699
- package/dist/chunk-VALXN5IO.mjs +0 -163
- package/dist/chunk-XCTRKCNM.mjs +0 -1848
- package/dist/chunk-YP7QVKQ6.cjs +0 -1062
- package/dist/claim.cjs +0 -11
- package/dist/claim.d.cts +0 -17
- package/dist/claim.d.ts +0 -17
- package/dist/claim.mjs +0 -11
- package/dist/modal-ui-state-OD1RmKkK.d.cts +0 -30
- 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.js';
|
|
1
2
|
import { TypedDataDefinition, Address, Hex, WalletClient, PublicClient, Chain } from 'viem';
|
|
2
|
-
|
|
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
|
|
43
|
-
*
|
|
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
|
-
*
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
*
|
|
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
|
|
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 =
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
402
|
-
*
|
|
403
|
-
*
|
|
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
|
-
*
|
|
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,
|
|
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
|
-
|
|
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 {
|
|
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 };
|