@rhinestone/deposit-modal 0.3.0-alpha.8 → 0.3.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 (39) hide show
  1. package/README.md +76 -0
  2. package/dist/{DepositModalReown-TYHATVOM.mjs → DepositModalReown-6SUEC5IU.mjs} +4 -4
  3. package/dist/{DepositModalReown-LWGABUOF.cjs → DepositModalReown-DNW4GH6L.cjs} +7 -7
  4. package/dist/{QRCode-SMMYPUQC.cjs → QRCode-5DXFNKI2.cjs} +2 -2
  5. package/dist/{QRCode-YMQTKSSK.mjs → QRCode-WUC652SH.mjs} +2 -2
  6. package/dist/{WithdrawModalReown-H7HA3JP3.mjs → WithdrawModalReown-7UAGSOSU.mjs} +4 -4
  7. package/dist/{WithdrawModalReown-FCWED55P.cjs → WithdrawModalReown-OUWBSKSM.cjs} +7 -7
  8. package/dist/{constants-DqVn968d.d.cts → caip-CrQ2KKU-.d.cts} +11 -1
  9. package/dist/{constants-DqVn968d.d.ts → caip-CrQ2KKU-.d.ts} +11 -1
  10. package/dist/{chunk-U3OLJZBT.cjs → chunk-2SMS542Q.cjs} +109 -102
  11. package/dist/{chunk-PKD7W5JG.cjs → chunk-33H6O5UU.cjs} +6 -16
  12. package/dist/{chunk-SZIYS42B.mjs → chunk-6YRDD462.mjs} +63 -3
  13. package/dist/{chunk-E46WOBZQ.mjs → chunk-GPSBM66J.mjs} +2 -12
  14. package/dist/{chunk-5ZS4ZJPW.mjs → chunk-KAWJABTW.mjs} +1071 -543
  15. package/dist/{chunk-H7QMSMM5.mjs → chunk-KJ2RR2D4.mjs} +1834 -586
  16. package/dist/{chunk-7JIDIX27.cjs → chunk-MILJQWPT.cjs} +73 -13
  17. package/dist/{chunk-UELVNPGE.cjs → chunk-RABZINV3.cjs} +1056 -528
  18. package/dist/{chunk-DW276H63.mjs → chunk-TKQYTBU6.mjs} +21 -14
  19. package/dist/{chunk-GBFOGYMH.cjs → chunk-VVJAIMKB.cjs} +1885 -637
  20. package/dist/constants.cjs +6 -2
  21. package/dist/constants.d.cts +1 -1
  22. package/dist/constants.d.ts +1 -1
  23. package/dist/constants.mjs +5 -1
  24. package/dist/deposit.cjs +4 -4
  25. package/dist/deposit.d.cts +2 -2
  26. package/dist/deposit.d.ts +2 -2
  27. package/dist/deposit.mjs +3 -3
  28. package/dist/index.cjs +19 -6
  29. package/dist/index.d.cts +2 -2
  30. package/dist/index.d.ts +2 -2
  31. package/dist/index.mjs +20 -7
  32. package/dist/styles.css +685 -75
  33. package/dist/{types-D8Q4TMk7.d.cts → types-BMcGO5k_.d.cts} +56 -2
  34. package/dist/{types-D8Q4TMk7.d.ts → types-BMcGO5k_.d.ts} +56 -2
  35. package/dist/withdraw.cjs +4 -4
  36. package/dist/withdraw.d.cts +2 -2
  37. package/dist/withdraw.d.ts +2 -2
  38. package/dist/withdraw.mjs +3 -3
  39. package/package.json +41 -17
@@ -153,6 +153,21 @@ interface RouteConfig {
153
153
  sourceChains?: number[];
154
154
  sourceTokens?: string[];
155
155
  }
