@volr/react-ui 0.1.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.
- package/README.md +341 -0
- package/dist/index.cjs +3141 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +236 -0
- package/dist/index.d.ts +236 -0
- package/dist/index.js +3124 -0
- package/dist/index.js.map +1 -0
- package/package.json +82 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
import React$1 from 'react';
|
|
2
|
+
import { KeyStorageType, VolrConfig } from '@volr/react';
|
|
3
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
interface BrandingConfig {
|
|
6
|
+
component: React.ReactNode;
|
|
7
|
+
backgroundColor?: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* UI 전용 설정을 포함한 Volr UI 구성 객체
|
|
12
|
+
* - VolrConfig(코어 설정)를 확장하고
|
|
13
|
+
* - UI/온보딩 관련 옵션을 모두 하나의 config 아래로 모읍니다.
|
|
14
|
+
*/
|
|
15
|
+
interface VolrUIConfig extends VolrConfig {
|
|
16
|
+
appName: string;
|
|
17
|
+
accentColor?: string;
|
|
18
|
+
enabledLoginMethods?: ("email" | "social" | "siwe")[];
|
|
19
|
+
socialProviders?: ("google" | "twitter" | "apple")[];
|
|
20
|
+
branding?: BrandingConfig;
|
|
21
|
+
keyStorageType: KeyStorageType;
|
|
22
|
+
}
|
|
23
|
+
interface VolrUIProviderProps {
|
|
24
|
+
config: VolrUIConfig;
|
|
25
|
+
children: React$1.ReactNode;
|
|
26
|
+
}
|
|
27
|
+
declare const useVolrUI: () => {
|
|
28
|
+
accentColor: string;
|
|
29
|
+
appName: string;
|
|
30
|
+
enabledLoginMethods?: ("email" | "social" | "siwe")[];
|
|
31
|
+
socialProviders?: ("google" | "twitter" | "apple")[];
|
|
32
|
+
branding?: BrandingConfig;
|
|
33
|
+
keyStorageType?: KeyStorageType;
|
|
34
|
+
};
|
|
35
|
+
declare const VolrUIProvider: React$1.FC<VolrUIProviderProps>;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Passkey Enrollment View Component
|
|
39
|
+
* Modern passkey setup with device-specific biometric icons
|
|
40
|
+
*/
|
|
41
|
+
interface PasskeyEnrollViewProps {
|
|
42
|
+
onComplete: () => void;
|
|
43
|
+
onError?: (error: Error) => void;
|
|
44
|
+
onLogout?: () => void;
|
|
45
|
+
onClose?: () => void;
|
|
46
|
+
/** Whether the modal is open */
|
|
47
|
+
isOpen?: boolean;
|
|
48
|
+
/** Whether to wrap content in Modal component */
|
|
49
|
+
wrapInModal?: boolean;
|
|
50
|
+
}
|
|
51
|
+
declare function PasskeyEnrollView({ onComplete, onError, onLogout, onClose, isOpen, wrapInModal, }: PasskeyEnrollViewProps): react_jsx_runtime.JSX.Element;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* MPC Connect View Component
|
|
55
|
+
* MPC 연결 플로우: useMpcConnection hook 사용
|
|
56
|
+
*/
|
|
57
|
+
interface MpcConnectViewProps {
|
|
58
|
+
onComplete: () => void;
|
|
59
|
+
onError?: (error: Error) => void;
|
|
60
|
+
/** Whether the modal is open */
|
|
61
|
+
isOpen?: boolean;
|
|
62
|
+
/** Whether to wrap content in Modal component */
|
|
63
|
+
wrapInModal?: boolean;
|
|
64
|
+
}
|
|
65
|
+
declare function MpcConnectView({ onComplete, onError, isOpen, wrapInModal, }: MpcConnectViewProps): react_jsx_runtime.JSX.Element;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* English translations
|
|
69
|
+
*/
|
|
70
|
+
declare const en: {
|
|
71
|
+
readonly common: {
|
|
72
|
+
readonly back: "Back";
|
|
73
|
+
readonly loading: "Loading...";
|
|
74
|
+
};
|
|
75
|
+
readonly login: {
|
|
76
|
+
readonly title: "Sign in";
|
|
77
|
+
readonly description: "Choose your preferred sign-in method";
|
|
78
|
+
readonly or: "or";
|
|
79
|
+
readonly poweredBy: "Powered by Volr";
|
|
80
|
+
readonly terms: "By continuing, you agree to our Terms of Service and Privacy Policy";
|
|
81
|
+
readonly email: {
|
|
82
|
+
readonly title: "Sign in with email";
|
|
83
|
+
readonly description: "Enter your email to receive a verification code";
|
|
84
|
+
readonly label: "Email Login";
|
|
85
|
+
readonly emailLabel: "Email address";
|
|
86
|
+
readonly placeholder: "Enter Email";
|
|
87
|
+
readonly sendCode: "Send verification code";
|
|
88
|
+
readonly codeLabel: "6-digit verification code";
|
|
89
|
+
readonly codePlaceholder: "000000";
|
|
90
|
+
readonly verifyTitle: "Enter verification code";
|
|
91
|
+
readonly verifyDescription: "We sent a code to";
|
|
92
|
+
readonly resend: "Resend code";
|
|
93
|
+
readonly submit: "Verify";
|
|
94
|
+
};
|
|
95
|
+
readonly social: {
|
|
96
|
+
readonly google: "Sign in with Google";
|
|
97
|
+
readonly twitter: "Sign in with Twitter";
|
|
98
|
+
readonly apple: "Sign in with Apple";
|
|
99
|
+
};
|
|
100
|
+
readonly wallet: {
|
|
101
|
+
readonly title: "Sign in with wallet";
|
|
102
|
+
readonly signDescription: "Sign the message to verify your wallet";
|
|
103
|
+
readonly connected: "Connected";
|
|
104
|
+
readonly connect: "Connect wallet";
|
|
105
|
+
readonly sign: "Sign message";
|
|
106
|
+
readonly label: "Wallet Login";
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
readonly passkey: {
|
|
110
|
+
readonly touchId: "Use Touch ID to create your passkey";
|
|
111
|
+
readonly faceId: "Use Face ID to create your passkey";
|
|
112
|
+
readonly fingerprint: "Use your fingerprint to create your passkey";
|
|
113
|
+
readonly biometric: "Use biometric authentication to create your passkey";
|
|
114
|
+
readonly creating: "Creating your secure passkey...";
|
|
115
|
+
readonly encrypting: "Encrypting your wallet...";
|
|
116
|
+
readonly uploading: "Uploading encrypted data...";
|
|
117
|
+
readonly registering: "Registering wallet provider...";
|
|
118
|
+
readonly start: "Create passkey";
|
|
119
|
+
readonly logout: "Logout";
|
|
120
|
+
readonly errors: {
|
|
121
|
+
readonly cancelled: "Passkey creation was cancelled. Please try again.";
|
|
122
|
+
readonly alreadyExists: "A passkey already exists for this account.";
|
|
123
|
+
readonly notSupported: "Your device doesn't support passkeys.";
|
|
124
|
+
readonly generic: "Failed to create passkey. Please try again.";
|
|
125
|
+
};
|
|
126
|
+
};
|
|
127
|
+
readonly success: {
|
|
128
|
+
readonly title: "Success!";
|
|
129
|
+
readonly message: "You're all set. Redirecting...";
|
|
130
|
+
};
|
|
131
|
+
readonly deposit: {
|
|
132
|
+
readonly selectTitle: "Select asset to deposit";
|
|
133
|
+
readonly qrTitle: "Deposit";
|
|
134
|
+
readonly scanInstruction: "Scan QR code to deposit";
|
|
135
|
+
readonly yourAddress: "Your deposit address";
|
|
136
|
+
readonly copy: "Copy address";
|
|
137
|
+
readonly copied: "Copied!";
|
|
138
|
+
readonly listening: "Waiting for deposit...";
|
|
139
|
+
readonly detected: "Deposit confirmed!";
|
|
140
|
+
readonly completed: "Deposit completed";
|
|
141
|
+
readonly completedDescription: "Your deposit has been credited to your account.";
|
|
142
|
+
readonly amount: "Amount";
|
|
143
|
+
readonly previousBalance: "Previous balance";
|
|
144
|
+
readonly newBalance: "New balance";
|
|
145
|
+
readonly seeMore: "See more";
|
|
146
|
+
readonly seeLess: "See less";
|
|
147
|
+
readonly noAssets: "No deposit assets configured.";
|
|
148
|
+
readonly otherToken: "Deposit with another token";
|
|
149
|
+
readonly noToken: "Don't have this token?";
|
|
150
|
+
readonly getOtherToken: "Deposit with another token";
|
|
151
|
+
};
|
|
152
|
+
readonly errors: {
|
|
153
|
+
readonly webauthnNotSupported: "WebAuthn API is not supported";
|
|
154
|
+
readonly passkeyCreationFailed: "Failed to create passkey";
|
|
155
|
+
readonly passkeyCreationError: "An error occurred while creating passkey";
|
|
156
|
+
readonly emailLoginFailed: "Email login failed";
|
|
157
|
+
readonly socialLoginFailed: "Social login failed";
|
|
158
|
+
readonly walletConnectionFailed: "Wallet connection failed";
|
|
159
|
+
readonly passkeySetupFailed: "Passkey setup failed";
|
|
160
|
+
};
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* i18n types and utilities
|
|
165
|
+
*/
|
|
166
|
+
|
|
167
|
+
type Locale = 'en' | 'ko';
|
|
168
|
+
type DeepStringify<T> = T extends string ? string : T extends object ? {
|
|
169
|
+
readonly [K in keyof T]: DeepStringify<T[K]>;
|
|
170
|
+
} : T;
|
|
171
|
+
type Translations = DeepStringify<typeof en>;
|
|
172
|
+
|
|
173
|
+
interface I18nContextValue {
|
|
174
|
+
locale: Locale;
|
|
175
|
+
translations: Translations;
|
|
176
|
+
t: (key: string) => string;
|
|
177
|
+
setLocale: (locale: Locale) => void;
|
|
178
|
+
}
|
|
179
|
+
declare const I18nContext: React$1.Context<I18nContextValue | null>;
|
|
180
|
+
/**
|
|
181
|
+
* Hook to access i18n context
|
|
182
|
+
*/
|
|
183
|
+
declare function useI18n(): I18nContextValue;
|
|
184
|
+
/**
|
|
185
|
+
* I18n Provider component
|
|
186
|
+
*/
|
|
187
|
+
interface I18nProviderProps {
|
|
188
|
+
children: React$1.ReactNode;
|
|
189
|
+
}
|
|
190
|
+
declare function I18nProvider({ children }: I18nProviderProps): react_jsx_runtime.JSX.Element;
|
|
191
|
+
declare const useTranslation: typeof useI18n;
|
|
192
|
+
|
|
193
|
+
type ModalMode = "auth" | "deposit";
|
|
194
|
+
interface VolrModalContextValue {
|
|
195
|
+
isOpen: boolean;
|
|
196
|
+
mode: ModalMode;
|
|
197
|
+
open: () => void;
|
|
198
|
+
close: () => void;
|
|
199
|
+
toggle: () => void;
|
|
200
|
+
}
|
|
201
|
+
declare const useVolrModal: () => VolrModalContextValue;
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* @deprecated Use NetworkWalletConfig instead
|
|
205
|
+
* Legacy interface for wallet_addEthereumChain (converted from API response)
|
|
206
|
+
*/
|
|
207
|
+
interface NetworkConfig {
|
|
208
|
+
chainId: number;
|
|
209
|
+
chainName: string;
|
|
210
|
+
nativeCurrency: {
|
|
211
|
+
name: string;
|
|
212
|
+
symbol: string;
|
|
213
|
+
decimals: number;
|
|
214
|
+
};
|
|
215
|
+
rpcUrls: string[];
|
|
216
|
+
blockExplorerUrls?: string[];
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Hook to switch to a different network
|
|
220
|
+
* Handles both switching and adding network if not present
|
|
221
|
+
* Fetches network configuration from backend DB
|
|
222
|
+
*/
|
|
223
|
+
declare function useSwitchNetwork(): (chainId: number) => Promise<void>;
|
|
224
|
+
/**
|
|
225
|
+
* @deprecated Use useSwitchNetwork hook instead
|
|
226
|
+
* Switch to a different network (legacy function, requires client parameter)
|
|
227
|
+
*/
|
|
228
|
+
declare function switchNetwork(chainId: number, client: {
|
|
229
|
+
get: <T>(url: string) => Promise<T>;
|
|
230
|
+
}): Promise<void>;
|
|
231
|
+
/**
|
|
232
|
+
* Get current chain ID from wallet
|
|
233
|
+
*/
|
|
234
|
+
declare function getCurrentChainId(): Promise<number>;
|
|
235
|
+
|
|
236
|
+
export { I18nContext, type I18nContextValue, I18nProvider, type I18nProviderProps, type Locale, MpcConnectView, type MpcConnectViewProps, type NetworkConfig, PasskeyEnrollView, type PasskeyEnrollViewProps, type Translations, type VolrUIConfig, VolrUIProvider, type VolrUIProviderProps, getCurrentChainId, switchNetwork, useI18n, useSwitchNetwork, useTranslation, useVolrModal, useVolrUI };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
import React$1 from 'react';
|
|
2
|
+
import { KeyStorageType, VolrConfig } from '@volr/react';
|
|
3
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
interface BrandingConfig {
|
|
6
|
+
component: React.ReactNode;
|
|
7
|
+
backgroundColor?: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* UI 전용 설정을 포함한 Volr UI 구성 객체
|
|
12
|
+
* - VolrConfig(코어 설정)를 확장하고
|
|
13
|
+
* - UI/온보딩 관련 옵션을 모두 하나의 config 아래로 모읍니다.
|
|
14
|
+
*/
|
|
15
|
+
interface VolrUIConfig extends VolrConfig {
|
|
16
|
+
appName: string;
|
|
17
|
+
accentColor?: string;
|
|
18
|
+
enabledLoginMethods?: ("email" | "social" | "siwe")[];
|
|
19
|
+
socialProviders?: ("google" | "twitter" | "apple")[];
|
|
20
|
+
branding?: BrandingConfig;
|
|
21
|
+
keyStorageType: KeyStorageType;
|
|
22
|
+
}
|
|
23
|
+
interface VolrUIProviderProps {
|
|
24
|
+
config: VolrUIConfig;
|
|
25
|
+
children: React$1.ReactNode;
|
|
26
|
+
}
|
|
27
|
+
declare const useVolrUI: () => {
|
|
28
|
+
accentColor: string;
|
|
29
|
+
appName: string;
|
|
30
|
+
enabledLoginMethods?: ("email" | "social" | "siwe")[];
|
|
31
|
+
socialProviders?: ("google" | "twitter" | "apple")[];
|
|
32
|
+
branding?: BrandingConfig;
|
|
33
|
+
keyStorageType?: KeyStorageType;
|
|
34
|
+
};
|
|
35
|
+
declare const VolrUIProvider: React$1.FC<VolrUIProviderProps>;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Passkey Enrollment View Component
|
|
39
|
+
* Modern passkey setup with device-specific biometric icons
|
|
40
|
+
*/
|
|
41
|
+
interface PasskeyEnrollViewProps {
|
|
42
|
+
onComplete: () => void;
|
|
43
|
+
onError?: (error: Error) => void;
|
|
44
|
+
onLogout?: () => void;
|
|
45
|
+
onClose?: () => void;
|
|
46
|
+
/** Whether the modal is open */
|
|
47
|
+
isOpen?: boolean;
|
|
48
|
+
/** Whether to wrap content in Modal component */
|
|
49
|
+
wrapInModal?: boolean;
|
|
50
|
+
}
|
|
51
|
+
declare function PasskeyEnrollView({ onComplete, onError, onLogout, onClose, isOpen, wrapInModal, }: PasskeyEnrollViewProps): react_jsx_runtime.JSX.Element;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* MPC Connect View Component
|
|
55
|
+
* MPC 연결 플로우: useMpcConnection hook 사용
|
|
56
|
+
*/
|
|
57
|
+
interface MpcConnectViewProps {
|
|
58
|
+
onComplete: () => void;
|
|
59
|
+
onError?: (error: Error) => void;
|
|
60
|
+
/** Whether the modal is open */
|
|
61
|
+
isOpen?: boolean;
|
|
62
|
+
/** Whether to wrap content in Modal component */
|
|
63
|
+
wrapInModal?: boolean;
|
|
64
|
+
}
|
|
65
|
+
declare function MpcConnectView({ onComplete, onError, isOpen, wrapInModal, }: MpcConnectViewProps): react_jsx_runtime.JSX.Element;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* English translations
|
|
69
|
+
*/
|
|
70
|
+
declare const en: {
|
|
71
|
+
readonly common: {
|
|
72
|
+
readonly back: "Back";
|
|
73
|
+
readonly loading: "Loading...";
|
|
74
|
+
};
|
|
75
|
+
readonly login: {
|
|
76
|
+
readonly title: "Sign in";
|
|
77
|
+
readonly description: "Choose your preferred sign-in method";
|
|
78
|
+
readonly or: "or";
|
|
79
|
+
readonly poweredBy: "Powered by Volr";
|
|
80
|
+
readonly terms: "By continuing, you agree to our Terms of Service and Privacy Policy";
|
|
81
|
+
readonly email: {
|
|
82
|
+
readonly title: "Sign in with email";
|
|
83
|
+
readonly description: "Enter your email to receive a verification code";
|
|
84
|
+
readonly label: "Email Login";
|
|
85
|
+
readonly emailLabel: "Email address";
|
|
86
|
+
readonly placeholder: "Enter Email";
|
|
87
|
+
readonly sendCode: "Send verification code";
|
|
88
|
+
readonly codeLabel: "6-digit verification code";
|
|
89
|
+
readonly codePlaceholder: "000000";
|
|
90
|
+
readonly verifyTitle: "Enter verification code";
|
|
91
|
+
readonly verifyDescription: "We sent a code to";
|
|
92
|
+
readonly resend: "Resend code";
|
|
93
|
+
readonly submit: "Verify";
|
|
94
|
+
};
|
|
95
|
+
readonly social: {
|
|
96
|
+
readonly google: "Sign in with Google";
|
|
97
|
+
readonly twitter: "Sign in with Twitter";
|
|
98
|
+
readonly apple: "Sign in with Apple";
|
|
99
|
+
};
|
|
100
|
+
readonly wallet: {
|
|
101
|
+
readonly title: "Sign in with wallet";
|
|
102
|
+
readonly signDescription: "Sign the message to verify your wallet";
|
|
103
|
+
readonly connected: "Connected";
|
|
104
|
+
readonly connect: "Connect wallet";
|
|
105
|
+
readonly sign: "Sign message";
|
|
106
|
+
readonly label: "Wallet Login";
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
readonly passkey: {
|
|
110
|
+
readonly touchId: "Use Touch ID to create your passkey";
|
|
111
|
+
readonly faceId: "Use Face ID to create your passkey";
|
|
112
|
+
readonly fingerprint: "Use your fingerprint to create your passkey";
|
|
113
|
+
readonly biometric: "Use biometric authentication to create your passkey";
|
|
114
|
+
readonly creating: "Creating your secure passkey...";
|
|
115
|
+
readonly encrypting: "Encrypting your wallet...";
|
|
116
|
+
readonly uploading: "Uploading encrypted data...";
|
|
117
|
+
readonly registering: "Registering wallet provider...";
|
|
118
|
+
readonly start: "Create passkey";
|
|
119
|
+
readonly logout: "Logout";
|
|
120
|
+
readonly errors: {
|
|
121
|
+
readonly cancelled: "Passkey creation was cancelled. Please try again.";
|
|
122
|
+
readonly alreadyExists: "A passkey already exists for this account.";
|
|
123
|
+
readonly notSupported: "Your device doesn't support passkeys.";
|
|
124
|
+
readonly generic: "Failed to create passkey. Please try again.";
|
|
125
|
+
};
|
|
126
|
+
};
|
|
127
|
+
readonly success: {
|
|
128
|
+
readonly title: "Success!";
|
|
129
|
+
readonly message: "You're all set. Redirecting...";
|
|
130
|
+
};
|
|
131
|
+
readonly deposit: {
|
|
132
|
+
readonly selectTitle: "Select asset to deposit";
|
|
133
|
+
readonly qrTitle: "Deposit";
|
|
134
|
+
readonly scanInstruction: "Scan QR code to deposit";
|
|
135
|
+
readonly yourAddress: "Your deposit address";
|
|
136
|
+
readonly copy: "Copy address";
|
|
137
|
+
readonly copied: "Copied!";
|
|
138
|
+
readonly listening: "Waiting for deposit...";
|
|
139
|
+
readonly detected: "Deposit confirmed!";
|
|
140
|
+
readonly completed: "Deposit completed";
|
|
141
|
+
readonly completedDescription: "Your deposit has been credited to your account.";
|
|
142
|
+
readonly amount: "Amount";
|
|
143
|
+
readonly previousBalance: "Previous balance";
|
|
144
|
+
readonly newBalance: "New balance";
|
|
145
|
+
readonly seeMore: "See more";
|
|
146
|
+
readonly seeLess: "See less";
|
|
147
|
+
readonly noAssets: "No deposit assets configured.";
|
|
148
|
+
readonly otherToken: "Deposit with another token";
|
|
149
|
+
readonly noToken: "Don't have this token?";
|
|
150
|
+
readonly getOtherToken: "Deposit with another token";
|
|
151
|
+
};
|
|
152
|
+
readonly errors: {
|
|
153
|
+
readonly webauthnNotSupported: "WebAuthn API is not supported";
|
|
154
|
+
readonly passkeyCreationFailed: "Failed to create passkey";
|
|
155
|
+
readonly passkeyCreationError: "An error occurred while creating passkey";
|
|
156
|
+
readonly emailLoginFailed: "Email login failed";
|
|
157
|
+
readonly socialLoginFailed: "Social login failed";
|
|
158
|
+
readonly walletConnectionFailed: "Wallet connection failed";
|
|
159
|
+
readonly passkeySetupFailed: "Passkey setup failed";
|
|
160
|
+
};
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* i18n types and utilities
|
|
165
|
+
*/
|
|
166
|
+
|
|
167
|
+
type Locale = 'en' | 'ko';
|
|
168
|
+
type DeepStringify<T> = T extends string ? string : T extends object ? {
|
|
169
|
+
readonly [K in keyof T]: DeepStringify<T[K]>;
|
|
170
|
+
} : T;
|
|
171
|
+
type Translations = DeepStringify<typeof en>;
|
|
172
|
+
|
|
173
|
+
interface I18nContextValue {
|
|
174
|
+
locale: Locale;
|
|
175
|
+
translations: Translations;
|
|
176
|
+
t: (key: string) => string;
|
|
177
|
+
setLocale: (locale: Locale) => void;
|
|
178
|
+
}
|
|
179
|
+
declare const I18nContext: React$1.Context<I18nContextValue | null>;
|
|
180
|
+
/**
|
|
181
|
+
* Hook to access i18n context
|
|
182
|
+
*/
|
|
183
|
+
declare function useI18n(): I18nContextValue;
|
|
184
|
+
/**
|
|
185
|
+
* I18n Provider component
|
|
186
|
+
*/
|
|
187
|
+
interface I18nProviderProps {
|
|
188
|
+
children: React$1.ReactNode;
|
|
189
|
+
}
|
|
190
|
+
declare function I18nProvider({ children }: I18nProviderProps): react_jsx_runtime.JSX.Element;
|
|
191
|
+
declare const useTranslation: typeof useI18n;
|
|
192
|
+
|
|
193
|
+
type ModalMode = "auth" | "deposit";
|
|
194
|
+
interface VolrModalContextValue {
|
|
195
|
+
isOpen: boolean;
|
|
196
|
+
mode: ModalMode;
|
|
197
|
+
open: () => void;
|
|
198
|
+
close: () => void;
|
|
199
|
+
toggle: () => void;
|
|
200
|
+
}
|
|
201
|
+
declare const useVolrModal: () => VolrModalContextValue;
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* @deprecated Use NetworkWalletConfig instead
|
|
205
|
+
* Legacy interface for wallet_addEthereumChain (converted from API response)
|
|
206
|
+
*/
|
|
207
|
+
interface NetworkConfig {
|
|
208
|
+
chainId: number;
|
|
209
|
+
chainName: string;
|
|
210
|
+
nativeCurrency: {
|
|
211
|
+
name: string;
|
|
212
|
+
symbol: string;
|
|
213
|
+
decimals: number;
|
|
214
|
+
};
|
|
215
|
+
rpcUrls: string[];
|
|
216
|
+
blockExplorerUrls?: string[];
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Hook to switch to a different network
|
|
220
|
+
* Handles both switching and adding network if not present
|
|
221
|
+
* Fetches network configuration from backend DB
|
|
222
|
+
*/
|
|
223
|
+
declare function useSwitchNetwork(): (chainId: number) => Promise<void>;
|
|
224
|
+
/**
|
|
225
|
+
* @deprecated Use useSwitchNetwork hook instead
|
|
226
|
+
* Switch to a different network (legacy function, requires client parameter)
|
|
227
|
+
*/
|
|
228
|
+
declare function switchNetwork(chainId: number, client: {
|
|
229
|
+
get: <T>(url: string) => Promise<T>;
|
|
230
|
+
}): Promise<void>;
|
|
231
|
+
/**
|
|
232
|
+
* Get current chain ID from wallet
|
|
233
|
+
*/
|
|
234
|
+
declare function getCurrentChainId(): Promise<number>;
|
|
235
|
+
|
|
236
|
+
export { I18nContext, type I18nContextValue, I18nProvider, type I18nProviderProps, type Locale, MpcConnectView, type MpcConnectViewProps, type NetworkConfig, PasskeyEnrollView, type PasskeyEnrollViewProps, type Translations, type VolrUIConfig, VolrUIProvider, type VolrUIProviderProps, getCurrentChainId, switchNetwork, useI18n, useSwitchNetwork, useTranslation, useVolrModal, useVolrUI };
|