@rhinestone/deposit-modal 0.2.4 → 0.3.0-alpha.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 (43) hide show
  1. package/README.md +40 -211
  2. package/dist/{DepositModalReown-CY5MSQGK.mjs → DepositModalReown-GXY65HZP.mjs} +3 -3
  3. package/dist/{DepositModalReown-2UMPITRN.cjs → DepositModalReown-HVIEA6YA.cjs} +4 -4
  4. package/dist/QRCode-SMMYPUQC.cjs +58 -0
  5. package/dist/QRCode-YMQTKSSK.mjs +58 -0
  6. package/dist/{WithdrawModalReown-Z5BUZQ4Z.cjs → WithdrawModalReown-4M3PBY2T.cjs} +4 -4
  7. package/dist/{WithdrawModalReown-YSRO5ZTA.mjs → WithdrawModalReown-O6V6KRH6.mjs} +3 -3
  8. package/dist/{chunk-ARGMXV6E.cjs → chunk-7SYZG47X.cjs} +1723 -1881
  9. package/dist/{chunk-WHW3ZMOT.mjs → chunk-EEHUOFIW.mjs} +107 -90
  10. package/dist/{chunk-KJEHVIPZ.mjs → chunk-FKPTIHU7.mjs} +631 -423
  11. package/dist/{chunk-HFQV7EHS.mjs → chunk-U5QIFNG4.mjs} +1774 -1932
  12. package/dist/{chunk-WNFGZS56.mjs → chunk-UIHAYD7J.mjs} +1079 -784
  13. package/dist/{chunk-R2HP743T.cjs → chunk-XCAF6B3D.cjs} +51 -34
  14. package/dist/{chunk-NFXJEOE6.cjs → chunk-Y3RA3YGA.cjs} +1101 -806
  15. package/dist/{chunk-QUOP5C6V.cjs → chunk-Z2SIC2TH.cjs} +686 -478
  16. package/dist/constants.cjs +2 -2
  17. package/dist/constants.d.cts +3 -2
  18. package/dist/constants.d.ts +3 -2
  19. package/dist/constants.mjs +1 -1
  20. package/dist/deposit.cjs +4 -4
  21. package/dist/deposit.d.cts +2 -3
  22. package/dist/deposit.d.ts +2 -3
  23. package/dist/deposit.mjs +3 -3
  24. package/dist/index.cjs +5 -5
  25. package/dist/index.d.cts +5 -3
  26. package/dist/index.d.ts +5 -3
  27. package/dist/index.mjs +4 -4
  28. package/dist/styles.css +1068 -752
  29. package/dist/{types-DGQzvl6v.d.ts → types-DRou84ZM.d.cts} +147 -33
  30. package/dist/{types-DJ1fzNC7.d.cts → types-DRou84ZM.d.ts} +147 -33
  31. package/dist/withdraw.cjs +4 -4
  32. package/dist/withdraw.d.cts +2 -3
  33. package/dist/withdraw.d.ts +2 -3
  34. package/dist/withdraw.mjs +3 -3
  35. package/package.json +13 -12
  36. package/dist/reown.cjs +0 -16
  37. package/dist/reown.d.cts +0 -10
  38. package/dist/reown.d.ts +0 -10
  39. package/dist/reown.mjs +0 -16
  40. package/dist/safe.cjs +0 -1
  41. package/dist/safe.d.cts +0 -62
  42. package/dist/safe.d.ts +0 -62
  43. package/dist/safe.mjs +0 -0
