@web3auth/no-modal 10.9.0 → 10.10.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/lib.cjs/base/connector/baseConnector.js +9 -5
- package/dist/lib.cjs/base/connector/connectorStatus.js +9 -0
- package/dist/lib.cjs/base/connector/constants.js +8 -1
- package/dist/lib.cjs/base/utils.js +2 -1
- package/dist/lib.cjs/connectors/auth-connector/authConnector.js +22 -10
- package/dist/lib.cjs/connectors/base-evm-connector/baseEvmConnector.js +20 -1
- package/dist/lib.cjs/connectors/base-solana-connector/baseSolanaConnector.js +20 -1
- package/dist/lib.cjs/connectors/coinbase-connector/coinbaseConnector.js +6 -5
- package/dist/lib.cjs/connectors/injected-evm-connector/injectedEvmConnector.js +6 -5
- package/dist/lib.cjs/connectors/injected-solana-connector/walletStandardConnector.js +7 -6
- package/dist/lib.cjs/connectors/metamask-connector/metamaskConnector.js +3 -2
- package/dist/lib.cjs/connectors/wallet-connect-v2-connector/WalletConnectV2Provider.js +1 -0
- package/dist/lib.cjs/connectors/wallet-connect-v2-connector/config.js +1 -0
- package/dist/lib.cjs/connectors/wallet-connect-v2-connector/walletConnectV2Connector.js +26 -7
- package/dist/lib.cjs/connectors/wallet-connect-v2-connector/walletConnectV2Utils.js +1 -0
- package/dist/lib.cjs/index.js +4 -0
- package/dist/lib.cjs/noModal.js +80 -19
- package/dist/lib.cjs/plugins/nft-checkout-plugin/plugin.js +3 -2
- package/dist/lib.cjs/plugins/wallet-services-plugin/plugin.js +3 -5
- package/dist/lib.cjs/providers/account-abstraction-provider/providers/AccountAbstractionProvider.js +1 -0
- package/dist/lib.cjs/providers/account-abstraction-provider/providers/utils.js +1 -0
- package/dist/lib.cjs/providers/base-provider/baseProvider.js +1 -0
- package/dist/lib.cjs/providers/ethereum-mpc-provider/providers/signingProviders/EthereumSigningProvider.js +1 -0
- package/dist/lib.cjs/providers/ethereum-mpc-provider/providers/signingProviders/signingUtils.js +1 -0
- package/dist/lib.cjs/providers/ethereum-provider/providers/privateKeyProviders/TransactionFormatter/formatter.js +1 -0
- package/dist/lib.cjs/providers/solana-provider/providers/injectedProviders/base/baseInjectedProvider.js +1 -0
- package/dist/lib.cjs/providers/solana-provider/providers/injectedProviders/walletStandardProvider.js +1 -0
- package/dist/lib.cjs/providers/xrpl-provider/providers/privateKeyProviders/xrplPrivateKeyProvider.js +1 -0
- package/dist/lib.cjs/react/context/WalletServicesInnerContext.js +1 -0
- package/dist/lib.cjs/react/context/Web3AuthInnerContext.js +20 -3
- package/dist/lib.cjs/react/hooks/useCheckout.js +1 -0
- package/dist/lib.cjs/react/hooks/useFunding.js +1 -0
- package/dist/lib.cjs/react/hooks/useIdentityToken.js +8 -3
- package/dist/lib.cjs/react/hooks/useReceive.js +1 -0
- package/dist/lib.cjs/react/hooks/useSwap.js +1 -0
- package/dist/lib.cjs/react/hooks/useWalletConnectScanner.js +1 -0
- package/dist/lib.cjs/react/hooks/useWalletUI.js +1 -0
- package/dist/lib.cjs/react/hooks/useWeb3Auth.js +2 -0
- package/dist/lib.cjs/react/hooks/useWeb3AuthInner.js +1 -0
- package/dist/lib.cjs/react/solana/hooks/useSolanaWallet.js +1 -0
- package/dist/lib.cjs/react/wagmi/provider.js +1 -0
- package/dist/lib.cjs/types/base/connector/baseConnector.d.ts +2 -1
- package/dist/lib.cjs/types/base/connector/connectorStatus.d.ts +3 -0
- package/dist/lib.cjs/types/base/connector/constants.d.ts +8 -0
- package/dist/lib.cjs/types/base/connector/index.d.ts +1 -0
- package/dist/lib.cjs/types/base/connector/interfaces.d.ts +16 -4
- package/dist/lib.cjs/types/base/core/IWeb3Auth.d.ts +7 -1
- package/dist/lib.cjs/types/base/hooks/index.d.ts +1 -0
- package/dist/lib.cjs/types/noModal.d.ts +1 -0
- package/dist/lib.cjs/types/vue/interfaces.d.ts +1 -0
- package/dist/lib.cjs/types/vue/solana/composables/useSignMessage.d.ts +1 -1
- package/dist/lib.cjs/vue/WalletServicesInnerProvider.js +2 -1
- package/dist/lib.cjs/vue/Web3AuthProvider.js +17 -2
- package/dist/lib.cjs/vue/composables/useCheckout.js +3 -1
- package/dist/lib.cjs/vue/composables/useEnableMFA.js +3 -1
- package/dist/lib.cjs/vue/composables/useFunding.js +3 -1
- package/dist/lib.cjs/vue/composables/useIdentityToken.js +12 -4
- package/dist/lib.cjs/vue/composables/useManageMFA.js +3 -1
- package/dist/lib.cjs/vue/composables/useReceive.js +3 -1
- package/dist/lib.cjs/vue/composables/useSwap.js +3 -1
- package/dist/lib.cjs/vue/composables/useSwitchChain.js +3 -1
- package/dist/lib.cjs/vue/composables/useWalletConnectScanner.js +3 -1
- package/dist/lib.cjs/vue/composables/useWalletUI.js +3 -1
- package/dist/lib.cjs/vue/composables/useWeb3Auth.js +2 -0
- package/dist/lib.cjs/vue/composables/useWeb3AuthConnect.js +3 -1
- package/dist/lib.cjs/vue/composables/useWeb3AuthDisconnect.js +3 -1
- package/dist/lib.cjs/vue/composables/useWeb3AuthInner.js +1 -0
- package/dist/lib.cjs/vue/composables/useWeb3AuthUser.js +3 -1
- package/dist/lib.cjs/vue/solana/composables/useSignAndSendTransaction.js +15 -0
- package/dist/lib.cjs/vue/solana/composables/useSignMessage.js +15 -0
- package/dist/lib.cjs/vue/solana/composables/useSignTransaction.js +15 -0
- package/dist/lib.cjs/vue/solana/composables/useSolanaWallet.js +1 -0
- package/dist/lib.cjs/vue/wagmi/provider.js +1 -0
- package/dist/lib.esm/base/connector/baseConnector.js +9 -5
- package/dist/lib.esm/base/connector/connectorStatus.js +6 -0
- package/dist/lib.esm/base/connector/constants.js +8 -2
- package/dist/lib.esm/base/utils.js +1 -1
- package/dist/lib.esm/connectors/auth-connector/authConnector.js +22 -10
- package/dist/lib.esm/connectors/base-evm-connector/baseEvmConnector.js +20 -2
- package/dist/lib.esm/connectors/base-solana-connector/baseSolanaConnector.js +20 -2
- package/dist/lib.esm/connectors/coinbase-connector/coinbaseConnector.js +5 -5
- package/dist/lib.esm/connectors/injected-evm-connector/injectedEvmConnector.js +5 -5
- package/dist/lib.esm/connectors/injected-solana-connector/walletStandardConnector.js +6 -6
- package/dist/lib.esm/connectors/metamask-connector/metamaskConnector.js +2 -2
- package/dist/lib.esm/connectors/wallet-connect-v2-connector/walletConnectV2Connector.js +25 -7
- package/dist/lib.esm/index.js +2 -1
- package/dist/lib.esm/noModal.js +81 -20
- package/dist/lib.esm/plugins/nft-checkout-plugin/plugin.js +2 -2
- package/dist/lib.esm/plugins/wallet-services-plugin/plugin.js +2 -5
- package/dist/lib.esm/react/context/Web3AuthInnerContext.js +20 -3
- package/dist/lib.esm/react/hooks/useIdentityToken.js +8 -3
- package/dist/lib.esm/react/hooks/useWeb3Auth.js +2 -0
- package/dist/lib.esm/vue/WalletServicesInnerProvider.js +1 -1
- package/dist/lib.esm/vue/Web3AuthProvider.js +16 -1
- package/dist/lib.esm/vue/composables/useCheckout.js +2 -0
- package/dist/lib.esm/vue/composables/useEnableMFA.js +2 -0
- package/dist/lib.esm/vue/composables/useFunding.js +2 -0
- package/dist/lib.esm/vue/composables/useIdentityToken.js +11 -3
- package/dist/lib.esm/vue/composables/useManageMFA.js +2 -0
- package/dist/lib.esm/vue/composables/useReceive.js +2 -0
- package/dist/lib.esm/vue/composables/useSwap.js +2 -0
- package/dist/lib.esm/vue/composables/useSwitchChain.js +2 -0
- package/dist/lib.esm/vue/composables/useWalletConnectScanner.js +2 -0
- package/dist/lib.esm/vue/composables/useWalletUI.js +2 -0
- package/dist/lib.esm/vue/composables/useWeb3Auth.js +2 -0
- package/dist/lib.esm/vue/composables/useWeb3AuthConnect.js +2 -0
- package/dist/lib.esm/vue/composables/useWeb3AuthDisconnect.js +2 -0
- package/dist/lib.esm/vue/composables/useWeb3AuthUser.js +2 -0
- package/dist/lib.esm/vue/solana/composables/useSignAndSendTransaction.js +2 -0
- package/dist/lib.esm/vue/solana/composables/useSignMessage.js +3 -1
- package/dist/lib.esm/vue/solana/composables/useSignTransaction.js +2 -0
- package/dist/noModal.umd.min.js +1 -1
- package/package.json +2 -2
|
@@ -5,6 +5,7 @@ var auth = require('@web3auth/auth');
|
|
|
5
5
|
var IChainInterface = require('../chain/IChainInterface.js');
|
|
6
6
|
var index$1 = require('../errors/index.js');
|
|
7
7
|
var index = require('../wallet/index.js');
|
|
8
|
+
var connectorStatus = require('./connectorStatus.js');
|
|
8
9
|
var constants = require('./constants.js');
|
|
9
10
|
var baseControllers = require('@toruslabs/base-controllers');
|
|
10
11
|
|
|
@@ -18,15 +19,18 @@ class BaseConnector extends auth.SafeEventEmitter {
|
|
|
18
19
|
_defineProperty(this, "rehydrated", false);
|
|
19
20
|
this.coreOptions = options.coreOptions;
|
|
20
21
|
}
|
|
21
|
-
get
|
|
22
|
-
return this.status
|
|
22
|
+
get connected() {
|
|
23
|
+
return connectorStatus.CONNECTED_STATUSES.includes(this.status);
|
|
24
|
+
}
|
|
25
|
+
get canAuthorize() {
|
|
26
|
+
return connectorStatus.CAN_AUTHORIZE_STATUSES.includes(this.status);
|
|
23
27
|
}
|
|
24
28
|
checkConnectionRequirements() {
|
|
25
29
|
// we reconnect without killing existing Wallet Connect or Metamask Connect session on calling connect again.
|
|
26
30
|
if (this.name === index.WALLET_CONNECTORS.WALLET_CONNECT_V2 && this.status === constants.CONNECTOR_STATUS.CONNECTING) return;
|
|
27
31
|
if (this.name === index.WALLET_CONNECTORS.METAMASK && !this.isInjected && this.status === constants.CONNECTOR_STATUS.CONNECTING) return;
|
|
28
32
|
if (this.status === constants.CONNECTOR_STATUS.CONNECTING) throw index$1.WalletInitializationError.notReady("Already connecting");
|
|
29
|
-
if (this.
|
|
33
|
+
if (this.connected) throw index$1.WalletLoginError.connectionError("Already connected");
|
|
30
34
|
if (this.status !== constants.CONNECTOR_STATUS.READY) throw index$1.WalletLoginError.connectionError("Wallet connector is not ready yet, Please wait for init function to resolve before calling connect/connectTo function");
|
|
31
35
|
}
|
|
32
36
|
checkInitializationRequirements({
|
|
@@ -42,11 +46,11 @@ class BaseConnector extends auth.SafeEventEmitter {
|
|
|
42
46
|
}
|
|
43
47
|
if (this.connectorNamespace !== IChainInterface.CONNECTOR_NAMESPACES.MULTICHAIN && this.connectorNamespace !== chainConfig.chainNamespace) throw index$1.WalletInitializationError.invalidParams("Connector doesn't support this chain namespace");
|
|
44
48
|
if (this.status === constants.CONNECTOR_STATUS.NOT_READY) return;
|
|
45
|
-
if (this.
|
|
49
|
+
if (this.connected) throw index$1.WalletInitializationError.notReady("Already connected");
|
|
46
50
|
if (this.status === constants.CONNECTOR_STATUS.READY) throw index$1.WalletInitializationError.notReady("Connector is already initialized");
|
|
47
51
|
}
|
|
48
52
|
checkDisconnectionRequirements() {
|
|
49
|
-
if (this.
|
|
53
|
+
if (!this.connected) throw index$1.WalletLoginError.disconnectionError("Not connected with wallet");
|
|
50
54
|
}
|
|
51
55
|
checkSwitchChainRequirements(params, init = false) {
|
|
52
56
|
if (!init && !this.provider) throw index$1.WalletLoginError.notConnectedError("Not connected with wallet.");
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var constants = require('./constants.js');
|
|
4
|
+
|
|
5
|
+
const CONNECTED_STATUSES = [constants.CONNECTOR_STATUS.CONNECTED, constants.CONNECTOR_STATUS.AUTHORIZED];
|
|
6
|
+
const CAN_AUTHORIZE_STATUSES = [constants.CONNECTOR_STATUS.AUTHORIZING, constants.CONNECTOR_STATUS.AUTHORIZED, constants.CONNECTOR_STATUS.CONNECTED];
|
|
7
|
+
|
|
8
|
+
exports.CAN_AUTHORIZE_STATUSES = CAN_AUTHORIZE_STATUSES;
|
|
9
|
+
exports.CONNECTED_STATUSES = CONNECTED_STATUSES;
|
|
@@ -9,7 +9,9 @@ const CONNECTOR_STATUS = {
|
|
|
9
9
|
CONNECTED: "connected",
|
|
10
10
|
DISCONNECTING: "disconnecting",
|
|
11
11
|
DISCONNECTED: "disconnected",
|
|
12
|
-
ERRORED: "errored"
|
|
12
|
+
ERRORED: "errored",
|
|
13
|
+
AUTHORIZED: "authorized",
|
|
14
|
+
AUTHORIZING: "authorizing"
|
|
13
15
|
};
|
|
14
16
|
const CONNECTOR_EVENTS = _objectSpread(_objectSpread({}, CONNECTOR_STATUS), {}, {
|
|
15
17
|
CONNECTOR_DATA_UPDATED: "connector_data_updated",
|
|
@@ -22,7 +24,12 @@ const CONNECTOR_CATEGORY = {
|
|
|
22
24
|
EXTERNAL: "external",
|
|
23
25
|
IN_APP: "in_app"
|
|
24
26
|
};
|
|
27
|
+
const CONNECTOR_INITIAL_AUTHENTICATION_MODE = {
|
|
28
|
+
CONNECT_ONLY: "connect-only",
|
|
29
|
+
CONNECT_AND_SIGN: "connect-and-sign"
|
|
30
|
+
};
|
|
25
31
|
|
|
26
32
|
exports.CONNECTOR_CATEGORY = CONNECTOR_CATEGORY;
|
|
27
33
|
exports.CONNECTOR_EVENTS = CONNECTOR_EVENTS;
|
|
34
|
+
exports.CONNECTOR_INITIAL_AUTHENTICATION_MODE = CONNECTOR_INITIAL_AUTHENTICATION_MODE;
|
|
28
35
|
exports.CONNECTOR_STATUS = CONNECTOR_STATUS;
|
|
@@ -7,6 +7,7 @@ require('@babel/runtime/helpers/defineProperty');
|
|
|
7
7
|
var auth = require('@web3auth/auth');
|
|
8
8
|
var index = require('./errors/index.js');
|
|
9
9
|
require('./wallet/index.js');
|
|
10
|
+
require('./connector/connectorStatus.js');
|
|
10
11
|
require('./connector/constants.js');
|
|
11
12
|
require('jwt-decode');
|
|
12
13
|
var constants = require('./constants.js');
|
|
@@ -146,7 +147,7 @@ const getWalletServicesAnalyticsProperties = walletServicesConfig => {
|
|
|
146
147
|
ws_default_portfolio: walletServicesConfig === null || walletServicesConfig === void 0 || (_walletServicesConfig10 = walletServicesConfig.whiteLabel) === null || _walletServicesConfig10 === void 0 ? void 0 : _walletServicesConfig10.defaultPortfolio
|
|
147
148
|
};
|
|
148
149
|
};
|
|
149
|
-
const sdkVersion = "10.
|
|
150
|
+
const sdkVersion = "10.10.0";
|
|
150
151
|
const getErrorAnalyticsProperties = error => {
|
|
151
152
|
try {
|
|
152
153
|
const code = error instanceof index.Web3AuthError ? error.code : error === null || error === void 0 ? void 0 : error.code;
|
|
@@ -9,6 +9,7 @@ require('@segment/analytics-next');
|
|
|
9
9
|
var loglevel = require('../../base/loglevel.js');
|
|
10
10
|
var IChainInterface = require('../../base/chain/IChainInterface.js');
|
|
11
11
|
var baseConnector = require('../../base/connector/baseConnector.js');
|
|
12
|
+
var connectorStatus = require('../../base/connector/connectorStatus.js');
|
|
12
13
|
var constants = require('../../base/connector/constants.js');
|
|
13
14
|
require('jwt-decode');
|
|
14
15
|
var index$1 = require('../../base/errors/index.js');
|
|
@@ -146,7 +147,7 @@ class AuthConnector extends baseConnector.BaseConnector {
|
|
|
146
147
|
this.rehydrated = true;
|
|
147
148
|
await this.connect({
|
|
148
149
|
chainId: options.chainId,
|
|
149
|
-
getIdentityToken:
|
|
150
|
+
getIdentityToken: options.getIdentityToken
|
|
150
151
|
});
|
|
151
152
|
} else if (!sessionId && options.autoConnect) {
|
|
152
153
|
// if here, this means that the connector is cached but the sessionId is not available.
|
|
@@ -184,7 +185,7 @@ class AuthConnector extends baseConnector.BaseConnector {
|
|
|
184
185
|
async enableMFA(params = {
|
|
185
186
|
authConnection: ""
|
|
186
187
|
}) {
|
|
187
|
-
if (this.
|
|
188
|
+
if (!this.connected) throw index$1.WalletLoginError.notConnectedError("Not connected with wallet");
|
|
188
189
|
if (!this.authInstance) throw index$1.WalletInitializationError.notReady("authInstance is not ready");
|
|
189
190
|
try {
|
|
190
191
|
const result = await this.authInstance.enableMFA(params);
|
|
@@ -201,7 +202,7 @@ class AuthConnector extends baseConnector.BaseConnector {
|
|
|
201
202
|
async manageMFA(params = {
|
|
202
203
|
authConnection: ""
|
|
203
204
|
}) {
|
|
204
|
-
if (this.
|
|
205
|
+
if (!this.connected) throw index$1.WalletLoginError.notConnectedError("Not connected with wallet");
|
|
205
206
|
if (!this.authInstance) throw index$1.WalletInitializationError.notReady("authInstance is not ready");
|
|
206
207
|
try {
|
|
207
208
|
await this.authInstance.manageMFA(params);
|
|
@@ -216,7 +217,7 @@ class AuthConnector extends baseConnector.BaseConnector {
|
|
|
216
217
|
async disconnect(options = {
|
|
217
218
|
cleanup: false
|
|
218
219
|
}) {
|
|
219
|
-
if (this.
|
|
220
|
+
if (!this.connected) throw index$1.WalletLoginError.notConnectedError("Not connected with wallet");
|
|
220
221
|
if (!this.authInstance) throw index$1.WalletInitializationError.notReady("authInstance is not ready");
|
|
221
222
|
this.status = constants.CONNECTOR_STATUS.DISCONNECTING;
|
|
222
223
|
await this.authInstance.logout();
|
|
@@ -234,14 +235,25 @@ class AuthConnector extends baseConnector.BaseConnector {
|
|
|
234
235
|
this.emit(constants.CONNECTOR_EVENTS.DISCONNECTED);
|
|
235
236
|
}
|
|
236
237
|
async getIdentityToken() {
|
|
237
|
-
if (this.
|
|
238
|
+
if (!this.canAuthorize) throw index$1.WalletLoginError.notConnectedError("Not connected with wallet, Please login/connect first");
|
|
239
|
+
this.status = constants.CONNECTOR_STATUS.AUTHORIZING;
|
|
240
|
+
this.emit(constants.CONNECTOR_EVENTS.AUTHORIZING, {
|
|
241
|
+
connector: index.WALLET_CONNECTORS.AUTH
|
|
242
|
+
});
|
|
238
243
|
const userInfo = await this.getUserInfo();
|
|
244
|
+
this.status = constants.CONNECTOR_STATUS.AUTHORIZED;
|
|
245
|
+
this.emit(constants.CONNECTOR_EVENTS.AUTHORIZED, {
|
|
246
|
+
connector: index.WALLET_CONNECTORS.AUTH,
|
|
247
|
+
identityTokenInfo: {
|
|
248
|
+
idToken: userInfo.idToken
|
|
249
|
+
}
|
|
250
|
+
});
|
|
239
251
|
return {
|
|
240
252
|
idToken: userInfo.idToken
|
|
241
253
|
};
|
|
242
254
|
}
|
|
243
255
|
async getUserInfo() {
|
|
244
|
-
if (this.
|
|
256
|
+
if (!this.canAuthorize) throw index$1.WalletLoginError.notConnectedError("Not connected with wallet");
|
|
245
257
|
if (!this.authInstance) throw index$1.WalletInitializationError.notReady("authInstance is not ready");
|
|
246
258
|
const userInfo = this.authInstance.getUserInfo();
|
|
247
259
|
return userInfo;
|
|
@@ -367,9 +379,6 @@ class AuthConnector extends baseConnector.BaseConnector {
|
|
|
367
379
|
// if getIdentityToken is true, then get the identity token
|
|
368
380
|
// No need to get the identity token for auth connector as it is already handled
|
|
369
381
|
let identityTokenInfo;
|
|
370
|
-
if (params.getIdentityToken) {
|
|
371
|
-
identityTokenInfo = await this.getIdentityToken();
|
|
372
|
-
}
|
|
373
382
|
this.status = constants.CONNECTOR_STATUS.CONNECTED;
|
|
374
383
|
this.emit(constants.CONNECTOR_EVENTS.CONNECTED, {
|
|
375
384
|
connector: index.WALLET_CONNECTORS.AUTH,
|
|
@@ -377,9 +386,12 @@ class AuthConnector extends baseConnector.BaseConnector {
|
|
|
377
386
|
provider: this.provider,
|
|
378
387
|
identityTokenInfo
|
|
379
388
|
});
|
|
389
|
+
if (params.getIdentityToken) {
|
|
390
|
+
identityTokenInfo = await this.getIdentityToken();
|
|
391
|
+
}
|
|
380
392
|
// handle disconnect from ws embed
|
|
381
393
|
(_this$wsEmbedInstance3 = this.wsEmbedInstance) === null || _this$wsEmbedInstance3 === void 0 || _this$wsEmbedInstance3.provider.on("accountsChanged", (accounts = []) => {
|
|
382
|
-
if (accounts.length === 0 && this.status
|
|
394
|
+
if (accounts.length === 0 && connectorStatus.CONNECTED_STATUSES.includes(this.status)) this.disconnect({
|
|
383
395
|
cleanup: false
|
|
384
396
|
});
|
|
385
397
|
});
|
|
@@ -7,6 +7,7 @@ require('@babel/runtime/helpers/defineProperty');
|
|
|
7
7
|
require('@segment/analytics-next');
|
|
8
8
|
require('../../base/loglevel.js');
|
|
9
9
|
var baseConnector = require('../../base/connector/baseConnector.js');
|
|
10
|
+
require('../../base/connector/connectorStatus.js');
|
|
10
11
|
var constants = require('../../base/connector/constants.js');
|
|
11
12
|
require('@web3auth/auth');
|
|
12
13
|
var utils = require('../../base/connector/utils.js');
|
|
@@ -20,8 +21,12 @@ require('../../base/wallet/index.js');
|
|
|
20
21
|
class BaseEvmConnector extends baseConnector.BaseConnector {
|
|
21
22
|
async init(_) {}
|
|
22
23
|
async getIdentityToken() {
|
|
23
|
-
if (!this.provider || this.
|
|
24
|
+
if (!this.provider || !this.canAuthorize) throw index.WalletLoginError.notConnectedError();
|
|
24
25
|
if (!this.coreOptions) throw index.WalletInitializationError.invalidParams("Please initialize Web3Auth with valid options");
|
|
26
|
+
this.status = constants.CONNECTOR_STATUS.AUTHORIZING;
|
|
27
|
+
this.emit(constants.CONNECTOR_EVENTS.AUTHORIZING, {
|
|
28
|
+
connector: this.name
|
|
29
|
+
});
|
|
25
30
|
const accounts = await this.provider.request({
|
|
26
31
|
method: wsEmbed.EVM_METHOD_TYPES.GET_ACCOUNTS
|
|
27
32
|
});
|
|
@@ -30,6 +35,13 @@ class BaseEvmConnector extends baseConnector.BaseConnector {
|
|
|
30
35
|
if (existingToken) {
|
|
31
36
|
const isExpired = utils.checkIfTokenIsExpired(existingToken);
|
|
32
37
|
if (!isExpired) {
|
|
38
|
+
this.status = constants.CONNECTOR_STATUS.AUTHORIZED;
|
|
39
|
+
this.emit(constants.CONNECTOR_EVENTS.AUTHORIZED, {
|
|
40
|
+
connector: this.name,
|
|
41
|
+
identityTokenInfo: {
|
|
42
|
+
idToken: existingToken
|
|
43
|
+
}
|
|
44
|
+
});
|
|
33
45
|
return {
|
|
34
46
|
idToken: existingToken
|
|
35
47
|
};
|
|
@@ -60,6 +72,13 @@ class BaseEvmConnector extends baseConnector.BaseConnector {
|
|
|
60
72
|
});
|
|
61
73
|
const idToken = await baseControllers.verifySignedChallenge(chainNamespace, signedMessage, challenge, this.name, this.coreOptions.sessionTime, this.coreOptions.clientId, this.coreOptions.web3AuthNetwork);
|
|
62
74
|
utils.saveToken(accounts[0], this.name, idToken);
|
|
75
|
+
this.status = constants.CONNECTOR_STATUS.AUTHORIZED;
|
|
76
|
+
this.emit(constants.CONNECTOR_EVENTS.AUTHORIZED, {
|
|
77
|
+
connector: this.name,
|
|
78
|
+
identityTokenInfo: {
|
|
79
|
+
idToken
|
|
80
|
+
}
|
|
81
|
+
});
|
|
63
82
|
return {
|
|
64
83
|
idToken
|
|
65
84
|
};
|
|
@@ -7,6 +7,7 @@ require('@babel/runtime/helpers/defineProperty');
|
|
|
7
7
|
require('@segment/analytics-next');
|
|
8
8
|
require('../../base/loglevel.js');
|
|
9
9
|
var baseConnector = require('../../base/connector/baseConnector.js');
|
|
10
|
+
require('../../base/connector/connectorStatus.js');
|
|
10
11
|
var constants = require('../../base/connector/constants.js');
|
|
11
12
|
require('@web3auth/auth');
|
|
12
13
|
var utils = require('../../base/connector/utils.js');
|
|
@@ -20,8 +21,12 @@ require('../../base/wallet/index.js');
|
|
|
20
21
|
class BaseSolanaConnector extends baseConnector.BaseConnector {
|
|
21
22
|
async init(_) {}
|
|
22
23
|
async getIdentityToken() {
|
|
23
|
-
if (!this.provider || this.
|
|
24
|
+
if (!this.provider || !this.canAuthorize) throw index.WalletLoginError.notConnectedError();
|
|
24
25
|
if (!this.coreOptions) throw index.WalletInitializationError.invalidParams("Please initialize Web3Auth with a valid options");
|
|
26
|
+
this.status = constants.CONNECTOR_STATUS.AUTHORIZING;
|
|
27
|
+
this.emit(constants.CONNECTOR_EVENTS.AUTHORIZING, {
|
|
28
|
+
connector: this.name
|
|
29
|
+
});
|
|
25
30
|
const accounts = await this.provider.request({
|
|
26
31
|
method: wsEmbed.SOLANA_METHOD_TYPES.GET_ACCOUNTS
|
|
27
32
|
});
|
|
@@ -30,6 +35,13 @@ class BaseSolanaConnector extends baseConnector.BaseConnector {
|
|
|
30
35
|
if (existingToken) {
|
|
31
36
|
const isExpired = utils.checkIfTokenIsExpired(existingToken);
|
|
32
37
|
if (!isExpired) {
|
|
38
|
+
this.status = constants.CONNECTOR_STATUS.AUTHORIZED;
|
|
39
|
+
this.emit(constants.CONNECTOR_EVENTS.AUTHORIZED, {
|
|
40
|
+
connector: this.name,
|
|
41
|
+
identityTokenInfo: {
|
|
42
|
+
idToken: existingToken
|
|
43
|
+
}
|
|
44
|
+
});
|
|
33
45
|
return {
|
|
34
46
|
idToken: existingToken
|
|
35
47
|
};
|
|
@@ -62,6 +74,13 @@ class BaseSolanaConnector extends baseConnector.BaseConnector {
|
|
|
62
74
|
});
|
|
63
75
|
const idToken = await baseControllers.verifySignedChallenge(chainNamespace, signedMessage, challenge, this.name, this.coreOptions.sessionTime, this.coreOptions.clientId, this.coreOptions.web3AuthNetwork);
|
|
64
76
|
utils.saveToken(accounts[0], this.name, idToken);
|
|
77
|
+
this.status = constants.CONNECTOR_STATUS.AUTHORIZED;
|
|
78
|
+
this.emit(constants.CONNECTOR_EVENTS.AUTHORIZED, {
|
|
79
|
+
connector: this.name,
|
|
80
|
+
identityTokenInfo: {
|
|
81
|
+
idToken
|
|
82
|
+
}
|
|
83
|
+
});
|
|
65
84
|
return {
|
|
66
85
|
idToken
|
|
67
86
|
};
|
|
@@ -8,6 +8,7 @@ var IChainInterface = require('../../base/chain/IChainInterface.js');
|
|
|
8
8
|
require('@web3auth/auth');
|
|
9
9
|
var index$1 = require('../../base/errors/index.js');
|
|
10
10
|
var index = require('../../base/wallet/index.js');
|
|
11
|
+
require('../../base/connector/connectorStatus.js');
|
|
11
12
|
var constants = require('../../base/connector/constants.js');
|
|
12
13
|
require('jwt-decode');
|
|
13
14
|
require('../../base/plugin/errors.js');
|
|
@@ -65,7 +66,7 @@ class CoinbaseConnector extends baseEvmConnector.BaseEvmConnector {
|
|
|
65
66
|
this.rehydrated = true;
|
|
66
67
|
const provider = await this.connect({
|
|
67
68
|
chainId: options.chainId,
|
|
68
|
-
getIdentityToken:
|
|
69
|
+
getIdentityToken: options.getIdentityToken
|
|
69
70
|
});
|
|
70
71
|
// the connect function could fail silently as well.
|
|
71
72
|
if (!provider) {
|
|
@@ -106,15 +107,15 @@ class CoinbaseConnector extends baseEvmConnector.BaseEvmConnector {
|
|
|
106
107
|
this.disconnect();
|
|
107
108
|
});
|
|
108
109
|
let identityTokenInfo;
|
|
109
|
-
if (getIdentityToken) {
|
|
110
|
-
identityTokenInfo = await this.getIdentityToken();
|
|
111
|
-
}
|
|
112
110
|
this.emit(constants.CONNECTOR_EVENTS.CONNECTED, {
|
|
113
111
|
connector: index.WALLET_CONNECTORS.COINBASE,
|
|
114
112
|
reconnected: this.rehydrated,
|
|
115
113
|
provider: this.provider,
|
|
116
114
|
identityTokenInfo
|
|
117
115
|
});
|
|
116
|
+
if (getIdentityToken) {
|
|
117
|
+
identityTokenInfo = await this.getIdentityToken();
|
|
118
|
+
}
|
|
118
119
|
return this.provider;
|
|
119
120
|
} catch (error) {
|
|
120
121
|
// ready again to be connected
|
|
@@ -142,7 +143,7 @@ class CoinbaseConnector extends baseEvmConnector.BaseEvmConnector {
|
|
|
142
143
|
await super.disconnect();
|
|
143
144
|
}
|
|
144
145
|
async getUserInfo() {
|
|
145
|
-
if (this.
|
|
146
|
+
if (!this.canAuthorize) throw index$1.WalletLoginError.notConnectedError("Not connected with wallet, Please login/connect first");
|
|
146
147
|
return {};
|
|
147
148
|
}
|
|
148
149
|
async switchChain(params, init = false) {
|
|
@@ -8,6 +8,7 @@ var IChainInterface = require('../../base/chain/IChainInterface.js');
|
|
|
8
8
|
require('@web3auth/auth');
|
|
9
9
|
var index = require('../../base/errors/index.js');
|
|
10
10
|
require('../../base/wallet/index.js');
|
|
11
|
+
require('../../base/connector/connectorStatus.js');
|
|
11
12
|
var constants = require('../../base/connector/constants.js');
|
|
12
13
|
require('jwt-decode');
|
|
13
14
|
require('../../base/plugin/errors.js');
|
|
@@ -53,7 +54,7 @@ class InjectedEvmConnector extends baseEvmConnector.BaseEvmConnector {
|
|
|
53
54
|
this.rehydrated = true;
|
|
54
55
|
const provider = await this.connect({
|
|
55
56
|
chainId: options.chainId,
|
|
56
|
-
getIdentityToken:
|
|
57
|
+
getIdentityToken: options.getIdentityToken
|
|
57
58
|
});
|
|
58
59
|
if (!provider) {
|
|
59
60
|
this.rehydrated = false;
|
|
@@ -99,15 +100,15 @@ class InjectedEvmConnector extends baseEvmConnector.BaseEvmConnector {
|
|
|
99
100
|
};
|
|
100
101
|
this.injectedProvider.on("accountsChanged", accountDisconnectHandler);
|
|
101
102
|
let identityTokenInfo;
|
|
102
|
-
if (getIdentityToken) {
|
|
103
|
-
identityTokenInfo = await this.getIdentityToken();
|
|
104
|
-
}
|
|
105
103
|
this.emit(constants.CONNECTOR_EVENTS.CONNECTED, {
|
|
106
104
|
connector: this.name,
|
|
107
105
|
reconnected: this.rehydrated,
|
|
108
106
|
provider: this.injectedProvider,
|
|
109
107
|
identityTokenInfo
|
|
110
108
|
});
|
|
109
|
+
if (getIdentityToken) {
|
|
110
|
+
identityTokenInfo = await this.getIdentityToken();
|
|
111
|
+
}
|
|
111
112
|
return this.injectedProvider;
|
|
112
113
|
} catch (error) {
|
|
113
114
|
// ready again to be connected
|
|
@@ -144,7 +145,7 @@ class InjectedEvmConnector extends baseEvmConnector.BaseEvmConnector {
|
|
|
144
145
|
await super.disconnect();
|
|
145
146
|
}
|
|
146
147
|
async getUserInfo() {
|
|
147
|
-
if (this.
|
|
148
|
+
if (!this.canAuthorize) throw index.WalletLoginError.notConnectedError("Not connected with wallet, Please login/connect first");
|
|
148
149
|
return {};
|
|
149
150
|
}
|
|
150
151
|
async addChain(chainConfig, _init = false) {
|
|
@@ -9,6 +9,7 @@ var IChainInterface = require('../../base/chain/IChainInterface.js');
|
|
|
9
9
|
require('@web3auth/auth');
|
|
10
10
|
var index = require('../../base/errors/index.js');
|
|
11
11
|
require('../../base/wallet/index.js');
|
|
12
|
+
require('../../base/connector/connectorStatus.js');
|
|
12
13
|
var constants = require('../../base/connector/constants.js');
|
|
13
14
|
require('jwt-decode');
|
|
14
15
|
require('../../base/plugin/errors.js');
|
|
@@ -46,7 +47,7 @@ class WalletStandardConnector extends baseSolanaConnector.BaseSolanaConnector {
|
|
|
46
47
|
return null;
|
|
47
48
|
}
|
|
48
49
|
get isWalletConnected() {
|
|
49
|
-
return !!(this.
|
|
50
|
+
return !!(this.connected && this.wallet.accounts.length > 0);
|
|
50
51
|
}
|
|
51
52
|
async init(options) {
|
|
52
53
|
await super.init(options);
|
|
@@ -69,7 +70,7 @@ class WalletStandardConnector extends baseSolanaConnector.BaseSolanaConnector {
|
|
|
69
70
|
this.rehydrated = true;
|
|
70
71
|
const provider = await this.connect({
|
|
71
72
|
chainId: options.chainId,
|
|
72
|
-
getIdentityToken:
|
|
73
|
+
getIdentityToken: options.getIdentityToken
|
|
73
74
|
});
|
|
74
75
|
if (!provider) {
|
|
75
76
|
this.rehydrated = false;
|
|
@@ -100,15 +101,15 @@ class WalletStandardConnector extends baseSolanaConnector.BaseSolanaConnector {
|
|
|
100
101
|
if (this.wallet.accounts.length === 0) throw index.WalletLoginError.connectionError();
|
|
101
102
|
this.status = constants.CONNECTOR_STATUS.CONNECTED;
|
|
102
103
|
let identityTokenInfo;
|
|
103
|
-
if (getIdentityToken) {
|
|
104
|
-
identityTokenInfo = await this.getIdentityToken();
|
|
105
|
-
}
|
|
106
104
|
this.emit(constants.CONNECTOR_EVENTS.CONNECTED, {
|
|
107
105
|
connector: this.name,
|
|
108
106
|
reconnected: this.rehydrated,
|
|
109
107
|
provider: this.provider,
|
|
110
108
|
identityTokenInfo
|
|
111
109
|
});
|
|
110
|
+
if (getIdentityToken) {
|
|
111
|
+
identityTokenInfo = await this.getIdentityToken();
|
|
112
|
+
}
|
|
112
113
|
return this.provider;
|
|
113
114
|
} catch (error) {
|
|
114
115
|
// ready again to be connected
|
|
@@ -137,7 +138,7 @@ class WalletStandardConnector extends baseSolanaConnector.BaseSolanaConnector {
|
|
|
137
138
|
}
|
|
138
139
|
}
|
|
139
140
|
async getUserInfo() {
|
|
140
|
-
if (!this.
|
|
141
|
+
if (!this.canAuthorize) throw index.WalletLoginError.notConnectedError("Not connected with wallet, Please login/connect first");
|
|
141
142
|
return {};
|
|
142
143
|
}
|
|
143
144
|
async switchChain(params, init = false) {
|
|
@@ -10,6 +10,7 @@ var IChainInterface = require('../../base/chain/IChainInterface.js');
|
|
|
10
10
|
require('@web3auth/auth');
|
|
11
11
|
var index$1 = require('../../base/errors/index.js');
|
|
12
12
|
var index = require('../../base/wallet/index.js');
|
|
13
|
+
require('../../base/connector/connectorStatus.js');
|
|
13
14
|
var constants = require('../../base/connector/constants.js');
|
|
14
15
|
require('jwt-decode');
|
|
15
16
|
require('../../base/loglevel.js');
|
|
@@ -79,7 +80,7 @@ class MetaMaskConnector extends baseEvmConnector.BaseEvmConnector {
|
|
|
79
80
|
this.rehydrated = true;
|
|
80
81
|
const provider = await this.connect({
|
|
81
82
|
chainId: options.chainId,
|
|
82
|
-
getIdentityToken:
|
|
83
|
+
getIdentityToken: options.getIdentityToken
|
|
83
84
|
});
|
|
84
85
|
if (!provider) {
|
|
85
86
|
this.rehydrated = false;
|
|
@@ -199,7 +200,7 @@ class MetaMaskConnector extends baseEvmConnector.BaseEvmConnector {
|
|
|
199
200
|
await super.disconnect();
|
|
200
201
|
}
|
|
201
202
|
async getUserInfo() {
|
|
202
|
-
if (this.
|
|
203
|
+
if (!this.canAuthorize) throw index$1.WalletLoginError.notConnectedError("Not connected with wallet, Please login/connect first");
|
|
203
204
|
return {};
|
|
204
205
|
}
|
|
205
206
|
async switchChain(params, init = false) {
|
|
@@ -9,6 +9,7 @@ var loglevel = require('../../base/loglevel.js');
|
|
|
9
9
|
var baseControllers = require('@toruslabs/base-controllers');
|
|
10
10
|
var index = require('../../base/errors/index.js');
|
|
11
11
|
require('../../base/wallet/index.js');
|
|
12
|
+
require('../../base/connector/connectorStatus.js');
|
|
12
13
|
require('../../base/connector/constants.js');
|
|
13
14
|
require('jwt-decode');
|
|
14
15
|
require('../../base/plugin/errors.js');
|
|
@@ -8,6 +8,7 @@ var baseControllers = require('@toruslabs/base-controllers');
|
|
|
8
8
|
require('@web3auth/auth');
|
|
9
9
|
require('../../base/errors/index.js');
|
|
10
10
|
require('../../base/wallet/index.js');
|
|
11
|
+
require('../../base/connector/connectorStatus.js');
|
|
11
12
|
require('../../base/connector/constants.js');
|
|
12
13
|
require('jwt-decode');
|
|
13
14
|
var constants = require('../../base/constants.js');
|
|
@@ -10,6 +10,7 @@ var deepmerge = require('deepmerge');
|
|
|
10
10
|
var analytics = require('../../base/analytics.js');
|
|
11
11
|
var IChainInterface = require('../../base/chain/IChainInterface.js');
|
|
12
12
|
var baseConnector = require('../../base/connector/baseConnector.js');
|
|
13
|
+
require('../../base/connector/connectorStatus.js');
|
|
13
14
|
var constants = require('../../base/connector/constants.js');
|
|
14
15
|
require('@web3auth/auth');
|
|
15
16
|
var utils$1 = require('../../base/connector/utils.js');
|
|
@@ -105,7 +106,7 @@ class WalletConnectV2Connector extends baseConnector.BaseConnector {
|
|
|
105
106
|
try {
|
|
106
107
|
await this.onConnectHandler({
|
|
107
108
|
chain: chainConfig,
|
|
108
|
-
getIdentityToken:
|
|
109
|
+
getIdentityToken: options.getIdentityToken
|
|
109
110
|
});
|
|
110
111
|
} catch (error) {
|
|
111
112
|
loglevel.log.error("wallet auto connect", error);
|
|
@@ -170,7 +171,7 @@ class WalletConnectV2Connector extends baseConnector.BaseConnector {
|
|
|
170
171
|
if (this.connected) {
|
|
171
172
|
await this.onConnectHandler({
|
|
172
173
|
chain: chainConfig,
|
|
173
|
-
getIdentityToken
|
|
174
|
+
getIdentityToken
|
|
174
175
|
});
|
|
175
176
|
return this.provider;
|
|
176
177
|
}
|
|
@@ -213,7 +214,7 @@ class WalletConnectV2Connector extends baseConnector.BaseConnector {
|
|
|
213
214
|
}
|
|
214
215
|
}
|
|
215
216
|
async getUserInfo() {
|
|
216
|
-
if (!this.
|
|
217
|
+
if (!this.canAuthorize) throw index$1.WalletLoginError.notConnectedError("Not connected with wallet, Please login/connect first");
|
|
217
218
|
return {};
|
|
218
219
|
}
|
|
219
220
|
async disconnect(options = {
|
|
@@ -242,7 +243,11 @@ class WalletConnectV2Connector extends baseConnector.BaseConnector {
|
|
|
242
243
|
this.emit(constants.CONNECTOR_EVENTS.DISCONNECTED);
|
|
243
244
|
}
|
|
244
245
|
async getIdentityToken() {
|
|
245
|
-
if (!this.provider || this.
|
|
246
|
+
if (!this.provider || !this.canAuthorize) throw index$1.WalletLoginError.notConnectedError();
|
|
247
|
+
this.status = constants.CONNECTOR_STATUS.AUTHORIZING;
|
|
248
|
+
this.emit(constants.CONNECTOR_EVENTS.AUTHORIZING, {
|
|
249
|
+
connector: index.WALLET_CONNECTORS.WALLET_CONNECT_V2
|
|
250
|
+
});
|
|
246
251
|
const {
|
|
247
252
|
chainId
|
|
248
253
|
} = this.provider;
|
|
@@ -259,6 +264,13 @@ class WalletConnectV2Connector extends baseConnector.BaseConnector {
|
|
|
259
264
|
if (existingToken) {
|
|
260
265
|
const isExpired = utils$1.checkIfTokenIsExpired(existingToken);
|
|
261
266
|
if (!isExpired) {
|
|
267
|
+
this.status = constants.CONNECTOR_STATUS.AUTHORIZED;
|
|
268
|
+
this.emit(constants.CONNECTOR_EVENTS.AUTHORIZED, {
|
|
269
|
+
connector: index.WALLET_CONNECTORS.WALLET_CONNECT_V2,
|
|
270
|
+
identityTokenInfo: {
|
|
271
|
+
idToken: existingToken
|
|
272
|
+
}
|
|
273
|
+
});
|
|
262
274
|
return {
|
|
263
275
|
idToken: existingToken
|
|
264
276
|
};
|
|
@@ -277,6 +289,13 @@ class WalletConnectV2Connector extends baseConnector.BaseConnector {
|
|
|
277
289
|
const signedMessage = await this._getSignedMessage(challenge, accounts, chainNamespace);
|
|
278
290
|
const idToken = await baseControllers.verifySignedChallenge(chainNamespace, signedMessage, challenge, this.name, this.coreOptions.sessionTime, this.coreOptions.clientId, this.coreOptions.web3AuthNetwork);
|
|
279
291
|
utils$1.saveToken(accounts[0], this.name, idToken);
|
|
292
|
+
this.status = constants.CONNECTOR_STATUS.AUTHORIZED;
|
|
293
|
+
this.emit(constants.CONNECTOR_EVENTS.AUTHORIZED, {
|
|
294
|
+
connector: index.WALLET_CONNECTORS.WALLET_CONNECT_V2,
|
|
295
|
+
identityTokenInfo: {
|
|
296
|
+
idToken
|
|
297
|
+
}
|
|
298
|
+
});
|
|
280
299
|
return {
|
|
281
300
|
idToken
|
|
282
301
|
};
|
|
@@ -414,15 +433,15 @@ class WalletConnectV2Connector extends baseConnector.BaseConnector {
|
|
|
414
433
|
// track connection events
|
|
415
434
|
if (trackCompletionEvents) trackCompletionEvents();
|
|
416
435
|
let identityTokenInfo;
|
|
417
|
-
if (getIdentityToken) {
|
|
418
|
-
identityTokenInfo = await this.getIdentityToken();
|
|
419
|
-
}
|
|
420
436
|
this.emit(constants.CONNECTOR_EVENTS.CONNECTED, {
|
|
421
437
|
connector: index.WALLET_CONNECTORS.WALLET_CONNECT_V2,
|
|
422
438
|
reconnected: this.rehydrated,
|
|
423
439
|
provider: this.provider,
|
|
424
440
|
identityTokenInfo
|
|
425
441
|
});
|
|
442
|
+
if (getIdentityToken) {
|
|
443
|
+
identityTokenInfo = await this.getIdentityToken();
|
|
444
|
+
}
|
|
426
445
|
}
|
|
427
446
|
subscribeEvents() {
|
|
428
447
|
if (!this.connector) throw index$1.WalletInitializationError.notReady("Wallet connector is not ready yet");
|
|
@@ -11,6 +11,7 @@ require('../../base/loglevel.js');
|
|
|
11
11
|
require('@toruslabs/base-controllers');
|
|
12
12
|
var index = require('../../base/errors/index.js');
|
|
13
13
|
require('../../base/wallet/index.js');
|
|
14
|
+
require('../../base/connector/connectorStatus.js');
|
|
14
15
|
require('../../base/connector/constants.js');
|
|
15
16
|
require('jwt-decode');
|
|
16
17
|
var constants = require('../../base/constants.js');
|
package/dist/lib.cjs/index.js
CHANGED
|
@@ -4,6 +4,7 @@ var analytics = require('./base/analytics.js');
|
|
|
4
4
|
var IChainInterface = require('./base/chain/IChainInterface.js');
|
|
5
5
|
var index = require('./base/composables/index.js');
|
|
6
6
|
var baseConnector = require('./base/connector/baseConnector.js');
|
|
7
|
+
var connectorStatus = require('./base/connector/connectorStatus.js');
|
|
7
8
|
var constants = require('./base/connector/constants.js');
|
|
8
9
|
var auth = require('@web3auth/auth');
|
|
9
10
|
var utils = require('./base/connector/utils.js');
|
|
@@ -62,8 +63,11 @@ exports.Analytics = analytics.Analytics;
|
|
|
62
63
|
exports.CONNECTOR_NAMESPACES = IChainInterface.CONNECTOR_NAMESPACES;
|
|
63
64
|
exports.Web3AuthContextKey = index.Web3AuthContextKey;
|
|
64
65
|
exports.BaseConnector = baseConnector.BaseConnector;
|
|
66
|
+
exports.CAN_AUTHORIZE_STATUSES = connectorStatus.CAN_AUTHORIZE_STATUSES;
|
|
67
|
+
exports.CONNECTED_STATUSES = connectorStatus.CONNECTED_STATUSES;
|
|
65
68
|
exports.CONNECTOR_CATEGORY = constants.CONNECTOR_CATEGORY;
|
|
66
69
|
exports.CONNECTOR_EVENTS = constants.CONNECTOR_EVENTS;
|
|
70
|
+
exports.CONNECTOR_INITIAL_AUTHENTICATION_MODE = constants.CONNECTOR_INITIAL_AUTHENTICATION_MODE;
|
|
67
71
|
exports.CONNECTOR_STATUS = constants.CONNECTOR_STATUS;
|
|
68
72
|
Object.defineProperty(exports, "AUTH_CONNECTION", {
|
|
69
73
|
enumerable: true,
|