156
+ interface FiatPaymentMethodOption {
157
+ /**
158
+ * Swapped's `payment_group` value (e.g. `creditcard`, `apple-pay`,
159
+ * `bank-transfer`) from GET /api/v1/merchant/get_payment_methods. This exact
160
+ * value is what the widget URL's `method` param prepopulates from — Apple Pay
161
+ * is `apple-pay`, not `applepay`.
162
+ */
163
+ method: string;
164
+ /** Row label shown in ConnectStep. */
165
+ label: string;
166
+ /** Optional sublabel under the row. */
167
+ sublabel?: string;
168
+ /** Optional icon name: `card` | `apple` | `bank`. Defaults to `card`. */
169
+ icon?: "card" | "apple" | "bank";
170
+ }
156
171
  interface DepositModalProps {
157
172
  dappWalletClient?: WalletClient | null;
158
173
  dappPublicClient?: PublicClient | null;
@@ -188,7 +203,6 @@ interface DepositModalProps {
188
203
  signerAddress?: Address;
189
204
  sessionChainIds?: number[];
190
205
  forceRegister?: boolean;
191
- waitForFinalTx?: boolean;
192
206
  reownAppId?: string;
193
207
  enableSolana?: boolean;
194
208
  /**
@@ -198,6 +212,21 @@ interface DepositModalProps {
198
212
  * entry screen.
199
213
  */
200
214
  dappImports?: DappImportsConfig;
215
+ /** Show fiat on-ramp option(s) that embed Swapped's iframe. Default: false. */
216
+ enableFiatOnramp?: boolean;
217
+ /** Show the Transfer Crypto / QR row. Default: true. */
218
+ enableQrTransfer?: boolean;
219
+ /**
220
+ * One row per Swapped payment method (Pay with Card / Apple Pay / Bank
221
+ * Transfer). When set, replaces the generic "Pay with Card" row.
222
+ */
223
+ fiatOnrampMethods?: FiatPaymentMethodOption[];
224
+ /**
225
+ * Show a "Fund from Exchange" row that opens Swapped Connect — the user
226
+ * picks their CEX (Coinbase, Binance, Kraken…) or wallet inside the iframe
227
+ * and Swapped pulls the crypto on-chain to the smart account. Default: false.
228
+ */
229
+ enableExchangeConnect?: boolean;
201
230
  onRequestConnect?: () => void;
202
231
  theme?: DepositModalTheme;
203
232
  uiConfig?: DepositModalUIConfig;
@@ -231,7 +260,6 @@ interface WithdrawModalProps {
231
260
  signerAddress?: Address;
232
261
  sessionChainIds?: number[];
233
262
  forceRegister?: boolean;
234
- waitForFinalTx?: boolean;
235
263
  reownAppId?: string;
236
264
  onSignTransaction?: (request: SafeTransactionRequest) => Promise<{
237
265
  signature: Hex;
@@ -276,14 +304,40 @@ type DepositLifecycleEvent = {
276
304
  type: "submitted";
277
305
  txHash: string;
278
306
  sourceChain: ChainId | "unknown";
307
+ /** Source-token base units (e.g. "1100000" for 1.10 USDC). */
279
308
  amount: string;
309
+ /**
310
+ * Decimals of the source token, for converting `amount` to a
311
+ * human-readable value. Omitted when the token is not recognised
312
+ * (e.g. a QR deposit of an unlisted token).
313
+ */
314
+ sourceDecimals?: number;
315
+ /**
316
+ * USD equivalent of the deposit as entered in the modal (token units
317
+ * for unpriced non-stablecoins). Omitted for flows without an amount
318
+ * input (QR transfer, fiat onramp, exchange connect).
319
+ */
320
+ amountUsd?: string;
280
321
  } | {
281
322
  type: "complete";
282
323
  txHash: string;
283
324
  destinationTxHash?: string;
325
+ /** Source-token base units (e.g. "1100000" for 1.10 USDC). */
284
326
  amount: string;
285
327
  sourceChain: ChainId | "unknown";
286
328
  sourceToken?: string;
329
+ /**
330
+ * Decimals of the source token, for converting `amount` to a
331
+ * human-readable value. Omitted when the token is not recognised
332
+ * (e.g. a QR deposit of an unlisted token).
333
+ */
334
+ sourceDecimals?: number;
335
+ /**
336
+ * USD equivalent of the deposit as entered in the modal (token units
337
+ * for unpriced non-stablecoins). Omitted for flows without an amount
338
+ * input (QR transfer, fiat onramp, exchange connect).
339
+ */
340
+ amountUsd?: string;
287
341
  targetChain: number | "solana";
288
342
  targetToken: string;
289
343
  } | {
@@ -153,6 +153,21 @@ interface RouteConfig {
153
153
  sourceChains?: number[];
154
154
  sourceTokens?: string[];
155
155
  }
156
+ interface FiatPaymentMethodOption {
157
+ /**
158
+ * Swapped's `payment_group` value (e.g. `creditcard`, `apple-pay`,
159
+ * `bank-transfer`) from GET /api/v1/merchant/get_payment_methods. This exact
160
+ * value is what the widget URL's `method` param prepopulates from — Apple Pay
161
+ * is `apple-pay`, not `applepay`.
162
+ */
163
+ method: string;
164
+ /** Row label shown in ConnectStep. */
165
+ label: string;
166
+ /** Optional sublabel under the row. */
167
+ sublabel?: string;
168
+ /** Optional icon name: `card` | `apple` | `bank`. Defaults to `card`. */
169
+ icon?: "card" | "apple" | "bank";
170
+ }
156
171
  interface DepositModalProps {
157
172
  dappWalletClient?: WalletClient | null;
158
173
  dappPublicClient?: PublicClient | null;
@@ -188,7 +203,6 @@ interface DepositModalProps {
188
203
  signerAddress?: Address;
189
204
  sessionChainIds?: number[];
190
205
  forceRegister?: boolean;
191
- waitForFinalTx?: boolean;
192
206
  reownAppId?: string;
193
207
  enableSolana?: boolean;
194
208
  /**
@@ -198,6 +212,21 @@ interface DepositModalProps {
198
212
  * entry screen.
199
213
  */
200
214
  dappImports?: DappImportsConfig;
215
+ /** Show fiat on-ramp option(s) that embed Swapped's iframe. Default: false. */
216
+ enableFiatOnramp?: boolean;
217
+ /** Show the Transfer Crypto / QR row. Default: true. */
218
+ enableQrTransfer?: boolean;
219
+ /**
220
+ * One row per Swapped payment method (Pay with Card / Apple Pay / Bank
221
+ * Transfer). When set, replaces the generic "Pay with Card" row.
222
+ */
223
+ fiatOnrampMethods?: FiatPaymentMethodOption[];
224
+ /**
225
+ * Show a "Fund from Exchange" row that opens Swapped Connect — the user
226
+ * picks their CEX (Coinbase, Binance, Kraken…) or wallet inside the iframe
227
+ * and Swapped pulls the crypto on-chain to the smart account. Default: false.
228
+ */
229
+ enableExchangeConnect?: boolean;
201
230
  onRequestConnect?: () => void;
202
231
  theme?: DepositModalTheme;
203
232
  uiConfig?: DepositModalUIConfig;
@@ -231,7 +260,6 @@ interface WithdrawModalProps {
231
260
  signerAddress?: Address;
232
261
  sessionChainIds?: number[];
233
262
  forceRegister?: boolean;
234
- waitForFinalTx?: boolean;
235
263
  reownAppId?: string;
236
264
  onSignTransaction?: (request: SafeTransactionRequest) => Promise<{
237
265
  signature: Hex;
@@ -276,14 +304,40 @@ type DepositLifecycleEvent = {
276
304
  type: "submitted";
277
305
  txHash: string;
278
306
  sourceChain: ChainId | "unknown";
307
+ /** Source-token base units (e.g. "1100000" for 1.10 USDC). */
279
308
  amount: string;
309
+ /**
310
+ * Decimals of the source token, for converting `amount` to a
311
+ * human-readable value. Omitted when the token is not recognised
312
+ * (e.g. a QR deposit of an unlisted token).
313
+ */
314
+ sourceDecimals?: number;
315
+ /**
316
+ * USD equivalent of the deposit as entered in the modal (token units
317
+ * for unpriced non-stablecoins). Omitted for flows without an amount
318
+ * input (QR transfer, fiat onramp, exchange connect).
319
+ */
320
+ amountUsd?: string;
280
321
  } | {
281
322
  type: "complete";
282
323
  txHash: string;
283
324
  destinationTxHash?: string;
325
+ /** Source-token base units (e.g. "1100000" for 1.10 USDC). */
284
326
  amount: string;
285
327
  sourceChain: ChainId | "unknown";
286
328
  sourceToken?: string;
329
+ /**
330
+ * Decimals of the source token, for converting `amount` to a
331
+ * human-readable value. Omitted when the token is not recognised
332
+ * (e.g. a QR deposit of an unlisted token).
333
+ */
334
+ sourceDecimals?: number;
335
+ /**
336
+ * USD equivalent of the deposit as entered in the modal (token units
337
+ * for unpriced non-stablecoins). Omitted for flows without an amount
338
+ * input (QR transfer, fiat onramp, exchange connect).
339
+ */
340
+ amountUsd?: string;
287
341
  targetChain: number | "solana";
288
342
  targetToken: string;
289
343
  } | {
package/dist/withdraw.cjs CHANGED
@@ -1,8 +1,8 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkU3OLJZBTcjs = require('./chunk-U3OLJZBT.cjs');
4
- require('./chunk-UELVNPGE.cjs');
5
- require('./chunk-7JIDIX27.cjs');
3
+ var _chunk2SMS542Qcjs = require('./chunk-2SMS542Q.cjs');
4
+ require('./chunk-RABZINV3.cjs');
5
+ require('./chunk-MILJQWPT.cjs');
6
6
 
7
7
 
8
- exports.WithdrawModal = _chunkU3OLJZBTcjs.WithdrawModal;
8
+ exports.WithdrawModal = _chunk2SMS542Qcjs.WithdrawModal;
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { n as WithdrawModalProps } from './types-D8Q4TMk7.cjs';
3
- export { A as AssetOption, a as ConnectedEventData, E as ErrorEventData, S as SafeTransactionRequest, k as WithdrawCompleteEventData, l as WithdrawFailedEventData, o as WithdrawSubmittedEventData } from './types-D8Q4TMk7.cjs';
2
+ import { n as WithdrawModalProps } from './types-BMcGO5k_.cjs';
3
+ export { A as AssetOption, a as ConnectedEventData, E as ErrorEventData, S as SafeTransactionRequest, k as WithdrawCompleteEventData, l as WithdrawFailedEventData, o as WithdrawSubmittedEventData } from './types-BMcGO5k_.cjs';
4
4
  import 'viem';
5
5
 
6
6
  declare function WithdrawModal(props: WithdrawModalProps): react_jsx_runtime.JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { n as WithdrawModalProps } from './types-D8Q4TMk7.js';
3
- export { A as AssetOption, a as ConnectedEventData, E as ErrorEventData, S as SafeTransactionRequest, k as WithdrawCompleteEventData, l as WithdrawFailedEventData, o as WithdrawSubmittedEventData } from './types-D8Q4TMk7.js';
2
+ import { n as WithdrawModalProps } from './types-BMcGO5k_.js';
3
+ export { A as AssetOption, a as ConnectedEventData, E as ErrorEventData, S as SafeTransactionRequest, k as WithdrawCompleteEventData, l as WithdrawFailedEventData, o as WithdrawSubmittedEventData } from './types-BMcGO5k_.js';
4
4
  import 'viem';
5
5
 
6
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-DW276H63.mjs";
4
- import "./chunk-5ZS4ZJPW.mjs";
5
- import "./chunk-SZIYS42B.mjs";
3
+ } from "./chunk-TKQYTBU6.mjs";
4
+ import "./chunk-KAWJABTW.mjs";
5
+ import "./chunk-6YRDD462.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.3.0-alpha.8",
3
+ "version": "0.3.0",
4
4
  "description": "React modal component for Rhinestone cross-chain deposits",
5
5
  "author": "Rhinestone <dev@rhinestone.wtf>",
6
6
  "bugs": {
@@ -12,24 +12,44 @@
12
12
  "types": "./dist/index.d.ts",
13
13
  "exports": {
14
14
  ".": {
15
- "types": "./dist/index.d.ts",
16
- "import": "./dist/index.mjs",
17
- "require": "./dist/index.cjs"
15
+ "import": {
16
+ "types": "./dist/index.d.ts",
17
+ "default": "./dist/index.mjs"
18
+ },
19
+ "require": {
20
+ "types": "./dist/index.d.cts",
21
+ "default": "./dist/index.cjs"
22
+ }
18
23
  },
19
24
  "./deposit": {
20
- "types": "./dist/deposit.d.ts",
21
- "import": "./dist/deposit.mjs",
22
- "require": "./dist/deposit.cjs"
25
+ "import": {
26
+ "types": "./dist/deposit.d.ts",
27
+ "default": "./dist/deposit.mjs"
28
+ },
29
+ "require": {
30
+ "types": "./dist/deposit.d.cts",
31
+ "default": "./dist/deposit.cjs"
32
+ }
23
33
  },
24
34
  "./withdraw": {
25
- "types": "./dist/withdraw.d.ts",
26
- "import": "./dist/withdraw.mjs",
27
- "require": "./dist/withdraw.cjs"
35
+ "import": {
36
+ "types": "./dist/withdraw.d.ts",
37
+ "default": "./dist/withdraw.mjs"
38
+ },
39
+ "require": {
40
+ "types": "./dist/withdraw.d.cts",
41
+ "default": "./dist/withdraw.cjs"
42
+ }
28
43
  },
29
44
  "./constants": {
30
- "types": "./dist/constants.d.ts",
31
- "import": "./dist/constants.mjs",
32
- "require": "./dist/constants.cjs"
45
+ "import": {
46
+ "types": "./dist/constants.d.ts",
47
+ "default": "./dist/constants.mjs"
48
+ },
49
+ "require": {
50
+ "types": "./dist/constants.d.cts",
51
+ "default": "./dist/constants.cjs"
52
+ }
33
53
  },
34
54
  "./styles.css": {
35
55
  "types": "./dist/styles.d.ts",
@@ -51,7 +71,10 @@
51
71
  "test": "vitest run",
52
72
  "test:watch": "vitest",
53
73
  "test:coverage": "vitest run --coverage",
54
- "prepublishOnly": "bun run clean && bun run build && bun run typecheck"
74
+ "prepublishOnly": "bun run clean && bun run build && bun run typecheck",
75
+ "changeset": "changeset",
76
+ "changeset:version": "changeset version",
77
+ "changeset:release": "bun run build && changeset publish"
55
78
  },
56
79
  "peerDependencies": {
57
80
  "react": ">=18",
@@ -82,6 +105,7 @@
82
105
  "zustand": "^5"
83
106
  },
84
107
  "devDependencies": {
108
+ "@changesets/cli": "^2.28.1",
85
109
  "@reown/appkit": "1.8.20",
86
110
  "@reown/appkit-adapter-solana": "1.8.20",
87
111
  "@reown/appkit-adapter-wagmi": "1.8.20",
@@ -110,7 +134,7 @@
110
134
  {
111
135
  "name": "Total Bundle (Everything)",
112
136
  "path": "dist/index.mjs",
113
- "limit": "52 kB",
137
+ "limit": "65 kB",
114
138
  "ignore": [
115
139
  "react",
116
140
  "react-dom",
@@ -130,7 +154,7 @@
130
154
  "name": "Deposit & Withdraw Modals Only",
131
155
  "path": "dist/index.mjs",
132
156
  "import": "{ DepositModal, WithdrawModal }",
133
- "limit": "52 kB",
157
+ "limit": "64 kB",
134
158
  "ignore": [
135
159
  "react",
136
160
  "react-dom",
@@ -158,7 +182,7 @@
158
182
  ],
159
183
  "repository": {
160
184
  "type": "git",
161
- "url": "https://github.com/rhinestonewtf/deposit-modal"
185
+ "url": "git+https://github.com/rhinestonewtf/deposit-modal.git"
162
186
  },
163
187
  "overrides": {
164
188
  "@reown/appkit-common": "1.8.20"