@web3auth/modal
Version:
Multi chain wallet aggregator for web3Auth
22 lines (19 loc) • 1.27 kB
JavaScript
import { AUTH_CONNECTION, BUILD_ENV } from '@web3auth/auth';
function capitalizeFirstLetter(string) {
return string.charAt(0).toUpperCase() + string.slice(1);
}
const restrictedLoginMethods = new Set([AUTH_CONNECTION.CUSTOM, AUTH_CONNECTION.PASSKEYS, AUTH_CONNECTION.TELEGRAM, AUTH_CONNECTION.AUTHENTICATOR]);
const AUTH_PROVIDERS = Object.values(AUTH_CONNECTION).filter(x => !restrictedLoginMethods.has(x));
const AUTH_PROVIDERS_NAMES = AUTH_PROVIDERS.reduce((acc, x) => {
if (x === "email_passwordless") acc[x] = "Email";else if (x === "sms_passwordless") acc[x] = "Mobile";else acc[x] = capitalizeFirstLetter(x);
return acc;
}, {});
const PASSWORDLESS_BUILD_ENV_MAP = {
// [BUILD_ENV.DEVELOPMENT]: "http://localhost:3041/passwordless-service",
[BUILD_ENV.DEVELOPMENT]: "https://api-develop.web3auth.io/passwordless-service",
[BUILD_ENV.STAGING]: "https://api.web3auth.io/passwordless-service",
[BUILD_ENV.PRODUCTION]: "https://api.web3auth.io/passwordless-service",
[BUILD_ENV.TESTING]: "https://api-develop.web3auth.io/passwordless-service"
};
const CAPTCHA_SITE_KEY = "d5f0c15c-eeda-4f9c-934a-d8e0348e83b2";
export { AUTH_PROVIDERS, AUTH_PROVIDERS_NAMES, CAPTCHA_SITE_KEY, PASSWORDLESS_BUILD_ENV_MAP, capitalizeFirstLetter, restrictedLoginMethods };