@@ -1,5 +1,63 @@
1
- import { Address, WalletClient, PublicClient, Chain, Hex } from 'viem';
2
- import { SafeTransactionRequest } from './safe.js';
1
+ import { Address, Hex, WalletClient, PublicClient, Chain } from 'viem';
2
+
3
+ interface SafeTransactionRequest {
4
+ chainId: number;
5
+ safeAddress: Address;
6
+ safeTxHash: Hex;
7
+ typedData: {
8
+ domain: {
9
+ chainId: number;
10
+ verifyingContract: Address;
11
+ };
12
+ types: typeof SAFE_TX_TYPES;
13
+ primaryType: "SafeTx";
14
+ message: {
15
+ to: Address;
16
+ value: bigint;
17
+ data: Hex;
18
+ operation: number;
19
+ safeTxGas: bigint;
20
+ baseGas: bigint;
21
+ gasPrice: bigint;
22
+ gasToken: Address;
23
+ refundReceiver: Address;
24
+ nonce: bigint;
25
+ };
26
+ };
27
+ }
28
+ declare const SAFE_TX_TYPES: {
29
+ readonly SafeTx: readonly [{
30
+ readonly name: "to";
31
+ readonly type: "address";
32
+ }, {
33
+ readonly name: "value";
34
+ readonly type: "uint256";
35
+ }, {
36
+ readonly name: "data";
37
+ readonly type: "bytes";
38
+ }, {
39
+ readonly name: "operation";
40
+ readonly type: "uint8";
41
+ }, {
42
+ readonly name: "safeTxGas";
43
+ readonly type: "uint256";
44
+ }, {
45
+ readonly name: "baseGas";
46
+ readonly type: "uint256";
47
+ }, {
48
+ readonly name: "gasPrice";
49
+ readonly type: "uint256";
50
+ }, {
51
+ readonly name: "gasToken";
52
+ readonly type: "address";
53
+ }, {
54
+ readonly name: "refundReceiver";
55
+ readonly type: "address";
56
+ }, {
57
+ readonly name: "nonce";
58
+ readonly type: "uint256";
59
+ }];
60
+ };
3
61
 
4
62
  type Caip2ChainId = `eip155:${number}` | `solana:${string}`;
5
63
  type ChainId = number | "solana" | Caip2ChainId;
@@ -14,20 +72,21 @@ interface DepositModalTheme {
14
72
  backgroundColor?: string;
15
73
  }
16
74
  interface DepositModalUIConfig {
17
- showLogo?: boolean;
18
- showStepper?: boolean;
19
75
  showBackButton?: boolean;
20
76
  showHistoryButton?: boolean;
21
- balance?: {
22
- title: string;
23
- amount?: string;
24
- };
25
77
  maxDepositUsd?: number;
26
78
  minDepositUsd?: number;
27
- }
28
- interface DepositModalBranding {
29
- logoUrl?: string;
30
- title?: string;
79
+ /**
80
+ * When true the network/protocol fee is sponsored — the Review / Processing /
81
+ * Success / Failure screens render the fee line-through and surface a
82
+ * tooltip on the info icon explaining the sponsorship.
83
+ */
84
+ feeSponsored?: boolean;
85
+ /**
86
+ * Custom tooltip copy for the fee info icon. Defaults to a generic
87
+ * "Fees are sponsored" / "Fees apply" message based on `feeSponsored`.
88
+ */
89
+ feeTooltip?: string;
31
90
  }
32
91
  interface ConnectedEventData {
33
92
  address: Address;
@@ -35,15 +94,15 @@ interface ConnectedEventData {
35
94
  }
36
95
  interface DepositSubmittedEventData {
37
96
  txHash: string;
38
- sourceChain: ChainId;
97
+ sourceChain: ChainId | "unknown";
39
98
  amount: string;
40
99
  }
41
100
  interface DepositCompleteEventData {
42
101
  txHash: string;
43
102
  destinationTxHash?: string;
44
103
  amount: string;
45
- sourceChain: ChainId;
46
- sourceToken: string;
104
+ sourceChain: ChainId | "unknown";
105
+ sourceToken?: string;
47
106
  targetChain: number;
48
107
  targetToken: string;
49
108
  }
@@ -113,18 +172,14 @@ interface DepositModalProps {
113
172
  reownAppId?: string;
114
173
  enableSolana?: boolean;
115
174
  onRequestConnect?: () => void;
116
- connectButtonLabel?: string;
117
175
  theme?: DepositModalTheme;
118
- branding?: DepositModalBranding;
119
176
  uiConfig?: DepositModalUIConfig;
120
177
  allowedRoutes?: RouteConfig;
121
178
  className?: string;
122
179
  onReady?: () => void;
123
- onConnected?: (data: ConnectedEventData) => void;
124
- onDepositSubmitted?: (data: DepositSubmittedEventData) => void;
125
- onDepositComplete?: (data: DepositCompleteEventData) => void;
126
- onDepositFailed?: (data: DepositFailedEventData) => void;
127
- onEvent?: (event: DepositEvent) => void;
180
+ /** Discriminated stream of deposit lifecycle transitions. */
181
+ onLifecycle?: (event: DepositLifecycleEvent) => void;
182
+ onEvent?: (event: DepositAnalyticsEvent) => void;
128
183
  onError?: (data: ErrorEventData) => void;
129
184
  debug?: boolean;
130
185
  }
@@ -155,17 +210,13 @@ interface WithdrawModalProps {
155
210
  signature: Hex;
156
211
  }>;
157
212
  onRequestConnect?: () => void;
158
- connectButtonLabel?: string;
159
213
  theme?: DepositModalTheme;
160
- branding?: DepositModalBranding;
161
214
  uiConfig?: DepositModalUIConfig;
162
215
  className?: string;
163
216
  onReady?: () => void;
164
- onConnected?: (data: ConnectedEventData) => void;
165
- onWithdrawSubmitted?: (data: WithdrawSubmittedEventData) => void;
166
- onWithdrawComplete?: (data: WithdrawCompleteEventData) => void;
167
- onWithdrawFailed?: (data: WithdrawFailedEventData) => void;
168
- onEvent?: (event: WithdrawEvent) => void;
217
+ /** Discriminated stream of withdraw lifecycle transitions. */
218
+ onLifecycle?: (event: WithdrawLifecycleEvent) => void;
219
+ onEvent?: (event: WithdrawAnalyticsEvent) => void;
169
220
  onError?: (data: ErrorEventData) => void;
170
221
  debug?: boolean;
171
222
  }
