@web3auth/no-modal 8.2.0 → 8.2.1

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.
@@ -131,7 +131,7 @@ class Web3AuthNoModal extends openlogin_jrpc_namespaceObject.SafeEventEmitter {
131
131
  });
132
132
  let projectConfig;
133
133
  try {
134
- projectConfig = await (0,base_namespaceObject.fetchProjectConfig)(this.coreOptions.clientId);
134
+ projectConfig = await (0,base_namespaceObject.fetchProjectConfig)(this.coreOptions.clientId, this.coreOptions.web3AuthNetwork);
135
135
  } catch (e) {
136
136
  throw base_namespaceObject.WalletInitializationError.notReady("failed to fetch project configurations");
137
137
  }
@@ -164,7 +164,8 @@ class Web3AuthNoModal extends openlogin_jrpc_namespaceObject.SafeEventEmitter {
164
164
  } = projectConfig;
165
165
  this.coreOptions.uiConfig = external_lodash_merge_default()(external_lodash_clonedeep_default()(whitelabel), this.coreOptions.uiConfig);
166
166
  const {
167
- sms_otp_enabled: smsOtpEnabled
167
+ sms_otp_enabled: smsOtpEnabled,
168
+ whitelist
168
169
  } = projectConfig;
169
170
  if (smsOtpEnabled !== undefined) {
170
171
  openloginAdapter.setAdapterSettings({
@@ -178,6 +179,11 @@ class Web3AuthNoModal extends openlogin_jrpc_namespaceObject.SafeEventEmitter {
178
179
  }
179
180
  });
180
181
  }
182
+ if (whitelist) {
183
+ openloginAdapter.setAdapterSettings({
184
+ originData: whitelist.signed_urls
185
+ });
186
+ }
181
187
  if (this.coreOptions.privateKeyProvider) {
182
188
  if (openloginAdapter.currentChainNamespace !== this.coreOptions.privateKeyProvider.currentChainConfig.chainNamespace) {
183
189
  throw base_namespaceObject.WalletInitializationError.incompatibleChainNameSpace("private key provider is not compatible with provided chainNamespace for openlogin adapter");
@@ -215,7 +221,7 @@ class Web3AuthNoModal extends openlogin_jrpc_namespaceObject.SafeEventEmitter {
215
221
  }).catch(e => base_namespaceObject.log.error(e));
216
222
  });
217
223
  await Promise.all(initPromises);
218
- this.status = base_namespaceObject.ADAPTER_STATUS.READY;
224
+ if (this.status === base_namespaceObject.ADAPTER_STATUS.NOT_READY) this.status = base_namespaceObject.ADAPTER_STATUS.READY;
219
225
  }
220
226
  getAdapter(adapterName) {
221
227
  return this.walletAdapters[adapterName] || null;
@@ -53,7 +53,7 @@ class Web3AuthNoModal extends SafeEventEmitter {
53
53
  });
54
54
  let projectConfig;
55
55
  try {
56
- projectConfig = await fetchProjectConfig(this.coreOptions.clientId);
56
+ projectConfig = await fetchProjectConfig(this.coreOptions.clientId, this.coreOptions.web3AuthNetwork);
57
57
  } catch (e) {
58
58
  throw WalletInitializationError.notReady("failed to fetch project configurations");
59
59
  }
@@ -86,7 +86,8 @@ class Web3AuthNoModal extends SafeEventEmitter {
86
86
  } = projectConfig;
87
87
  this.coreOptions.uiConfig = merge(clonedeep(whitelabel), this.coreOptions.uiConfig);
88
88
  const {
89
- sms_otp_enabled: smsOtpEnabled
89
+ sms_otp_enabled: smsOtpEnabled,
90
+ whitelist
90
91
  } = projectConfig;
91
92
  if (smsOtpEnabled !== undefined) {
92
93
  openloginAdapter.setAdapterSettings({
@@ -100,6 +101,11 @@ class Web3AuthNoModal extends SafeEventEmitter {
100
101
  }
101
102
  });
102
103
  }
104
+ if (whitelist) {
105
+ openloginAdapter.setAdapterSettings({
106
+ originData: whitelist.signed_urls
107
+ });
108
+ }
103
109
  if (this.coreOptions.privateKeyProvider) {
104
110
  if (openloginAdapter.currentChainNamespace !== this.coreOptions.privateKeyProvider.currentChainConfig.chainNamespace) {
105
111
  throw WalletInitializationError.incompatibleChainNameSpace("private key provider is not compatible with provided chainNamespace for openlogin adapter");
@@ -137,7 +143,7 @@ class Web3AuthNoModal extends SafeEventEmitter {
137
143
  }).catch(e => log.error(e));
138
144
  });
139
145
  await Promise.all(initPromises);
140
- this.status = ADAPTER_STATUS.READY;
146
+ if (this.status === ADAPTER_STATUS.NOT_READY) this.status = ADAPTER_STATUS.READY;
141
147
  }
142
148
  getAdapter(adapterName) {
143
149
  return this.walletAdapters[adapterName] || null;