@web3auth/no-modal 10.5.0 → 10.5.3

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.
@@ -23,10 +23,12 @@ const SOLANA_CAIP_CHAIN_MAP = {
23
23
  "0x66": "4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z",
24
24
  "0x67": "EtWTRABZaYq6iMfeYKouRu166VU2xqa1"
25
25
  };
26
+ const WALLET_REGISTRY_URL = "https://assets.web3auth.io/v2/wallet-registry.json";
26
27
 
27
28
  exports.LOGIN_MODE = LOGIN_MODE;
28
29
  exports.MODAL_SIGN_IN_METHODS = MODAL_SIGN_IN_METHODS;
29
30
  exports.SMART_ACCOUNT_WALLET_SCOPE = SMART_ACCOUNT_WALLET_SCOPE;
30
31
  exports.SOLANA_CAIP_CHAIN_MAP = SOLANA_CAIP_CHAIN_MAP;
32
+ exports.WALLET_REGISTRY_URL = WALLET_REGISTRY_URL;
31
33
  exports.WEB3AUTH_STATE_STORAGE_KEY = WEB3AUTH_STATE_STORAGE_KEY;
32
34
  exports.WIDGET_TYPE = WIDGET_TYPE;
@@ -32,7 +32,7 @@ const fetchProjectConfig = async ({
32
32
  return res;
33
33
  };
34
34
  const fetchWalletRegistry = async url => {
35
- const res = await httpHelpers.get(url || "https://assets.web3auth.io/v1/wallet-registry.json");
35
+ const res = await httpHelpers.get(url || constants.WALLET_REGISTRY_URL);
36
36
  return res;
37
37
  };
38
38
  // Normalize wallet name to a standard format, used for external wallets that are auto-detected by MIPD (EIP-6963 and Wallet Standard)
@@ -145,7 +145,7 @@ const getWalletServicesAnalyticsProperties = walletServicesConfig => {
145
145
  ws_default_portfolio: walletServicesConfig === null || walletServicesConfig === void 0 || (_walletServicesConfig1 = walletServicesConfig.whiteLabel) === null || _walletServicesConfig1 === void 0 ? void 0 : _walletServicesConfig1.defaultPortfolio
146
146
  };
147
147
  };
148
- const sdkVersion = "10.5.0";
148
+ const sdkVersion = "10.5.3";
149
149
  const getErrorAnalyticsProperties = error => {
150
150
  try {
151
151
  const code = error instanceof index.Web3AuthError ? error.code : error === null || error === void 0 ? void 0 : error.code;
@@ -98,6 +98,7 @@ exports.LOGIN_MODE = constants$1.LOGIN_MODE;
98
98
  exports.MODAL_SIGN_IN_METHODS = constants$1.MODAL_SIGN_IN_METHODS;
99
99
  exports.SMART_ACCOUNT_WALLET_SCOPE = constants$1.SMART_ACCOUNT_WALLET_SCOPE;
100
100
  exports.SOLANA_CAIP_CHAIN_MAP = constants$1.SOLANA_CAIP_CHAIN_MAP;
101
+ exports.WALLET_REGISTRY_URL = constants$1.WALLET_REGISTRY_URL;
101
102
  exports.WEB3AUTH_STATE_STORAGE_KEY = constants$1.WEB3AUTH_STATE_STORAGE_KEY;
102
103
  exports.WIDGET_TYPE = constants$1.WIDGET_TYPE;
103
104
  exports.cookieToWeb3AuthState = cookie.cookieToWeb3AuthState;
@@ -136,6 +136,7 @@ class Web3AuthNoModal extends auth.SafeEventEmitter {
136
136
  this.initCachedConnectorAndChainId();
137
137
  this.initUIConfig(projectConfig);
138
138
  this.initWalletServicesConfig(projectConfig);
139
+ this.initSessionTimeConfig(projectConfig);
139
140
  this.analytics.setGlobalProperties({
140
141
  team_id: projectConfig.teamId
141
142
  });
@@ -474,6 +475,10 @@ class Web3AuthNoModal extends auth.SafeEventEmitter {
474
475
  uxMode: auth.UX_MODE.POPUP
475
476
  }, auth.cloneDeep(projectConfig.whitelabel || {}), this.coreOptions.uiConfig || {}]);
476
477
  }
