@web3auth/modal 10.0.0-beta.4 → 10.0.0-beta.5
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/lib.cjs/packages/modal/src/config.js +1 -1
- package/dist/lib.cjs/packages/modal/src/modalManager.js +17 -19
- package/dist/lib.esm/packages/modal/src/config.js +1 -1
- package/dist/lib.esm/packages/modal/src/modalManager.js +19 -19
- package/dist/modal.umd.min.js +1 -1
- package/dist/modal.umd.min.js.LICENSE.txt +0 -10
- package/package.json +9 -9
|
@@ -190,32 +190,30 @@ class Web3Auth extends noModal.Web3AuthNoModal {
|
|
|
190
190
|
};
|
|
191
191
|
}
|
|
192
192
|
async getProjectAndWalletConfig() {
|
|
193
|
-
var _this$modalConfig;
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
} catch (e) {
|
|
205
|
-
noModal.log.error("Failed to fetch project configurations", e);
|
|
206
|
-
throw noModal.WalletInitializationError.notReady("failed to fetch project configurations", e);
|
|
193
|
+
var _this$options$account, _this$modalConfig;
|
|
194
|
+
const [projectConfigResult, walletRegistryResult] = await Promise.allSettled([noModal.fetchProjectConfig({
|
|
195
|
+
clientId: this.options.clientId,
|
|
196
|
+
web3AuthNetwork: this.options.web3AuthNetwork,
|
|
197
|
+
aaProvider: (_this$options$account = this.options.accountAbstractionConfig) === null || _this$options$account === void 0 ? void 0 : _this$options$account.smartAccountType,
|
|
198
|
+
authBuildEnv: this.options.authBuildEnv
|
|
199
|
+
}), noModal.fetchWalletRegistry(config.walletRegistryUrl)]);
|
|
200
|
+
// handle project config result
|
|
201
|
+
if (projectConfigResult.status === "rejected") {
|
|
202
|
+
noModal.log.error("Failed to fetch project configurations", projectConfigResult.reason);
|
|
203
|
+
throw noModal.WalletInitializationError.notReady("failed to fetch project configurations", projectConfigResult.reason);
|
|
207
204
|
}
|
|
208
|
-
|
|
205
|
+
const projectConfig = projectConfigResult.value;
|
|
206
|
+
// handle wallet registry result
|
|
209
207
|
let walletRegistry = {
|
|
210
208
|
others: {},
|
|
211
209
|
default: {}
|
|
212
210
|
};
|
|
213
211
|
const isExternalWalletEnabled = Boolean(projectConfig.externalWalletAuth);
|
|
214
212
|
if (isExternalWalletEnabled && !((_this$modalConfig = this.modalConfig) !== null && _this$modalConfig !== void 0 && _this$modalConfig.hideWalletDiscovery)) {
|
|
215
|
-
|
|
216
|
-
walletRegistry =
|
|
217
|
-
}
|
|
218
|
-
noModal.log.error("Failed to fetch wallet registry",
|
|
213
|
+
if (walletRegistryResult.status === "fulfilled") {
|
|
214
|
+
walletRegistry = walletRegistryResult.value;
|
|
215
|
+
} else {
|
|
216
|
+
noModal.log.error("Failed to fetch wallet registry", walletRegistryResult.reason);
|
|
219
217
|
}
|
|
220
218
|
}
|
|
221
219
|
return {
|
|
@@ -196,32 +196,32 @@ class Web3Auth extends Web3AuthNoModal {
|
|
|
196
196
|
};
|
|
197
197
|
}
|
|
198
198
|
async getProjectAndWalletConfig() {
|
|
199
|
-
var _this$modalConfig;
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
log.error("Failed to fetch project configurations", e);
|
|
212
|
-
throw WalletInitializationError.notReady("failed to fetch project configurations", e);
|
|
199
|
+
var _this$options$account, _this$modalConfig;
|
|
200
|
+
const [projectConfigResult, walletRegistryResult] = await Promise.allSettled([fetchProjectConfig({
|
|
201
|
+
clientId: this.options.clientId,
|
|
202
|
+
web3AuthNetwork: this.options.web3AuthNetwork,
|
|
203
|
+
aaProvider: (_this$options$account = this.options.accountAbstractionConfig) === null || _this$options$account === void 0 ? void 0 : _this$options$account.smartAccountType,
|
|
204
|
+
authBuildEnv: this.options.authBuildEnv
|
|
205
|
+
}), fetchWalletRegistry(walletRegistryUrl)]);
|
|
206
|
+
|
|
207
|
+
// handle project config result
|
|
208
|
+
if (projectConfigResult.status === "rejected") {
|
|
209
|
+
log.error("Failed to fetch project configurations", projectConfigResult.reason);
|
|
210
|
+
throw WalletInitializationError.notReady("failed to fetch project configurations", projectConfigResult.reason);
|
|
213
211
|
}
|
|
214
|
-
|
|
212
|
+
const projectConfig = projectConfigResult.value;
|
|
213
|
+
|
|
214
|
+
// handle wallet registry result
|
|
215
215
|
let walletRegistry = {
|
|
216
216
|
others: {},
|
|
217
217
|
default: {}
|
|
218
218
|
};
|
|
219
219
|
const isExternalWalletEnabled = Boolean(projectConfig.externalWalletAuth);
|
|
220
220
|
if (isExternalWalletEnabled && !((_this$modalConfig = this.modalConfig) !== null && _this$modalConfig !== void 0 && _this$modalConfig.hideWalletDiscovery)) {
|
|
221
|
-
|
|
222
|
-
walletRegistry =
|
|
223
|
-
}
|
|
224
|
-
log.error("Failed to fetch wallet registry",
|
|
221
|
+
if (walletRegistryResult.status === "fulfilled") {
|
|
222
|
+
walletRegistry = walletRegistryResult.value;
|
|
223
|
+
} else {
|
|
224
|
+
log.error("Failed to fetch wallet registry", walletRegistryResult.reason);
|
|
225
225
|
}
|
|
226
226
|
}
|
|
227
227
|
return {
|