@rhinestone/deposit-modal 0.12.2 → 0.13.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 (65) hide show
  1. package/README.md +30 -16
  2. package/dist/ClaimModal-CREZO27I.mjs +11 -0
  3. package/dist/ClaimModal-JRIA32U2.cjs +11 -0
  4. package/dist/{DepositModalReown-TEC3MEZ4.mjs → DepositModalReown-3H75G3XQ.mjs} +44 -22
  5. package/dist/{DepositModalReown-VG66OTIU.cjs → DepositModalReown-YNNHLAV2.cjs} +57 -35
  6. package/dist/{QRCode-WUC652SH.mjs → QRCode-5RGIZZHL.mjs} +1 -1
  7. package/dist/{QRCode-5DXFNKI2.cjs → QRCode-JKXG4RHN.cjs} +2 -2
  8. package/dist/WithdrawModal-NVRX44IZ.mjs +10 -0
  9. package/dist/WithdrawModal-YYSBPCJJ.cjs +10 -0
  10. package/dist/{chunk-OIN4CXCP.cjs → chunk-2G2EIN4A.cjs} +1510 -896
  11. package/dist/{chunk-O7BCVQ6L.cjs → chunk-4KCSH4T3.cjs} +157 -199
  12. package/dist/{chunk-TM7VGHAG.cjs → chunk-5NUIKYSF.cjs} +83 -209
  13. package/dist/{chunk-UQIJU6HV.cjs → chunk-7N77GIP4.cjs} +102 -88
  14. package/dist/{chunk-J46WDSRD.mjs → chunk-COCBCQQC.mjs} +121 -86
  15. package/dist/chunk-CVGNCUVU.cjs +154 -0
  16. package/dist/{chunk-SDSKIJC7.mjs → chunk-DSIZNRWA.mjs} +1540 -926
  17. package/dist/{chunk-75DVGSAX.cjs → chunk-DW2EQA2U.cjs} +6 -3
  18. package/dist/{chunk-FXXUIK4E.mjs → chunk-EOMT5LKX.mjs} +374 -151
  19. package/dist/chunk-FZ5FZFIG.mjs +31 -0
  20. package/dist/chunk-GACIGCSN.cjs +31 -0
  21. package/dist/{chunk-HL5NUKZW.cjs → chunk-HOGZKHHY.cjs} +3 -3
  22. package/dist/{chunk-FLVLYO64.mjs → chunk-LTMMETAB.mjs} +29 -15
  23. package/dist/{chunk-2TPSF77V.mjs → chunk-OLCD75JK.mjs} +20 -146
  24. package/dist/{chunk-PWLEBV5V.cjs → chunk-RAADLTSW.cjs} +240 -205
  25. package/dist/{chunk-4ZXQPFNU.mjs → chunk-RN5VKWI6.mjs} +4 -1
  26. package/dist/{chunk-3STTWRAN.mjs → chunk-VUATPOWJ.mjs} +147 -189
  27. package/dist/{chunk-JE4R5VA3.mjs → chunk-XYJFEN5D.mjs} +1 -1
  28. package/dist/chunk-YREVFB64.mjs +154 -0
  29. package/dist/{chunk-BRYNGLDM.cjs → chunk-ZMT4ATHR.cjs} +437 -214
  30. package/dist/claim.cjs +7 -6
  31. package/dist/claim.d.cts +11 -3
  32. package/dist/claim.d.ts +11 -3
  33. package/dist/claim.mjs +6 -5
  34. package/dist/{constants-FuzG3h4m.d.cts → constants-DBrWhJWE.d.cts} +12 -7
  35. package/dist/{constants-FuzG3h4m.d.ts → constants-DBrWhJWE.d.ts} +12 -7
  36. package/dist/constants.cjs +3 -9
  37. package/dist/constants.d.cts +2 -3
  38. package/dist/constants.d.ts +2 -3
  39. package/dist/constants.mjs +4 -10
  40. package/dist/deposit.cjs +8 -8
  41. package/dist/deposit.d.cts +2 -2
  42. package/dist/deposit.d.ts +2 -2
  43. package/dist/deposit.mjs +7 -7
  44. package/dist/embed.cjs +1268 -0
  45. package/dist/embed.d.cts +177 -0
  46. package/dist/embed.d.ts +177 -0
  47. package/dist/embed.mjs +1268 -0
  48. package/dist/index.cjs +11 -16
  49. package/dist/index.d.cts +3 -3
  50. package/dist/index.d.ts +3 -3
  51. package/dist/index.mjs +14 -19
  52. package/dist/modal-ui-state-OD1RmKkK.d.cts +30 -0
  53. package/dist/modal-ui-state-OD1RmKkK.d.ts +30 -0
  54. package/dist/polymarket.cjs +17 -7
  55. package/dist/polymarket.mjs +13 -3
  56. package/dist/styles.css +124 -98
  57. package/dist/{types-oFblf65g.d.ts → types-B89I8_8H.d.ts} +27 -1
  58. package/dist/{types-BO4iP6fG.d.cts → types-nnDR4tqA.d.cts} +27 -1
  59. package/dist/withdraw.cjs +6 -6
  60. package/dist/withdraw.d.cts +11 -3
  61. package/dist/withdraw.d.ts +11 -3
  62. package/dist/withdraw.mjs +5 -5
  63. package/package.json +33 -1
  64. package/dist/chunk-IAGFDSNC.mjs +0 -11
  65. package/dist/chunk-L32UI7LA.cjs +0 -11
