@rhinestone/deposit-modal 0.12.2 → 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 (68) hide show
  1. package/README.md +73 -18
  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-VG66OTIU.cjs → DepositModalReown-46LPVFB6.cjs} +58 -35
  6. package/dist/{DepositModalReown-TEC3MEZ4.mjs → DepositModalReown-Q2JMLT47.mjs} +45 -22
  7. package/dist/{QRCode-WUC652SH.mjs → QRCode-5RGIZZHL.mjs} +1 -1
  8. package/dist/{QRCode-5DXFNKI2.cjs → QRCode-JKXG4RHN.cjs} +2 -2
  9. package/dist/WithdrawModal-5ICGD4HJ.mjs +12 -0
  10. package/dist/WithdrawModal-VP6PMIRO.cjs +12 -0
  11. package/dist/{chunk-O7BCVQ6L.cjs → chunk-4KCSH4T3.cjs} +157 -199
  12. package/dist/chunk-6KG642KH.cjs +31 -0
  13. package/dist/{chunk-PWLEBV5V.cjs → chunk-7ICSHJFE.cjs} +296 -220
  14. package/dist/{chunk-J46WDSRD.mjs → chunk-7SR7ENVJ.mjs} +165 -89
  15. package/dist/{chunk-2TPSF77V.mjs → chunk-CFKC77SV.mjs} +455 -261
  16. package/dist/{chunk-75DVGSAX.cjs → chunk-DW2EQA2U.cjs} +6 -3
  17. package/dist/{chunk-FXXUIK4E.mjs → chunk-IN77XSWO.mjs} +899 -153
  18. package/dist/chunk-K4H6TGBE.mjs +31 -0
  19. package/dist/{chunk-SDSKIJC7.mjs → chunk-KTUVSKR4.mjs} +2410 -1177
  20. package/dist/{chunk-HL5NUKZW.cjs → chunk-LZFRL2AL.cjs} +3 -3
  21. package/dist/{chunk-UQIJU6HV.cjs → chunk-MTFJSE52.cjs} +499 -191
  22. package/dist/{chunk-FLVLYO64.mjs → chunk-PKML3XVS.mjs} +430 -122
  23. package/dist/{chunk-4ZXQPFNU.mjs → chunk-RN5VKWI6.mjs} +4 -1
  24. package/dist/{chunk-BRYNGLDM.cjs → chunk-V2OBGLJD.cjs} +961 -215
  25. package/dist/{chunk-3STTWRAN.mjs → chunk-VUATPOWJ.mjs} +147 -189
  26. package/dist/{chunk-JE4R5VA3.mjs → chunk-WUJIKCFU.mjs} +1 -1
  27. package/dist/chunk-X2IPAPXU.cjs +163 -0
  28. package/dist/{chunk-OIN4CXCP.cjs → chunk-YCQZJQO6.cjs} +2343 -1110
  29. package/dist/{chunk-TM7VGHAG.cjs → chunk-YWMWI7PZ.cjs} +462 -268
  30. package/dist/chunk-ZEO6ADM3.mjs +163 -0
  31. package/dist/claim.cjs +7 -6
  32. package/dist/claim.d.cts +11 -3
  33. package/dist/claim.d.ts +11 -3
  34. package/dist/claim.mjs +6 -5
  35. package/dist/{constants-FuzG3h4m.d.cts → constants-DBrWhJWE.d.cts} +12 -7
  36. package/dist/{constants-FuzG3h4m.d.ts → constants-DBrWhJWE.d.ts} +12 -7
  37. package/dist/constants.cjs +3 -9
  38. package/dist/constants.d.cts +2 -3
  39. package/dist/constants.d.ts +2 -3
  40. package/dist/constants.mjs +4 -10
  41. package/dist/deposit.cjs +8 -8
  42. package/dist/deposit.d.cts +2 -2
  43. package/dist/deposit.d.ts +2 -2
  44. package/dist/deposit.mjs +7 -7
  45. package/dist/embed.cjs +1476 -0
  46. package/dist/embed.d.cts +183 -0
  47. package/dist/embed.d.ts +183 -0
  48. package/dist/embed.mjs +1476 -0
  49. package/dist/index.cjs +11 -16
  50. package/dist/index.d.cts +3 -3
  51. package/dist/index.d.ts +3 -3
  52. package/dist/index.mjs +14 -19
  53. package/dist/modal-ui-state-OD1RmKkK.d.cts +30 -0
  54. package/dist/modal-ui-state-OD1RmKkK.d.ts +30 -0
  55. package/dist/polymarket.cjs +17 -7
  56. package/dist/polymarket.mjs +13 -3
  57. package/dist/styles.css +124 -98
  58. package/dist/types-Bho4OA03.d.ts +982 -0
  59. package/dist/types-DP_3KwlD.d.cts +982 -0
  60. package/dist/withdraw.cjs +6 -6
  61. package/dist/withdraw.d.cts +11 -3
  62. package/dist/withdraw.d.ts +11 -3
  63. package/dist/withdraw.mjs +5 -5
  64. package/package.json +59 -6
  65. package/dist/chunk-IAGFDSNC.mjs +0 -11
  66. package/dist/chunk-L32UI7LA.cjs +0 -11
  67. package/dist/types-BO4iP6fG.d.cts +0 -612
  68. package/dist/types-oFblf65g.d.ts +0 -612
