UNPKG

@web3auth/modal

Version:

Multi chain wallet aggregator for web3Auth

29 lines (25 loc) 1.48 kB
'use strict'; var auth = require('@web3auth/auth'); function capitalizeFirstLetter(string) { return string.charAt(0).toUpperCase() + string.slice(1); } const restrictedLoginMethods = new Set([auth.AUTH_CONNECTION.CUSTOM, auth.AUTH_CONNECTION.PASSKEYS, auth.AUTH_CONNECTION.TELEGRAM, auth.AUTH_CONNECTION.AUTHENTICATOR]); const AUTH_PROVIDERS = Object.values(auth.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", [auth.BUILD_ENV.DEVELOPMENT]: "https://api-develop.web3auth.io/passwordless-service", [auth.BUILD_ENV.STAGING]: "https://api.web3auth.io/passwordless-service", [auth.BUILD_ENV.PRODUCTION]: "https://api.web3auth.io/passwordless-service", [auth.BUILD_ENV.TESTING]: "https://api-develop.web3auth.io/passwordless-service" }; const CAPTCHA_SITE_KEY = "d5f0c15c-eeda-4f9c-934a-d8e0348e83b2"; exports.AUTH_PROVIDERS = AUTH_PROVIDERS; exports.AUTH_PROVIDERS_NAMES = AUTH_PROVIDERS_NAMES; exports.CAPTCHA_SITE_KEY = CAPTCHA_SITE_KEY; exports.PASSWORDLESS_BUILD_ENV_MAP = PASSWORDLESS_BUILD_ENV_MAP; exports.capitalizeFirstLetter = capitalizeFirstLetter; exports.restrictedLoginMethods = restrictedLoginMethods;