@rhinestone/deposit-modal 0.1.20 → 0.1.22

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/dist/index.d.cts CHANGED
@@ -1,221 +1,9 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { Address, Hex, WalletClient, PublicClient, Chain } from 'viem';
3
- import { Chain as Chain$1 } from 'viem/chains';
1
+ export { DepositModal } from './deposit.cjs';
2
+ export { WithdrawModal } from './withdraw.cjs';
3
+ export { A as AssetOption, C as ConnectedEventData, D as DepositCompleteEventData, a as DepositFailedEventData, b as DepositModalBranding, c as DepositModalProps, d as DepositModalTheme, e as DepositModalUIConfig, f as DepositSubmittedEventData, E as ErrorEventData, W as WithdrawCompleteEventData, g as WithdrawFailedEventData, h as WithdrawModalProps, i as WithdrawSubmittedEventData } from './types-D_xeOU8G.cjs';
4
+ export { CHAIN_BY_ID, DEFAULT_BACKEND_URL, DEFAULT_SIGNER_ADDRESS, NATIVE_TOKEN_ADDRESS, SOURCE_CHAINS, SUPPORTED_CHAINS, findChainIdForToken, getChainBadge, getChainIcon, getChainId, getChainName, getChainObject, getExplorerName, getExplorerTxUrl, getExplorerUrl, getSupportedChainIds, getSupportedTargetTokens, getSupportedTokenSymbolsForChain, getTokenAddress, getTokenDecimals, getTokenDecimalsByAddress, getTokenIcon, getTokenSymbol, getUsdcAddress, getUsdcDecimals, isSupportedTokenAddressForChain } from './constants.cjs';
5
+ export { SafeTransactionRequest } from './safe.cjs';
4
6
  export { chainRegistry } from '@rhinestone/shared-configs';