@@ -185,7 +236,70 @@ interface OrderBookSwapAction {
185
236
  outputToken: Address;
186
237
  }
187
238
  type PostBridgeAction = OrderBookSwapAction;
188
- type DepositEvent = {
239
+ /**
240
+ * Discriminated union covering every deposit flow state transition the
241
+ * consumer can observe. Consumers handle additions in a single switch; the
242
+ * modal can add new event variants without changing the prop surface.
243
+ */
244
+ type DepositLifecycleEvent = {
245
+ type: "connected";
246
+ address: Address;
247
+ smartAccount: Address;
248
+ } | {
249
+ type: "submitted";
250
+ txHash: string;
251
+ sourceChain: ChainId | "unknown";
252
+ amount: string;
253
+ } | {
254
+ type: "complete";
255
+ txHash: string;
256
+ destinationTxHash?: string;
257
+ amount: string;
258
+ sourceChain: ChainId | "unknown";
259
+ sourceToken?: string;
260
+ targetChain: number;
261
+ targetToken: string;
262
+ } | {
263
+ type: "failed";
264
+ txHash: string;
265
+ error?: string;
266
+ } | {
267
+ type: "balance-changed";
268
+ totalUsd: number;
269
+ } | {
270
+ type: "smart-account-changed";
271
+ evm: Address | null;
272
+ solana: string | null;
273
+ };
274
+ type WithdrawLifecycleEvent = {
275
+ type: "connected";
276
+ address: Address;
277
+ smartAccount: Address;
278
+ } | {
279
+ type: "submitted";
280
+ txHash: Hex;
281
+ sourceChain: number;
282
+ amount: string;
283
+ safeAddress: Address;
284
+ } | {
285
+ type: "complete";
286
+ txHash: Hex;
287
+ destinationTxHash?: Hex;
288
+ amount: string;
289
+ sourceChain: number;
290
+ sourceToken: Address;
291
+ targetChain: number;
292
+ targetToken: Address;
293
+ } | {
294
+ type: "failed";
295
+ txHash: Hex;
296
+ error?: string;
297
+ };
298
+ /**
299
+ * Telemetry events fired when screens open or CTAs are clicked.
300
+ * Distinct from {@link DepositLifecycleEvent}, which tracks transaction state.
301
+ */
302
+ type DepositAnalyticsEvent = {
189
303
  type: "deposit_modal_connected_wallet_select_source_open";
190
304
  total_balance_in_external_wallet: number | null;
191
305
  pred_balance: number | null;
@@ -219,7 +333,7 @@ type DepositEvent = {
219
333
  pred_balance: number | null;
220
334
  cta_name: "continue" | "25%" | "50%" | "75%" | "Max";
221
335
  };
222
- type WithdrawEvent = {
336
+ type WithdrawAnalyticsEvent = {
223
337
  type: "withdraw_modal_select_amount_open";
224
338
  pred_balance: number | null;
225
339
  default_token: string;
@@ -232,6 +346,6 @@ type WithdrawEvent = {
232
346
  amount: string;
233
347
  cta_name: "withdraw";
234
348
  };
235
- type ModalEvent = DepositEvent | WithdrawEvent;
349
+ type ModalAnalyticsEvent = DepositAnalyticsEvent | WithdrawAnalyticsEvent;
236
350
 
237
- export type { AssetOption as A, ChainId as C, DepositCompleteEventData as D, ErrorEventData as E, ModalEvent as M, OrderBookSwapAction as O, PostBridgeAction as P, RouteConfig as R, WithdrawCompleteEventData as W, ConnectedEventData as a, DepositEvent as b, DepositFailedEventData as c, DepositModalBranding as d, DepositModalProps as e, DepositModalTheme as f, DepositModalUIConfig as g, DepositSubmittedEventData as h, OutputTokenRule as i, WithdrawEvent as j, WithdrawFailedEventData as k, WithdrawModalProps as l, WithdrawSubmittedEventData as m };
351
+ export type { AssetOption as A, ChainId as C, DepositAnalyticsEvent as D, ErrorEventData as E, ModalAnalyticsEvent as M, OrderBookSwapAction as O, PostBridgeAction as P, RouteConfig as R, SafeTransactionRequest as S, WithdrawAnalyticsEvent as W, ConnectedEventData as a, DepositCompleteEventData as b, DepositFailedEventData as c, DepositLifecycleEvent as d, DepositModalProps as e, DepositModalTheme as f, DepositModalUIConfig as g, DepositSubmittedEventData as h, OutputTokenRule as i, WithdrawCompleteEventData as j, WithdrawFailedEventData as k, WithdrawLifecycleEvent as l, WithdrawModalProps as m, WithdrawSubmittedEventData as n };
@@ -1,5 +1,63 @@
1
- import { Address, WalletClient, PublicClient, Chain, Hex } from 'viem';
2
- import { SafeTransactionRequest } from './safe.cjs';
1
+ import { Address, Hex, WalletClient, PublicClient, Chain } from 'viem';
2
+
3
+ interface SafeTransactionRequest {
4
+ chainId: number;
5
+ safeAddress: Address;
6
+ safeTxHash: Hex;
7
+ typedData: {
8
+ domain: {
9
+ chainId: number;
10
+ verifyingContract: Address;
11
+ };
12
+ types: typeof SAFE_TX_TYPES;
13
+ primaryType: "SafeTx";
14
+ message: {
15
+ to: Address;
16
+ value: bigint;
17
+ data: Hex;
18
+ operation: number;
19
+ safeTxGas: bigint;
20
+ baseGas: bigint;
21
+ gasPrice: bigint;
22
+ gasToken: Address;
23
+ refundReceiver: Address;
24
+ nonce: bigint;
25
+ };
26
+ };
27
+ }
28
+ declare const SAFE_TX_TYPES: {
29
+ readonly SafeTx: readonly [{
30
+ readonly name: "to";
31
+ readonly type: "address";
32
+ }, {
33
+ readonly name: "value";
34
+ readonly type: "uint256";
35
+ }, {
36
+ readonly name: "data";
37
+ readonly type: "bytes";
38
+ }, {
39
+ readonly name: "operation";
40
+ readonly type: "uint8";
41
+ }, {
42
+ readonly name: "safeTxGas";
43
+ readonly type: "uint256";
44
+ }, {
45
+ readonly name: "baseGas";
46
+ readonly type: "uint256";
47
+ }, {
48
+ readonly name: "gasPrice";
49
+ readonly type: "uint256";
50
+ }, {
51
+ readonly name: "gasToken";
52
+ readonly type: "address";
53
+ }, {
54
+ readonly name: "refundReceiver";
55
+ readonly type: "address";
56
+ }, {
57
+ readonly name: "nonce";
58
+ readonly type: "uint256";
59
+ }];
60
+ };
3
61
 
4
62
  type Caip2ChainId = `eip155:${number}` | `solana:${string}`;
5
63
  type ChainId = number | "solana" | Caip2ChainId;
@@ -14,20 +72,21 @@ interface DepositModalTheme {
14
72
  backgroundColor?: string;
15
73
  }
16
74
  interface DepositModalUIConfig {
17
- showLogo?: boolean;
18
- showStepper?: boolean;
19
75
  showBackButton?: boolean;
20
76
  showHistoryButton?: boolean;
21
- balance?: {
22
- title: string;
23
- amount?: string;
24
- };
25
77
  maxDepositUsd?: number;
26
78
  minDepositUsd?: number;
27
- }
28
- interface DepositModalBranding {
29
- logoUrl?: string;
30
- title?: string;
79
+ /**
80
+ * When true the network/protocol fee is sponsored — the Review / Processing /
81
+ * Success / Failure screens render the fee line-through and surface a
82
+ * tooltip on the info icon explaining the sponsorship.
83
+ */
84
+ feeSponsored?: boolean;
85
+ /**
86
+ * Custom tooltip copy for the fee info icon. Defaults to a generic
87
+ * "Fees are sponsored" / "Fees apply" message based on `feeSponsored`.
88
+ */
89
+ feeTooltip?: string;
31
90
  }
32
91
  interface ConnectedEventData {
33
92
  address: Address;
@@ -35,15 +94,15 @@ interface ConnectedEventData {
35
94
  }
36
95
  interface DepositSubmittedEventData {
37
96
  txHash: string;
38
- sourceChain: ChainId;
97
+ sourceChain: ChainId | "unknown";
39
98
  amount: string;
40
99
  }
41
100
  interface DepositCompleteEventData {
42
101
  txHash: string;
43
102
  destinationTxHash?: string;
44
103
  amount: string;
45
- sourceChain: ChainId;
46
- sourceToken: string;
104
+ sourceChain: ChainId | "unknown";
105
+ sourceToken?: string;
47
106
  targetChain: number;
48
107
  targetToken: string;
49
108
  }
@@ -113,18 +172,14 @@ interface DepositModalProps {
113
172
  reownAppId?: string;
114
173
  enableSolana?: boolean;
115
174
  onRequestConnect?: () => void;
116
- connectButtonLabel?: string;
117
175
  theme?: DepositModalTheme;
118
- branding?: DepositModalBranding;
119
176
  uiConfig?: DepositModalUIConfig;
120
177
  allowedRoutes?: RouteConfig;
121
178
  className?: string;
122
179
  onReady?: () => void;
123
- onConnected?: (data: ConnectedEventData) => void;
124
- onDepositSubmitted?: (data: DepositSubmittedEventData) => void;
125
- onDepositComplete?: (data: DepositCompleteEventData) => void;
126
- onDepositFailed?: (data: DepositFailedEventData) => void;
127
- onEvent?: (event: DepositEvent) => void;
180
+ /** Discriminated stream of deposit lifecycle transitions. */
181
+ onLifecycle?: (event: DepositLifecycleEvent) => void;
182
+ onEvent?: (event: DepositAnalyticsEvent) => void;
128
183
  onError?: (data: ErrorEventData) => void;
129
184
  debug?: boolean;
130
185
  }
@@ -155,17 +210,13 @@ interface WithdrawModalProps {
155
210
  signature: Hex;
156
211
  }>;
157
212
  onRequestConnect?: () => void;
158
- connectButtonLabel?: string;
159
213
  theme?: DepositModalTheme;
160
- branding?: DepositModalBranding;
161
214
  uiConfig?: DepositModalUIConfig;
162
215
  className?: string;
163
216
  onReady?: () => void;
164
- onConnected?: (data: ConnectedEventData) => void;
165
- onWithdrawSubmitted?: (data: WithdrawSubmittedEventData) => void;
166
- onWithdrawComplete?: (data: WithdrawCompleteEventData) => void;
167
- onWithdrawFailed?: (data: WithdrawFailedEventData) => void;
168
- onEvent?: (event: WithdrawEvent) => void;
217
+ /** Discriminated stream of withdraw lifecycle transitions. */
218
+ onLifecycle?: (event: WithdrawLifecycleEvent) => void;
219
+ onEvent?: (event: WithdrawAnalyticsEvent) => void;
169
220
  onError?: (data: ErrorEventData) => void;
170
221
  debug?: boolean;
171
222
  }
@@ -185,7 +236,70 @@ interface OrderBookSwapAction {
185
236
  outputToken: Address;
186
237
  }
187
238
  type PostBridgeAction = OrderBookSwapAction;
188
- type DepositEvent = {
239
+ /**
240
+ * Discriminated union covering every deposit flow state transition the
241
+ * consumer can observe. Consumers handle additions in a single switch; the
242
+ * modal can add new event variants without changing the prop surface.
243
+ */
244
+ type DepositLifecycleEvent = {
245
+ type: "connected";
246
+ address: Address;
247
+ smartAccount: Address;
248
+ } | {
249
+ type: "submitted";
250
+ txHash: string;
251
+ sourceChain: ChainId | "unknown";
252
+ amount: string;
253
+ } | {
254
+ type: "complete";
255
+ txHash: string;
256
+ destinationTxHash?: string;
257
+ amount: string;
258
+ sourceChain: ChainId | "unknown";
259
+ sourceToken?: string;
260
+ targetChain: number;
261
+ targetToken: string;
262
+ } | {
263
+ type: "failed";
264
+ txHash: string;
265
+ error?: string;
266
+ } | {
267
+ type: "balance-changed";
268
+ totalUsd: number;
269
+ } | {
270
+ type: "smart-account-changed";
271
+ evm: Address | null;
272
+ solana: string | null;
273
+ };
274
+ type WithdrawLifecycleEvent = {
275
+ type: "connected";
276
+ address: Address;
277
+ smartAccount: Address;
278
+ } | {
279
+ type: "submitted";
280
+ txHash: Hex;
281
+ sourceChain: number;
282
+ amount: string;
283
+ safeAddress: Address;
284
+ } | {
285
+ type: "complete";
286
+ txHash: Hex;
287
+ destinationTxHash?: Hex;
288
+ amount: string;
289
+ sourceChain: number;
290
+ sourceToken: Address;
291
+ targetChain: number;
292
+ targetToken: Address;
293
+ } | {
294
+ type: "failed";
295
+ txHash: Hex;
296
+ error?: string;
297
+ };
298
+ /**
299
+ * Telemetry events fired when screens open or CTAs are clicked.
300
+ * Distinct from {@link DepositLifecycleEvent}, which tracks transaction state.
301
+ */
302
+ type DepositAnalyticsEvent = {
189
303
  type: "deposit_modal_connected_wallet_select_source_open";
190
304
  total_balance_in_external_wallet: number | null;
191
305
  pred_balance: number | null;
@@ -219,7 +333,7 @@ type DepositEvent = {
219
333
  pred_balance: number | null;
220
334
  cta_name: "continue" | "25%" | "50%" | "75%" | "Max";
221
335
  };
222
- type WithdrawEvent = {
336
+ type WithdrawAnalyticsEvent = {
223
337
  type: "withdraw_modal_select_amount_open";
224
338
  pred_balance: number | null;
225
339
  default_token: string;
@@ -232,6 +346,6 @@ type WithdrawEvent = {
232
346
  amount: string;
233
347
  cta_name: "withdraw";
234
348
  };
235
- type ModalEvent = DepositEvent | WithdrawEvent;
349
+ type ModalAnalyticsEvent = DepositAnalyticsEvent | WithdrawAnalyticsEvent;
236
350
 
237
- export type { AssetOption as A, ChainId as C, DepositCompleteEventData as D, ErrorEventData as E, ModalEvent as M, OrderBookSwapAction as O, PostBridgeAction as P, RouteConfig as R, WithdrawCompleteEventData as W, ConnectedEventData as a, DepositEvent as b, DepositFailedEventData as c, DepositModalBranding as d, DepositModalProps as e, DepositModalTheme as f, DepositModalUIConfig as g, DepositSubmittedEventData as h, OutputTokenRule as i, WithdrawEvent as j, WithdrawFailedEventData as k, WithdrawModalProps as l, WithdrawSubmittedEventData as m };
351
+ export type { AssetOption as A, ChainId as C, DepositAnalyticsEvent as D, ErrorEventData as E, ModalAnalyticsEvent as M, OrderBookSwapAction as O, PostBridgeAction as P, RouteConfig as R, SafeTransactionRequest as S, WithdrawAnalyticsEvent as W, ConnectedEventData as a, DepositCompleteEventData as b, DepositFailedEventData as c, DepositLifecycleEvent as d, DepositModalProps as e, DepositModalTheme as f, DepositModalUIConfig as g, DepositSubmittedEventData as h, OutputTokenRule as i, WithdrawCompleteEventData as j, WithdrawFailedEventData as k, WithdrawLifecycleEvent as l, WithdrawModalProps as m, WithdrawSubmittedEventData as n };
package/dist/withdraw.cjs CHANGED
@@ -1,8 +1,8 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkQUOP5C6Vcjs = require('./chunk-QUOP5C6V.cjs');
4
- require('./chunk-NFXJEOE6.cjs');
5
- require('./chunk-R2HP743T.cjs');
3
+ var _chunkZ2SIC2THcjs = require('./chunk-Z2SIC2TH.cjs');
4
+ require('./chunk-Y3RA3YGA.cjs');
5
+ require('./chunk-XCAF6B3D.cjs');
6
6
 
7
7
 
8
- exports.WithdrawModal = _chunkQUOP5C6Vcjs.WithdrawModal;
8
+ exports.WithdrawModal = _chunkZ2SIC2THcjs.WithdrawModal;
@@ -1,7 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { l as WithdrawModalProps } from './types-DJ1fzNC7.cjs';
3
- export { A as AssetOption, a as ConnectedEventData, E as ErrorEventData, W as WithdrawCompleteEventData, k as WithdrawFailedEventData, m as WithdrawSubmittedEventData } from './types-DJ1fzNC7.cjs';
4
- export { SafeTransactionRequest } from './safe.cjs';
2
+ import { m as WithdrawModalProps } from './types-DRou84ZM.cjs';
3
+ export { A as AssetOption, a as ConnectedEventData, E as ErrorEventData, S as SafeTransactionRequest, j as WithdrawCompleteEventData, k as WithdrawFailedEventData, n as WithdrawSubmittedEventData } from './types-DRou84ZM.cjs';
5
4
  import 'viem';
6
5
 
7
6
  declare function WithdrawModal(props: WithdrawModalProps): react_jsx_runtime.JSX.Element;
@@ -1,7 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { l as WithdrawModalProps } from './types-DGQzvl6v.js';
3
- export { A as AssetOption, a as ConnectedEventData, E as ErrorEventData, W as WithdrawCompleteEventData, k as WithdrawFailedEventData, m as WithdrawSubmittedEventData } from './types-DGQzvl6v.js';
4
- export { SafeTransactionRequest } from './safe.js';
2
+ import { m as WithdrawModalProps } from './types-DRou84ZM.js';
3
+ export { A as AssetOption, a as ConnectedEventData, E as ErrorEventData, S as SafeTransactionRequest, j as WithdrawCompleteEventData, k as WithdrawFailedEventData, n as WithdrawSubmittedEventData } from './types-DRou84ZM.js';
5
4
  import 'viem';
6
5
 
7
6
  declare function WithdrawModal(props: WithdrawModalProps): react_jsx_runtime.JSX.Element;
package/dist/withdraw.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  WithdrawModal
3
- } from "./chunk-KJEHVIPZ.mjs";
4
- import "./chunk-WNFGZS56.mjs";
5
- import "./chunk-WHW3ZMOT.mjs";
3
+ } from "./chunk-FKPTIHU7.mjs";
4
+ import "./chunk-UIHAYD7J.mjs";
5
+ import "./chunk-EEHUOFIW.mjs";
6
6
  export {
7
7
  WithdrawModal
8
8
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rhinestone/deposit-modal",
3
- "version": "0.2.4",
3
+ "version": "0.3.0-alpha.0",
4
4
  "description": "React modal component for Rhinestone cross-chain deposits",
5
5
  "author": "Rhinestone <dev@rhinestone.wtf>",
6
6
  "bugs": {
@@ -26,16 +26,6 @@
26
26
  "import": "./dist/withdraw.mjs",
27
27
  "require": "./dist/withdraw.cjs"
28
28
  },
29
- "./reown": {
30
- "types": "./dist/reown.d.ts",
31
- "import": "./dist/reown.mjs",
32
- "require": "./dist/reown.cjs"
33
- },
34
- "./safe": {
35
- "types": "./dist/safe.d.ts",
36
- "import": "./dist/safe.mjs",
37
- "require": "./dist/safe.cjs"
38
- },
39
29
  "./constants": {
40
30
  "types": "./dist/constants.d.ts",
41
31
  "import": "./dist/constants.mjs",
@@ -58,6 +48,9 @@
58
48
  "build": "tsup && bun run scripts/postbuild.ts",
59
49
  "clean": "rm -rf dist",
60
50
  "typecheck": "tsc --noEmit",
51
+ "test": "vitest run",
52
+ "test:watch": "vitest",
53
+ "test:coverage": "vitest run --coverage",
61
54
  "prepublishOnly": "bun run clean && bun run build && bun run typecheck"
62
55
  },
63
56
  "peerDependencies": {
@@ -84,7 +77,9 @@
84
77
  }
85
78
  },
86
79
  "dependencies": {
87
- "react-qrcode-logo": "^4.0.0"
80
+ "lucide-react": "^1.14.0",
81
+ "react-qrcode-logo": "^4.0.0",
82
+ "zustand": "^5"
88
83
  },
89
84
  "devDependencies": {
90
85
  "@reown/appkit": "1.8.19",
@@ -94,15 +89,21 @@
94
89
  "@solana/spl-token": "^0.4.14",
95
90
  "@solana/web3.js": "^1.98.4",
96
91
  "@tanstack/react-query": "^5.0.0",
92
+ "@testing-library/jest-dom": "^6",
93
+ "@testing-library/react": "^16",
94
+ "@testing-library/user-event": "^14",
97
95
  "@types/react": "^19.0.0",
98
96
  "@types/react-dom": "^19.0.0",
97
+ "@vitest/coverage-v8": "^4.0.10",
99
98
  "bun-types": "^1.3.8",
99
+ "jsdom": "^25",
100
100
  "react": "^19.0.0",
101
101
  "react-dom": "^19.0.0",
102
102
  "size-limit": "^12.0.0",
103
103
  "tsup": "^8.0.0",
104
104
  "typescript": "^5.5.0",
105
105
  "viem": "^2.47.12",
106
+ "vitest": "^4.0.10",
106
107
  "wagmi": "^3.4.2"
107
108
  },
108
109
  "size-limit": [
package/dist/reown.cjs DELETED
@@ -1,16 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
-
3
- var _chunkARGMXV6Ecjs = require('./chunk-ARGMXV6E.cjs');
4
-
5
-
6
- var _chunkQUOP5C6Vcjs = require('./chunk-QUOP5C6V.cjs');
7
-
8
-
9
- var _chunkYQFH2WSWcjs = require('./chunk-YQFH2WSW.cjs');
10
- require('./chunk-NFXJEOE6.cjs');
11
- require('./chunk-R2HP743T.cjs');
12
-
13
-
14
-
15
-
16
- exports.DepositModal = _chunkARGMXV6Ecjs.DepositModal; exports.WithdrawModal = _chunkQUOP5C6Vcjs.WithdrawModal; exports.disconnectWallet = _chunkYQFH2WSWcjs.disconnectWallet;
package/dist/reown.d.cts DELETED
@@ -1,10 +0,0 @@
1
- export { DepositModal } from './deposit.cjs';
2
- export { WithdrawModal } from './withdraw.cjs';
3
- export { A as AssetOption, a as ConnectedEventData, D as DepositCompleteEventData, c as DepositFailedEventData, d as DepositModalBranding, e as DepositModalProps, f as DepositModalTheme, g as DepositModalUIConfig, h as DepositSubmittedEventData, E as ErrorEventData, W as WithdrawCompleteEventData, k as WithdrawFailedEventData, l as WithdrawModalProps, m as WithdrawSubmittedEventData } from './types-DJ1fzNC7.cjs';
4
- export { SafeTransactionRequest } from './safe.cjs';
5
- import 'react/jsx-runtime';
6
- import 'viem';
7
-
8
- declare function disconnectWallet(): Promise<void>;
9
-
10
- export { disconnectWallet };
package/dist/reown.d.ts DELETED
@@ -1,10 +0,0 @@
1
- export { DepositModal } from './deposit.js';
2
- export { WithdrawModal } from './withdraw.js';
3
- export { A as AssetOption, a as ConnectedEventData, D as DepositCompleteEventData, c as DepositFailedEventData, d as DepositModalBranding, e as DepositModalProps, f as DepositModalTheme, g as DepositModalUIConfig, h as DepositSubmittedEventData, E as ErrorEventData, W as WithdrawCompleteEventData, k as WithdrawFailedEventData, l as WithdrawModalProps, m as WithdrawSubmittedEventData } from './types-DGQzvl6v.js';
4
- export { SafeTransactionRequest } from './safe.js';
5
- import 'react/jsx-runtime';
6
- import 'viem';
7
-
8
- declare function disconnectWallet(): Promise<void>;
9
-
10
- export { disconnectWallet };
package/dist/reown.mjs DELETED
@@ -1,16 +0,0 @@
1
- import {
2
- DepositModal
3
- } from "./chunk-HFQV7EHS.mjs";
4
- import {
5
- WithdrawModal
6
- } from "./chunk-KJEHVIPZ.mjs";
7
- import {
8
- disconnectWallet
9
- } from "./chunk-5YXAQB6A.mjs";
10
- import "./chunk-WNFGZS56.mjs";
11
- import "./chunk-WHW3ZMOT.mjs";
12
- export {
13
- DepositModal,
14
- WithdrawModal,
15
- disconnectWallet
16
- };
package/dist/safe.cjs DELETED
@@ -1 +0,0 @@
1
- "use strict";