@web3auth/no-modal 8.3.0 → 8.4.0
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/noModal.cjs.js +4 -4
- package/dist/noModal.esm.js +4 -2
- package/dist/noModal.umd.min.js +1 -1
- package/dist/types/noModal.d.ts +4 -4
- package/package.json +6 -7
package/dist/noModal.cjs.js
CHANGED
|
@@ -64,8 +64,6 @@ var defineProperty_default = /*#__PURE__*/__webpack_require__.n(defineProperty_n
|
|
|
64
64
|
const openlogin_jrpc_namespaceObject = require("@toruslabs/openlogin-jrpc");
|
|
65
65
|
;// CONCATENATED MODULE: external "@web3auth/base"
|
|
66
66
|
const base_namespaceObject = require("@web3auth/base");
|
|
67
|
-
;// CONCATENATED MODULE: external "@web3auth/base-plugin"
|
|
68
|
-
const base_plugin_namespaceObject = require("@web3auth/base-plugin");
|
|
69
67
|
;// CONCATENATED MODULE: external "@web3auth/base-provider"
|
|
70
68
|
const base_provider_namespaceObject = require("@web3auth/base-provider");
|
|
71
69
|
;// CONCATENATED MODULE: external "@web3auth/openlogin-adapter"
|
|
@@ -85,7 +83,6 @@ var external_lodash_merge_default = /*#__PURE__*/__webpack_require__.n(external_
|
|
|
85
83
|
|
|
86
84
|
|
|
87
85
|
|
|
88
|
-
|
|
89
86
|
const ADAPTER_CACHE_KEY = "Web3Auth-cachedAdapter";
|
|
90
87
|
class Web3AuthNoModal extends openlogin_jrpc_namespaceObject.SafeEventEmitter {
|
|
91
88
|
constructor(options) {
|
|
@@ -295,10 +292,13 @@ class Web3AuthNoModal extends openlogin_jrpc_namespaceObject.SafeEventEmitter {
|
|
|
295
292
|
}
|
|
296
293
|
addPlugin(plugin) {
|
|
297
294
|
if (this.plugins[plugin.name]) throw new Error(`Plugin ${plugin.name} already exist`);
|
|
298
|
-
if (plugin.pluginNamespace !==
|
|
295
|
+
if (plugin.pluginNamespace !== base_namespaceObject.PLUGIN_NAMESPACES.MULTICHAIN && plugin.pluginNamespace !== this.coreOptions.chainConfig.chainNamespace) throw new Error(`This plugin belongs to ${plugin.pluginNamespace} namespace which is incompatible with currently used namespace: ${this.coreOptions.chainConfig.chainNamespace}`);
|
|
299
296
|
this.plugins[plugin.name] = plugin;
|
|
300
297
|
return this;
|
|
301
298
|
}
|
|
299
|
+
getPlugin(name) {
|
|
300
|
+
return this.plugins[name] || null;
|
|
301
|
+
}
|
|
302
302
|
subscribeToAdapterEvents(walletAdapter) {
|
|
303
303
|
walletAdapter.on(base_namespaceObject.ADAPTER_EVENTS.CONNECTED, async data => {
|
|
304
304
|
if (!this.commonJRPCProvider) throw base_namespaceObject.WalletInitializationError.notFound(`CommonJrpcProvider not found`);
|
package/dist/noModal.esm.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
2
2
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
3
3
|
import { SafeEventEmitter } from '@toruslabs/openlogin-jrpc';
|
|
4
|
-
import { ADAPTER_STATUS, WalletInitializationError, log, CHAIN_NAMESPACES, storageAvailable, getChainConfig, fetchProjectConfig, WALLET_ADAPTERS, ADAPTER_NAMESPACES, WalletLoginError, ADAPTER_EVENTS } from '@web3auth/base';
|
|
5
|
-
import { PLUGIN_NAMESPACES } from '@web3auth/base-plugin';
|
|
4
|
+
import { ADAPTER_STATUS, WalletInitializationError, log, CHAIN_NAMESPACES, storageAvailable, getChainConfig, fetchProjectConfig, WALLET_ADAPTERS, ADAPTER_NAMESPACES, WalletLoginError, PLUGIN_NAMESPACES, ADAPTER_EVENTS } from '@web3auth/base';
|
|
6
5
|
import { CommonJRPCProvider } from '@web3auth/base-provider';
|
|
7
6
|
import { LOGIN_PROVIDER } from '@web3auth/openlogin-adapter';
|
|
8
7
|
import clonedeep from 'lodash.clonedeep';
|
|
@@ -221,6 +220,9 @@ class Web3AuthNoModal extends SafeEventEmitter {
|
|
|
221
220
|
this.plugins[plugin.name] = plugin;
|
|
222
221
|
return this;
|
|
223
222
|
}
|
|
223
|
+
getPlugin(name) {
|
|
224
|
+
return this.plugins[name] || null;
|
|
225
|
+
}
|
|
224
226
|
subscribeToAdapterEvents(walletAdapter) {
|
|
225
227
|
walletAdapter.on(ADAPTER_EVENTS.CONNECTED, async data => {
|
|
226
228
|
if (!this.commonJRPCProvider) throw WalletInitializationError.notFound(`CommonJrpcProvider not found`);
|