5
-
6
- interface DepositModalTheme {
7
- mode?: "light" | "dark";
8
- radius?: "none" | "sm" | "md" | "lg" | "full";
9
- fontColor?: string;
10
- iconColor?: string;
11
- ctaColor?: string;
12
- ctaHoverColor?: string;
13
- borderColor?: string;
14
- backgroundColor?: string;
15
- }
16
- interface DepositModalUIConfig {
17
- showLogo?: boolean;
18
- showStepper?: boolean;
19
- showBackButton?: boolean;
20
- balanceTitle?: string;
21
- maxDepositUsd?: number;
22
- minDepositUsd?: number;
23
- }
24
- interface DepositModalBranding {
25
- logoUrl?: string;
26
- title?: string;
27
- }
28
- interface ConnectedEventData {
29
- address: Address;
30
- smartAccount: Address;
31
- }
32
- interface DepositSubmittedEventData {
33
- txHash: Hex;
34
- sourceChain: number;
35
- amount: string;
36
- }
37
- interface DepositCompleteEventData {
38
- txHash: Hex;
39
- destinationTxHash?: Hex;
40
- }
41
- interface DepositFailedEventData {
42
- txHash: Hex;
43
- error?: string;
44
- }
45
- interface WithdrawSubmittedEventData {
46
- txHash: Hex;
47
- sourceChain: number;
48
- amount: string;
49
- safeAddress: Address;
50
- }
51
- interface WithdrawCompleteEventData {
52
- txHash: Hex;
53
- destinationTxHash?: Hex;
54
- }
55
- interface WithdrawFailedEventData {
56
- txHash: Hex;
57
- error?: string;
58
- }
59
- interface ErrorEventData {
60
- message: string;
61
- code?: string;
62
- }
63
- interface DepositModalProps {
64
- dappWalletClient?: WalletClient | null;
65
- dappPublicClient?: PublicClient | null;
66
- dappAddress?: Address | null;
67
- targetChain: Chain | number;
68
- targetToken: Address;
69
- isOpen: boolean;
70
- onClose: () => void;
71
- inline?: boolean;
72
- sourceChain?: Chain | number;
73
- sourceToken?: Address;
74
- defaultAmount?: string;
75
- recipient?: Address;
76
- backendUrl?: string;
77
- rhinestoneApiKey?: string;
78
- signerAddress?: Address;
79
- sessionChainIds?: number[];
80
- forceRegister?: boolean;
81
- waitForFinalTx?: boolean;
82
- reownAppId?: string;
83
- onRequestConnect?: () => void;
84
- connectButtonLabel?: string;
85
- theme?: DepositModalTheme;
86
- branding?: DepositModalBranding;
87
- uiConfig?: DepositModalUIConfig;
88
- className?: string;
89
- onReady?: () => void;
90
- onConnected?: (data: ConnectedEventData) => void;
91
- onDepositSubmitted?: (data: DepositSubmittedEventData) => void;
92
- onDepositComplete?: (data: DepositCompleteEventData) => void;
93
- onDepositFailed?: (data: DepositFailedEventData) => void;
94
- onError?: (data: ErrorEventData) => void;
95
- debug?: boolean;
96
- }
97
- interface WithdrawSignParams {
98
- safeAddress: Address;
99
- recipient: Address;
100
- amount: bigint;
101
- tokenAddress: Address;
102
- chainId: number;
103
- isNative: boolean;
104
- }
105
- interface WithdrawModalProps {
106
- dappWalletClient?: WalletClient | null;
107
- dappPublicClient?: PublicClient | null;
108
- dappAddress?: Address | null;
109
- safeAddress: Address;
110
- sourceChain: Chain | number;
111
- sourceToken: Address;
112
- targetChain: Chain | number;
113
- targetToken: Address;
114
- recipient?: Address;
115
- defaultAmount?: string;
116
- isOpen: boolean;
117
- onClose: () => void;
118
- inline?: boolean;
119
- backendUrl?: string;
120
- rhinestoneApiKey?: string;
121
- signerAddress?: Address;
122
- sessionChainIds?: number[];
123
- forceRegister?: boolean;
124
- waitForFinalTx?: boolean;
125
- reownAppId?: string;
126
- onWithdrawSign?: (params: WithdrawSignParams) => Promise<{
127
- txHash: Hex;
128
- }>;
129
- onRequestConnect?: () => void;
130
- connectButtonLabel?: string;
131
- theme?: DepositModalTheme;
132
- branding?: DepositModalBranding;
133
- uiConfig?: DepositModalUIConfig;
134
- className?: string;
135
- onReady?: () => void;
136
- onConnected?: (data: ConnectedEventData) => void;
137
- onWithdrawSubmitted?: (data: WithdrawSubmittedEventData) => void;
138
- onWithdrawComplete?: (data: WithdrawCompleteEventData) => void;
139
- onWithdrawFailed?: (data: WithdrawFailedEventData) => void;
140
- onError?: (data: ErrorEventData) => void;
141
- debug?: boolean;
142
- }
143
- interface AssetOption {
144
- id: string;
145
- chainId: number;
146
- token: Address;
147
- symbol: string;
148
- name: string;
149
- decimals: number;
150
- balance?: string;
151
- balanceUsd?: number;
152
- }
153
-
154
- declare function DepositModal(props: DepositModalProps): react_jsx_runtime.JSX.Element;
155
- declare namespace DepositModal {
156
- var displayName: string;
157
- }
158
-
159
- declare function WithdrawModal(props: WithdrawModalProps): react_jsx_runtime.JSX.Element;
160
- declare namespace WithdrawModal {
161
- var displayName: string;
162
- }
163
-
164
- type SafeTransferResult = {
165
- txHash: Hex;
166
- };
167
- declare function executeSafeEthTransfer(params: {
168
- walletClient: WalletClient;
169
- publicClient: PublicClient;
170
- safeAddress: Address;
171
- recipient: Address;
172
- amount: bigint;
173
- chainId: number;
174
- }): Promise<SafeTransferResult>;
175
- declare function executeSafeErc20Transfer(params: {
176
- walletClient: WalletClient;
177
- publicClient: PublicClient;
178
- safeAddress: Address;
179
- tokenAddress: Address;
180
- recipient: Address;
181
- amount: bigint;
182
- chainId: number;
183
- }): Promise<SafeTransferResult>;
184
-
185
- declare const DEFAULT_BACKEND_URL = "https://v1.orchestrator.rhinestone.dev/deposit-widget";
186
- declare const DEFAULT_SIGNER_ADDRESS: Address;
187
- declare const NATIVE_TOKEN_ADDRESS: Address;
188
- declare const CHAIN_BY_ID: Record<number, Chain$1>;
189
- declare const SOURCE_CHAINS: Chain$1[];
190
- declare const SUPPORTED_CHAINS: Chain$1[];
191
- type SupportedTokenOption = {
192
- symbol: string;
193
- address: Address;
194
- decimals: number;
195
- };
196
- declare function getChainId(chain: Chain$1 | number): number;
197
- declare function getChainObject(chain: Chain$1 | number): Chain$1 | undefined;
198
- declare function getUsdcAddress(chainId: number): Address | undefined;
199
- declare function getUsdcDecimals(chainId: number): number;
200
- declare function getTokenAddress(symbol: string, chainId: number): Address | undefined;
201
- declare function getTokenDecimals(symbol: string, chainId: number): number;
202
- declare function getSupportedTokenSymbolsForChain(chainId: number): string[];
203
- declare function getSupportedChainIds(): number[];
204
- declare function isSupportedTokenAddressForChain(token: Address, chainId: number): boolean;
205
- declare function getSupportedTargetTokens(chainId: number): SupportedTokenOption[];
206
- declare function getTokenDecimalsByAddress(token: Address, chainId?: number): number;
207
- declare function findChainIdForToken(address: Address): number | undefined;
208
- declare function getTokenSymbol(token: Address, chainId?: number): string;
209
- declare function getChainName(chainId: number): string;
210
- declare function getChainBadge(chainId: number): {
211
- shortLabel: string;
212
- color: string;
213
- bg: string;
214
- };
215
- declare function getExplorerUrl(chainId: number): string | undefined;
216
- declare function getExplorerTxUrl(chainId: number, txHash: string): string | undefined;
217
- declare function getExplorerName(chainId: number): string;
218
- declare function getChainIcon(chainId: number): string | undefined;
219
- declare function getTokenIcon(symbol: string): string | undefined;
220
-
221
- export { type AssetOption, CHAIN_BY_ID, type ConnectedEventData, DEFAULT_BACKEND_URL, DEFAULT_SIGNER_ADDRESS, type DepositCompleteEventData, type DepositFailedEventData, DepositModal, type DepositModalBranding, type DepositModalProps, type DepositModalTheme, type DepositModalUIConfig, type DepositSubmittedEventData, type ErrorEventData, NATIVE_TOKEN_ADDRESS, SOURCE_CHAINS, SUPPORTED_CHAINS, type WithdrawCompleteEventData, type WithdrawFailedEventData, WithdrawModal, type WithdrawModalProps, type WithdrawSignParams, type WithdrawSubmittedEventData, executeSafeErc20Transfer, executeSafeEthTransfer, findChainIdForToken, getChainBadge, getChainIcon, getChainId, getChainName, getChainObject, getExplorerName, getExplorerTxUrl, getExplorerUrl, getSupportedChainIds, getSupportedTargetTokens, getSupportedTokenSymbolsForChain, getTokenAddress, getTokenDecimals, getTokenDecimalsByAddress, getTokenIcon, getTokenSymbol, getUsdcAddress, getUsdcDecimals, isSupportedTokenAddressForChain };
7
+ import 'react/jsx-runtime';
8
+ import 'viem';
9
+ import 'viem/chains';
package/dist/index.d.ts CHANGED
@@ -1,221 +1,9 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { Address, Hex, WalletClient, PublicClient, Chain } from 'viem';
3
- import { Chain as Chain$1 } from 'viem/chains';
1
+ export { DepositModal } from './deposit.js';
2
+ export { WithdrawModal } from './withdraw.js';
3
+ export { A as AssetOption, C as ConnectedEventData, D as DepositCompleteEventData, a as DepositFailedEventData, b as DepositModalBranding, c as DepositModalProps, d as DepositModalTheme, e as DepositModalUIConfig, f as DepositSubmittedEventData, E as ErrorEventData, W as WithdrawCompleteEventData, g as WithdrawFailedEventData, h as WithdrawModalProps, i as WithdrawSubmittedEventData } from './types-DnGF9RJJ.js';
4
+ export { CHAIN_BY_ID, DEFAULT_BACKEND_URL, DEFAULT_SIGNER_ADDRESS, NATIVE_TOKEN_ADDRESS, SOURCE_CHAINS, SUPPORTED_CHAINS, findChainIdForToken, getChainBadge, getChainIcon, getChainId, getChainName, getChainObject, getExplorerName, getExplorerTxUrl, getExplorerUrl, getSupportedChainIds, getSupportedTargetTokens, getSupportedTokenSymbolsForChain, getTokenAddress, getTokenDecimals, getTokenDecimalsByAddress, getTokenIcon, getTokenSymbol, getUsdcAddress, getUsdcDecimals, isSupportedTokenAddressForChain } from './constants.js';
5
+ export { SafeTransactionRequest } from './safe.js';
4
6
  export { chainRegistry } from '@rhinestone/shared-configs';