478
+ initSessionTimeConfig(projectConfig) {
479
+ if (this.coreOptions.sessionTime) return;
480
+ if (projectConfig.sessionTime) this.coreOptions.sessionTime = projectConfig.sessionTime;
481
+ }
477
482
  initCachedConnectorAndChainId() {
478
483
  // init chainId using cached chainId if it exists and is valid, otherwise use the defaultChainId or the first chain
479
484
  const cachedChainId = this.state.currentChainId;
@@ -17,3 +17,4 @@ export declare const LOGIN_MODE: {
17
17
  readonly NO_MODAL: "no-modal";
18
18
  };
19
19
  export declare const SOLANA_CAIP_CHAIN_MAP: Record<string, string>;
20
+ export declare const WALLET_REGISTRY_URL = "https://assets.web3auth.io/v2/wallet-registry.json";
@@ -49,6 +49,7 @@ export declare class Web3AuthNoModal extends SafeEventEmitter<Web3AuthNoModalEve
49
49
  protected initChainsConfig(projectConfig: ProjectConfig): void;
50
50
  protected initAccountAbstractionConfig(projectConfig?: ProjectConfig): void;
51
51
  protected initUIConfig(projectConfig: ProjectConfig): void;
52
+ protected initSessionTimeConfig(projectConfig: ProjectConfig): void;
52
53
  protected initCachedConnectorAndChainId(): void;
53
54
  protected initWalletServicesConfig(projectConfig: ProjectConfig): void;
54
55
  protected getInitializationTrackData(): {};
@@ -21,5 +21,6 @@ const SOLANA_CAIP_CHAIN_MAP = {
21
21
  "0x66": "4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z",
22
22
  "0x67": "EtWTRABZaYq6iMfeYKouRu166VU2xqa1"
23
23
  };
24
+ const WALLET_REGISTRY_URL = "https://assets.web3auth.io/v2/wallet-registry.json";
24
25
 
25
- export { LOGIN_MODE, MODAL_SIGN_IN_METHODS, SMART_ACCOUNT_WALLET_SCOPE, SOLANA_CAIP_CHAIN_MAP, WEB3AUTH_STATE_STORAGE_KEY, WIDGET_TYPE };
26
+ export { LOGIN_MODE, MODAL_SIGN_IN_METHODS, SMART_ACCOUNT_WALLET_SCOPE, SOLANA_CAIP_CHAIN_MAP, WALLET_REGISTRY_URL, WEB3AUTH_STATE_STORAGE_KEY, WIDGET_TYPE };
@@ -2,7 +2,7 @@ import { CHAIN_NAMESPACES } from '@toruslabs/base-controllers';
2
2
  export { cloneDeep } from '@toruslabs/base-controllers';
3
3
  import { SIGNER_MAP } from '@toruslabs/constants';
4
4
  import { get } from '@toruslabs/http-helpers';
5
- import { SOLANA_CAIP_CHAIN_MAP } from './constants.js';
5
+ import { WALLET_REGISTRY_URL, SOLANA_CAIP_CHAIN_MAP } from './constants.js';
6
6
  import { Web3AuthError } from './errors/index.js';
7
7
  import { WEB3AUTH_NETWORK } from '@web3auth/auth';
8
8
 
@@ -27,7 +27,7 @@ const fetchProjectConfig = async ({
27
27
  return res;
28
28
  };
29
29
  const fetchWalletRegistry = async url => {
30
- const res = await get(url || "https://assets.web3auth.io/v1/wallet-registry.json");
30
+ const res = await get(url || WALLET_REGISTRY_URL);
31
31
  return res;
32
32
  };
33
33
 
@@ -145,7 +145,7 @@ const getWalletServicesAnalyticsProperties = walletServicesConfig => {
145
145
  ws_default_portfolio: walletServicesConfig === null || walletServicesConfig === void 0 || (_walletServicesConfig1 = walletServicesConfig.whiteLabel) === null || _walletServicesConfig1 === void 0 ? void 0 : _walletServicesConfig1.defaultPortfolio
146
146
  };
147
147
  };
148
- const sdkVersion = "10.5.0";
148
+ const sdkVersion = "10.5.3";
149
149
  const getErrorAnalyticsProperties = error => {
150
150
  try {
151
151
  const code = error instanceof Web3AuthError ? error.code : error === null || error === void 0 ? void 0 : error.code;
@@ -8,7 +8,7 @@ export { BaseConnector } from './base/connector/baseConnector.js';
8
8
  export { CONNECTOR_CATEGORY, CONNECTOR_EVENTS, CONNECTOR_STATUS } from './base/connector/constants.js';
9
9
  export { AUTH_CONNECTION, MFA_FACTOR, MFA_LEVELS, UX_MODE, WEB3AUTH_NETWORK, getED25519Key } from '@web3auth/auth';
10
10
  export { checkIfTokenIsExpired, clearToken, getSavedToken, saveToken, storageAvailable } from './base/connector/utils.js';
11
- export { LOGIN_MODE, MODAL_SIGN_IN_METHODS, SMART_ACCOUNT_WALLET_SCOPE, SOLANA_CAIP_CHAIN_MAP, WEB3AUTH_STATE_STORAGE_KEY, WIDGET_TYPE } from './base/constants.js';
11
+ export { LOGIN_MODE, MODAL_SIGN_IN_METHODS, SMART_ACCOUNT_WALLET_SCOPE, SOLANA_CAIP_CHAIN_MAP, WALLET_REGISTRY_URL, WEB3AUTH_STATE_STORAGE_KEY, WIDGET_TYPE } from './base/constants.js';
12
12
  export { WalletInitializationError, WalletLoginError, WalletOperationsError, WalletProviderError, Web3AuthError } from './base/errors/index.js';
13
13
  export { log } from './base/loglevel.js';
14
14
  export { NFTCheckoutPluginError, WalletServicesPluginError } from './base/plugin/errors.js';
@@ -132,6 +132,7 @@ class Web3AuthNoModal extends SafeEventEmitter {
132
132
  this.initCachedConnectorAndChainId();
133
133
  this.initUIConfig(projectConfig);
134
134
  this.initWalletServicesConfig(projectConfig);
135
+ this.initSessionTimeConfig(projectConfig);
135
136
  this.analytics.setGlobalProperties({
136
137
  team_id: projectConfig.teamId
137
138
  });
@@ -483,6 +484,10 @@ class Web3AuthNoModal extends SafeEventEmitter {
483
484
  uxMode: UX_MODE.POPUP
484
485
  }, cloneDeep(projectConfig.whitelabel || {}), this.coreOptions.uiConfig || {}]);
485
486
  }
487
+ initSessionTimeConfig(projectConfig) {
488
+ if (this.coreOptions.sessionTime) return;
489
+ if (projectConfig.sessionTime) this.coreOptions.sessionTime = projectConfig.sessionTime;
490
+ }
486
491
  initCachedConnectorAndChainId() {
487
492
  // init chainId using cached chainId if it exists and is valid, otherwise use the defaultChainId or the first chain
488
493
  const cachedChainId = this.state.currentChainId;