@web3auth/modal 9.0.0-alpha.5 → 9.0.0-alpha.7
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.
|
@@ -39,7 +39,10 @@ class Web3Auth extends noModal.Web3AuthNoModal {
|
|
|
39
39
|
this.options.uiConfig = deepmerge(base.cloneDeep(whitelabel), this.options.uiConfig);
|
|
40
40
|
if (!this.options.uiConfig.defaultLanguage) this.options.uiConfig.defaultLanguage = ui.getUserLanguage(this.options.uiConfig.defaultLanguage);
|
|
41
41
|
if (!this.options.uiConfig.mode) this.options.uiConfig.mode = "light";
|
|
42
|
-
let walletRegistry = {
|
|
42
|
+
let walletRegistry = {
|
|
43
|
+
others: {},
|
|
44
|
+
default: {}
|
|
45
|
+
};
|
|
43
46
|
try {
|
|
44
47
|
walletRegistry = await base.fetchWalletRegistry(config.walletRegistryUrl);
|
|
45
48
|
} catch (e) {
|
|
@@ -84,7 +87,7 @@ class Web3Auth extends noModal.Web3AuthNoModal {
|
|
|
84
87
|
var _this$modalConfig$ada, _params2, _this$modalConfig$ada2, _this$modalConfig$ada3;
|
|
85
88
|
// start with the default config of adapter.
|
|
86
89
|
let adapterConfig = ((_this$modalConfig$ada = this.modalConfig.adapters) === null || _this$modalConfig$ada === void 0 ? void 0 : _this$modalConfig$ada[adapterName]) || {
|
|
87
|
-
label: adapterName.split("-").map(ui.capitalizeFirstLetter).join(" "),
|
|
90
|
+
label: base.ADAPTER_NAMES[adapterName] || adapterName.split("-").map(ui.capitalizeFirstLetter).join(" "),
|
|
88
91
|
showOnModal: true,
|
|
89
92
|
showOnMobile: true,
|
|
90
93
|
showOnDesktop: true
|
|
@@ -335,6 +338,7 @@ class Web3Auth extends noModal.Web3AuthNoModal {
|
|
|
335
338
|
async initExternalWalletAdapters(externalWalletsInitialized, options) {
|
|
336
339
|
if (externalWalletsInitialized) return;
|
|
337
340
|
const adaptersConfig = {};
|
|
341
|
+
// we do it like this because we don't want one slow adapter to delay the load of the entire external wallet section.
|
|
338
342
|
Object.keys(this.walletAdapters).forEach(async adapterName => {
|
|
339
343
|
const adapter = this.walletAdapters[adapterName];
|
|
340
344
|
if ((adapter === null || adapter === void 0 ? void 0 : adapter.type) === base.ADAPTER_CATEGORY.EXTERNAL) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
2
2
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
3
3
|
import { LOGIN_PROVIDER, getAuthDefaultOptions, AuthAdapter } from '@web3auth/auth-adapter';
|
|
4
|
-
import { cloneDeep, WalletInitializationError, fetchProjectConfig, log, fetchWalletRegistry, WALLET_ADAPTERS, getChainConfig, ADAPTER_CATEGORY, ADAPTER_STATUS, ADAPTER_EVENTS } from '@web3auth/base';
|
|
4
|
+
import { cloneDeep, WalletInitializationError, fetchProjectConfig, log, fetchWalletRegistry, WALLET_ADAPTERS, ADAPTER_NAMES, getChainConfig, ADAPTER_CATEGORY, ADAPTER_STATUS, ADAPTER_EVENTS } from '@web3auth/base';
|
|
5
5
|
import { CommonJRPCProvider } from '@web3auth/base-provider';
|
|
6
6
|
import { Web3AuthNoModal } from '@web3auth/no-modal';
|
|
7
7
|
import { getUserLanguage, LoginModal, capitalizeFirstLetter, getAdapterSocialLogins, LOGIN_MODAL_EVENTS, AUTH_PROVIDERS } from '@web3auth/ui';
|
|
@@ -37,7 +37,10 @@ class Web3Auth extends Web3AuthNoModal {
|
|
|
37
37
|
this.options.uiConfig = deepmerge(cloneDeep(whitelabel), this.options.uiConfig);
|
|
38
38
|
if (!this.options.uiConfig.defaultLanguage) this.options.uiConfig.defaultLanguage = getUserLanguage(this.options.uiConfig.defaultLanguage);
|
|
39
39
|
if (!this.options.uiConfig.mode) this.options.uiConfig.mode = "light";
|
|
40
|
-
let walletRegistry = {
|
|
40
|
+
let walletRegistry = {
|
|
41
|
+
others: {},
|
|
42
|
+
default: {}
|
|
43
|
+
};
|
|
41
44
|
try {
|
|
42
45
|
walletRegistry = await fetchWalletRegistry(walletRegistryUrl);
|
|
43
46
|
} catch (e) {
|
|
@@ -82,7 +85,7 @@ class Web3Auth extends Web3AuthNoModal {
|
|
|
82
85
|
var _this$modalConfig$ada, _params2, _this$modalConfig$ada2, _this$modalConfig$ada3;
|
|
83
86
|
// start with the default config of adapter.
|
|
84
87
|
let adapterConfig = ((_this$modalConfig$ada = this.modalConfig.adapters) === null || _this$modalConfig$ada === void 0 ? void 0 : _this$modalConfig$ada[adapterName]) || {
|
|
85
|
-
label: adapterName.split("-").map(capitalizeFirstLetter).join(" "),
|
|
88
|
+
label: ADAPTER_NAMES[adapterName] || adapterName.split("-").map(capitalizeFirstLetter).join(" "),
|
|
86
89
|
showOnModal: true,
|
|
87
90
|
showOnMobile: true,
|
|
88
91
|
showOnDesktop: true
|
|
@@ -333,6 +336,7 @@ class Web3Auth extends Web3AuthNoModal {
|
|
|
333
336
|
async initExternalWalletAdapters(externalWalletsInitialized, options) {
|
|
334
337
|
if (externalWalletsInitialized) return;
|
|
335
338
|
const adaptersConfig = {};
|
|
339
|
+
// we do it like this because we don't want one slow adapter to delay the load of the entire external wallet section.
|
|
336
340
|
Object.keys(this.walletAdapters).forEach(async adapterName => {
|
|
337
341
|
const adapter = this.walletAdapters[adapterName];
|
|
338
342
|
if ((adapter === null || adapter === void 0 ? void 0 : adapter.type) === ADAPTER_CATEGORY.EXTERNAL) {
|
package/dist/modal.cjs.js
CHANGED
|
@@ -170,7 +170,10 @@ class Web3Auth extends no_modal_namespaceObject.Web3AuthNoModal {
|
|
|
170
170
|
this.options.uiConfig = external_deepmerge_default()((0,base_.cloneDeep)(whitelabel), this.options.uiConfig);
|
|
171
171
|
if (!this.options.uiConfig.defaultLanguage) this.options.uiConfig.defaultLanguage = (0,ui_namespaceObject.getUserLanguage)(this.options.uiConfig.defaultLanguage);
|
|
172
172
|
if (!this.options.uiConfig.mode) this.options.uiConfig.mode = "light";
|
|
173
|
-
let walletRegistry = {
|
|
173
|
+
let walletRegistry = {
|
|
174
|
+
others: {},
|
|
175
|
+
default: {}
|
|
176
|
+
};
|
|
174
177
|
try {
|
|
175
178
|
walletRegistry = await (0,base_.fetchWalletRegistry)(config/* walletRegistryUrl */.e4);
|
|
176
179
|
} catch (e) {
|
|
@@ -215,7 +218,7 @@ class Web3Auth extends no_modal_namespaceObject.Web3AuthNoModal {
|
|
|
215
218
|
var _this$modalConfig$ada, _params2, _this$modalConfig$ada2, _this$modalConfig$ada3;
|
|
216
219
|
// start with the default config of adapter.
|
|
217
220
|
let adapterConfig = ((_this$modalConfig$ada = this.modalConfig.adapters) === null || _this$modalConfig$ada === void 0 ? void 0 : _this$modalConfig$ada[adapterName]) || {
|
|
218
|
-
label: adapterName.split("-").map(ui_namespaceObject.capitalizeFirstLetter).join(" "),
|
|
221
|
+
label: base_.ADAPTER_NAMES[adapterName] || adapterName.split("-").map(ui_namespaceObject.capitalizeFirstLetter).join(" "),
|
|
219
222
|
showOnModal: true,
|
|
220
223
|
showOnMobile: true,
|
|
221
224
|
showOnDesktop: true
|
|
@@ -466,6 +469,7 @@ class Web3Auth extends no_modal_namespaceObject.Web3AuthNoModal {
|
|
|
466
469
|
async initExternalWalletAdapters(externalWalletsInitialized, options) {
|
|
467
470
|
if (externalWalletsInitialized) return;
|
|
468
471
|
const adaptersConfig = {};
|
|
472
|
+
// we do it like this because we don't want one slow adapter to delay the load of the entire external wallet section.
|
|
469
473
|
Object.keys(this.walletAdapters).forEach(async adapterName => {
|
|
470
474
|
const adapter = this.walletAdapters[adapterName];
|
|
471
475
|
if ((adapter === null || adapter === void 0 ? void 0 : adapter.type) === base_.ADAPTER_CATEGORY.EXTERNAL) {
|
package/dist/modal.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CHAIN_NAMESPACES, SOLANA_ADAPTERS, EVM_ADAPTERS, cloneDeep, WalletInitializationError, fetchProjectConfig, log, fetchWalletRegistry, WALLET_ADAPTERS, getChainConfig, ADAPTER_CATEGORY, ADAPTER_STATUS, ADAPTER_EVENTS } from '@web3auth/base';
|
|
1
|
+
import { CHAIN_NAMESPACES, SOLANA_ADAPTERS, EVM_ADAPTERS, cloneDeep, WalletInitializationError, fetchProjectConfig, log, fetchWalletRegistry, WALLET_ADAPTERS, ADAPTER_NAMES, getChainConfig, ADAPTER_CATEGORY, ADAPTER_STATUS, ADAPTER_EVENTS } from '@web3auth/base';
|
|
2
2
|
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
3
3
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
4
4
|
import { LOGIN_PROVIDER, getAuthDefaultOptions, AuthAdapter } from '@web3auth/auth-adapter';
|
|
@@ -111,7 +111,10 @@ class Web3Auth extends Web3AuthNoModal {
|
|
|
111
111
|
this.options.uiConfig = deepmerge(cloneDeep(whitelabel), this.options.uiConfig);
|
|
112
112
|
if (!this.options.uiConfig.defaultLanguage) this.options.uiConfig.defaultLanguage = getUserLanguage(this.options.uiConfig.defaultLanguage);
|
|
113
113
|
if (!this.options.uiConfig.mode) this.options.uiConfig.mode = "light";
|
|
114
|
-
let walletRegistry = {
|
|
114
|
+
let walletRegistry = {
|
|
115
|
+
others: {},
|
|
116
|
+
default: {}
|
|
117
|
+
};
|
|
115
118
|
try {
|
|
116
119
|
walletRegistry = await fetchWalletRegistry(walletRegistryUrl);
|
|
117
120
|
} catch (e) {
|
|
@@ -156,7 +159,7 @@ class Web3Auth extends Web3AuthNoModal {
|
|
|
156
159
|
var _this$modalConfig$ada, _params2, _this$modalConfig$ada2, _this$modalConfig$ada3;
|
|
157
160
|
// start with the default config of adapter.
|
|
158
161
|
let adapterConfig = ((_this$modalConfig$ada = this.modalConfig.adapters) === null || _this$modalConfig$ada === void 0 ? void 0 : _this$modalConfig$ada[adapterName]) || {
|
|
159
|
-
label: adapterName.split("-").map(capitalizeFirstLetter).join(" "),
|
|
162
|
+
label: ADAPTER_NAMES[adapterName] || adapterName.split("-").map(capitalizeFirstLetter).join(" "),
|
|
160
163
|
showOnModal: true,
|
|
161
164
|
showOnMobile: true,
|
|
162
165
|
showOnDesktop: true
|
|
@@ -407,6 +410,7 @@ class Web3Auth extends Web3AuthNoModal {
|
|
|
407
410
|
async initExternalWalletAdapters(externalWalletsInitialized, options) {
|
|
408
411
|
if (externalWalletsInitialized) return;
|
|
409
412
|
const adaptersConfig = {};
|
|
413
|
+
// we do it like this because we don't want one slow adapter to delay the load of the entire external wallet section.
|
|
410
414
|
Object.keys(this.walletAdapters).forEach(async adapterName => {
|
|
411
415
|
const adapter = this.walletAdapters[adapterName];
|
|
412
416
|
if ((adapter === null || adapter === void 0 ? void 0 : adapter.type) === ADAPTER_CATEGORY.EXTERNAL) {
|