@web3auth/no-modal 10.0.0-alpha.2 → 10.0.0-beta.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/chain/config.js +2 -1
- package/dist/lib.cjs/base/connector/constants.js +5 -0
- package/dist/lib.cjs/base/utils.js +3 -2
- package/dist/lib.cjs/base/wallet/index.js +2 -1
- package/dist/lib.cjs/connectors/auth-connector/authConnector.js +67 -19
- package/dist/lib.cjs/connectors/injected-solana-connector/walletStandardConnector.js +0 -1
- package/dist/lib.cjs/connectors/metamask-connector/metamaskConnector.js +197 -0
- package/dist/lib.cjs/connectors/utils.js +61 -0
- package/dist/lib.cjs/connectors/wallet-connect-v2-connector/WalletConnectV2Provider.js +0 -1
- package/dist/lib.cjs/connectors/wallet-connect-v2-connector/config.js +3 -58
- package/dist/lib.cjs/connectors/wallet-connect-v2-connector/walletConnectV2Connector.js +6 -16
- package/dist/lib.cjs/index.js +1 -2
- package/dist/lib.cjs/noModal.js +119 -29
- package/dist/lib.cjs/plugins/wallet-services-plugin/plugin.js +1 -1
- package/dist/lib.cjs/providers/account-abstraction-provider/providers/AccountAbstractionProvider.js +18 -12
- package/dist/lib.cjs/providers/solana-provider/rpc/solanaRpcMiddlewares.js +1 -1
- package/dist/lib.cjs/types/base/chain/IChainInterface.d.ts +3 -45
- package/dist/lib.cjs/types/base/connector/constants.d.ts +4 -0
- package/dist/lib.cjs/types/base/connector/interfaces.d.ts +7 -3
- package/dist/lib.cjs/types/base/core/IWeb3Auth.d.ts +10 -4
- package/dist/lib.cjs/types/base/interfaces.d.ts +66 -9
- package/dist/lib.cjs/types/base/utils.d.ts +2 -2
- package/dist/lib.cjs/types/base/wallet/index.d.ts +2 -0
- package/dist/lib.cjs/types/connectors/auth-connector/authConnector.d.ts +5 -2
- package/dist/lib.cjs/types/connectors/auth-connector/interface.d.ts +4 -2
- package/dist/lib.cjs/types/connectors/metamask-connector/index.d.ts +1 -0
- package/dist/lib.cjs/types/connectors/metamask-connector/metamaskConnector.d.ts +6 -0
- package/dist/lib.cjs/types/connectors/utils.d.ts +8 -0
- package/dist/lib.cjs/types/noModal.d.ts +5 -3
- package/dist/lib.cjs/types/providers/account-abstraction-provider/providers/AccountAbstractionProvider.d.ts +4 -5
- package/dist/lib.cjs/types/providers/solana-provider/providers/index.d.ts +0 -1
- package/dist/lib.esm/base/chain/config.js +2 -1
- package/dist/lib.esm/base/connector/constants.js +5 -1
- package/dist/lib.esm/base/utils.js +3 -2
- package/dist/lib.esm/base/wallet/index.js +2 -1
- package/dist/lib.esm/connectors/auth-connector/authConnector.js +67 -19
- package/dist/lib.esm/connectors/injected-solana-connector/walletStandardConnector.js +0 -1
- package/dist/lib.esm/connectors/metamask-connector/metamaskConnector.js +195 -0
- package/dist/lib.esm/connectors/utils.js +58 -0
- package/dist/lib.esm/connectors/wallet-connect-v2-connector/WalletConnectV2Provider.js +1 -2
- package/dist/lib.esm/connectors/wallet-connect-v2-connector/config.js +1 -56
- package/dist/lib.esm/connectors/wallet-connect-v2-connector/walletConnectV2Connector.js +6 -16
- package/dist/lib.esm/connectors/wallet-connect-v2-connector/walletConnectV2Utils.js +1 -1
- package/dist/lib.esm/index.js +1 -2
- package/dist/lib.esm/noModal.js +121 -31
- package/dist/lib.esm/plugins/wallet-services-plugin/plugin.js +1 -1
- package/dist/lib.esm/providers/account-abstraction-provider/providers/AccountAbstractionProvider.js +18 -12
- package/dist/lib.esm/providers/solana-provider/rpc/solanaRpcMiddlewares.js +1 -1
- package/dist/noModal.umd.min.js +1 -1
- package/package.json +5 -4
- package/dist/lib.cjs/connectors/auth-connector/config/authConnectionConfig.js +0 -216
- package/dist/lib.cjs/connectors/auth-connector/config/config-build.js +0 -54
- package/dist/lib.cjs/connectors/auth-connector/config/config-env.js +0 -361
- package/dist/lib.cjs/providers/solana-provider/providers/privateKeyProvider/solanaPrivateKeyProvider.js +0 -161
- package/dist/lib.cjs/providers/solana-provider/providers/privateKeyProvider/solanaPrivateKeyUtils.js +0 -104
- package/dist/lib.cjs/types/connectors/auth-connector/config/authConnectionConfig.d.ts +0 -2
- package/dist/lib.cjs/types/connectors/auth-connector/config/config-build.d.ts +0 -18
- package/dist/lib.cjs/types/connectors/auth-connector/config/config-env.d.ts +0 -60
- package/dist/lib.cjs/types/providers/solana-provider/providers/privateKeyProvider/index.d.ts +0 -1
- package/dist/lib.cjs/types/providers/solana-provider/providers/privateKeyProvider/solanaPrivateKeyProvider.d.ts +0 -30
- package/dist/lib.cjs/types/providers/solana-provider/providers/privateKeyProvider/solanaPrivateKeyUtils.d.ts +0 -7
- package/dist/lib.esm/connectors/auth-connector/config/authConnectionConfig.js +0 -214
- package/dist/lib.esm/connectors/auth-connector/config/config-build.js +0 -48
- package/dist/lib.esm/connectors/auth-connector/config/config-env.js +0 -359
- package/dist/lib.esm/providers/solana-provider/providers/privateKeyProvider/solanaPrivateKeyProvider.js +0 -159
- package/dist/lib.esm/providers/solana-provider/providers/privateKeyProvider/solanaPrivateKeyUtils.js +0 -102
|
@@ -81,7 +81,8 @@ const getEvmChainConfig = (chainId, web3AuthClientId = "") => {
|
|
|
81
81
|
logo: "https://images.toruswallet.io/eth.svg",
|
|
82
82
|
rpcTarget: infuraRpcTarget,
|
|
83
83
|
ticker: "ETH",
|
|
84
|
-
tickerName: "Ethereum"
|
|
84
|
+
tickerName: "Ethereum",
|
|
85
|
+
displayName: "Linea"
|
|
85
86
|
};
|
|
86
87
|
}
|
|
87
88
|
if (chainId === 11155111) {
|
|
@@ -20,7 +20,12 @@ const CONNECTOR_CATEGORY = {
|
|
|
20
20
|
EXTERNAL: "external",
|
|
21
21
|
IN_APP: "in_app"
|
|
22
22
|
};
|
|
23
|
+
const SMART_ACCOUNT_WALLET_SCOPE = {
|
|
24
|
+
EMBEDDED: "embedded",
|
|
25
|
+
ALL: "all"
|
|
26
|
+
};
|
|
23
27
|
|
|
24
28
|
exports.CONNECTOR_CATEGORY = CONNECTOR_CATEGORY;
|
|
25
29
|
exports.CONNECTOR_EVENTS = CONNECTOR_EVENTS;
|
|
26
30
|
exports.CONNECTOR_STATUS = CONNECTOR_STATUS;
|
|
31
|
+
exports.SMART_ACCOUNT_WALLET_SCOPE = SMART_ACCOUNT_WALLET_SCOPE;
|
|
@@ -17,10 +17,11 @@ const signerHost = web3AuthNetwork => {
|
|
|
17
17
|
return constants.SIGNER_MAP[web3AuthNetwork !== null && web3AuthNetwork !== void 0 ? web3AuthNetwork : auth.WEB3AUTH_NETWORK.SAPPHIRE_MAINNET];
|
|
18
18
|
};
|
|
19
19
|
const fetchProjectConfig = async (clientId, web3AuthNetwork, aaProvider) => {
|
|
20
|
-
const url = new URL(`${signerHost(web3AuthNetwork)}/api/configuration`);
|
|
20
|
+
// const url = new URL(`${signerHost(web3AuthNetwork)}/api/v2/configuration`);
|
|
21
|
+
// TODO: remove this before production
|
|
22
|
+
const url = new URL("https://test-signer.web3auth.io/api/v2/configuration");
|
|
21
23
|
url.searchParams.append("project_id", clientId);
|
|
22
24
|
url.searchParams.append("network", web3AuthNetwork);
|
|
23
|
-
url.searchParams.append("whitelist", "true");
|
|
24
25
|
if (aaProvider) url.searchParams.append("aa_provider", aaProvider);
|
|
25
26
|
const res = await httpHelpers.get(url.href);
|
|
26
27
|
return res;
|
|
@@ -9,7 +9,8 @@ const MULTI_CHAIN_CONNECTORS = {
|
|
|
9
9
|
};
|
|
10
10
|
const SOLANA_CONNECTORS = _objectSpread({}, MULTI_CHAIN_CONNECTORS);
|
|
11
11
|
const EVM_CONNECTORS = _objectSpread({
|
|
12
|
-
COINBASE: "coinbase"
|
|
12
|
+
COINBASE: "coinbase",
|
|
13
|
+
METAMASK: "metamask"
|
|
13
14
|
}, MULTI_CHAIN_CONNECTORS);
|
|
14
15
|
const WALLET_CONNECTORS = _objectSpread(_objectSpread({}, EVM_CONNECTORS), SOLANA_CONNECTORS);
|
|
15
16
|
const CONNECTOR_NAMES = {
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var _objectSpread = require('@babel/runtime/helpers/objectSpread2');
|
|
4
4
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
5
|
+
var baseControllers = require('@toruslabs/base-controllers');
|
|
5
6
|
var securePubSub = require('@toruslabs/secure-pub-sub');
|
|
6
7
|
var auth = require('@web3auth/auth');
|
|
7
8
|
var deepmerge = require('deepmerge');
|
|
@@ -13,11 +14,9 @@ require('jwt-decode');
|
|
|
13
14
|
var loglevel = require('../../base/loglevel.js');
|
|
14
15
|
require('../../base/plugin/errors.js');
|
|
15
16
|
require('../../base/plugin/IPlugin.js');
|
|
16
|
-
var baseControllers = require('@toruslabs/base-controllers');
|
|
17
17
|
require('@toruslabs/constants');
|
|
18
18
|
require('@toruslabs/http-helpers');
|
|
19
19
|
var index = require('../../base/wallet/index.js');
|
|
20
|
-
var authConnectionConfig = require('./config/authConnectionConfig.js');
|
|
21
20
|
|
|
22
21
|
class AuthConnector extends baseConnector.BaseConnector {
|
|
23
22
|
constructor(params) {
|
|
@@ -70,6 +69,7 @@ class AuthConnector extends baseConnector.BaseConnector {
|
|
|
70
69
|
});
|
|
71
70
|
if (!this.coreOptions.clientId) throw index$1.WalletInitializationError.invalidParams("clientId is required before auth's initialization");
|
|
72
71
|
if (!this.authOptions) throw index$1.WalletInitializationError.invalidParams("authOptions is required before auth's initialization");
|
|
72
|
+
if (this.authConnectionConfig.length === 0) throw index$1.WalletInitializationError.invalidParams("authConnectionConfig is required before auth's initialization");
|
|
73
73
|
const isRedirectResult = this.authOptions.uxMode === auth.UX_MODE.REDIRECT;
|
|
74
74
|
this.authOptions = _objectSpread(_objectSpread({}, this.authOptions), {}, {
|
|
75
75
|
replaceUrlOnRedirect: isRedirectResult,
|
|
@@ -79,7 +79,7 @@ class AuthConnector extends baseConnector.BaseConnector {
|
|
|
79
79
|
clientId: this.coreOptions.clientId,
|
|
80
80
|
network: this.coreOptions.web3AuthNetwork,
|
|
81
81
|
sdkMode: auth.SDK_MODE.IFRAME,
|
|
82
|
-
authConnectionConfig: this.authConnectionConfig
|
|
82
|
+
authConnectionConfig: this.authConnectionConfig.filter(x => !x.isDefault)
|
|
83
83
|
}));
|
|
84
84
|
loglevel.log.debug("initializing auth connector init", this.authOptions);
|
|
85
85
|
await this.authInstance.init();
|
|
@@ -352,8 +352,8 @@ class AuthConnector extends baseConnector.BaseConnector {
|
|
|
352
352
|
authConnectionId: params.authConnectionId,
|
|
353
353
|
groupedAuthConnectionId: params.groupedAuthConnectionId
|
|
354
354
|
});
|
|
355
|
-
if (!(providerConfig !== null && providerConfig !== void 0 && providerConfig.authConnection)) throw index$1.WalletLoginError.connectionError("
|
|
356
|
-
const jwtParams = _objectSpread(_objectSpread(_objectSpread({}, providerConfig.jwtParameters), params.extraLoginOptions || {}), {}, {
|
|
355
|
+
if (!(providerConfig !== null && providerConfig !== void 0 && providerConfig.authConnection)) throw index$1.WalletLoginError.connectionError("Invalid auth connection.");
|
|
356
|
+
const jwtParams = _objectSpread(_objectSpread(_objectSpread({}, providerConfig.jwtParameters || {}), params.extraLoginOptions || {}), {}, {
|
|
357
357
|
login_hint: params.login_hint || ((_params$extraLoginOpt3 = params.extraLoginOptions) === null || _params$extraLoginOpt3 === void 0 ? void 0 : _params$extraLoginOpt3.login_hint)
|
|
358
358
|
});
|
|
359
359
|
const nonce = auth.randomId();
|
|
@@ -372,10 +372,11 @@ class AuthConnector extends baseConnector.BaseConnector {
|
|
|
372
372
|
jwtParams,
|
|
373
373
|
customState: {
|
|
374
374
|
nonce,
|
|
375
|
-
dapp_redirect_url: this.authOptions.redirectUrl,
|
|
376
375
|
appState: params.appState,
|
|
377
|
-
|
|
378
|
-
|
|
376
|
+
// use the default settings from the auth instance.
|
|
377
|
+
dapp_redirect_url: this.authInstance.options.redirectUrl,
|
|
378
|
+
uxMode: this.authInstance.options.uxMode,
|
|
379
|
+
whiteLabel: JSON.stringify(this.authInstance.options.whiteLabel),
|
|
379
380
|
loginParams: JSON.stringify(loginParams)
|
|
380
381
|
},
|
|
381
382
|
web3AuthClientId: this.coreOptions.clientId,
|
|
@@ -431,7 +432,16 @@ class AuthConnector extends baseConnector.BaseConnector {
|
|
|
431
432
|
authConnectionId: params.authConnectionId,
|
|
432
433
|
groupedAuthConnectionId: params.groupedAuthConnectionId
|
|
433
434
|
});
|
|
434
|
-
|
|
435
|
+
// throw error only when we cannot find the login config and authConnectionId is not provided in the params.
|
|
436
|
+
// otherwise, we will use the params to create a new auth connection config in the auth instance.
|
|
437
|
+
if (!(loginConfig !== null && loginConfig !== void 0 && loginConfig.authConnection) && !params.authConnectionId) throw index$1.WalletLoginError.connectionError("Invalid auth connection.");
|
|
438
|
+
if (!(loginConfig !== null && loginConfig !== void 0 && loginConfig.authConnection)) {
|
|
439
|
+
this.authInstance.options.authConnectionConfig.push({
|
|
440
|
+
authConnection: params.authConnection,
|
|
441
|
+
authConnectionId: params.authConnectionId,
|
|
442
|
+
groupedAuthConnectionId: params.groupedAuthConnectionId
|
|
443
|
+
});
|
|
444
|
+
}
|
|
435
445
|
const loginParams = baseControllers.cloneDeep(params);
|
|
436
446
|
loginParams.extraLoginOptions = _objectSpread(_objectSpread({}, loginParams.extraLoginOptions || {}), {}, {
|
|
437
447
|
login_hint: params.login_hint || ((_params$extraLoginOpt5 = params.extraLoginOptions) === null || _params$extraLoginOpt5 === void 0 ? void 0 : _params$extraLoginOpt5.login_hint)
|
|
@@ -452,7 +462,8 @@ class AuthConnector extends baseConnector.BaseConnector {
|
|
|
452
462
|
if (authConnectionId) {
|
|
453
463
|
return x.authConnection === authConnection && x.authConnectionId === authConnectionId;
|
|
454
464
|
}
|
|
455
|
-
return
|
|
465
|
+
// return the default auth connection, if not found, return undefined
|
|
466
|
+
return x.authConnection === authConnection && x.isDefault;
|
|
456
467
|
});
|
|
457
468
|
return providerConfig;
|
|
458
469
|
}
|
|
@@ -462,31 +473,67 @@ const authConnector = params => {
|
|
|
462
473
|
projectConfig,
|
|
463
474
|
coreOptions
|
|
464
475
|
}) => {
|
|
465
|
-
var _coreOptions$uiConfig, _coreOptions$walletSe;
|
|
476
|
+
var _coreOptions$uiConfig, _coreOptions$walletSe, _coreOptions$walletSe2, _coreOptions$walletSe3;
|
|
466
477
|
// Connector settings
|
|
467
478
|
const connectorSettings = {};
|
|
468
479
|
const {
|
|
469
480
|
whitelist,
|
|
470
|
-
whitelabel
|
|
481
|
+
whitelabel,
|
|
482
|
+
sessionTime
|
|
471
483
|
} = projectConfig;
|
|
472
484
|
if (whitelist) connectorSettings.originData = whitelist.signed_urls;
|
|
485
|
+
if (sessionTime) connectorSettings.sessionTime = sessionTime;
|
|
473
486
|
if ((_coreOptions$uiConfig = coreOptions.uiConfig) !== null && _coreOptions$uiConfig !== void 0 && _coreOptions$uiConfig.uxMode) connectorSettings.uxMode = coreOptions.uiConfig.uxMode;
|
|
474
487
|
const uiConfig = deepmerge(baseControllers.cloneDeep(whitelabel || {}), coreOptions.uiConfig || {});
|
|
475
488
|
if (!uiConfig.mode) uiConfig.mode = "light";
|
|
476
489
|
connectorSettings.whiteLabel = uiConfig;
|
|
477
490
|
const finalConnectorSettings = deepmerge.all([{
|
|
478
491
|
uxMode: auth.UX_MODE.POPUP,
|
|
479
|
-
buildEnv: auth.BUILD_ENV.PRODUCTION
|
|
492
|
+
buildEnv: coreOptions.authBuildEnv || auth.BUILD_ENV.PRODUCTION
|
|
480
493
|
},
|
|
481
494
|
// default settings
|
|
482
|
-
(params === null || params === void 0 ? void 0 : params.connectorSettings) || {}
|
|
495
|
+
connectorSettings, (params === null || params === void 0 ? void 0 : params.connectorSettings) || {}]);
|
|
483
496
|
// WS settings
|
|
484
|
-
const
|
|
497
|
+
const {
|
|
498
|
+
enableKeyExport,
|
|
499
|
+
walletUi
|
|
500
|
+
} = projectConfig;
|
|
501
|
+
const isKeyExportEnabled = typeof enableKeyExport === "boolean" ? enableKeyExport : true;
|
|
502
|
+
const {
|
|
503
|
+
enablePortfolioWidget = false,
|
|
504
|
+
enableTokenDisplay = true,
|
|
505
|
+
enableNftDisplay = true,
|
|
506
|
+
enableWalletConnect = true,
|
|
507
|
+
enableBuyButton = true,
|
|
508
|
+
enableSendButton = true,
|
|
509
|
+
enableSwapButton = true,
|
|
510
|
+
enableReceiveButton = true,
|
|
511
|
+
enableShowAllTokensButton = true,
|
|
512
|
+
enableConfirmationModal = false,
|
|
513
|
+
portfolioWidgetPosition = baseControllers.BUTTON_POSITION.BOTTOM_LEFT,
|
|
514
|
+
defaultPortfolio = "token"
|
|
515
|
+
} = walletUi || {};
|
|
516
|
+
const projectConfigWhiteLabel = {
|
|
517
|
+
showWidgetButton: enablePortfolioWidget,
|
|
518
|
+
hideNftDisplay: !enableNftDisplay,
|
|
519
|
+
hideTokenDisplay: !enableTokenDisplay,
|
|
520
|
+
hideTransfers: !enableSendButton,
|
|
521
|
+
hideTopup: !enableBuyButton,
|
|
522
|
+
hideReceive: !enableReceiveButton,
|
|
523
|
+
hideSwap: !enableSwapButton,
|
|
524
|
+
hideShowAllTokens: !enableShowAllTokensButton,
|
|
525
|
+
hideWalletConnect: !enableWalletConnect,
|
|
526
|
+
buttonPosition: portfolioWidgetPosition,
|
|
527
|
+
defaultPortfolio
|
|
528
|
+
};
|
|
529
|
+
const whiteLabel = deepmerge.all([projectConfigWhiteLabel, uiConfig, ((_coreOptions$walletSe = coreOptions.walletServicesConfig) === null || _coreOptions$walletSe === void 0 ? void 0 : _coreOptions$walletSe.whiteLabel) || {}]);
|
|
530
|
+
const confirmationStrategy = (_coreOptions$walletSe2 = (_coreOptions$walletSe3 = coreOptions.walletServicesConfig) === null || _coreOptions$walletSe3 === void 0 ? void 0 : _coreOptions$walletSe3.confirmationStrategy) !== null && _coreOptions$walletSe2 !== void 0 ? _coreOptions$walletSe2 : enableConfirmationModal ? baseControllers.CONFIRMATION_STRATEGY.MODAL : baseControllers.CONFIRMATION_STRATEGY.AUTO_APPROVE;
|
|
485
531
|
const finalWsSettings = _objectSpread(_objectSpread({}, coreOptions.walletServicesConfig), {}, {
|
|
486
|
-
|
|
532
|
+
confirmationStrategy,
|
|
533
|
+
whiteLabel,
|
|
487
534
|
accountAbstractionConfig: coreOptions.accountAbstractionConfig,
|
|
488
|
-
enableLogging: coreOptions.enableLogging
|
|
489
|
-
|
|
535
|
+
enableLogging: coreOptions.enableLogging,
|
|
536
|
+
enableKeyExport: enableKeyExport
|
|
490
537
|
});
|
|
491
538
|
// Core options
|
|
492
539
|
if (coreOptions.privateKeyProvider) coreOptions.privateKeyProvider.setKeyExportFlag(isKeyExportEnabled);
|
|
@@ -495,7 +542,8 @@ const authConnector = params => {
|
|
|
495
542
|
walletServicesSettings: finalWsSettings,
|
|
496
543
|
loginSettings: params === null || params === void 0 ? void 0 : params.loginSettings,
|
|
497
544
|
coreOptions,
|
|
498
|
-
|
|
545
|
+
// TODO: check, test this and may need to send modal config here later on.!!
|
|
546
|
+
authConnectionConfig: projectConfig.embeddedWalletAuth
|
|
499
547
|
});
|
|
500
548
|
};
|
|
501
549
|
};
|
|
@@ -14,7 +14,6 @@ require('../../base/plugin/IPlugin.js');
|
|
|
14
14
|
var utils = require('../../base/utils.js');
|
|
15
15
|
var utils$1 = require('../../providers/solana-provider/providers/injectedProviders/utils.js');
|
|
16
16
|
var walletStandardProvider = require('../../providers/solana-provider/providers/injectedProviders/walletStandardProvider.js');
|
|
17
|
-
require('../../providers/solana-provider/providers/privateKeyProvider/solanaPrivateKeyProvider.js');
|
|
18
17
|
var baseControllers = require('@toruslabs/base-controllers');
|
|
19
18
|
require('@web3auth/ws-embed');
|
|
20
19
|
require('@solana/web3.js');
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
4
|
+
var sdk = require('@metamask/sdk');
|
|
5
|
+
var deepmerge = require('deepmerge');
|
|
6
|
+
var index$1 = require('../../base/errors/index.js');
|
|
7
|
+
var IChainInterface = require('../../base/chain/IChainInterface.js');
|
|
8
|
+
require('@web3auth/auth');
|
|
9
|
+
var index = require('../../base/wallet/index.js');
|
|
10
|
+
var constants = require('../../base/connector/constants.js');
|
|
11
|
+
require('jwt-decode');
|
|
12
|
+
require('../../base/loglevel.js');
|
|
13
|
+
require('../../base/plugin/errors.js');
|
|
14
|
+
require('../../base/plugin/IPlugin.js');
|
|
15
|
+
var baseControllers = require('@toruslabs/base-controllers');
|
|
16
|
+
require('@toruslabs/constants');
|
|
17
|
+
require('@toruslabs/http-helpers');
|
|
18
|
+
var baseEvmConnector = require('../base-evm-connector/baseEvmConnector.js');
|
|
19
|
+
var utils = require('../utils.js');
|
|
20
|
+
|
|
21
|
+
class MetaMaskConnector extends baseEvmConnector.BaseEvmConnector {
|
|
22
|
+
constructor(connectorOptions) {
|
|
23
|
+
super(connectorOptions);
|
|
24
|
+
_defineProperty(this, "connectorNamespace", IChainInterface.CONNECTOR_NAMESPACES.EIP155);
|
|
25
|
+
_defineProperty(this, "currentChainNamespace", baseControllers.CHAIN_NAMESPACES.EIP155);
|
|
26
|
+
_defineProperty(this, "type", constants.CONNECTOR_CATEGORY.EXTERNAL);
|
|
27
|
+
_defineProperty(this, "name", index.WALLET_CONNECTORS.METAMASK);
|
|
28
|
+
_defineProperty(this, "status", constants.CONNECTOR_STATUS.NOT_READY);
|
|
29
|
+
_defineProperty(this, "metamaskProvider", null);
|
|
30
|
+
_defineProperty(this, "metamaskSDK", null);
|
|
31
|
+
_defineProperty(this, "metamaskOptions", void 0);
|
|
32
|
+
this.metamaskOptions = connectorOptions.connectorSettings;
|
|
33
|
+
}
|
|
34
|
+
get provider() {
|
|
35
|
+
if (this.status !== constants.CONNECTOR_STATUS.NOT_READY && this.metamaskProvider) {
|
|
36
|
+
return this.metamaskProvider;
|
|
37
|
+
}
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
set provider(_) {
|
|
41
|
+
throw new Error("Not implemented");
|
|
42
|
+
}
|
|
43
|
+
async init(options) {
|
|
44
|
+
await super.init(options);
|
|
45
|
+
const chainConfig = this.coreOptions.chains.find(x => x.chainId === options.chainId);
|
|
46
|
+
super.checkInitializationRequirements({
|
|
47
|
+
chainConfig
|
|
48
|
+
});
|
|
49
|
+
// Detect app metadata
|
|
50
|
+
const iconUrl = await utils.getSiteIcon(window);
|
|
51
|
+
const appMetadata = {
|
|
52
|
+
name: utils.getSiteName(window),
|
|
53
|
+
url: window.location.origin,
|
|
54
|
+
iconUrl
|
|
55
|
+
};
|
|
56
|
+
// Initialize the MetaMask SDK
|
|
57
|
+
const metamaskOptions = deepmerge(this.metamaskOptions || {}, {
|
|
58
|
+
dappMetadata: appMetadata
|
|
59
|
+
});
|
|
60
|
+
this.metamaskSDK = new sdk.MetaMaskSDK(metamaskOptions);
|
|
61
|
+
this.status = constants.CONNECTOR_STATUS.READY;
|
|
62
|
+
this.emit(constants.CONNECTOR_EVENTS.READY, index.WALLET_CONNECTORS.METAMASK);
|
|
63
|
+
try {
|
|
64
|
+
if (options.autoConnect) {
|
|
65
|
+
this.rehydrated = true;
|
|
66
|
+
await this.connect({
|
|
67
|
+
chainId: options.chainId
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
} catch (error) {
|
|
71
|
+
this.emit(constants.CONNECTOR_EVENTS.ERRORED, error);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
async connect({
|
|
75
|
+
chainId
|
|
76
|
+
}) {
|
|
77
|
+
super.checkConnectionRequirements();
|
|
78
|
+
if (!this.metamaskSDK) throw index$1.WalletLoginError.notConnectedError("Connector is not initialized");
|
|
79
|
+
const chainConfig = this.coreOptions.chains.find(x => x.chainId === chainId);
|
|
80
|
+
if (!chainConfig) throw index$1.WalletLoginError.connectionError("Chain config is not available");
|
|
81
|
+
this.status = constants.CONNECTOR_STATUS.CONNECTING;
|
|
82
|
+
this.emit(constants.CONNECTOR_EVENTS.CONNECTING, {
|
|
83
|
+
connector: index.WALLET_CONNECTORS.METAMASK
|
|
84
|
+
});
|
|
85
|
+
try {
|
|
86
|
+
await this.metamaskSDK.connect();
|
|
87
|
+
this.metamaskProvider = this.metamaskSDK.getProvider();
|
|
88
|
+
if (!this.metamaskProvider) throw index$1.WalletLoginError.notConnectedError("Failed to connect with provider");
|
|
89
|
+
// switch chain if not connected to the right chain
|
|
90
|
+
const currentChainId = await this.metamaskProvider.request({
|
|
91
|
+
method: "eth_chainId"
|
|
92
|
+
});
|
|
93
|
+
if (currentChainId !== chainConfig.chainId) {
|
|
94
|
+
await this.switchChain(chainConfig, true);
|
|
95
|
+
}
|
|
96
|
+
// handle disconnect event
|
|
97
|
+
const accountDisconnectHandler = accounts => {
|
|
98
|
+
if (accounts.length === 0) this.disconnect();
|
|
99
|
+
};
|
|
100
|
+
this.metamaskProvider.on("accountsChanged", accountDisconnectHandler);
|
|
101
|
+
this.metamaskProvider.once("disconnect", () => {
|
|
102
|
+
this.disconnect();
|
|
103
|
+
});
|
|
104
|
+
this.status = constants.CONNECTOR_STATUS.CONNECTED;
|
|
105
|
+
this.emit(constants.CONNECTOR_EVENTS.CONNECTED, {
|
|
106
|
+
connector: index.WALLET_CONNECTORS.METAMASK,
|
|
107
|
+
reconnected: this.rehydrated,
|
|
108
|
+
provider: this.metamaskProvider
|
|
109
|
+
});
|
|
110
|
+
return this.metamaskProvider;
|
|
111
|
+
} catch (error) {
|
|
112
|
+
// ready again to be connected
|
|
113
|
+
this.status = constants.CONNECTOR_STATUS.READY;
|
|
114
|
+
this.rehydrated = false;
|
|
115
|
+
this.emit(constants.CONNECTOR_EVENTS.ERRORED, error);
|
|
116
|
+
if (error instanceof index$1.Web3AuthError) throw error;
|
|
117
|
+
throw index$1.WalletLoginError.connectionError("Failed to login with MetaMask wallet", error);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
async disconnect(options = {
|
|
121
|
+
cleanup: false
|
|
122
|
+
}) {
|
|
123
|
+
if (!this.metamaskProvider) throw index$1.WalletLoginError.connectionError("MetaMask provider is not available");
|
|
124
|
+
await super.disconnectSession();
|
|
125
|
+
if (typeof this.metamaskProvider.removeAllListeners !== "undefined") this.metamaskProvider.removeAllListeners();
|
|
126
|
+
await this.metamaskSDK.terminate();
|
|
127
|
+
if (options.cleanup) {
|
|
128
|
+
this.status = constants.CONNECTOR_STATUS.NOT_READY;
|
|
129
|
+
this.metamaskProvider = null;
|
|
130
|
+
} else {
|
|
131
|
+
// ready to be connected again
|
|
132
|
+
this.status = constants.CONNECTOR_STATUS.READY;
|
|
133
|
+
}
|
|
134
|
+
await super.disconnect();
|
|
135
|
+
}
|
|
136
|
+
async getUserInfo() {
|
|
137
|
+
if (this.status !== constants.CONNECTOR_STATUS.CONNECTED) throw index$1.WalletLoginError.notConnectedError("Not connected with wallet, Please login/connect first");
|
|
138
|
+
return {};
|
|
139
|
+
}
|
|
140
|
+
async switchChain(params, init = false) {
|
|
141
|
+
super.checkSwitchChainRequirements(params, init);
|
|
142
|
+
const requestSwitchChain = () => this.metamaskProvider.request({
|
|
143
|
+
method: "wallet_switchEthereumChain",
|
|
144
|
+
params: [{
|
|
145
|
+
chainId: params.chainId
|
|
146
|
+
}]
|
|
147
|
+
});
|
|
148
|
+
try {
|
|
149
|
+
await requestSwitchChain();
|
|
150
|
+
} catch (error) {
|
|
151
|
+
// If the error code is 4902, the network needs to be added
|
|
152
|
+
if ((error === null || error === void 0 ? void 0 : error.code) === 4902) {
|
|
153
|
+
const chainConfig = this.coreOptions.chains.find(x => x.chainId === params.chainId && x.chainNamespace === this.connectorNamespace);
|
|
154
|
+
await this.addChain(chainConfig);
|
|
155
|
+
await requestSwitchChain();
|
|
156
|
+
} else {
|
|
157
|
+
throw error;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
async enableMFA() {
|
|
162
|
+
throw new Error("Method Not implemented");
|
|
163
|
+
}
|
|
164
|
+
async manageMFA() {
|
|
165
|
+
throw new Error("Method Not implemented");
|
|
166
|
+
}
|
|
167
|
+
async addChain(chainConfig) {
|
|
168
|
+
if (!this.metamaskProvider) throw index$1.WalletLoginError.connectionError("Injected provider is not available");
|
|
169
|
+
await this.metamaskProvider.request({
|
|
170
|
+
method: "wallet_addEthereumChain",
|
|
171
|
+
params: [{
|
|
172
|
+
chainId: chainConfig.chainId,
|
|
173
|
+
chainName: chainConfig.displayName,
|
|
174
|
+
rpcUrls: [chainConfig.rpcTarget],
|
|
175
|
+
blockExplorerUrls: [chainConfig.blockExplorerUrl],
|
|
176
|
+
nativeCurrency: {
|
|
177
|
+
name: chainConfig.tickerName,
|
|
178
|
+
symbol: chainConfig.ticker,
|
|
179
|
+
decimals: chainConfig.decimals || 18
|
|
180
|
+
},
|
|
181
|
+
iconUrls: [chainConfig.logo]
|
|
182
|
+
}]
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
const metaMaskConnector = params => {
|
|
187
|
+
return ({
|
|
188
|
+
coreOptions
|
|
189
|
+
}) => {
|
|
190
|
+
return new MetaMaskConnector({
|
|
191
|
+
connectorSettings: params,
|
|
192
|
+
coreOptions
|
|
193
|
+
});
|
|
194
|
+
};
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
exports.metaMaskConnector = metaMaskConnector;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Extracts a name for the site from the DOM
|
|
5
|
+
*/
|
|
6
|
+
const getSiteName = window => {
|
|
7
|
+
const {
|
|
8
|
+
document
|
|
9
|
+
} = window;
|
|
10
|
+
const siteName = document.querySelector('head > meta[property="og:site_name"]');
|
|
11
|
+
if (siteName) {
|
|
12
|
+
return siteName.content;
|
|
13
|
+
}
|
|
14
|
+
const metaTitle = document.querySelector('head > meta[name="title"]');
|
|
15
|
+
if (metaTitle) {
|
|
16
|
+
return metaTitle.content;
|
|
17
|
+
}
|
|
18
|
+
if (document.title && document.title.length > 0) {
|
|
19
|
+
return document.title;
|
|
20
|
+
}
|
|
21
|
+
return window.location.hostname;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Returns whether the given image URL exists
|
|
25
|
+
* @param url - the url of the image
|
|
26
|
+
* @returns - whether the image exists
|
|
27
|
+
*/
|
|
28
|
+
function imgExists(url) {
|
|
29
|
+
return new Promise((resolve, reject) => {
|
|
30
|
+
try {
|
|
31
|
+
const img = document.createElement("img");
|
|
32
|
+
img.onload = () => resolve(true);
|
|
33
|
+
img.onerror = () => resolve(false);
|
|
34
|
+
img.src = url;
|
|
35
|
+
} catch (e) {
|
|
36
|
+
reject(e);
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Extracts an icon for the site from the DOM
|
|
42
|
+
*/
|
|
43
|
+
async function getSiteIcon(window) {
|
|
44
|
+
const {
|
|
45
|
+
document
|
|
46
|
+
} = window;
|
|
47
|
+
// Use the site's favicon if it exists
|
|
48
|
+
let icon = document.querySelector('head > link[rel="shortcut icon"]');
|
|
49
|
+
if (icon && (await imgExists(icon.href))) {
|
|
50
|
+
return icon.href;
|
|
51
|
+
}
|
|
52
|
+
// Search through available icons in no particular order
|
|
53
|
+
icon = Array.from(document.querySelectorAll('head > link[rel="icon"]')).find(_icon => Boolean(_icon.href)) || null;
|
|
54
|
+
if (icon && (await imgExists(icon.href))) {
|
|
55
|
+
return icon.href;
|
|
56
|
+
}
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
exports.getSiteIcon = getSiteIcon;
|
|
61
|
+
exports.getSiteName = getSiteName;
|
|
@@ -30,7 +30,6 @@ require('@solana/web3.js');
|
|
|
30
30
|
require('@toruslabs/bs58');
|
|
31
31
|
var JrpcClient = require('../../providers/solana-provider/rpc/JrpcClient.js');
|
|
32
32
|
var solanaRpcMiddlewares = require('../../providers/solana-provider/rpc/solanaRpcMiddlewares.js');
|
|
33
|
-
require('../../providers/solana-provider/providers/privateKeyProvider/solanaPrivateKeyProvider.js');
|
|
34
33
|
require('@web3auth/ws-embed');
|
|
35
34
|
var walletConnectV2Utils = require('./walletConnectV2Utils.js');
|
|
36
35
|
|
|
@@ -12,6 +12,7 @@ require('../../base/plugin/errors.js');
|
|
|
12
12
|
require('../../base/plugin/IPlugin.js');
|
|
13
13
|
require('@toruslabs/constants');
|
|
14
14
|
require('@toruslabs/http-helpers');
|
|
15
|
+
var utils = require('../utils.js');
|
|
15
16
|
|
|
16
17
|
exports.DEFAULT_EIP155_METHODS = void 0;
|
|
17
18
|
(function (DEFAULT_EIP155_METHODS) {
|
|
@@ -45,69 +46,13 @@ const SOLANA_CAIP_CHAIN_MAP = {
|
|
|
45
46
|
"0x66": "4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z",
|
|
46
47
|
"0x67": "EtWTRABZaYq6iMfeYKouRu166VU2xqa1"
|
|
47
48
|
};
|
|
48
|
-
/**
|
|
49
|
-
* Extracts a name for the site from the DOM
|
|
50
|
-
*/
|
|
51
|
-
const getSiteName = window => {
|
|
52
|
-
const {
|
|
53
|
-
document
|
|
54
|
-
} = window;
|
|
55
|
-
const siteName = document.querySelector('head > meta[property="og:site_name"]');
|
|
56
|
-
if (siteName) {
|
|
57
|
-
return siteName.content;
|
|
58
|
-
}
|
|
59
|
-
const metaTitle = document.querySelector('head > meta[name="title"]');
|
|
60
|
-
if (metaTitle) {
|
|
61
|
-
return metaTitle.content;
|
|
62
|
-
}
|
|
63
|
-
if (document.title && document.title.length > 0) {
|
|
64
|
-
return document.title;
|
|
65
|
-
}
|
|
66
|
-
return window.location.hostname;
|
|
67
|
-
};
|
|
68
|
-
/**
|
|
69
|
-
* Returns whether the given image URL exists
|
|
70
|
-
* @param url - the url of the image
|
|
71
|
-
* @returns - whether the image exists
|
|
72
|
-
*/
|
|
73
|
-
function imgExists(url) {
|
|
74
|
-
return new Promise((resolve, reject) => {
|
|
75
|
-
try {
|
|
76
|
-
const img = document.createElement("img");
|
|
77
|
-
img.onload = () => resolve(true);
|
|
78
|
-
img.onerror = () => resolve(false);
|
|
79
|
-
img.src = url;
|
|
80
|
-
} catch (e) {
|
|
81
|
-
reject(e);
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* Extracts an icon for the site from the DOM
|
|
87
|
-
*/
|
|
88
|
-
async function getSiteIcon(window) {
|
|
89
|
-
const {
|
|
90
|
-
document
|
|
91
|
-
} = window;
|
|
92
|
-
// Use the site's favicon if it exists
|
|
93
|
-
let icon = document.querySelector('head > link[rel="shortcut icon"]');
|
|
94
|
-
if (icon && (await imgExists(icon.href))) {
|
|
95
|
-
return icon.href;
|
|
96
|
-
}
|
|
97
|
-
// Search through available icons in no particular order
|
|
98
|
-
icon = Array.from(document.querySelectorAll('head > link[rel="icon"]')).find(_icon => Boolean(_icon.href)) || null;
|
|
99
|
-
if (icon && (await imgExists(icon.href))) {
|
|
100
|
-
return icon.href;
|
|
101
|
-
}
|
|
102
|
-
return null;
|
|
103
|
-
}
|
|
104
49
|
/**
|
|
105
50
|
* Gets site metadata and returns it
|
|
106
51
|
*
|
|
107
52
|
*/
|
|
108
53
|
const getSiteMetadata = async () => ({
|
|
109
|
-
name: getSiteName(window),
|
|
110
|
-
icon: await getSiteIcon(window)
|
|
54
|
+
name: utils.getSiteName(window),
|
|
55
|
+
icon: await utils.getSiteIcon(window)
|
|
111
56
|
});
|
|
112
57
|
const getNamespacesFromChains = chains => {
|
|
113
58
|
const supportedNamespaces = [];
|
|
@@ -72,8 +72,7 @@ class WalletConnectV2Connector extends baseConnector.BaseConnector {
|
|
|
72
72
|
super.checkInitializationRequirements({
|
|
73
73
|
chainConfig
|
|
74
74
|
});
|
|
75
|
-
|
|
76
|
-
const projectId = ((_this$connectorOption6 = this.connectorOptions.connectorSettings) === null || _this$connectorOption6 === void 0 || (_this$connectorOption6 = _this$connectorOption6.walletConnectInitOptions) === null || _this$connectorOption6 === void 0 ? void 0 : _this$connectorOption6.projectId) || "d3c63f19f9582f8ba48e982057eb096b";
|
|
75
|
+
const projectId = (_this$connectorOption6 = this.connectorOptions.connectorSettings) === null || _this$connectorOption6 === void 0 || (_this$connectorOption6 = _this$connectorOption6.walletConnectInitOptions) === null || _this$connectorOption6 === void 0 ? void 0 : _this$connectorOption6.projectId;
|
|
77
76
|
const wc2Settings = await config.getWalletConnectV2Settings(this.coreOptions.chains, projectId);
|
|
78
77
|
if (!this.connectorOptions.loginSettings || Object.keys(this.connectorOptions.loginSettings).length === 0) {
|
|
79
78
|
this.connectorOptions.loginSettings = wc2Settings.loginSettings;
|
|
@@ -389,23 +388,14 @@ class WalletConnectV2Connector extends baseConnector.BaseConnector {
|
|
|
389
388
|
}
|
|
390
389
|
const walletConnectV2Connector = params => {
|
|
391
390
|
return ({
|
|
392
|
-
|
|
393
|
-
|
|
391
|
+
coreOptions,
|
|
392
|
+
projectConfig
|
|
394
393
|
}) => {
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
} = (params === null || params === void 0 ? void 0 : params.walletConnectInitOptions) || {};
|
|
398
|
-
// use project config if projectId is not set
|
|
399
|
-
if (projectConfig) {
|
|
400
|
-
const {
|
|
401
|
-
wallet_connect_enabled: walletConnectEnabled,
|
|
402
|
-
wallet_connect_project_id: walletConnectProjectId
|
|
403
|
-
} = projectConfig;
|
|
404
|
-
if (walletConnectEnabled && walletConnectProjectId && !projectId) projectId = walletConnectProjectId;
|
|
405
|
-
}
|
|
394
|
+
var _params$walletConnect;
|
|
395
|
+
const projectId = (params === null || params === void 0 || (_params$walletConnect = params.walletConnectInitOptions) === null || _params$walletConnect === void 0 ? void 0 : _params$walletConnect.projectId) || (projectConfig === null || projectConfig === void 0 ? void 0 : projectConfig.walletConnectProjectId);
|
|
406
396
|
const connectorSettings = _objectSpread(_objectSpread({}, params), {}, {
|
|
407
397
|
walletConnectInitOptions: _objectSpread(_objectSpread({}, params === null || params === void 0 ? void 0 : params.walletConnectInitOptions), {}, {
|
|
408
|
-
projectId
|
|
398
|
+
projectId: projectId
|
|
409
399
|
})
|
|
410
400
|
});
|
|
411
401
|
return new WalletConnectV2Connector({
|
package/dist/lib.cjs/index.js
CHANGED
|
@@ -44,7 +44,6 @@ var jrpcClient = require('./providers/ethereum-provider/rpc/jrpcClient.js');
|
|
|
44
44
|
var walletMidddleware = require('./providers/ethereum-provider/rpc/walletMidddleware.js');
|
|
45
45
|
var utils$4 = require('./providers/solana-provider/providers/injectedProviders/utils.js');
|
|
46
46
|
var walletStandardProvider = require('./providers/solana-provider/providers/injectedProviders/walletStandardProvider.js');
|
|
47
|
-
var solanaPrivateKeyProvider = require('./providers/solana-provider/providers/privateKeyProvider/solanaPrivateKeyProvider.js');
|
|
48
47
|
var JrpcClient = require('./providers/solana-provider/rpc/JrpcClient.js');
|
|
49
48
|
var solanaRpcMiddlewares = require('./providers/solana-provider/rpc/solanaRpcMiddlewares.js');
|
|
50
49
|
var solanaWallet = require('./providers/solana-provider/solanaWallet.js');
|
|
@@ -67,6 +66,7 @@ exports.BaseConnector = baseConnector.BaseConnector;
|
|
|
67
66
|
exports.CONNECTOR_CATEGORY = constants.CONNECTOR_CATEGORY;
|
|
68
67
|
exports.CONNECTOR_EVENTS = constants.CONNECTOR_EVENTS;
|
|
69
68
|
exports.CONNECTOR_STATUS = constants.CONNECTOR_STATUS;
|
|
69
|
+
exports.SMART_ACCOUNT_WALLET_SCOPE = constants.SMART_ACCOUNT_WALLET_SCOPE;
|
|
70
70
|
Object.defineProperty(exports, "AUTH_CONNECTION", {
|
|
71
71
|
enumerable: true,
|
|
72
72
|
get: function () { return auth.AUTH_CONNECTION; }
|
|
@@ -209,7 +209,6 @@ exports.createEthProviderConfigMiddleware = jrpcClient.createEthProviderConfigMi
|
|
|
209
209
|
exports.createWalletMiddleware = walletMidddleware.createWalletMiddleware;
|
|
210
210
|
exports.getSolanaChainByChainConfig = utils$4.getSolanaChainByChainConfig;
|
|
211
211
|
exports.WalletStandardProvider = walletStandardProvider.WalletStandardProvider;
|
|
212
|
-
exports.SolanaPrivateKeyProvider = solanaPrivateKeyProvider.SolanaPrivateKeyProvider;
|
|
213
212
|
exports.createConfigMiddleware = JrpcClient.createConfigMiddleware;
|
|
214
213
|
exports.createSolanaChainIdMiddleware = JrpcClient.createSolanaChainIdMiddleware;
|
|
215
214
|
exports.createSolanaJsonRpcClient = JrpcClient.createSolanaJsonRpcClient;
|