@volr/react 0.2.1 → 0.2.4
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.cjs +4 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -289,6 +289,11 @@ type VolrConfig = {
|
|
|
289
289
|
projectApiKey: string;
|
|
290
290
|
rpcOverrides?: Record<string, string>;
|
|
291
291
|
autoRecoverOnLogin?: boolean;
|
|
292
|
+
/**
|
|
293
|
+
* Allowed locales for UI language selection.
|
|
294
|
+
* If the user's locale is not allowed, English is used.
|
|
295
|
+
*/
|
|
296
|
+
allowedLocales?: Array<"en" | "ko">;
|
|
292
297
|
providerPolicy?: {
|
|
293
298
|
enforceOnFirstLogin?: boolean;
|
|
294
299
|
};
|
|
@@ -593,11 +598,6 @@ type VolrClient = {
|
|
|
593
598
|
* EVM namespace with address, signing methods, and chain client
|
|
594
599
|
*/
|
|
595
600
|
evm: EvmNamespace;
|
|
596
|
-
/**
|
|
597
|
-
* User's EVM wallet address
|
|
598
|
-
* @deprecated Use evm.address instead
|
|
599
|
-
*/
|
|
600
|
-
evmAddress: `0x${string}` | undefined;
|
|
601
601
|
/**
|
|
602
602
|
* User's email (if logged in with email)
|
|
603
603
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -289,6 +289,11 @@ type VolrConfig = {
|
|
|
289
289
|
projectApiKey: string;
|
|
290
290
|
rpcOverrides?: Record<string, string>;
|
|
291
291
|
autoRecoverOnLogin?: boolean;
|
|
292
|
+
/**
|
|
293
|
+
* Allowed locales for UI language selection.
|
|
294
|
+
* If the user's locale is not allowed, English is used.
|
|
295
|
+
*/
|
|
296
|
+
allowedLocales?: Array<"en" | "ko">;
|
|
292
297
|
providerPolicy?: {
|
|
293
298
|
enforceOnFirstLogin?: boolean;
|
|
294
299
|
};
|
|
@@ -593,11 +598,6 @@ type VolrClient = {
|
|
|
593
598
|
* EVM namespace with address, signing methods, and chain client
|
|
594
599
|
*/
|
|
595
600
|
evm: EvmNamespace;
|
|
596
|
-
/**
|
|
597
|
-
* User's EVM wallet address
|
|
598
|
-
* @deprecated Use evm.address instead
|
|
599
|
-
*/
|
|
600
|
-
evmAddress: `0x${string}` | undefined;
|
|
601
601
|
/**
|
|
602
602
|
* User's email (if logged in with email)
|
|
603
603
|
*/
|
package/dist/index.js
CHANGED
|
@@ -10736,7 +10736,7 @@ function VolrProvider({ config, children }) {
|
|
|
10736
10736
|
const client = useMemo(() => {
|
|
10737
10737
|
if (!config.projectApiKey) {
|
|
10738
10738
|
throw new Error(
|
|
10739
|
-
"VolrProvider requires config.projectApiKey. Please
|
|
10739
|
+
"VolrProvider requires config.projectApiKey. Please provide projectApiKey in config."
|
|
10740
10740
|
);
|
|
10741
10741
|
}
|
|
10742
10742
|
return new APIClient({
|
|
@@ -19604,8 +19604,6 @@ function useVolr() {
|
|
|
19604
19604
|
);
|
|
19605
19605
|
return {
|
|
19606
19606
|
evm,
|
|
19607
|
-
evmAddress: user?.evmAddress,
|
|
19608
|
-
// deprecated, kept for backward compatibility
|
|
19609
19607
|
email: user?.email,
|
|
19610
19608
|
isLoggedIn: user !== null,
|
|
19611
19609
|
signerType: user?.signerType,
|
|
@@ -19912,7 +19910,9 @@ Issued At: ${issuedAt}`;
|
|
|
19912
19910
|
if (apiBaseUrl.includes("dev-api") || apiBaseUrl.includes("localhost")) {
|
|
19913
19911
|
params.set("env", "dev");
|
|
19914
19912
|
}
|
|
19915
|
-
const
|
|
19913
|
+
const detectedLang = typeof navigator !== "undefined" ? navigator.language?.toLowerCase().startsWith("ko") ? "ko" : "en" : "en";
|
|
19914
|
+
const allowedLocales = config.allowedLocales;
|
|
19915
|
+
const lang = allowedLocales && !allowedLocales.includes(detectedLang) ? "en" : detectedLang;
|
|
19916
19916
|
params.set("lang", lang);
|
|
19917
19917
|
return `https://sign.volr.io?${params.toString()}`;
|
|
19918
19918
|
},
|