5
-
6
- interface DepositModalTheme {
7
- mode?: "light" | "dark";
8
- radius?: "none" | "sm" | "md" | "lg" | "full";
9
- fontColor?: string;
10
- iconColor?: string;
11
- ctaColor?: string;
12
- ctaHoverColor?: string;
13
- borderColor?: string;
14
- backgroundColor?: string;
15
- }
16
- interface DepositModalUIConfig {
17
- showLogo?: boolean;
18
- showStepper?: boolean;
19
- showBackButton?: boolean;
20
- balanceTitle?: string;
21
- maxDepositUsd?: number;
22
- minDepositUsd?: number;
23
- }
24
- interface DepositModalBranding {
25
- logoUrl?: string;
26
- title?: string;
27
- }
28
- interface ConnectedEventData {
29
- address: Address;
30
- smartAccount: Address;
31
- }
32
- interface DepositSubmittedEventData {
33
- txHash: Hex;
34
- sourceChain: number;
35
- amount: string;
36
- }
37
- interface DepositCompleteEventData {
38
- txHash: Hex;
39
- destinationTxHash?: Hex;
40
- }
41
- interface DepositFailedEventData {
42
- txHash: Hex;
43
- error?: string;
44
- }
45
- interface WithdrawSubmittedEventData {
46
- txHash: Hex;
47
- sourceChain: number;
48
- amount: string;
49
- safeAddress: Address;
50
- }
51
- interface WithdrawCompleteEventData {
52
- txHash: Hex;
53
- destinationTxHash?: Hex;
54
- }
55
- interface WithdrawFailedEventData {
56
- txHash: Hex;
57
- error?: string;
58
- }
59
- interface ErrorEventData {
60
- message: string;
61
- code?: string;
62
- }
63
- interface DepositModalProps {
64
- dappWalletClient?: WalletClient | null;
65
- dappPublicClient?: PublicClient | null;
66
- dappAddress?: Address | null;
67
- targetChain: Chain | number;
68
- targetToken: Address;
69
- isOpen: boolean;
70
- onClose: () => void;
71
- inline?: boolean;
72
- sourceChain?: Chain | number;
73
- sourceToken?: Address;
74
- defaultAmount?: string;
75
- recipient?: Address;
76
- backendUrl?: string;
77
- rhinestoneApiKey?: string;
78
- signerAddress?: Address;
79
- sessionChainIds?: number[];
80
- forceRegister?: boolean;
81
- waitForFinalTx?: boolean;
82
- reownAppId?: string;
83
- onRequestConnect?: () => void;
84
- connectButtonLabel?: string;
85
- theme?: DepositModalTheme;
86
- branding?: DepositModalBranding;
87
- uiConfig?: DepositModalUIConfig;
88
- className?: string;
89
- onReady?: () => void;
90
- onConnected?: (data: ConnectedEventData) => void;
91
- onDepositSubmitted?: (data: DepositSubmittedEventData) => void;
92
- onDepositComplete?: (data: DepositCompleteEventData) => void;
93
- onDepositFailed?: (data: DepositFailedEventData) => void;
94
- onError?: (data: ErrorEventData) => void;
95
- debug?: boolean;
96
- }
97
- interface WithdrawSignParams {
98
- safeAddress: Address;
99
- recipient: Address;
100
- amount: bigint;
101
- tokenAddress: Address;
102
- chainId: number;
103
- isNative: boolean;
104
- }
105
- interface WithdrawModalProps {
106
- dappWalletClient?: WalletClient | null;
107
- dappPublicClient?: PublicClient | null;
108
- dappAddress?: Address | null;
109
- safeAddress: Address;
110
- sourceChain: Chain | number;
111
- sourceToken: Address;
112
- targetChain: Chain | number;
113
- targetToken: Address;
114
- recipient?: Address;
115
- defaultAmount?: string;
116
- isOpen: boolean;
117
- onClose: () => void;
118
- inline?: boolean;
119
- backendUrl?: string;
120
- rhinestoneApiKey?: string;
121
- signerAddress?: Address;
122
- sessionChainIds?: number[];
123
- forceRegister?: boolean;
124
- waitForFinalTx?: boolean;
125
- reownAppId?: string;
126
- onWithdrawSign?: (params: WithdrawSignParams) => Promise<{
127
- txHash: Hex;
128
- }>;
129
- onRequestConnect?: () => void;
130
- connectButtonLabel?: string;
131
- theme?: DepositModalTheme;
132
- branding?: DepositModalBranding;
133
- uiConfig?: DepositModalUIConfig;
134
- className?: string;
135
- onReady?: () => void;
136
- onConnected?: (data: ConnectedEventData) => void;
137
- onWithdrawSubmitted?: (data: WithdrawSubmittedEventData) => void;
138
- onWithdrawComplete?: (data: WithdrawCompleteEventData) => void;
139
- onWithdrawFailed?: (data: WithdrawFailedEventData) => void;
140
- onError?: (data: ErrorEventData) => void;
141
- debug?: boolean;
142
- }
143
- interface AssetOption {
144
- id: string;
145
- chainId: number;
146
- token: Address;
147
- symbol: string;
148
- name: string;
149
- decimals: number;
150
- balance?: string;
151
- balanceUsd?: number;
152
- }
153
-
154
- declare function DepositModal(props: DepositModalProps): react_jsx_runtime.JSX.Element;
155
- declare namespace DepositModal {
156
- var displayName: string;
157
- }
158
-
159
- declare function WithdrawModal(props: WithdrawModalProps): react_jsx_runtime.JSX.Element;
160
- declare namespace WithdrawModal {
161
- var displayName: string;
162
- }
163
-
164
- type SafeTransferResult = {
165
- txHash: Hex;
166
- };
167
- declare function executeSafeEthTransfer(params: {
168
- walletClient: WalletClient;
169
- publicClient: PublicClient;
170
- safeAddress: Address;
171
- recipient: Address;
172
- amount: bigint;
173
- chainId: number;
174
- }): Promise<SafeTransferResult>;
175
- declare function executeSafeErc20Transfer(params: {
176
- walletClient: WalletClient;
177
- publicClient: PublicClient;
178
- safeAddress: Address;
179
- tokenAddress: Address;
180
- recipient: Address;
181
- amount: bigint;
182
- chainId: number;
183
- }): Promise<SafeTransferResult>;
184
-
185
- declare const DEFAULT_BACKEND_URL = "https://v1.orchestrator.rhinestone.dev/deposit-widget";
186
- declare const DEFAULT_SIGNER_ADDRESS: Address;
187
- declare const NATIVE_TOKEN_ADDRESS: Address;
188
- declare const CHAIN_BY_ID: Record<number, Chain$1>;
189
- declare const SOURCE_CHAINS: Chain$1[];
190
- declare const SUPPORTED_CHAINS: Chain$1[];
191
- type SupportedTokenOption = {
192
- symbol: string;
193
- address: Address;
194
- decimals: number;
195
- };
196
- declare function getChainId(chain: Chain$1 | number): number;
197
- declare function getChainObject(chain: Chain$1 | number): Chain$1 | undefined;
198
- declare function getUsdcAddress(chainId: number): Address | undefined;
199
- declare function getUsdcDecimals(chainId: number): number;
200
- declare function getTokenAddress(symbol: string, chainId: number): Address | undefined;
201
- declare function getTokenDecimals(symbol: string, chainId: number): number;
202
- declare function getSupportedTokenSymbolsForChain(chainId: number): string[];
203
- declare function getSupportedChainIds(): number[];
204
- declare function isSupportedTokenAddressForChain(token: Address, chainId: number): boolean;
205
- declare function getSupportedTargetTokens(chainId: number): SupportedTokenOption[];
206
- declare function getTokenDecimalsByAddress(token: Address, chainId?: number): number;
207
- declare function findChainIdForToken(address: Address): number | undefined;
208
- declare function getTokenSymbol(token: Address, chainId?: number): string;
209
- declare function getChainName(chainId: number): string;
210
- declare function getChainBadge(chainId: number): {
211
- shortLabel: string;
212
- color: string;
213
- bg: string;
214
- };
215
- declare function getExplorerUrl(chainId: number): string | undefined;
216
- declare function getExplorerTxUrl(chainId: number, txHash: string): string | undefined;
217
- declare function getExplorerName(chainId: number): string;
218
- declare function getChainIcon(chainId: number): string | undefined;
219
- declare function getTokenIcon(symbol: string): string | undefined;
220
-
221
- export { type AssetOption, CHAIN_BY_ID, type ConnectedEventData, DEFAULT_BACKEND_URL, DEFAULT_SIGNER_ADDRESS, type DepositCompleteEventData, type DepositFailedEventData, DepositModal, type DepositModalBranding, type DepositModalProps, type DepositModalTheme, type DepositModalUIConfig, type DepositSubmittedEventData, type ErrorEventData, NATIVE_TOKEN_ADDRESS, SOURCE_CHAINS, SUPPORTED_CHAINS, type WithdrawCompleteEventData, type WithdrawFailedEventData, WithdrawModal, type WithdrawModalProps, type WithdrawSignParams, type WithdrawSubmittedEventData, executeSafeErc20Transfer, executeSafeEthTransfer, findChainIdForToken, getChainBadge, getChainIcon, getChainId, getChainName, getChainObject, getExplorerName, getExplorerTxUrl, getExplorerUrl, getSupportedChainIds, getSupportedTargetTokens, getSupportedTokenSymbolsForChain, getTokenAddress, getTokenDecimals, getTokenDecimalsByAddress, getTokenIcon, getTokenSymbol, getUsdcAddress, getUsdcDecimals, isSupportedTokenAddressForChain };
7
+ import 'react/jsx-runtime';
8
+ import 'viem';
9
+ import 'viem/chains';