@rhinestone/deposit-modal 0.0.0-dev-20260608080045
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 +134 -0
- package/dist/DepositModalReown-6SUEC5IU.mjs +60 -0
- package/dist/DepositModalReown-DNW4GH6L.cjs +60 -0
- package/dist/QRCode-5DXFNKI2.cjs +58 -0
- package/dist/QRCode-WUC652SH.mjs +58 -0
- package/dist/WithdrawModalReown-7UAGSOSU.mjs +37 -0
- package/dist/WithdrawModalReown-OUWBSKSM.cjs +37 -0
- package/dist/caip-CsslyHGL.d.cts +62 -0
- package/dist/caip-CsslyHGL.d.ts +62 -0
- package/dist/chunk-2SMS542Q.cjs +1654 -0
- package/dist/chunk-33H6O5UU.cjs +162 -0
- package/dist/chunk-6YRDD462.mjs +614 -0
- package/dist/chunk-GPSBM66J.mjs +162 -0
- package/dist/chunk-KAWJABTW.mjs +3765 -0
- package/dist/chunk-KJ2RR2D4.mjs +7619 -0
- package/dist/chunk-MILJQWPT.cjs +614 -0
- package/dist/chunk-RABZINV3.cjs +3765 -0
- package/dist/chunk-TKQYTBU6.mjs +1654 -0
- package/dist/chunk-VVJAIMKB.cjs +7619 -0
- package/dist/constants.cjs +70 -0
- package/dist/constants.d.cts +21 -0
- package/dist/constants.d.ts +21 -0
- package/dist/constants.mjs +70 -0
- package/dist/deposit.cjs +8 -0
- package/dist/deposit.d.cts +11 -0
- package/dist/deposit.d.ts +11 -0
- package/dist/deposit.mjs +8 -0
- package/dist/index.cjs +86 -0
- package/dist/index.d.cts +11 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.mjs +86 -0
- package/dist/styles.css +5143 -0
- package/dist/styles.d.ts +3 -0
- package/dist/types-BMcGO5k_.d.cts +432 -0
- package/dist/types-BMcGO5k_.d.ts +432 -0
- package/dist/withdraw.cjs +8 -0
- package/dist/withdraw.d.cts +11 -0
- package/dist/withdraw.d.ts +11 -0
- package/dist/withdraw.mjs +8 -0
- package/package.json +190 -0
|
@@ -0,0 +1,432 @@
|
|
|
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
|
+
};
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Public config shape exposed on DepositModalProps. Each dapp defaults to
|
|
64
|
+
* off — clients must explicitly opt in.
|
|
65
|
+
*/
|
|
66
|
+
interface DappImportsConfig {
|
|
67
|
+
polymarket?: boolean;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
type Caip2ChainId = `eip155:${number}` | `solana:${string}`;
|
|
71
|
+
type ChainId = number | "solana" | Caip2ChainId;
|
|
72
|
+
interface DepositModalTheme {
|
|
73
|
+
mode?: "light" | "dark";
|
|
74
|
+
radius?: "none" | "sm" | "md" | "lg" | "full";
|
|
75
|
+
fontColor?: string;
|
|
76
|
+
iconColor?: string;
|
|
77
|
+
ctaColor?: string;
|
|
78
|
+
ctaHoverColor?: string;
|
|
79
|
+
borderColor?: string;
|
|
80
|
+
backgroundColor?: string;
|
|
81
|
+
}
|
|
82
|
+
interface DepositModalUIConfig {
|
|
83
|
+
showBackButton?: boolean;
|
|
84
|
+
showHistoryButton?: boolean;
|
|
85
|
+
maxDepositUsd?: number;
|
|
86
|
+
minDepositUsd?: number;
|
|
87
|
+
/**
|
|
88
|
+
* When true the network/protocol fee is sponsored — the Review / Processing /
|
|
89
|
+
* Success / Failure screens render the fee line-through and surface a
|
|
90
|
+
* tooltip on the info icon explaining the sponsorship.
|
|
91
|
+
*/
|
|
92
|
+
feeSponsored?: boolean;
|
|
93
|
+
/**
|
|
94
|
+
* Custom tooltip copy for the fee info icon. Defaults to a generic
|
|
95
|
+
* "Fees are sponsored" / "Fees apply" message based on `feeSponsored`.
|
|
96
|
+
*/
|
|
97
|
+
feeTooltip?: string;
|
|
98
|
+
}
|
|
99
|
+
interface ConnectedEventData {
|
|
100
|
+
address: Address;
|
|
101
|
+
smartAccount: Address;
|
|
102
|
+
}
|
|
103
|
+
interface DepositSubmittedEventData {
|
|
104
|
+
txHash: string;
|
|
105
|
+
sourceChain: ChainId | "unknown";
|
|
106
|
+
amount: string;
|
|
107
|
+
}
|
|
108
|
+
interface DepositCompleteEventData {
|
|
109
|
+
txHash: string;
|
|
110
|
+
destinationTxHash?: string;
|
|
111
|
+
amount: string;
|
|
112
|
+
sourceChain: ChainId | "unknown";
|
|
113
|
+
sourceToken?: string;
|
|
114
|
+
targetChain: number | "solana";
|
|
115
|
+
targetToken: string;
|
|
116
|
+
}
|
|
117
|
+
interface DepositFailedEventData {
|
|
118
|
+
txHash: string;
|
|
119
|
+
error?: string;
|
|
120
|
+
}
|
|
121
|
+
interface WithdrawSubmittedEventData {
|
|
122
|
+
txHash: Hex;
|
|
123
|
+
sourceChain: number;
|
|
124
|
+
amount: string;
|
|
125
|
+
safeAddress: Address;
|
|
126
|
+
}
|
|
127
|
+
interface WithdrawCompleteEventData {
|
|
128
|
+
txHash: Hex;
|
|
129
|
+
destinationTxHash?: Hex;
|
|
130
|
+
amount: string;
|
|
131
|
+
sourceChain: number;
|
|
132
|
+
sourceToken: Address;
|
|
133
|
+
targetChain: number;
|
|
134
|
+
targetToken: Address;
|
|
135
|
+
}
|
|
136
|
+
interface WithdrawFailedEventData {
|
|
137
|
+
txHash: Hex;
|
|
138
|
+
error?: string;
|
|
139
|
+
}
|
|
140
|
+
interface ErrorEventData {
|
|
141
|
+
message: string;
|
|
142
|
+
code?: string;
|
|
143
|
+
}
|
|
144
|
+
interface OutputTokenRule {
|
|
145
|
+
match: {
|
|
146
|
+
chain?: string;
|
|
147
|
+
token?: string;
|
|
148
|
+
symbol?: string;
|
|
149
|
+
};
|
|
150
|
+
outputToken: string;
|
|
151
|
+
}
|
|
152
|
+
interface RouteConfig {
|
|
153
|
+
sourceChains?: number[];
|
|
154
|
+
sourceTokens?: string[];
|
|
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
|
+
}
|
|
171
|
+
interface DepositModalProps {
|
|
172
|
+
dappWalletClient?: WalletClient | null;
|
|
173
|
+
dappPublicClient?: PublicClient | null;
|
|
174
|
+
dappAddress?: Address | null;
|
|
175
|
+
targetChain: Chain | number | "solana";
|
|
176
|
+
targetToken: Address | string;
|
|
177
|
+
isOpen: boolean;
|
|
178
|
+
onClose: () => void;
|
|
179
|
+
inline?: boolean;
|
|
180
|
+
closeOnOverlayClick?: boolean;
|
|
181
|
+
sourceChain?: Chain | number;
|
|
182
|
+
sourceToken?: Address;
|
|
183
|
+
/**
|
|
184
|
+
* Pre-fills the deposit amount. Either a USD-denominated number string
|
|
185
|
+
* (e.g. "25") or the case-insensitive sentinel `"max"`, which fills the
|
|
186
|
+
* full available balance once it loads (same as the Max preset).
|
|
187
|
+
*/
|
|
188
|
+
defaultAmount?: string;
|
|
189
|
+
recipient: Address | string;
|
|
190
|
+
/**
|
|
191
|
+
* The user's current in-app balance, in USD, as the consuming app displays
|
|
192
|
+
* it. When provided, the amount screen shows a "Balance after deposit" row
|
|
193
|
+
* (`appBalanceUsd + amount`) so the user sees their post-deposit app
|
|
194
|
+
* balance. The row is hidden when this is omitted.
|
|
195
|
+
*/
|
|
196
|
+
appBalanceUsd?: number;
|
|
197
|
+
postBridgeActions?: PostBridgeAction[];
|
|
198
|
+
outputTokenRules?: OutputTokenRule[];
|
|
199
|
+
rejectUnmapped?: boolean;
|
|
200
|
+
backendUrl?: string;
|
|
201
|
+
solanaRpcUrl?: string;
|
|
202
|
+
rhinestoneApiKey?: string;
|
|
203
|
+
signerAddress?: Address;
|
|
204
|
+
sessionChainIds?: number[];
|
|
205
|
+
forceRegister?: boolean;
|
|
206
|
+
reownAppId?: string;
|
|
207
|
+
enableSolana?: boolean;
|
|
208
|
+
/**
|
|
209
|
+
* Enable importing balances from third-party dapps. Each dapp defaults to
|
|
210
|
+
* off — clients must explicitly opt in. When a dapp is enabled and the
|
|
211
|
+
* connected wallet has a balance there, a new row appears on the deposit
|
|
212
|
+
* entry screen.
|
|
213
|
+
*/
|
|
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;
|
|
230
|
+
onRequestConnect?: () => void;
|
|
231
|
+
theme?: DepositModalTheme;
|
|
232
|
+
uiConfig?: DepositModalUIConfig;
|
|
233
|
+
allowedRoutes?: RouteConfig;
|
|
234
|
+
className?: string;
|
|
235
|
+
onReady?: () => void;
|
|
236
|
+
/** Discriminated stream of deposit lifecycle transitions. */
|
|
237
|
+
onLifecycle?: (event: DepositLifecycleEvent) => void;
|
|
238
|
+
onEvent?: (event: DepositAnalyticsEvent) => void;
|
|
239
|
+
onError?: (data: ErrorEventData) => void;
|
|
240
|
+
debug?: boolean;
|
|
241
|
+
}
|
|
242
|
+
interface WithdrawModalProps {
|
|
243
|
+
dappWalletClient?: WalletClient | null;
|
|
244
|
+
dappPublicClient?: PublicClient | null;
|
|
245
|
+
dappAddress?: Address | null;
|
|
246
|
+
safeAddress: Address;
|
|
247
|
+
sourceChain: Chain | number;
|
|
248
|
+
sourceToken: Address;
|
|
249
|
+
targetChain: Chain | number;
|
|
250
|
+
targetToken: Address;
|
|
251
|
+
recipient?: Address;
|
|
252
|
+
defaultAmount?: string;
|
|
253
|
+
isOpen: boolean;
|
|
254
|
+
onClose: () => void;
|
|
255
|
+
inline?: boolean;
|
|
256
|
+
closeOnOverlayClick?: boolean;
|
|
257
|
+
allowedRoutes?: RouteConfig;
|
|
258
|
+
backendUrl?: string;
|
|
259
|
+
rhinestoneApiKey?: string;
|
|
260
|
+
signerAddress?: Address;
|
|
261
|
+
sessionChainIds?: number[];
|
|
262
|
+
forceRegister?: boolean;
|
|
263
|
+
reownAppId?: string;
|
|
264
|
+
onSignTransaction?: (request: SafeTransactionRequest) => Promise<{
|
|
265
|
+
signature: Hex;
|
|
266
|
+
}>;
|
|
267
|
+
onRequestConnect?: () => void;
|
|
268
|
+
theme?: DepositModalTheme;
|
|
269
|
+
uiConfig?: DepositModalUIConfig;
|
|
270
|
+
className?: string;
|
|
271
|
+
onReady?: () => void;
|
|
272
|
+
/** Discriminated stream of withdraw lifecycle transitions. */
|
|
273
|
+
onLifecycle?: (event: WithdrawLifecycleEvent) => void;
|
|
274
|
+
onEvent?: (event: WithdrawAnalyticsEvent) => void;
|
|
275
|
+
onError?: (data: ErrorEventData) => void;
|
|
276
|
+
debug?: boolean;
|
|
277
|
+
}
|
|
278
|
+
interface AssetOption {
|
|
279
|
+
id: string;
|
|
280
|
+
chainId: number;
|
|
281
|
+
token: Address;
|
|
282
|
+
symbol: string;
|
|
283
|
+
name: string;
|
|
284
|
+
decimals: number;
|
|
285
|
+
balance?: string;
|
|
286
|
+
balanceUsd?: number;
|
|
287
|
+
}
|
|
288
|
+
interface OrderBookSwapAction {
|
|
289
|
+
type: "orderbook-swap";
|
|
290
|
+
contract: Address;
|
|
291
|
+
outputToken: Address;
|
|
292
|
+
}
|
|
293
|
+
type PostBridgeAction = OrderBookSwapAction;
|
|
294
|
+
/**
|
|
295
|
+
* Discriminated union covering every deposit flow state transition the
|
|
296
|
+
* consumer can observe. Consumers handle additions in a single switch; the
|
|
297
|
+
* modal can add new event variants without changing the prop surface.
|
|
298
|
+
*/
|
|
299
|
+
type DepositLifecycleEvent = {
|
|
300
|
+
type: "connected";
|
|
301
|
+
address: Address;
|
|
302
|
+
smartAccount: Address;
|
|
303
|
+
} | {
|
|
304
|
+
type: "submitted";
|
|
305
|
+
txHash: string;
|
|
306
|
+
sourceChain: ChainId | "unknown";
|
|
307
|
+
/** Source-token base units (e.g. "1100000" for 1.10 USDC). */
|
|
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;
|
|
321
|
+
} | {
|
|
322
|
+
type: "complete";
|
|
323
|
+
txHash: string;
|
|
324
|
+
destinationTxHash?: string;
|
|
325
|
+
/** Source-token base units (e.g. "1100000" for 1.10 USDC). */
|
|
326
|
+
amount: string;
|
|
327
|
+
sourceChain: ChainId | "unknown";
|
|
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;
|
|
341
|
+
targetChain: number | "solana";
|
|
342
|
+
targetToken: string;
|
|
343
|
+
} | {
|
|
344
|
+
type: "failed";
|
|
345
|
+
txHash: string;
|
|
346
|
+
error?: string;
|
|
347
|
+
} | {
|
|
348
|
+
type: "balance-changed";
|
|
349
|
+
totalUsd: number;
|
|
350
|
+
} | {
|
|
351
|
+
type: "smart-account-changed";
|
|
352
|
+
evm: Address | null;
|
|
353
|
+
solana: string | null;
|
|
354
|
+
};
|
|
355
|
+
type WithdrawLifecycleEvent = {
|
|
356
|
+
type: "connected";
|
|
357
|
+
address: Address;
|
|
358
|
+
smartAccount: Address;
|
|
359
|
+
} | {
|
|
360
|
+
type: "submitted";
|
|
361
|
+
txHash: Hex;
|
|
362
|
+
sourceChain: number;
|
|
363
|
+
amount: string;
|
|
364
|
+
safeAddress: Address;
|
|
365
|
+
} | {
|
|
366
|
+
type: "complete";
|
|
367
|
+
txHash: Hex;
|
|
368
|
+
destinationTxHash?: Hex;
|
|
369
|
+
amount: string;
|
|
370
|
+
sourceChain: number;
|
|
371
|
+
sourceToken: Address;
|
|
372
|
+
targetChain: number;
|
|
373
|
+
targetToken: Address;
|
|
374
|
+
} | {
|
|
375
|
+
type: "failed";
|
|
376
|
+
txHash: Hex;
|
|
377
|
+
error?: string;
|
|
378
|
+
};
|
|
379
|
+
/**
|
|
380
|
+
* Telemetry events fired when screens open or CTAs are clicked.
|
|
381
|
+
* Distinct from {@link DepositLifecycleEvent}, which tracks transaction state.
|
|
382
|
+
*/
|
|
383
|
+
type DepositAnalyticsEvent = {
|
|
384
|
+
type: "deposit_modal_connected_wallet_select_source_open";
|
|
385
|
+
total_balance_in_external_wallet: number | null;
|
|
386
|
+
pred_balance: number | null;
|
|
387
|
+
} | {
|
|
388
|
+
type: "deposit_modal_connected_wallet_select_source_cta_click";
|
|
389
|
+
total_balance_in_external_wallet: number | null;
|
|
390
|
+
pred_balance: number | null;
|
|
391
|
+
cta_name: "token_selected";
|
|
392
|
+
token_name: string;
|
|
393
|
+
token_balance: string;
|
|
394
|
+
} | {
|
|
395
|
+
type: "deposit_modal_transfer_crypto_open";
|
|
396
|
+
default_chain: string;
|
|
397
|
+
default_token: string;
|
|
398
|
+
pred_balance: number | null;
|
|
399
|
+
} | {
|
|
400
|
+
type: "deposit_modal_transfer_crypto_cta_click";
|
|
401
|
+
default_chain: string;
|
|
402
|
+
default_token: string;
|
|
403
|
+
pred_balance: number | null;
|
|
404
|
+
cta_name: "copy";
|
|
405
|
+
} | {
|
|
406
|
+
type: "deposit_modal_connected_wallet_enter_value_open";
|
|
407
|
+
send_token: string;
|
|
408
|
+
receive_token: string;
|
|
409
|
+
pred_balance: number | null;
|
|
410
|
+
} | {
|
|
411
|
+
type: "deposit_modal_connected_wallet_enter_value_cta_click";
|
|
412
|
+
send_token: string;
|
|
413
|
+
receive_token: string;
|
|
414
|
+
pred_balance: number | null;
|
|
415
|
+
cta_name: "continue" | "25%" | "50%" | "75%" | "Max";
|
|
416
|
+
};
|
|
417
|
+
type WithdrawAnalyticsEvent = {
|
|
418
|
+
type: "withdraw_modal_select_amount_open";
|
|
419
|
+
pred_balance: number | null;
|
|
420
|
+
default_token: string;
|
|
421
|
+
default_chain: string;
|
|
422
|
+
} | {
|
|
423
|
+
type: "withdraw_modal_select_amount_cta_click";
|
|
424
|
+
pred_balance: number | null;
|
|
425
|
+
selected_token: string;
|
|
426
|
+
selected_chain: string;
|
|
427
|
+
amount: string;
|
|
428
|
+
cta_name: "withdraw";
|
|
429
|
+
};
|
|
430
|
+
type ModalAnalyticsEvent = DepositAnalyticsEvent | WithdrawAnalyticsEvent;
|
|
431
|
+
|
|
432
|
+
export type { AssetOption as A, ChainId as C, DappImportsConfig 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, DepositAnalyticsEvent as b, DepositCompleteEventData as c, DepositFailedEventData as d, DepositLifecycleEvent as e, DepositModalProps as f, DepositModalTheme as g, DepositModalUIConfig as h, DepositSubmittedEventData as i, OutputTokenRule as j, WithdrawCompleteEventData as k, WithdrawFailedEventData as l, WithdrawLifecycleEvent as m, WithdrawModalProps as n, WithdrawSubmittedEventData as o };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
var _chunk2SMS542Qcjs = require('./chunk-2SMS542Q.cjs');
|
|
4
|
+
require('./chunk-RABZINV3.cjs');
|
|
5
|
+
require('./chunk-MILJQWPT.cjs');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
exports.WithdrawModal = _chunk2SMS542Qcjs.WithdrawModal;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
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
|
+
import 'viem';
|
|
5
|
+
|
|
6
|
+
declare function WithdrawModal(props: WithdrawModalProps): react.JSX.Element;
|
|
7
|
+
declare namespace WithdrawModal {
|
|
8
|
+
var displayName: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export { WithdrawModal, WithdrawModalProps };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
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
|
+
import 'viem';
|
|
5
|
+
|
|
6
|
+
declare function WithdrawModal(props: WithdrawModalProps): react.JSX.Element;
|
|
7
|
+
declare namespace WithdrawModal {
|
|
8
|
+
var displayName: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export { WithdrawModal, WithdrawModalProps };
|
package/package.json
ADDED
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@rhinestone/deposit-modal",
|
|
3
|
+
"version": "0.0.0-dev-20260608080045",
|
|
4
|
+
"description": "React modal component for Rhinestone cross-chain deposits",
|
|
5
|
+
"author": "Rhinestone <dev@rhinestone.wtf>",
|
|
6
|
+
"bugs": {
|
|
7
|
+
"url": "https://github.com/rhinestonewtf/deposit-modal/issues"
|
|
8
|
+
},
|
|
9
|
+
"type": "module",
|
|
10
|
+
"main": "./dist/index.cjs",
|
|
11
|
+
"module": "./dist/index.mjs",
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
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
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"./deposit": {
|
|
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
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"./withdraw": {
|
|
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
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"./constants": {
|
|
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
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"./styles.css": {
|
|
55
|
+
"types": "./dist/styles.d.ts",
|
|
56
|
+
"default": "./dist/styles.css"
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"files": [
|
|
60
|
+
"dist",
|
|
61
|
+
"README.md"
|
|
62
|
+
],
|
|
63
|
+
"sideEffects": [
|
|
64
|
+
"*.css"
|
|
65
|
+
],
|
|
66
|
+
"scripts": {
|
|
67
|
+
"size": "size-limit",
|
|
68
|
+
"build": "tsup && bun run scripts/postbuild.ts",
|
|
69
|
+
"clean": "rm -rf dist",
|
|
70
|
+
"typecheck": "tsc --noEmit",
|
|
71
|
+
"test": "vitest run",
|
|
72
|
+
"test:watch": "vitest",
|
|
73
|
+
"test:coverage": "vitest run --coverage",
|
|
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"
|
|
78
|
+
},
|
|
79
|
+
"peerDependencies": {
|
|
80
|
+
"react": ">=18",
|
|
81
|
+
"react-dom": ">=18",
|
|
82
|
+
"viem": ">=2",
|
|
83
|
+
"wagmi": ">=3",
|
|
84
|
+
"@reown/appkit": ">=1.6.0",
|
|
85
|
+
"@reown/appkit-adapter-wagmi": ">=1.6.0",
|
|
86
|
+
"@reown/appkit-adapter-solana": ">=1.6.0",
|
|
87
|
+
"@solana/web3.js": ">=1",
|
|
88
|
+
"@solana/spl-token": ">=0.4",
|
|
89
|
+
"@tanstack/react-query": ">=5"
|
|
90
|
+
},
|
|
91
|
+
"peerDependenciesMeta": {
|
|
92
|
+
"@reown/appkit-adapter-solana": {
|
|
93
|
+
"optional": true
|
|
94
|
+
},
|
|
95
|
+
"@solana/web3.js": {
|
|
96
|
+
"optional": true
|
|
97
|
+
},
|
|
98
|
+
"@solana/spl-token": {
|
|
99
|
+
"optional": true
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
"dependencies": {
|
|
103
|
+
"lucide-react": "^1.14.0",
|
|
104
|
+
"react-qrcode-logo": "^4.0.0",
|
|
105
|
+
"zustand": "^5"
|
|
106
|
+
},
|
|
107
|
+
"devDependencies": {
|
|
108
|
+
"@changesets/cli": "^2.28.1",
|
|
109
|
+
"@reown/appkit": "1.8.20",
|
|
110
|
+
"@reown/appkit-adapter-solana": "1.8.20",
|
|
111
|
+
"@reown/appkit-adapter-wagmi": "1.8.20",
|
|
112
|
+
"@size-limit/preset-small-lib": "^12.0.0",
|
|
113
|
+
"@solana/spl-token": "^0.4.14",
|
|
114
|
+
"@solana/web3.js": "^1.98.4",
|
|
115
|
+
"@tanstack/react-query": "^5.0.0",
|
|
116
|
+
"@testing-library/jest-dom": "^6",
|
|
117
|
+
"@testing-library/react": "^16",
|
|
118
|
+
"@testing-library/user-event": "^14",
|
|
119
|
+
"@types/react": "^19.0.0",
|
|
120
|
+
"@types/react-dom": "^19.0.0",
|
|
121
|
+
"@vitest/coverage-v8": "^4.0.10",
|
|
122
|
+
"bun-types": "^1.3.8",
|
|
123
|
+
"jsdom": "^25",
|
|
124
|
+
"react": "^19.0.0",
|
|
125
|
+
"react-dom": "^19.0.0",
|
|
126
|
+
"size-limit": "^12.0.0",
|
|
127
|
+
"tsup": "^8.0.0",
|
|
128
|
+
"typescript": "^5.5.0",
|
|
129
|
+
"viem": "^2.47.12",
|
|
130
|
+
"vitest": "^4.0.10",
|
|
131
|
+
"wagmi": "^3.4.2"
|
|
132
|
+
},
|
|
133
|
+
"size-limit": [
|
|
134
|
+
{
|
|
135
|
+
"name": "Total Bundle (Everything)",
|
|
136
|
+
"path": "dist/index.mjs",
|
|
137
|
+
"limit": "65 kB",
|
|
138
|
+
"ignore": [
|
|
139
|
+
"react",
|
|
140
|
+
"react-dom",
|
|
141
|
+
"viem",
|
|
142
|
+
"wagmi",
|
|
143
|
+
"@tanstack/react-query",
|
|
144
|
+
"@reown/appkit",
|
|
145
|
+
"@reown/appkit-adapter-wagmi",
|
|
146
|
+
"@walletconnect/ethereum-provider",
|
|
147
|
+
"@coinbase/wallet-sdk",
|
|
148
|
+
"@metamask/sdk",
|
|
149
|
+
"porto",
|
|
150
|
+
"porto/internal"
|
|
151
|
+
]
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
"name": "Deposit & Withdraw Modals Only",
|
|
155
|
+
"path": "dist/index.mjs",
|
|
156
|
+
"import": "{ DepositModal, WithdrawModal }",
|
|
157
|
+
"limit": "64 kB",
|
|
158
|
+
"ignore": [
|
|
159
|
+
"react",
|
|
160
|
+
"react-dom",
|
|
161
|
+
"viem",
|
|
162
|
+
"wagmi",
|
|
163
|
+
"@tanstack/react-query",
|
|
164
|
+
"@reown/appkit",
|
|
165
|
+
"@reown/appkit-adapter-wagmi",
|
|
166
|
+
"@walletconnect/ethereum-provider",
|
|
167
|
+
"@coinbase/wallet-sdk",
|
|
168
|
+
"@metamask/sdk",
|
|
169
|
+
"porto",
|
|
170
|
+
"porto/internal"
|
|
171
|
+
]
|
|
172
|
+
}
|
|
173
|
+
],
|
|
174
|
+
"keywords": [
|
|
175
|
+
"rhinestone",
|
|
176
|
+
"deposit",
|
|
177
|
+
"modal",
|
|
178
|
+
"react",
|
|
179
|
+
"web3",
|
|
180
|
+
"viem",
|
|
181
|
+
"cross-chain"
|
|
182
|
+
],
|
|
183
|
+
"repository": {
|
|
184
|
+
"type": "git",
|
|
185
|
+
"url": "git+https://github.com/rhinestonewtf/deposit-modal.git"
|
|
186
|
+
},
|
|
187
|
+
"overrides": {
|
|
188
|
+
"@reown/appkit-common": "1.8.20"
|
|
189
|
+
}
|
|
190
|
+
}
|