@@ -1,612 +0,0 @@
1
- import { TypedDataDefinition, Address, Hex, WalletClient, PublicClient, Chain } from 'viem';
2
- import { T as TargetChain } from './caip-D8aRWdEY.cjs';
3
-
4
- /**
5
- * Public config shape exposed on DepositModalProps. Each provider defaults to
6
- * off — clients must explicitly opt in.
7
- *
8
- * A key controls VISIBILITY only. A provider that is enabled but has no
9
- * implementation yet renders as a disabled "Coming soon" row; one that is not
10
- * enabled is not shown at all.
11
- */
12
- interface AssetMigrationsConfig {
13
- polymarket?: boolean;
14
- hyperliquid?: boolean;
15
- aave?: boolean;
16
- morpho?: boolean;
17
- }
18
-
19
- declare const RECOVER_TYPES: {
20
- readonly RecoverDeposit: readonly [{
21
- readonly name: "depositId";
22
- readonly type: "uint256";
23
- }, {
24
- readonly name: "destination";
25
- readonly type: "address";
26
- }];
27
- };
28
- /** What `signRecovery` is handed. */
29
- interface SignRecoveryPayload {
30
- /**
31
- * Sign this exactly. Pass it to `signTypedData` on the wallet that owns
32
- * `signer` — or to your account SDK, if `signer` is a smart account.
33
- */
34
- typedData: TypedDataDefinition<typeof RECOVER_TYPES, "RecoverDeposit">;
35
- /**
36
- * The address whose signature the processor will verify: the deposit's
37
- * `recipient`. Whatever you return must be a signature this address's own
38
- * verifier accepts.
39
- */
40
- signer: Address;
41
- /** Deposit being recovered, for your own logging or confirmation UI. */
42
- depositId: string;
43
- /** Where the funds will go. Covered by the signature. */
44
- destination: Address;
45
- }
46
- /**
47
- * Produces a signature the recipient's verifier accepts.
48
- *
49
- * - **embedded EOA** (Privy, Turnkey, Dynamic): `signTypedData` and return the raw
50
- * 65-byte result.
51
- * - **deployed smart account**: return a signature valid under its ERC-1271
52
- * `isValidSignature`. A raw owner signature is usually *not* enough — a Safe, for
53
- * instance, expects its own message wrapping — so go through your account SDK.
54
- * - **undeployed smart account**: wrap it per ERC-6492 so the processor can verify
55
- * counterfactually. `ox/erc6492`'s `SignatureErc6492.wrap` does this, and ships
56
- * with viem already.
57
- */
58
- type SignRecovery = (payload: SignRecoveryPayload) => Promise<Hex>;
59
- /** Structured code from the processor; drives copy and whether a retry helps. */
60
- type RecoveryErrorCode = "DEPOSIT_NOT_RECOVERABLE" | "RECOVERY_UNSUPPORTED" | "SIGNATURE_INVALID" | "VERIFICATION_UNAVAILABLE" | "REFUND_RECONCILIATION_REQUIRED" | "REFUND_FAILED";
61
-
62
- /**
63
- * Consumer-supplied RPC URL overrides, scoped to a single modal instance (see
64
- * {@link RpcUrlsProvider}). Threaded into every client the modal builds — EVM
65
- * public clients (`public-client.ts`), the wallet adapter's transports
66
- * (`reown.tsx`), and the Solana connection (`solana.ts`).
67
- *
68
- * Keyed by the same `number | "solana"` chain identifier the rest of the modal
69
- * uses (see `core/constants.ts`), so a single `rpcUrls` prop covers every
70
- * chain — EVM mainnets, Polygon (137, also feeds Polymarket reads), HyperEVM
71
- * (999), and Solana.
72
- */
73
- type ChainKey = number | "solana";
74
- type RpcUrlMap = Partial<Record<ChainKey, string>>;
75
-
76
- type Caip2ChainId = `eip155:${number}` | `solana:${string}`;
77
- type ChainId = number | "solana" | "hypercore" | Caip2ChainId;
78
- interface DepositModalTheme {
79
- mode?: "light" | "dark";
80
- radius?: "none" | "sm" | "md" | "lg" | "full";
81
- fontColor?: string;
82
- iconColor?: string;
83
- ctaColor?: string;
84
- ctaHoverColor?: string;
85
- borderColor?: string;
86
- backgroundColor?: string;
87
- }
88
- interface DepositModalUIConfig {
89
- showBackButton?: boolean;
90
- maxDepositUsd?: number;
91
- minDepositUsd?: number;
92
- /**
93
- * When true the network/protocol fee is sponsored — the Review / Processing /
94
- * Success / Failure screens render the fee line-through and surface a
95
- * tooltip on the info icon explaining the sponsorship.
96
- */
97
- feeSponsored?: boolean;
98
- /**
99
- * Custom tooltip copy for the fee info icon. Defaults to a generic
100
- * "Fees are sponsored" / "Fees apply" message based on `feeSponsored`.
101
- */
102
- feeTooltip?: string;
103
- }
104
- interface ConnectedEventData {
105
- address: Address;
106
- smartAccount: Address;
107
- }
108
- interface DepositSubmittedEventData {
109
- txHash: string;
110
- sourceChain: ChainId | "unknown";
111
- amount: string;
112
- }
113
- interface DepositCompleteEventData {
114
- txHash: string;
115
- destinationTxHash?: string;
116
- amount: string;
117
- sourceChain: ChainId | "unknown";
118
- sourceToken?: string;
119
- targetChain: TargetChain;
120
- targetToken: string;
121
- }
122
- interface DepositFailedEventData {
123
- txHash: string;
124
- error?: string;
125
- }
126
- interface WithdrawSubmittedEventData {
127
- txHash: Hex;
128
- sourceChain: number;
129
- amount: string;
130
- accountAddress: Address;
131
- }
132
- interface WithdrawCompleteEventData {
133
- txHash: Hex;
134
- destinationTxHash?: Hex;
135
- amount: string;
136
- sourceChain: number;
137
- sourceToken: Address;
138
- targetChain: number;
139
- targetToken: Address;
140
- }
141
- interface WithdrawFailedEventData {
142
- txHash: Hex;
143
- error?: string;
144
- }
145
- interface ErrorEventData {
146
- message: string;
147
- code?: string;
148
- /**
149
- * The underlying wallet/RPC error, verbatim. `message` is written for the
150
- * end user and drops the detail a bug report needs — log this instead. Never
151
- * render it: it is unsanitized and can carry RPC URLs.
152
- */
153
- cause?: string;
154
- }
155
- interface OutputTokenRule {
156
- match: {
157
- chain?: string;
158
- token?: string;
159
- symbol?: string;
160
- };
161
- outputToken: string;
162
- }
163
- /**
164
- * Which Swapped payment groups the fiat on-ramp offers. Keys are Swapped
165
- * `payment_group` values; omit the object to offer all of them.
166
- *
167
- * Deliberately booleans rather than a list of row descriptors: the label,
168
- * sublabel and icon belong to the modal, so subsetting cannot drift from — or
169
- * freeze a stale copy of — Swapped's own limits and naming.
170
- */
171
- interface FiatMethodsConfig {
172
- creditcard?: boolean;
173
- "bank-transfer"?: boolean;
174
- "apple-pay"?: boolean;
175
- }
176
- interface DepositModalProps {
177
- /**
178
- * A wallet the host app already has connected. Pass this to reuse the user's
179
- * existing session — the modal reads the address off `.account`, so it cannot
180
- * disagree with what your app thinks the user is. Also what lets the modal
181
- * skip its own connect step when the wallet is the only funding feature.
182
- *
183
- * Omit it and pass `reownAppId` instead to have the modal connect a wallet
184
- * itself.
185
- */
186
- walletClient?: WalletClient | null;
187
- /** Read client paired with `walletClient`. Defaults to the modal's own. */
188
- publicClient?: PublicClient | null;
189
- targetChain: Chain | TargetChain;
190
- targetToken: Address | string;
191
- isOpen: boolean;
192
- onClose: () => void;
193
- inline?: boolean;
194
- closeOnOverlayClick?: boolean;
195
- sourceChain?: Chain | number;
196
- sourceToken?: Address;
197
- /**
198
- * Pre-fills the deposit amount. Either a USD-denominated number string
199
- * (e.g. "25") or the case-insensitive sentinel `"max"`, which fills the
200
- * full available balance once it loads (same as the Max preset).
201
- */
202
- defaultAmount?: string;
203
- recipient: Address | string;
204
- /**
205
- * The user's current in-app balance, in USD, as the consuming app displays
206
- * it. When provided, the amount screen shows a "Balance after deposit" row
207
- * (`appBalanceUsd + amount`) so the user sees their post-deposit app
208
- * balance. The row is hidden when this is omitted.
209
- */
210
- appBalanceUsd?: number;
211
- outputTokenRules?: OutputTokenRule[];
212
- rejectUnmapped?: boolean;
213
- backendUrl: string;
214
- /**
215
- * Per-chain RPC URL overrides, keyed by EVM chain id plus the literal
216
- * `"solana"` key. Applied everywhere the modal reads chain state — EVM
217
- * public clients, the connected wallet's transports (avoiding the
218
- * rate-limited public defaults), Polygon/Polymarket reads, HyperEVM (999),
219
- * and the Solana connection. Chains left unset use their default RPC.
220
- */
221
- rpcUrls?: RpcUrlMap;
222
- forceRegister?: boolean;
223
- reownAppId?: string;
224
- /**
225
- * Enable importing balances from third-party dapps. Each dapp defaults to
226
- * off — clients must explicitly opt in. When a dapp is enabled and the
227
- * connected wallet has a balance there, a new row appears on the deposit
228
- * entry screen.
229
- */
230
- assetMigrations?: AssetMigrationsConfig;
231
- /**
232
- * Open the modal pre-routed into a dapp-import provider, skipping the
233
- * deposit-method home screen. Must name an enabled `assetMigrations` key
234
- * (e.g. "polymarket"); disabled/unknown values are a no-op. While the
235
- * provider's balances are checked the modal shows a loading skeleton;
236
- * if the flow turns out to be unreachable (no account, no balance, no
237
- * wallet) it falls back to the home screen.
238
- */
239
- initialAssetMigration?: keyof AssetMigrationsConfig;
240
- /** Show fiat on-ramp option(s) that embed Swapped's iframe. Default: false. */
241
- /**
242
- * Offer the connected wallet as a funding source. Default: true. Turn off to
243
- * present a wallet-free flow (QR / fiat / exchange only) even when a wallet
244
- * client or `reownAppId` is supplied.
245
- */
246
- enableWallet?: boolean;
247
- enableFiatOnramp?: boolean;
248
- /** Show the Transfer Crypto / QR row. Default: true. */
249
- enableQrTransfer?: boolean;
250
- /**
251
- * Restrict Cash to an exact subset of the standard payment groups. Providing
252
- * the map opts this modal instance out of regional personalization; omit it
253
- * to use backend-resolved methods with the built-in global fallback.
254
- * An empty or all-false map disables Cash.
255
- */
256
- fiatMethods?: FiatMethodsConfig;
257
- /**
258
- * Show a "Connect exchange" row that opens Swapped Connect — the user
259
- * picks their CEX (Coinbase, Binance, Kraken…) or wallet inside the iframe
260
- * and Swapped pulls the crypto on-chain to the smart account. Default: false.
261
- */
262
- enableExchangeConnect?: boolean;
263
- onRequestConnect?: () => void;
264
- theme?: DepositModalTheme;
265
- uiConfig?: DepositModalUIConfig;
266
- className?: string;
267
- onReady?: () => void;
268
- /** Discriminated stream of deposit lifecycle transitions. */
269
- onLifecycle?: (event: DepositLifecycleEvent) => void;
270
- onEvent?: (event: DepositAnalyticsEvent) => void;
271
- onError?: (data: ErrorEventData) => void;
272
- debug?: boolean;
273
- }
274
- /**
275
- * One transfer the host app must execute to fund a withdrawal.
276
- *
277
- * `to` is authoritative: it is the Rhinestone deposit account the processor
278
- * watches, except on a same-route withdrawal (source chain+token identical to
279
- * the target) where the modal skips the bridge and `to` is the end recipient.
280
- * Either way the app's job is identical — move `amount` of `token` to `to` on
281
- * `chainId` — so it must never substitute an address of its own.
282
- */
283
- interface WithdrawTransferRequest {
284
- /** Source chain to send from. */
285
- chainId: number;
286
- /** Source token; `NATIVE_TOKEN_ADDRESS` for the chain's native asset. */
287
- token: Address;
288
- /** Amount in the token's base units. */
289
- amount: bigint;
290
- /** Destination for this transfer. Send here. */
291
- to: Address;
292
- }
293
- interface WithdrawModalProps {
294
- /**
295
- * Account holding the funds being withdrawn. Used to read the withdrawable
296
- * balance and to keep the user from sending to themselves; the modal never
297
- * transacts from it — `onSendTransaction` does.
298
- */
299
- accountAddress: Address;
300
- sourceChain: Chain | number;
301
- sourceToken: Address;
302
- /**
303
- * Initial destination, not a constraint. The withdraw form lets the user pick
304
- * any supported chain/token/recipient, so these only seed the fields — pass
305
- * them to open on a particular destination, omit them to let the user choose.
306
- */
307
- targetChain?: Chain | number;
308
- targetToken?: Address;
309
- recipient?: Address;
310
- defaultAmount?: string;
311
- isOpen: boolean;
312
- onClose: () => void;
313
- inline?: boolean;
314
- closeOnOverlayClick?: boolean;
315
- backendUrl: string;
316
- /**
317
- * Per-chain RPC URL overrides, keyed by EVM chain id plus the literal
318
- * `"solana"` key. Applied to every chain read (EVM public clients and the
319
- * connected wallet's transports). Chains left unset use their default RPC.
320
- */
321
- rpcUrls?: RpcUrlMap;
322
- forceRegister?: boolean;
323
- /**
324
- * Executes the transfer that funds the withdrawal, using whatever account
325
- * model the host app has (EOA, smart account, in-app wallet, relayer).
326
- *
327
- * Must resolve with the **on-chain transaction hash** — not a userOp hash or
328
- * bundler id. Progress is tracked by looking the deposit up by that hash, so
329
- * anything else leaves the modal waiting on a withdrawal that already
330
- * succeeded. Reject to surface a failure in the modal.
331
- */
332
- onSendTransaction: (request: WithdrawTransferRequest) => Promise<{
333
- txHash: Hex;
334
- }>;
335
- theme?: DepositModalTheme;
336
- uiConfig?: DepositModalUIConfig;
337
- className?: string;
338
- onReady?: () => void;
339
- /** Discriminated stream of withdraw lifecycle transitions. */
340
- onLifecycle?: (event: WithdrawLifecycleEvent) => void;
341
- onEvent?: (event: WithdrawAnalyticsEvent) => void;
342
- onError?: (data: ErrorEventData) => void;
343
- debug?: boolean;
344
- }
345
- /**
346
- * Self-service recovery modal. Returns a failed or rejected deposit's
347
- * source-chain funds to an address the user names. The deposit is looked up by
348
- * transaction hash.
349
- *
350
- * The user's own wallet authorizes it: the deposit's `recipient` — the in-app
351
- * wallet the funds were headed to — signs an EIP-712 struct naming the deposit and
352
- * the destination, and the processor verifies that signature against the same
353
- * `recipient` before moving anything. Your app needs no backend and no shared
354
- * secret; the request goes from the browser through your `deposit-widget-proxy`,
355
- * which adds only the project API key.
356
- *
357
- * Note the signer is the recipient, not the deposit account — deposit accounts are
358
- * service-owned and cannot sign for themselves.
359
- */
360
- interface ClaimModalProps {
361
- /**
362
- * Signs the recovery authorization. Called with the exact typed data to sign and
363
- * the `signer` address whose signature the processor will verify — the deposit's
364
- * `recipient`.
365
- *
366
- * Return whatever that address's own verifier accepts:
367
- * - **embedded EOA** (Privy, Turnkey, Dynamic) — `signTypedData`, raw 65-byte
368
- * result.
369
- * - **deployed smart account** — a signature valid under its ERC-1271
370
- * `isValidSignature`. A raw owner signature is usually not enough; a Safe, for
371
- * one, expects its own message wrapping, so go through your account SDK.
372
- * - **undeployed smart account** — wrap per ERC-6492 so it can be verified
373
- * counterfactually. `SignatureErc6492.wrap` from `ox/erc6492` does this and
374
- * ships with viem already.
375
- *
376
- * Throwing (or returning nothing) is treated as the user declining, which is
377
- * retryable.
378
- *
379
- * If your users can't sign — a lost embedded wallet, or a recipient your app
380
- * controls rather than the user — use `createRefundHandler` from
381
- * `@rhinestone/deposit-modal/server` against your own backend instead, and drive
382
- * your own UI. That path authorizes on your say-so rather than a signature.
383
- */
384
- signRecovery: SignRecovery;
385
- isOpen: boolean;
386
- onClose: () => void;
387
- inline?: boolean;
388
- closeOnOverlayClick?: boolean;
389
- backendUrl: string;
390
- rpcUrls?: RpcUrlMap;
391
- /** Optional prefills for the lookup form and destination. */
392
- defaultTxHash?: string;
393
- /**
394
- * Prefills the refund destination. Left empty otherwise — the modal
395
- * deliberately does NOT default to the deposit's sender, because returning
396
- * funds to an exchange's hot wallet can lose them.
397
- *
398
- * Matches `refundDestination` on `RefundAuthorization` in `./server`, which
399
- * is the authoritative version: this one only seeds the field and the user can
400
- * edit it. Not related to the deposit's `recipient`.
401
- */
402
- defaultRefundDestination?: Address;
403
- theme?: DepositModalTheme;
404
- uiConfig?: DepositModalUIConfig;
405
- className?: string;
406
- onReady?: () => void;
407
- onLifecycle?: (event: ClaimLifecycleEvent) => void;
408
- onEvent?: (event: ClaimAnalyticsEvent) => void;
409
- onError?: (data: ErrorEventData) => void;
410
- debug?: boolean;
411
- }
412
- interface AssetOption {
413
- id: string;
414
- chainId: number;
415
- token: Address;
416
- symbol: string;
417
- name: string;
418
- decimals: number;
419
- balance?: string;
420
- balanceUsd?: number;
421
- }
422
- /**
423
- * Discriminated union covering every deposit flow state transition the
424
- * consumer can observe. Consumers handle additions in a single switch; the
425
- * modal can add new event variants without changing the prop surface.
426
- */
427
- type DepositLifecycleEvent = {
428
- type: "connected";
429
- address: Address;
430
- smartAccount: Address;
431
- } | {
432
- type: "submitted";
433
- txHash: string;
434
- sourceChain: ChainId | "unknown";
435
- /** Source-token base units (e.g. "1100000" for 1.10 USDC). */
436
- amount: string;
437
- /**
438
- * Decimals of the source token, for converting `amount` to a
439
- * human-readable value. Omitted when the token is not recognised
440
- * (e.g. a QR deposit of an unlisted token).
441
- */
442
- sourceDecimals?: number;
443
- /**
444
- * USD equivalent of the deposit as entered in the modal (token units
445
- * for unpriced non-stablecoins). Omitted for flows without an amount
446
- * input (QR transfer, fiat onramp, exchange connect).
447
- */
448
- amountUsd?: string;
449
- } | {
450
- type: "complete";
451
- txHash: string;
452
- destinationTxHash?: string;
453
- /** Source-token base units (e.g. "1100000" for 1.10 USDC). */
454
- amount: string;
455
- sourceChain: ChainId | "unknown";
456
- sourceToken?: string;
457
- /**
458
- * Decimals of the source token, for converting `amount` to a
459
- * human-readable value. Omitted when the token is not recognised
460
- * (e.g. a QR deposit of an unlisted token).
461
- */
462
- sourceDecimals?: number;
463
- /**
464
- * USD equivalent of the deposit as entered in the modal (token units
465
- * for unpriced non-stablecoins). Omitted for flows without an amount
466
- * input (QR transfer, fiat onramp, exchange connect).
467
- */
468
- amountUsd?: string;
469
- targetChain: TargetChain;
470
- targetToken: string;
471
- } | {
472
- type: "failed";
473
- txHash: string;
474
- error?: string;
475
- } | {
476
- type: "balance-changed";
477
- totalUsd: number;
478
- } | {
479
- type: "smart-account-changed";
480
- evm: Address | null;
481
- solana: string | null;
482
- };
483
- type WithdrawLifecycleEvent =
484
- /** The deposit account for the chosen target is registered and fundable. */
485
- {
486
- type: "connected";
487
- address: Address;
488
- smartAccount: Address;
489
- } | {
490
- type: "submitted";
491
- txHash: Hex;
492
- sourceChain: number;
493
- amount: string;
494
- accountAddress: Address;
495
- } | {
496
- type: "complete";
497
- txHash: Hex;
498
- destinationTxHash?: Hex;
499
- amount: string;
500
- sourceChain: number;
501
- sourceToken: Address;
502
- targetChain: number;
503
- targetToken: Address;
504
- } | {
505
- type: "failed";
506
- txHash: Hex;
507
- error?: string;
508
- };
509
- type ClaimLifecycleEvent = {
510
- type: "lookup";
511
- txHash: string;
512
- matches: number;
513
- } | {
514
- type: "refund_requested";
515
- account: Address;
516
- /** Where the funds were asked to go, on the source chain. */
517
- destination: Address;
518
- chain: number;
519
- } | {
520
- type: "complete";
521
- txHash: string;
522
- account: Address;
523
- destination: Address;
524
- chain: number;
525
- token: string;
526
- amount: string;
527
- } | {
528
- type: "failed";
529
- /** HTTP status from the refund endpoint; 0 if it was unreachable. */
530
- status?: number;
531
- error?: string;
532
- };
533
- /**
534
- * Telemetry events fired when screens open or CTAs are clicked.
535
- * Distinct from {@link DepositLifecycleEvent}, which tracks transaction state.
536
- */
537
- type DepositAnalyticsEvent = {
538
- type: "deposit_modal_fiat_methods_rendered";
539
- country: string | null;
540
- payment_methods: string[];
541
- source: "personalized" | "fallback" | "configured";
542
- } | {
543
- type: "deposit_modal_fiat_method_click";
544
- country: string | null;
545
- payment_method: string;
546
- source: "personalized" | "fallback" | "configured";
547
- } | {
548
- type: "deposit_modal_connected_wallet_select_source_open";
549
- total_balance_in_external_wallet: number | null;
550
- pred_balance: number | null;
551
- } | {
552
- type: "deposit_modal_connected_wallet_select_source_cta_click";
553
- total_balance_in_external_wallet: number | null;
554
- pred_balance: number | null;
555
- cta_name: "token_selected";
556
- token_name: string;
557
- token_balance: string;
558
- } | {
559
- type: "deposit_modal_transfer_crypto_open";
560
- default_chain: string;
561
- default_token: string;
562
- pred_balance: number | null;
563
- } | {
564
- type: "deposit_modal_transfer_crypto_cta_click";
565
- default_chain: string;
566
- default_token: string;
567
- pred_balance: number | null;
568
- cta_name: "copy";
569
- } | {
570
- type: "deposit_modal_connected_wallet_enter_value_open";
571
- send_token: string;
572
- receive_token: string;
573
- pred_balance: number | null;
574
- } | {
575
- type: "deposit_modal_connected_wallet_enter_value_cta_click";
576
- send_token: string;
577
- receive_token: string;
578
- pred_balance: number | null;
579
- cta_name: "continue" | "25%" | "50%" | "75%" | "Max";
580
- };
581
- type WithdrawAnalyticsEvent = {
582
- type: "withdraw_modal_select_amount_open";
583
- pred_balance: number | null;
584
- default_token: string;
585
- default_chain: string;
586
- } | {
587
- type: "withdraw_modal_select_amount_cta_click";
588
- pred_balance: number | null;
589
- selected_token: string;
590
- selected_chain: string;
591
- amount: string;
592
- cta_name: "withdraw";
593
- };
594
- type ClaimAnalyticsEvent = {
595
- type: "claim_modal_open";
596
- } | {
597
- type: "claim_modal_lookup";
598
- matches: number;
599
- } | {
600
- type: "claim_modal_refund_click";
601
- chain: string;
602
- } | {
603
- type: "claim_modal_complete";
604
- chain: string;
605
- } | {
606
- type: "claim_modal_failed";
607
- chain: string;
608
- status?: number;
609
- };
610
- type ModalAnalyticsEvent = DepositAnalyticsEvent | WithdrawAnalyticsEvent | ClaimAnalyticsEvent;
611
-
612
- export type { AssetMigrationsConfig as A, ChainId as C, DepositAnalyticsEvent as D, ErrorEventData as E, FiatMethodsConfig as F, ModalAnalyticsEvent as M, OutputTokenRule as O, RpcUrlMap as R, SignRecovery as S, WithdrawAnalyticsEvent as W, AssetOption as a, ClaimAnalyticsEvent as b, ClaimLifecycleEvent as c, ClaimModalProps as d, ConnectedEventData as e, DepositCompleteEventData as f, DepositFailedEventData as g, DepositLifecycleEvent as h, DepositModalProps as i, DepositModalTheme as j, DepositModalUIConfig as k, DepositSubmittedEventData as l, WithdrawCompleteEventData as m, WithdrawFailedEventData as n, WithdrawLifecycleEvent as o, WithdrawModalProps as p, WithdrawSubmittedEventData as q, WithdrawTransferRequest as r, RecoveryErrorCode as s, SignRecoveryPayload as t };