@@ -38,6 +38,16 @@ interface SignRecoveryPayload {
38
38
  * verifier accepts.
39
39
  */
40
40
  signer: Address;
41
+ /**
42
+ * The chain the deposit is on, and therefore the chain the signature is
43
+ * verified against.
44
+ *
45
+ * Load-bearing for a smart account: ERC-1271 and ERC-6492 verification are
46
+ * per-chain, so a signature produced against the wrong one is well formed,
47
+ * rejected remotely, and reported to the user as a signature their wallet
48
+ * cannot make. An EOA signature does not depend on it.
49
+ */
50
+ chainId: number;
41
51
  /** Deposit being recovered, for your own logging or confirmation UI. */
42
52
  depositId: string;
43
53
  /** Where the funds will go. Covered by the signature. */
@@ -76,7 +86,13 @@ type RpcUrlMap = Partial<Record<ChainKey, string>>;
76
86
  type Caip2ChainId = `eip155:${number}` | `solana:${string}`;
77
87
  type ChainId = number | "solana" | "hypercore" | Caip2ChainId;
78
88
  interface DepositModalTheme {
79
- mode?: "light" | "dark";
89
+ /**
90
+ * Absent means light, unconditionally — never "follow the OS". `"system"` is
91
+ * opt-in because an app that is single-appearance by design would otherwise
92
+ * get a dark funding sheet inside a light app the moment the user flips
93
+ * their phone.
94
+ */
95
+ mode?: "light" | "dark" | "system";
80
96
  radius?: "none" | "sm" | "md" | "lg" | "full";
81
97
  fontColor?: string;
82
98
  iconColor?: string;
@@ -247,6 +263,15 @@ interface DepositModalProps {
247
263
  enableFiatOnramp?: boolean;
248
264
  /** Show the Transfer Crypto / QR row. Default: true. */
249
265
  enableQrTransfer?: boolean;
266
+ /**
267
+ * Offer gasless ERC-20 deposits from the connected wallet: instead of an
268
+ * on-chain transfer, the user signs the highest-priority token authorization
269
+ * supported by the backend (ERC-3009, ERC-2612, then Permit2). Opt-in and
270
+ * purely additive — the plain transfer stays the default and the automatic
271
+ * fallback whenever the gasless path is unavailable (older proxy, feature
272
+ * disabled, missing Permit2 allowance, rejected signature). Default: false.
273
+ */
274
+ enableGaslessDeposit?: boolean;
250
275
  /**
251
276
  * Restrict Cash to an exact subset of the standard payment groups. Providing
252
277
  * the map opts this modal instance out of regional personalization; omit it
@@ -430,6 +455,7 @@ type DepositLifecycleEvent = {
430
455
  smartAccount: Address;
431
456
  } | {
432
457
  type: "submitted";
458
+ /** Real source-chain transaction hash; not emitted for permit deposits before settlement. */
433
459
  txHash: string;
434
460
  sourceChain: ChainId | "unknown";
435
461
  /** Source-token base units (e.g. "1100000" for 1.10 USDC). */
@@ -38,6 +38,16 @@ interface SignRecoveryPayload {
38
38
  * verifier accepts.
39
39
  */
40
40
  signer: Address;
41
+ /**
42
+ * The chain the deposit is on, and therefore the chain the signature is
43
+ * verified against.
44
+ *
45
+ * Load-bearing for a smart account: ERC-1271 and ERC-6492 verification are
46
+ * per-chain, so a signature produced against the wrong one is well formed,
47
+ * rejected remotely, and reported to the user as a signature their wallet
48
+ * cannot make. An EOA signature does not depend on it.
49
+ */
50
+ chainId: number;
41
51
  /** Deposit being recovered, for your own logging or confirmation UI. */
42
52
  depositId: string;
43
53
  /** Where the funds will go. Covered by the signature. */
@@ -76,7 +86,13 @@ type RpcUrlMap = Partial<Record<ChainKey, string>>;
76
86
  type Caip2ChainId = `eip155:${number}` | `solana:${string}`;
77
87
  type ChainId = number | "solana" | "hypercore" | Caip2ChainId;
78
88
  interface DepositModalTheme {
79
- mode?: "light" | "dark";
89
+ /**
90
+ * Absent means light, unconditionally — never "follow the OS". `"system"` is
91
+ * opt-in because an app that is single-appearance by design would otherwise
92
+ * get a dark funding sheet inside a light app the moment the user flips
93
+ * their phone.
94
+ */
95
+ mode?: "light" | "dark" | "system";
80
96
  radius?: "none" | "sm" | "md" | "lg" | "full";
81
97
  fontColor?: string;
82
98
  iconColor?: string;
@@ -247,6 +263,15 @@ interface DepositModalProps {
247
263
  enableFiatOnramp?: boolean;
248
264
  /** Show the Transfer Crypto / QR row. Default: true. */
249
265
  enableQrTransfer?: boolean;
266
+ /**
267
+ * Offer gasless ERC-20 deposits from the connected wallet: instead of an
268
+ * on-chain transfer, the user signs the highest-priority token authorization
269
+ * supported by the backend (ERC-3009, ERC-2612, then Permit2). Opt-in and
270
+ * purely additive — the plain transfer stays the default and the automatic
271
+ * fallback whenever the gasless path is unavailable (older proxy, feature
272
+ * disabled, missing Permit2 allowance, rejected signature). Default: false.
273
+ */
274
+ enableGaslessDeposit?: boolean;
250
275
  /**
251
276
  * Restrict Cash to an exact subset of the standard payment groups. Providing
252
277
  * the map opts this modal instance out of regional personalization; omit it
@@ -430,6 +455,7 @@ type DepositLifecycleEvent = {
430
455
  smartAccount: Address;
431
456
  } | {
432
457
  type: "submitted";
458
+ /** Real source-chain transaction hash; not emitted for permit deposits before settlement. */
433
459
  txHash: string;
434
460
  sourceChain: ChainId | "unknown";
435
461
  /** Source-token base units (e.g. "1100000" for 1.10 USDC). */
package/dist/withdraw.cjs CHANGED
@@ -1,10 +1,10 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkUQIJU6HVcjs = require('./chunk-UQIJU6HV.cjs');
4
- require('./chunk-PWLEBV5V.cjs');
5
- require('./chunk-BRYNGLDM.cjs');
6
- require('./chunk-L32UI7LA.cjs');
7
- require('./chunk-O7BCVQ6L.cjs');
3
+ var _chunk7N77GIP4cjs = require('./chunk-7N77GIP4.cjs');
4
+ require('./chunk-RAADLTSW.cjs');
5
+ require('./chunk-ZMT4ATHR.cjs');
6
+ require('./chunk-GACIGCSN.cjs');
7
+ require('./chunk-4KCSH4T3.cjs');
8
8
 
9
9
 
10
- exports.WithdrawModal = _chunkUQIJU6HVcjs.WithdrawModal;
10
+ exports.WithdrawModal = _chunk7N77GIP4cjs.WithdrawModal;
@@ -1,9 +1,17 @@
1
1
  import * as react from 'react';
2
- import { p as WithdrawModalProps } from './types-BO4iP6fG.cjs';
3
- export { a as AssetOption, e as ConnectedEventData, E as ErrorEventData, R as RpcUrlMap, m as WithdrawCompleteEventData, n as WithdrawFailedEventData, q as WithdrawSubmittedEventData, r as WithdrawTransferRequest } from './types-BO4iP6fG.cjs';
2
+ import { p as WithdrawModalProps } from './types-nnDR4tqA.cjs';
3
+ export { a as AssetOption, e as ConnectedEventData, E as ErrorEventData, R as RpcUrlMap, m as WithdrawCompleteEventData, n as WithdrawFailedEventData, q as WithdrawSubmittedEventData, r as WithdrawTransferRequest } from './types-nnDR4tqA.cjs';
4
+ import { M as ModalUiState } from './modal-ui-state-OD1RmKkK.cjs';
4
5
  import 'viem';
5
6
  import './caip-D8aRWdEY.cjs';
6
7
 
7
- declare function WithdrawModal({ accountAddress, sourceChain: sourceChainProp, sourceToken, targetChain: targetChainProp, targetToken, recipient, defaultAmount, isOpen, onClose, inline, closeOnOverlayClick, backendUrl, rpcUrls: rpcUrlsProp, forceRegister, onSendTransaction, theme, uiConfig, className, onReady, onLifecycle, onEvent, onError, debug, ...removedProps }: WithdrawModalProps): react.JSX.Element;
8
+ /**
9
+ * Not part of `WithdrawModalProps`: the native embed is the only consumer, and
10
+ * a published prop is immediately someone else's import.
11
+ */
12
+ interface WithdrawModalInternalProps {
13
+ onUiState?: (state: ModalUiState) => void;
14
+ }
15
+ declare function WithdrawModal({ accountAddress, sourceChain: sourceChainProp, sourceToken, targetChain: targetChainProp, targetToken, recipient, defaultAmount, isOpen, onClose, inline, closeOnOverlayClick, backendUrl, rpcUrls: rpcUrlsProp, forceRegister, onSendTransaction, theme, uiConfig, className, onReady, onLifecycle, onEvent, onError, debug, onUiState, ...removedProps }: WithdrawModalProps & WithdrawModalInternalProps): react.JSX.Element;
8
16
 
9
17
  export { WithdrawModal, WithdrawModalProps };
@@ -1,9 +1,17 @@
1
1
  import * as react from 'react';
2
- import { p as WithdrawModalProps } from './types-oFblf65g.js';
3
- export { a as AssetOption, e as ConnectedEventData, E as ErrorEventData, R as RpcUrlMap, m as WithdrawCompleteEventData, n as WithdrawFailedEventData, q as WithdrawSubmittedEventData, r as WithdrawTransferRequest } from './types-oFblf65g.js';
2
+ import { p as WithdrawModalProps } from './types-B89I8_8H.js';
3
+ export { a as AssetOption, e as ConnectedEventData, E as ErrorEventData, R as RpcUrlMap, m as WithdrawCompleteEventData, n as WithdrawFailedEventData, q as WithdrawSubmittedEventData, r as WithdrawTransferRequest } from './types-B89I8_8H.js';
4
+ import { M as ModalUiState } from './modal-ui-state-OD1RmKkK.js';
4
5
  import 'viem';
5
6
  import './caip-D8aRWdEY.js';
6
7
 
7
- declare function WithdrawModal({ accountAddress, sourceChain: sourceChainProp, sourceToken, targetChain: targetChainProp, targetToken, recipient, defaultAmount, isOpen, onClose, inline, closeOnOverlayClick, backendUrl, rpcUrls: rpcUrlsProp, forceRegister, onSendTransaction, theme, uiConfig, className, onReady, onLifecycle, onEvent, onError, debug, ...removedProps }: WithdrawModalProps): react.JSX.Element;
8
+ /**
9
+ * Not part of `WithdrawModalProps`: the native embed is the only consumer, and
10
+ * a published prop is immediately someone else's import.
11
+ */
12
+ interface WithdrawModalInternalProps {
13
+ onUiState?: (state: ModalUiState) => void;
14
+ }
15
+ declare function WithdrawModal({ accountAddress, sourceChain: sourceChainProp, sourceToken, targetChain: targetChainProp, targetToken, recipient, defaultAmount, isOpen, onClose, inline, closeOnOverlayClick, backendUrl, rpcUrls: rpcUrlsProp, forceRegister, onSendTransaction, theme, uiConfig, className, onReady, onLifecycle, onEvent, onError, debug, onUiState, ...removedProps }: WithdrawModalProps & WithdrawModalInternalProps): react.JSX.Element;
8
16
 
9
17
  export { WithdrawModal, WithdrawModalProps };
package/dist/withdraw.mjs CHANGED
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  WithdrawModal
3
- } from "./chunk-FLVLYO64.mjs";
4
- import "./chunk-J46WDSRD.mjs";
5
- import "./chunk-FXXUIK4E.mjs";
6
- import "./chunk-IAGFDSNC.mjs";
7
- import "./chunk-3STTWRAN.mjs";
3
+ } from "./chunk-LTMMETAB.mjs";
4
+ import "./chunk-COCBCQQC.mjs";
5
+ import "./chunk-EOMT5LKX.mjs";
6
+ import "./chunk-FZ5FZFIG.mjs";
7
+ import "./chunk-VUATPOWJ.mjs";
8
8
  export {
9
9
  WithdrawModal
10
10
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rhinestone/deposit-modal",
3
- "version": "0.12.2",
3
+ "version": "0.13.0",
4
4
  "description": "React modal component for Rhinestone cross-chain deposits",
5
5
  "author": "Rhinestone <dev@rhinestone.wtf>",
6
6
  "bugs": {
@@ -51,6 +51,16 @@
51
51
  "default": "./dist/claim.cjs"
52
52
  }
53
53
  },
54
+ "./embed": {
55
+ "import": {
56
+ "types": "./dist/embed.d.ts",
57
+ "default": "./dist/embed.mjs"
58
+ },
59
+ "require": {
60
+ "types": "./dist/embed.d.cts",
61
+ "default": "./dist/embed.cjs"
62
+ }
63
+ },
54
64
  "./server": {
55
65
  "import": {
56
66
  "types": "./dist/server.d.ts",
@@ -91,6 +101,8 @@
91
101
  "scripts": {
92
102
  "size": "size-limit",
93
103
  "build": "bun run scripts/sync-version.ts && tsup && bun run scripts/postbuild.ts",
104
+ "build:embed": "vite build --config embed-page/vite.config.ts",
105
+ "size:bundles": "bun run scripts/check-bundles.ts",
94
106
  "clean": "rm -rf dist",
95
107
  "typecheck": "tsc --noEmit",
96
108
  "test": "vitest run",
@@ -159,6 +171,7 @@
159
171
  "tsup": "^8.0.0",
160
172
  "typescript": "^5.5.0",
161
173
  "viem": "^2.53.1",
174
+ "vite": "^8.1.4",
162
175
  "vitest": "^4.0.10",
163
176
  "wagmi": "^3.6.18"
164
177
  },
@@ -182,6 +195,25 @@
182
195
  "porto/internal"
183
196
  ]
184
197
  },
198
+ {
199
+ "name": "Native Embed (all three modes)",
200
+ "path": "dist/embed.mjs",
201
+ "limit": "92 kB",
202
+ "ignore": [
203
+ "react",
204
+ "react-dom",
205
+ "viem",
206
+ "wagmi",
207
+ "@tanstack/react-query",
208
+ "@reown/appkit",
209
+ "@reown/appkit-adapter-wagmi",
210
+ "@walletconnect/ethereum-provider",
211
+ "@coinbase/wallet-sdk",
212
+ "@metamask/sdk",
213
+ "porto",
214
+ "porto/internal"
215
+ ]
216
+ },
185
217
  {
186
218
  "name": "Deposit & Withdraw Modals Only",
187
219
  "path": "dist/index.mjs",
@@ -1,11 +0,0 @@
1
- // src/core/version.ts
2
- var MODAL_VERSION = "0.12.2";
3
- var SERVICE_HEADERS = {
4
- "Content-Type": "application/json",
5
- "x-deposit-modal-version": MODAL_VERSION
6
- };
7
-
8
- export {
9
- MODAL_VERSION,
10
- SERVICE_HEADERS
11
- };
@@ -1,11 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/core/version.ts
2
- var MODAL_VERSION = "0.12.2";
3
- var SERVICE_HEADERS = {
4
- "Content-Type": "application/json",
5
- "x-deposit-modal-version": MODAL_VERSION
6
- };
7
-
8
-
9
-
10
-
11
- exports.MODAL_VERSION = MODAL_VERSION; exports.SERVICE_HEADERS = SERVICE_HEADERS;