@web3auth/modal 4.1.1-alpha.0 → 4.2.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/modal.cjs.js +37 -19
- package/dist/modal.cjs.js.map +1 -1
- package/dist/modal.esm.js +37 -19
- package/dist/modal.esm.js.map +1 -1
- package/dist/modal.umd.min.js +1 -1
- package/dist/modal.umd.min.js.map +1 -1
- package/dist/types/default.d.ts +3 -0
- package/dist/types/interface.d.ts +7 -1
- package/dist/types/modalManager.d.ts +4 -39
- package/dist/types/utils.d.ts +1 -0
- package/package.json +13 -13
- package/src/default.ts +14 -9
- package/src/interface.ts +13 -1
- package/src/modalManager.ts +10 -45
- package/src/utils.ts +1 -0
package/dist/modal.cjs.js
CHANGED
|
@@ -158,15 +158,15 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
158
158
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { defineProperty_default()(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
159
159
|
|
|
160
160
|
|
|
161
|
-
// warning: this function is not compatible with "OTHER"
|
|
161
|
+
// warning: this function is not compatible with "OTHER" chain namespace.
|
|
162
162
|
var getDefaultAdapterModule = /*#__PURE__*/function () {
|
|
163
163
|
var _ref = asyncToGenerator_default()( /*#__PURE__*/regenerator_default().mark(function _callee(params) {
|
|
164
|
-
var name, customChainConfig, clientId, finalChainConfig, _yield$import, TorusWalletAdapter, adapter, _yield$import2, SolanaWalletAdapter, _adapter, _yield$import3, MetamaskAdapter, _adapter2, _yield$import4, PhantomAdapter, _adapter3, _yield$import5, WalletConnectV1Adapter, _adapter4, _yield$import6, OpenloginAdapter, getOpenloginDefaultOptions, defaultOptions, _adapter5;
|
|
164
|
+
var name, customChainConfig, clientId, sessionTime, web3AuthNetwork, finalChainConfig, _yield$import, TorusWalletAdapter, adapter, _yield$import2, SolanaWalletAdapter, _adapter, _yield$import3, MetamaskAdapter, _adapter2, _yield$import4, PhantomAdapter, _adapter3, _yield$import5, WalletConnectV1Adapter, _adapter4, _yield$import6, OpenloginAdapter, getOpenloginDefaultOptions, defaultOptions, _adapter5;
|
|
165
165
|
return regenerator_default().wrap(function _callee$(_context) {
|
|
166
166
|
while (1) {
|
|
167
167
|
switch (_context.prev = _context.next) {
|
|
168
168
|
case 0:
|
|
169
|
-
name = params.name, customChainConfig = params.customChainConfig, clientId = params.clientId;
|
|
169
|
+
name = params.name, customChainConfig = params.customChainConfig, clientId = params.clientId, sessionTime = params.sessionTime, web3AuthNetwork = params.web3AuthNetwork;
|
|
170
170
|
if (Object.values(base_.CHAIN_NAMESPACES).includes(customChainConfig.chainNamespace)) {
|
|
171
171
|
_context.next = 3;
|
|
172
172
|
break;
|
|
@@ -185,7 +185,9 @@ var getDefaultAdapterModule = /*#__PURE__*/function () {
|
|
|
185
185
|
TorusWalletAdapter = _yield$import.TorusWalletAdapter;
|
|
186
186
|
adapter = new TorusWalletAdapter({
|
|
187
187
|
chainConfig: finalChainConfig,
|
|
188
|
-
clientId: clientId
|
|
188
|
+
clientId: clientId,
|
|
189
|
+
sessionTime: sessionTime,
|
|
190
|
+
web3AuthNetwork: web3AuthNetwork
|
|
189
191
|
});
|
|
190
192
|
return _context.abrupt("return", adapter);
|
|
191
193
|
case 13:
|
|
@@ -200,7 +202,9 @@ var getDefaultAdapterModule = /*#__PURE__*/function () {
|
|
|
200
202
|
SolanaWalletAdapter = _yield$import2.SolanaWalletAdapter;
|
|
201
203
|
_adapter = new SolanaWalletAdapter({
|
|
202
204
|
chainConfig: finalChainConfig,
|
|
203
|
-
clientId: clientId
|
|
205
|
+
clientId: clientId,
|
|
206
|
+
sessionTime: sessionTime,
|
|
207
|
+
web3AuthNetwork: web3AuthNetwork
|
|
204
208
|
});
|
|
205
209
|
return _context.abrupt("return", _adapter);
|
|
206
210
|
case 22:
|
|
@@ -215,7 +219,9 @@ var getDefaultAdapterModule = /*#__PURE__*/function () {
|
|
|
215
219
|
MetamaskAdapter = _yield$import3.MetamaskAdapter;
|
|
216
220
|
_adapter2 = new MetamaskAdapter({
|
|
217
221
|
chainConfig: finalChainConfig,
|
|
218
|
-
clientId: clientId
|
|
222
|
+
clientId: clientId,
|
|
223
|
+
sessionTime: sessionTime,
|
|
224
|
+
web3AuthNetwork: web3AuthNetwork
|
|
219
225
|
});
|
|
220
226
|
return _context.abrupt("return", _adapter2);
|
|
221
227
|
case 31:
|
|
@@ -230,7 +236,9 @@ var getDefaultAdapterModule = /*#__PURE__*/function () {
|
|
|
230
236
|
PhantomAdapter = _yield$import4.PhantomAdapter;
|
|
231
237
|
_adapter3 = new PhantomAdapter({
|
|
232
238
|
chainConfig: finalChainConfig,
|
|
233
|
-
clientId: clientId
|
|
239
|
+
clientId: clientId,
|
|
240
|
+
sessionTime: sessionTime,
|
|
241
|
+
web3AuthNetwork: web3AuthNetwork
|
|
234
242
|
});
|
|
235
243
|
return _context.abrupt("return", _adapter3);
|
|
236
244
|
case 40:
|
|
@@ -245,7 +253,9 @@ var getDefaultAdapterModule = /*#__PURE__*/function () {
|
|
|
245
253
|
WalletConnectV1Adapter = _yield$import5.WalletConnectV1Adapter;
|
|
246
254
|
_adapter4 = new WalletConnectV1Adapter({
|
|
247
255
|
chainConfig: finalChainConfig,
|
|
248
|
-
clientId: clientId
|
|
256
|
+
clientId: clientId,
|
|
257
|
+
sessionTime: sessionTime,
|
|
258
|
+
web3AuthNetwork: web3AuthNetwork
|
|
249
259
|
});
|
|
250
260
|
return _context.abrupt("return", _adapter4);
|
|
251
261
|
case 49:
|
|
@@ -261,10 +271,14 @@ var getDefaultAdapterModule = /*#__PURE__*/function () {
|
|
|
261
271
|
getOpenloginDefaultOptions = _yield$import6.getOpenloginDefaultOptions;
|
|
262
272
|
defaultOptions = getOpenloginDefaultOptions();
|
|
263
273
|
_adapter5 = new OpenloginAdapter(_objectSpread(_objectSpread({}, defaultOptions), {}, {
|
|
274
|
+
clientId: clientId,
|
|
264
275
|
chainConfig: _objectSpread({}, finalChainConfig),
|
|
265
276
|
adapterSettings: _objectSpread(_objectSpread({}, defaultOptions.adapterSettings), {}, {
|
|
266
|
-
clientId: clientId
|
|
267
|
-
|
|
277
|
+
clientId: clientId,
|
|
278
|
+
network: web3AuthNetwork
|
|
279
|
+
}),
|
|
280
|
+
sessionTime: sessionTime,
|
|
281
|
+
web3AuthNetwork: web3AuthNetwork
|
|
268
282
|
}));
|
|
269
283
|
return _context.abrupt("return", _adapter5);
|
|
270
284
|
case 58:
|
|
@@ -288,7 +302,8 @@ var languageMap = {
|
|
|
288
302
|
ko: "korean",
|
|
289
303
|
zh: "mandarin",
|
|
290
304
|
es: "spanish",
|
|
291
|
-
fr: "french"
|
|
305
|
+
fr: "french",
|
|
306
|
+
pt: "portuguese"
|
|
292
307
|
};
|
|
293
308
|
var getUserLanguage = function getUserLanguage(defaultLanguage) {
|
|
294
309
|
var userLanguage = defaultLanguage;
|
|
@@ -324,7 +339,7 @@ var Web3Auth = /*#__PURE__*/function (_Web3AuthCore) {
|
|
|
324
339
|
inherits_default()(Web3Auth, _Web3AuthCore);
|
|
325
340
|
var _super = _createSuper(Web3Auth);
|
|
326
341
|
function Web3Auth(options) {
|
|
327
|
-
var _this$options$uiConfi, _this$options$uiConfi2, _this$options$uiConfi3;
|
|
342
|
+
var _this$options$uiConfi, _this$options$uiConfi2, _this$options$uiConfi3, _this$options$uiConfi4, _this$options$uiConfi5, _this$options$uiConfi6;
|
|
328
343
|
var _this;
|
|
329
344
|
classCallCheck_default()(this, Web3Auth);
|
|
330
345
|
_this = _super.call(this, options);
|
|
@@ -359,11 +374,12 @@ var Web3Auth = /*#__PURE__*/function (_Web3AuthCore) {
|
|
|
359
374
|
var defaultLanguage = getUserLanguage((_this$options$uiConfi = _this.options.uiConfig) === null || _this$options$uiConfi === void 0 ? void 0 : _this$options$uiConfi.defaultLanguage);
|
|
360
375
|
_this.loginModal = new ui_namespaceObject.LoginModal({
|
|
361
376
|
theme: (_this$options$uiConfi2 = _this.options.uiConfig) === null || _this$options$uiConfi2 === void 0 ? void 0 : _this$options$uiConfi2.theme,
|
|
362
|
-
|
|
363
|
-
|
|
377
|
+
appName: ((_this$options$uiConfi3 = _this.options.uiConfig) === null || _this$options$uiConfi3 === void 0 ? void 0 : _this$options$uiConfi3.appName) || "blockchain",
|
|
378
|
+
appLogo: ((_this$options$uiConfi4 = _this.options.uiConfig) === null || _this$options$uiConfi4 === void 0 ? void 0 : _this$options$uiConfi4.appLogo) || "",
|
|
364
379
|
adapterListener: assertThisInitialized_default()(_this),
|
|
365
|
-
displayErrorsOnModal: _this.options.displayErrorsOnModal,
|
|
366
|
-
defaultLanguage: defaultLanguage
|
|
380
|
+
displayErrorsOnModal: (_this$options$uiConfi5 = _this.options.uiConfig) === null || _this$options$uiConfi5 === void 0 ? void 0 : _this$options$uiConfi5.displayErrorsOnModal,
|
|
381
|
+
defaultLanguage: defaultLanguage,
|
|
382
|
+
modalZIndex: ((_this$options$uiConfi6 = _this.options.uiConfig) === null || _this$options$uiConfi6 === void 0 ? void 0 : _this$options$uiConfi6.modalZIndex) || "99998"
|
|
367
383
|
});
|
|
368
384
|
_this.subscribeToLoginModalEvents();
|
|
369
385
|
return _this;
|
|
@@ -418,7 +434,9 @@ var Web3Auth = /*#__PURE__*/function (_Web3AuthCore) {
|
|
|
418
434
|
return getDefaultAdapterModule({
|
|
419
435
|
name: adapterName,
|
|
420
436
|
customChainConfig: _this2.options.chainConfig,
|
|
421
|
-
clientId: _this2.options.clientId
|
|
437
|
+
clientId: _this2.options.clientId,
|
|
438
|
+
sessionTime: _this2.options.sessionTime,
|
|
439
|
+
web3AuthNetwork: _this2.options.web3AuthNetwork
|
|
422
440
|
});
|
|
423
441
|
case 8:
|
|
424
442
|
ad = _context.sent;
|
|
@@ -688,8 +706,8 @@ var Web3Auth = /*#__PURE__*/function (_Web3AuthCore) {
|
|
|
688
706
|
value: function initializeInAppWallet(adapterName) {
|
|
689
707
|
base_.log.info("adapterInitResults", adapterName);
|
|
690
708
|
if (this.walletAdapters[adapterName].type === base_.ADAPTER_CATEGORY.IN_APP) {
|
|
691
|
-
var _adapterName, _this$options$
|
|
692
|
-
this.loginModal.addSocialLogins(adapterName, (0,ui_namespaceObject.getAdapterSocialLogins)(adapterName, this.walletAdapters[adapterName], (_adapterName = this.modalConfig.adapters[adapterName]) === null || _adapterName === void 0 ? void 0 : _adapterName.loginMethods), ((_this$options$
|
|
709
|
+
var _adapterName, _this$options$uiConfi7;
|
|
710
|
+
this.loginModal.addSocialLogins(adapterName, (0,ui_namespaceObject.getAdapterSocialLogins)(adapterName, this.walletAdapters[adapterName], (_adapterName = this.modalConfig.adapters[adapterName]) === null || _adapterName === void 0 ? void 0 : _adapterName.loginMethods), ((_this$options$uiConfi7 = this.options.uiConfig) === null || _this$options$uiConfi7 === void 0 ? void 0 : _this$options$uiConfi7.loginMethodsOrder) || ui_namespaceObject.OPENLOGIN_PROVIDERS);
|
|
693
711
|
}
|
|
694
712
|
}
|
|
695
713
|
}, {
|
package/dist/modal.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modal.cjs.js","mappings":";;;;;;;;;;;;;;;;;;;;AAAiF;AAI1E,IAAMG,4BAAiD,GAAG;EAC/DC,cAAc,EAAEJ,mEAAuB;EACvCM,QAAQ,2GACLJ,wEAA4B,EAAG;IAC9BM,KAAK,EAAE,cAAc;IACrBC,WAAW,EAAE,IAAI;IACjBC,YAAY,EAAE,IAAI;IAClBC,aAAa,EAAE;EACjB,CAAC,2FACAT,qEAAyB,EAAG;IAC3BM,KAAK,EAAE,WAAW;IAClBC,WAAW,EAAE,IAAI;IACjBC,YAAY,EAAE,IAAI;IAClB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jF1C;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;UCAA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCtBA;WACA;WACA;WACA;WACA;WACA,iCAAiC,WAAW;WAC5C;WACA;;;;;WCPA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA,sDAAsD;WACtD,sCAAsC,iEAAiE;WACvG;WACA;WACA;WACA;WACA;WACA;;;;;WCzBA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;;;;;;;;;;;;;;;;;;;;ACNyB;AACG","sources":["webpack://@web3auth/modal/./src/config.ts","webpack://@web3auth/modal/external commonjs2 \"@babel/runtime/helpers/toConsumableArray\"","webpack://@web3auth/modal/external commonjs2 \"@babel/runtime/helpers/asyncToGenerator\"","webpack://@web3auth/modal/external commonjs2 \"@babel/runtime/helpers/classCallCheck\"","webpack://@web3auth/modal/external commonjs2 \"@babel/runtime/helpers/createClass\"","webpack://@web3auth/modal/external commonjs2 \"@babel/runtime/helpers/assertThisInitialized\"","webpack://@web3auth/modal/external commonjs2 \"@babel/runtime/helpers/get\"","webpack://@web3auth/modal/external commonjs2 \"@babel/runtime/helpers/inherits\"","webpack://@web3auth/modal/external commonjs2 \"@babel/runtime/helpers/possibleConstructorReturn\"","webpack://@web3auth/modal/external commonjs2 \"@babel/runtime/helpers/getPrototypeOf\"","webpack://@web3auth/modal/external commonjs2 \"@babel/runtime/regenerator\"","webpack://@web3auth/modal/external commonjs2 \"@web3auth/core\"","webpack://@web3auth/modal/external commonjs2 \"@web3auth/ui\"","webpack://@web3auth/modal/./src/default.ts","webpack://@web3auth/modal/./src/utils.ts","webpack://@web3auth/modal/./src/modalManager.ts","webpack://@web3auth/modal/external commonjs2 \"@babel/runtime/helpers/defineProperty\"","webpack://@web3auth/modal/external commonjs2 \"@web3auth/base\"","webpack://@web3auth/modal/external commonjs2 \"@web3auth/metamask-adapter\"","webpack://@web3auth/modal/external commonjs2 \"@web3auth/openlogin-adapter\"","webpack://@web3auth/modal/external commonjs2 \"@web3auth/phantom-adapter\"","webpack://@web3auth/modal/external commonjs2 \"@web3auth/torus-evm-adapter\"","webpack://@web3auth/modal/external commonjs2 \"@web3auth/torus-solana-adapter\"","webpack://@web3auth/modal/external commonjs2 \"@web3auth/wallet-connect-v1-adapter\"","webpack://@web3auth/modal/webpack/bootstrap","webpack://@web3auth/modal/webpack/runtime/compat get default export","webpack://@web3auth/modal/webpack/runtime/create fake namespace object","webpack://@web3auth/modal/webpack/runtime/define property getters","webpack://@web3auth/modal/webpack/runtime/hasOwnProperty shorthand","webpack://@web3auth/modal/webpack/runtime/make namespace object","webpack://@web3auth/modal/./src/index.ts"],"sourcesContent":["import { CHAIN_NAMESPACES, EVM_ADAPTERS, SOLANA_ADAPTERS } from \"@web3auth/base\";\n\nimport { AdaptersModalConfig } from \"./interface\";\n\nexport const defaultSolanaDappModalConfig: AdaptersModalConfig = {\n chainNamespace: CHAIN_NAMESPACES.SOLANA,\n adapters: {\n [SOLANA_ADAPTERS.TORUS_SOLANA]: {\n label: \"Torus Wallet\",\n showOnModal: true,\n showOnMobile: true,\n showOnDesktop: true,\n },\n [SOLANA_ADAPTERS.OPENLOGIN]: {\n label: \"OpenLogin\",\n showOnModal: true,\n showOnMobile: true,\n showOnDesktop: true,\n },\n [SOLANA_ADAPTERS.PHANTOM]: {\n label: \"Phantom\",\n showOnModal: true,\n showOnMobile: false,\n showOnDesktop: true,\n },\n },\n};\n\nexport const defaultEvmDappModalConfig: AdaptersModalConfig = {\n chainNamespace: CHAIN_NAMESPACES.EIP155,\n adapters: {\n [EVM_ADAPTERS.TORUS_EVM]: {\n label: \"Torus Wallet\",\n showOnModal: true,\n showOnMobile: true,\n showOnDesktop: true,\n },\n [EVM_ADAPTERS.METAMASK]: {\n label: \"MetaMask\",\n showOnModal: true,\n showOnMobile: false,\n showOnDesktop: true,\n },\n [EVM_ADAPTERS.OPENLOGIN]: {\n label: \"OpenLogin\",\n showOnModal: true,\n showOnMobile: true,\n showOnDesktop: true,\n },\n [EVM_ADAPTERS.WALLET_CONNECT_V1]: {\n label: \"Wallet Connect\",\n showOnModal: true,\n showOnMobile: true,\n showOnDesktop: true,\n },\n },\n};\n\nexport const defaultSolanaWalletModalConfig: AdaptersModalConfig = {\n chainNamespace: CHAIN_NAMESPACES.SOLANA,\n adapters: {\n [SOLANA_ADAPTERS.OPENLOGIN]: {\n label: \"OpenLogin\",\n showOnModal: true,\n showOnMobile: true,\n showOnDesktop: true,\n },\n },\n};\n\nexport const defaultEvmWalletModalConfig: AdaptersModalConfig = {\n chainNamespace: CHAIN_NAMESPACES.EIP155,\n adapters: {\n [EVM_ADAPTERS.OPENLOGIN]: {\n label: \"OpenLogin\",\n showOnModal: true,\n showOnMobile: true,\n showOnDesktop: true,\n },\n },\n};\n\nexport const defaultOtherModalConfig: AdaptersModalConfig = {\n chainNamespace: CHAIN_NAMESPACES.OTHER,\n adapters: {\n [EVM_ADAPTERS.OPENLOGIN]: {\n label: \"OpenLogin\",\n showOnModal: true,\n showOnMobile: true,\n showOnDesktop: true,\n },\n },\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@babel/runtime/helpers/toConsumableArray\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@babel/runtime/helpers/asyncToGenerator\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@babel/runtime/helpers/classCallCheck\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@babel/runtime/helpers/createClass\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@babel/runtime/helpers/assertThisInitialized\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@babel/runtime/helpers/get\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@babel/runtime/helpers/inherits\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@babel/runtime/helpers/possibleConstructorReturn\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@babel/runtime/helpers/getPrototypeOf\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@babel/runtime/regenerator\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@web3auth/core\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@web3auth/ui\");","import type { OpenLoginOptions } from \"@toruslabs/openlogin\";\nimport { CHAIN_NAMESPACES, CustomChainConfig, getChainConfig, IAdapter, WALLET_ADAPTER_TYPE, WALLET_ADAPTERS } from \"@web3auth/base\";\n\n// warning: this function is not compatible with \"OTHER\" chainnamespace.\nexport const getDefaultAdapterModule = async (params: {\n name: WALLET_ADAPTER_TYPE;\n clientId: string;\n customChainConfig: Partial<CustomChainConfig> & Pick<CustomChainConfig, \"chainNamespace\">;\n}): Promise<IAdapter<unknown>> => {\n const { name, customChainConfig, clientId } = params;\n if (!Object.values(CHAIN_NAMESPACES).includes(customChainConfig.chainNamespace))\n throw new Error(`Invalid chainNamespace: ${customChainConfig.chainNamespace}`);\n const finalChainConfig = {\n ...(getChainConfig(customChainConfig.chainNamespace, customChainConfig?.chainId) as CustomChainConfig),\n ...(customChainConfig || {}),\n };\n if (name === WALLET_ADAPTERS.TORUS_EVM) {\n const { TorusWalletAdapter } = await import(\"@web3auth/torus-evm-adapter\");\n const adapter = new TorusWalletAdapter({ chainConfig: finalChainConfig, clientId });\n return adapter;\n } else if (name === WALLET_ADAPTERS.TORUS_SOLANA) {\n const { SolanaWalletAdapter } = await import(\"@web3auth/torus-solana-adapter\");\n const adapter = new SolanaWalletAdapter({ chainConfig: finalChainConfig, clientId });\n return adapter;\n } else if (name === WALLET_ADAPTERS.METAMASK) {\n const { MetamaskAdapter } = await import(\"@web3auth/metamask-adapter\");\n const adapter = new MetamaskAdapter({ chainConfig: finalChainConfig, clientId });\n return adapter;\n } else if (name === WALLET_ADAPTERS.PHANTOM) {\n const { PhantomAdapter } = await import(\"@web3auth/phantom-adapter\");\n const adapter = new PhantomAdapter({ chainConfig: finalChainConfig, clientId });\n return adapter;\n } else if (name === WALLET_ADAPTERS.WALLET_CONNECT_V1) {\n const { WalletConnectV1Adapter } = await import(\"@web3auth/wallet-connect-v1-adapter\");\n const adapter = new WalletConnectV1Adapter({ chainConfig: finalChainConfig, clientId });\n return adapter;\n } else if (name === WALLET_ADAPTERS.OPENLOGIN) {\n const { OpenloginAdapter, getOpenloginDefaultOptions } = await import(\"@web3auth/openlogin-adapter\");\n const defaultOptions = getOpenloginDefaultOptions();\n const adapter = new OpenloginAdapter({\n ...defaultOptions,\n chainConfig: { ...finalChainConfig },\n adapterSettings: { ...(defaultOptions.adapterSettings as OpenLoginOptions), clientId },\n });\n return adapter;\n }\n throw new Error(\"Invalid wallet adapter name\");\n};\n","interface NavigatorLanguage {\n userLanguage?: string;\n}\n\nexport const languageMap = {\n en: \"english\",\n de: \"german\",\n ja: \"japanese\",\n ko: \"korean\",\n zh: \"mandarin\",\n es: \"spanish\",\n fr: \"french\",\n};\n\nexport const getUserLanguage = (defaultLanguage: string | undefined) => {\n let userLanguage = defaultLanguage;\n if (!userLanguage) {\n const browserLanguage =\n typeof window !== \"undefined\" ? (window.navigator as NavigatorLanguage).userLanguage || window.navigator.language || \"en-US\" : \"en-US\";\n userLanguage = browserLanguage.split(\"-\")[0];\n }\n return Object.prototype.hasOwnProperty.call(languageMap, userLanguage) ? userLanguage : \"en\";\n};\n","import {\n ADAPTER_CATEGORY,\n ADAPTER_EVENTS,\n ADAPTER_STATUS,\n BaseAdapterConfig,\n CHAIN_NAMESPACES,\n CustomChainConfig,\n getChainConfig,\n log,\n SafeEventEmitterProvider,\n WALLET_ADAPTER_TYPE,\n WALLET_ADAPTERS,\n} from \"@web3auth/base\";\nimport { Web3AuthCore, Web3AuthCoreOptions } from \"@web3auth/core\";\nimport { getAdapterSocialLogins, LOGIN_MODAL_EVENTS, LoginModal, OPENLOGIN_PROVIDERS } from \"@web3auth/ui\";\n\nimport {\n defaultEvmDappModalConfig,\n defaultEvmWalletModalConfig,\n defaultOtherModalConfig,\n defaultSolanaDappModalConfig,\n defaultSolanaWalletModalConfig,\n} from \"./config\";\nimport { getDefaultAdapterModule } from \"./default\";\nimport { AdaptersModalConfig, ModalConfig } from \"./interface\";\nimport { getUserLanguage } from \"./utils\";\n\nexport interface UIConfig {\n /**\n * Logo for your app.\n */\n appLogo?: string;\n\n /**\n * theme for the modal\n *\n * @defaultValue `light`\n */\n theme?: \"light\" | \"dark\";\n\n /**\n * order of how login methods are shown\n *\n * @defaultValue `[\"google\", \"facebook\", \"twitter\", \"reddit\", \"discord\", \"twitch\", \"apple\", \"line\", \"github\", \"kakao\", \"linkedin\", \"weibo\", \"wechat\", \"email_passwordless\"]`\n */\n loginMethodsOrder?: string[];\n\n /**\n * language which will be used by web3auth. app will use browser language if not specified. if language is not supported it will use \"en\"\n * en: english\n * de: german\n * ja: japanese\n * ko: korean\n * zh: mandarin\n * es: spanish\n *\n */\n defaultLanguage?: string;\n}\nexport interface Web3AuthOptions extends Web3AuthCoreOptions {\n /**\n * web3auth instance provides different adapters for different type of usages. If you are dapp and want to\n * use external wallets like metamask, then you can use the `DAPP` authMode.\n * If you are a wallet and only want to use you own wallet implementations along with openlogin,\n * then you should use `WALLET` authMode.\n *\n * @defaultValue `DAPP`\n */\n authMode?: \"DAPP\" | \"WALLET\";\n /**\n * Config for configuring modal ui display properties\n */\n uiConfig?: UIConfig;\n\n /**\n * Whether to show errors on Web3Auth modal.\n *\n * @defaultValue `true`\n */\n displayErrorsOnModal?: boolean;\n}\nexport class Web3Auth extends Web3AuthCore {\n public loginModal: LoginModal;\n\n readonly options: Web3AuthOptions;\n\n private modalConfig: AdaptersModalConfig = defaultEvmDappModalConfig;\n\n constructor(options: Web3AuthOptions) {\n super(options);\n this.options = { ...options };\n const providedChainConfig = this.options.chainConfig;\n if (providedChainConfig.chainNamespace === CHAIN_NAMESPACES.SOLANA) {\n if (options.authMode === \"WALLET\") {\n // default config for solana wallet modal\n this.modalConfig = defaultSolanaWalletModalConfig;\n } else {\n // default config for solana dapp modal\n this.modalConfig = defaultSolanaDappModalConfig;\n }\n } else if (providedChainConfig.chainNamespace === CHAIN_NAMESPACES.EIP155) {\n if (options.authMode === \"WALLET\") {\n // default config for evm wallet modal\n this.modalConfig = defaultEvmWalletModalConfig;\n } else {\n // default config for evm dapp modal\n this.modalConfig = defaultEvmDappModalConfig;\n }\n } else if (providedChainConfig.chainNamespace === CHAIN_NAMESPACES.OTHER) {\n this.modalConfig = defaultOtherModalConfig;\n } else {\n throw new Error(`Invalid chainNamespace provided: ${providedChainConfig.chainNamespace}`);\n }\n\n // get userLanguage\n const defaultLanguage = getUserLanguage(this.options.uiConfig?.defaultLanguage);\n\n this.loginModal = new LoginModal({\n theme: this.options.uiConfig?.theme,\n appLogo: this.options.uiConfig?.appLogo || \"\",\n version: \"\",\n adapterListener: this,\n displayErrorsOnModal: this.options.displayErrorsOnModal,\n defaultLanguage,\n });\n this.subscribeToLoginModalEvents();\n }\n\n public async initModal(params?: { modalConfig?: Record<WALLET_ADAPTER_TYPE, ModalConfig> }): Promise<void> {\n super.checkInitRequirements();\n await this.loginModal.initModal();\n const providedChainConfig = this.options.chainConfig;\n\n // merge default adapters with the custom configured adapters.\n const allAdapters = [...new Set([...Object.keys(this.modalConfig.adapters || {}), ...Object.keys(this.walletAdapters)])];\n\n const adapterConfigurationPromises = allAdapters.map(async (adapterName) => {\n // start with the default config of adapter.\n let adapterConfig = this.modalConfig.adapters?.[adapterName] || {\n label: adapterName,\n showOnModal: true,\n showOnMobile: true,\n showOnDesktop: true,\n };\n\n // override the default config of adapter if some config is being provided by the user.\n if (params?.modalConfig?.[adapterName]) {\n adapterConfig = { ...adapterConfig, ...params.modalConfig[adapterName] };\n }\n (this.modalConfig.adapters as Record<WALLET_ADAPTER_TYPE, ModalConfig>)[adapterName] = adapterConfig as ModalConfig;\n\n // check if adapter is configured/added by user and exist in walletAdapters map.\n const adapter = this.walletAdapters[adapterName];\n log.debug(\"adapter config\", adapterName, this.modalConfig.adapters?.[adapterName].showOnModal, adapter);\n\n // if adapter is not custom configured then check if it is available in default adapters.\n // and if adapter is not hidden by user\n if (!adapter && this.modalConfig.adapters?.[adapterName].showOnModal) {\n // if adapter is not configured and some default configuration is available, use it.\n const ad = await getDefaultAdapterModule({\n name: adapterName,\n customChainConfig: this.options.chainConfig,\n clientId: this.options.clientId,\n });\n\n this.walletAdapters[adapterName] = ad;\n\n return adapterName;\n } else if (adapter?.type === ADAPTER_CATEGORY.IN_APP || adapter?.type === ADAPTER_CATEGORY.EXTERNAL || adapterName === this.cachedAdapter) {\n if (!this.modalConfig.adapters?.[adapterName].showOnModal) return;\n // add client id to adapter, same web3auth client id can be used in adapter.\n // this id is being overridden if user is also passing client id in adapter's constructor.\n this.walletAdapters[adapterName].setAdapterSettings({\n clientId: this.options.clientId,\n sessionTime: this.options.sessionTime,\n web3AuthNetwork: this.options.web3AuthNetwork,\n });\n\n // if adapter doesn't have any chainConfig then we will set the chainConfig based of passed chainNamespace\n // and chainNamespace.\n if (!adapter.chainConfigProxy) {\n const chainConfig = {\n ...getChainConfig(providedChainConfig.chainNamespace, this.coreOptions.chainConfig?.chainId),\n ...this.coreOptions.chainConfig,\n } as CustomChainConfig;\n this.walletAdapters[adapterName].setAdapterSettings({ chainConfig });\n }\n\n return adapterName;\n }\n });\n\n const adapterNames = await Promise.all(adapterConfigurationPromises);\n const hasInAppWallets = Object.values(this.walletAdapters).some((adapter) => {\n if (adapter.type !== ADAPTER_CATEGORY.IN_APP) return false;\n if (this.modalConfig.adapters[adapter.name].showOnModal !== true) return false;\n if (!this.modalConfig.adapters[adapter.name].loginMethods) return true;\n const mergedLoginMethods = getAdapterSocialLogins(\n adapter.name,\n this.walletAdapters[adapter.name],\n (this.modalConfig.adapters as Record<WALLET_ADAPTER_TYPE, ModalConfig>)[adapter.name]?.loginMethods\n );\n if (Object.values(mergedLoginMethods).some((method) => method.showOnModal)) return true;\n return false;\n });\n log.debug(hasInAppWallets, this.walletAdapters, \"hasInAppWallets\");\n // Now, initialize the adapters.\n const initPromises = adapterNames.map(async (adapterName) => {\n if (!adapterName) return;\n try {\n const adapter = this.walletAdapters[adapterName];\n // only initialize a external adapter here if it is a cached adapter.\n if (this.cachedAdapter !== adapterName && adapter.type === ADAPTER_CATEGORY.EXTERNAL) {\n return;\n }\n // in-app wallets or cached wallet (being connected or already connected) are initialized first.\n // if adapter is configured thn only initialize in app or cached adapter.\n // external wallets are initialized on INIT_EXTERNAL_WALLET event.\n this.subscribeToAdapterEvents(adapter);\n if (adapter.status === ADAPTER_STATUS.NOT_READY) await adapter.init({ autoConnect: this.cachedAdapter === adapterName });\n // note: not adding cachedWallet to modal if it is external wallet.\n // adding it later if no in-app wallets are available.\n if (adapter.type === ADAPTER_CATEGORY.IN_APP) {\n this.initializeInAppWallet(adapterName);\n }\n } catch (error) {\n log.error(error, \"error while initializing adapter\");\n }\n });\n\n this.status = ADAPTER_STATUS.READY;\n await Promise.all(initPromises);\n\n const hasExternalWallets = allAdapters.some((adapterName) => {\n return this.walletAdapters[adapterName]?.type === ADAPTER_CATEGORY.EXTERNAL && this.modalConfig.adapters?.[adapterName].showOnModal;\n });\n\n if (hasExternalWallets) {\n this.loginModal.initExternalWalletContainer();\n }\n\n // variable to check if we have any in app wallets\n // currently all default in app and external wallets can be hidden or shown based on config.\n if (!hasInAppWallets && hasExternalWallets) {\n // if no in app wallet is available then initialize external wallets in modal\n await this.initExternalWalletAdapters(false, { showExternalWalletsOnly: true });\n }\n }\n\n public async connect(): Promise<SafeEventEmitterProvider | null> {\n // if (!this.loginModal.initialized) throw new Error(\"Login modal is not initialized\");\n // if already connected return provider\n if (this.provider) return this.provider;\n this.loginModal.open();\n return new Promise((resolve, reject) => {\n this.once(ADAPTER_EVENTS.CONNECTED, () => {\n return resolve(this.provider);\n });\n this.once(ADAPTER_EVENTS.ERRORED, (err: unknown) => {\n return reject(err);\n });\n });\n }\n\n private async initExternalWalletAdapters(externalWalletsInitialized: boolean, options?: { showExternalWalletsOnly: boolean }): Promise<void> {\n if (externalWalletsInitialized) return;\n const adaptersConfig: Record<string, BaseAdapterConfig> = {};\n Object.keys(this.walletAdapters).forEach(async (adapterName) => {\n const adapter = this.walletAdapters[adapterName];\n if (adapter?.type === ADAPTER_CATEGORY.EXTERNAL) {\n log.debug(\"init external wallet\", this.cachedAdapter, adapterName);\n this.subscribeToAdapterEvents(adapter);\n // we are not initializing cached adapter here as it is already being initialized in initModal before.\n if (this.cachedAdapter === adapterName) {\n return;\n }\n if (adapter.status === ADAPTER_STATUS.NOT_READY)\n await adapter\n .init({ autoConnect: this.cachedAdapter === adapterName })\n .then(() => {\n adaptersConfig[adapterName] = (this.modalConfig.adapters as Record<WALLET_ADAPTER_TYPE, ModalConfig>)[adapterName];\n this.loginModal.addWalletLogins(adaptersConfig, { showExternalWalletsOnly: !!options?.showExternalWalletsOnly });\n return undefined;\n })\n .catch((error) => log.error(error, \"error while initializing adapter\"));\n }\n });\n }\n\n private initializeInAppWallet(adapterName: string): void {\n log.info(\"adapterInitResults\", adapterName);\n if (this.walletAdapters[adapterName].type === ADAPTER_CATEGORY.IN_APP) {\n this.loginModal.addSocialLogins(\n adapterName,\n getAdapterSocialLogins(\n adapterName,\n this.walletAdapters[adapterName],\n (this.modalConfig.adapters as Record<WALLET_ADAPTER_TYPE, ModalConfig>)[adapterName]?.loginMethods\n ),\n this.options.uiConfig?.loginMethodsOrder || OPENLOGIN_PROVIDERS\n );\n }\n }\n\n private subscribeToLoginModalEvents(): void {\n this.loginModal.on(LOGIN_MODAL_EVENTS.LOGIN, async (params: { adapter: WALLET_ADAPTER_TYPE; loginParams: unknown }) => {\n try {\n await this.connectTo<unknown>(params.adapter, params.loginParams);\n } catch (error) {\n log.error(`Error while connecting to adapter: ${params.adapter}`, error);\n }\n });\n this.loginModal.on(LOGIN_MODAL_EVENTS.INIT_EXTERNAL_WALLETS, async (params: { externalWalletsInitialized: boolean }) => {\n await this.initExternalWalletAdapters(params.externalWalletsInitialized);\n });\n this.loginModal.on(LOGIN_MODAL_EVENTS.DISCONNECT, async () => {\n try {\n await this.logout();\n } catch (error) {\n log.error(`Error while disconnecting`, error);\n }\n });\n this.loginModal.on(LOGIN_MODAL_EVENTS.MODAL_VISIBILITY, async (visibility: boolean) => {\n log.debug(\"is login modal visible\", visibility);\n this.emit(LOGIN_MODAL_EVENTS.MODAL_VISIBILITY, visibility);\n const walletConnectStatus = this.walletAdapters[WALLET_ADAPTERS.WALLET_CONNECT_V1]?.status;\n if (visibility && walletConnectStatus === ADAPTER_STATUS.READY) {\n // refreshing session for wallet connect whenever modal is opened.\n try {\n this.walletAdapters[WALLET_ADAPTERS.WALLET_CONNECT_V1].connect();\n } catch (error) {\n log.error(`Error while disconnecting to wallet connect in core`, error);\n }\n }\n });\n }\n}\n","module.exports = require(\"@babel/runtime/helpers/defineProperty\");","module.exports = require(\"@web3auth/base\");","module.exports = require(\"@web3auth/metamask-adapter\");","module.exports = require(\"@web3auth/openlogin-adapter\");","module.exports = require(\"@web3auth/phantom-adapter\");","module.exports = require(\"@web3auth/torus-evm-adapter\");","module.exports = require(\"@web3auth/torus-solana-adapter\");","module.exports = require(\"@web3auth/wallet-connect-v1-adapter\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__);\nvar leafPrototypes;\n// create a fake namespace object\n// mode & 1: value is a module id, require it\n// mode & 2: merge all properties of value into the ns\n// mode & 4: return value when already ns object\n// mode & 16: return value when it's Promise-like\n// mode & 8|1: behave like require\n__webpack_require__.t = function(value, mode) {\n\tif(mode & 1) value = this(value);\n\tif(mode & 8) return value;\n\tif(typeof value === 'object' && value) {\n\t\tif((mode & 4) && value.__esModule) return value;\n\t\tif((mode & 16) && typeof value.then === 'function') return value;\n\t}\n\tvar ns = Object.create(null);\n\t__webpack_require__.r(ns);\n\tvar def = {};\n\tleafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)];\n\tfor(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) {\n\t\tObject.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key])));\n\t}\n\tdef['default'] = () => (value);\n\t__webpack_require__.d(ns, def);\n\treturn ns;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","export * from \"./config\";\nexport * from \"./interface\";\nexport * from \"./modalManager\";\n"],"names":["CHAIN_NAMESPACES","EVM_ADAPTERS","SOLANA_ADAPTERS","defaultSolanaDappModalConfig","chainNamespace","SOLANA","adapters","TORUS_SOLANA","label","showOnModal","showOnMobile","showOnDesktop","OPENLOGIN","PHANTOM","defaultEvmDappModalConfig","EIP155","TORUS_EVM","METAMASK","WALLET_CONNECT_V1","defaultSolanaWalletModalConfig","defaultEvmWalletModalConfig","defaultOtherModalConfig","OTHER","getChainConfig","WALLET_ADAPTERS","getDefaultAdapterModule","params","name","customChainConfig","clientId","Object","values","includes","Error","finalChainConfig","chainId","TorusWalletAdapter","adapter","chainConfig","SolanaWalletAdapter","MetamaskAdapter","PhantomAdapter","WalletConnectV1Adapter","OpenloginAdapter","getOpenloginDefaultOptions","defaultOptions","adapterSettings","languageMap","en","de","ja","ko","zh","es","fr","getUserLanguage","defaultLanguage","userLanguage","browserLanguage","window","navigator","language","split","prototype","hasOwnProperty","call","ADAPTER_CATEGORY","ADAPTER_EVENTS","ADAPTER_STATUS","log","Web3AuthCore","getAdapterSocialLogins","LOGIN_MODAL_EVENTS","LoginModal","OPENLOGIN_PROVIDERS","Web3Auth","options","providedChainConfig","authMode","modalConfig","uiConfig","loginModal","theme","appLogo","version","adapterListener","displayErrorsOnModal","subscribeToLoginModalEvents","initModal","allAdapters","Set","keys","walletAdapters","adapterConfigurationPromises","map","adapterName","adapterConfig","debug","ad","type","IN_APP","EXTERNAL","cachedAdapter","setAdapterSettings","sessionTime","web3AuthNetwork","chainConfigProxy","coreOptions","Promise","all","adapterNames","hasInAppWallets","some","loginMethods","mergedLoginMethods","method","initPromises","subscribeToAdapterEvents","status","NOT_READY","init","autoConnect","initializeInAppWallet","error","READY","hasExternalWallets","initExternalWalletContainer","initExternalWalletAdapters","showExternalWalletsOnly","provider","open","resolve","reject","once","CONNECTED","ERRORED","err","externalWalletsInitialized","adaptersConfig","forEach","then","addWalletLogins","undefined","catch","info","addSocialLogins","loginMethodsOrder","on","LOGIN","connectTo","loginParams","INIT_EXTERNAL_WALLETS","DISCONNECT","logout","MODAL_VISIBILITY","visibility","emit","walletConnectStatus","connect"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"modal.cjs.js","mappings":";;;;;;;;;;;;;;;;;;;;AAAiF;AAI1E,IAAMG,4BAAiD,GAAG;EAC/DC,cAAc,EAAEJ,mEAAuB;EACvCM,QAAQ,2GACLJ,wEAA4B,EAAG;IAC9BM,KAAK,EAAE,cAAc;IACrBC,WAAW,EAAE,IAAI;IACjBC,YAAY,EAAE,IAAI;IAClBC,aAAa,EAAE;EACjB,CAAC,2FACAT,qEAAyB,EAAG;IAC3BM,KAAK,EAAE,WAAW;IAClBC,WAAW,EAAE,IAAI;IACjBC,YAAY,EAAE,IAAI;IAClBC,aAAa,EAAE;EACjB,CAAC,2FACAT,mEAAuB,EAAG;IACzBM,KAAK,EAAE,SAAS;IAChBC,WAAW,EAAE,IAAI;IACjBC,YAAY,EAAE,KAAK;IACnBC,aAAa,EAAE;EACjB,CAAC;AAEL,CAAC;AAEM,IAAMG,yBAA8C,GAAG;EAC5DV,cAAc,EAAEJ,mEAAuB;EACvCM,QAAQ,6GACLL,kEAAsB,EAAG;IACxBO,KAAK,EAAE,cAAc;IACrBC,WAAW,EAAE,IAAI;IACjBC,YAAY,EAAE,IAAI;IAClBC,aAAa,EAAE;EACjB,CAAC,4FACAV,iEAAqB,EAAG;IACvBO,KAAK,EAAE,UAAU;IACjBC,WAAW,EAAE,IAAI;IACjBC,YAAY,EAAE,KAAK;IACnBC,aAAa,EAAE;EACjB,CAAC,4FACAV,kEAAsB,EAAG;IACxBO,KAAK,EAAE,WAAW;IAClBC,WAAW,EAAE,IAAI;IACjBC,YAAY,EAAE,IAAI;IAClBC,aAAa,EAAE;EACjB,CAAC,4FACAV,0EAA8B,EAAG;IAChCO,KAAK,EAAE,gBAAgB;IACvBC,WAAW,EAAE,IAAI;IAC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;UAAA;QAAA;MAAA,IAAC;IACJ;EAAC;EAAA;AAAA,EAjQ2BpD,iCAAY;;;;;;;;AC3C1C;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;UCAA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCtBA;WACA;WACA;WACA;WACA;WACA,iCAAiC,WAAW;WAC5C;WACA;;;;;WCPA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA,sDAAsD;WACtD,sCAAsC,iEAAiE;WACvG;WACA;WACA;WACA;WACA;WACA;;;;;WCzBA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;;;;;;;;;;;;;;;;;;;;ACNyB;AACG","sources":["webpack://@web3auth/modal/./src/config.ts","webpack://@web3auth/modal/external commonjs2 \"@babel/runtime/helpers/toConsumableArray\"","webpack://@web3auth/modal/external commonjs2 \"@babel/runtime/helpers/asyncToGenerator\"","webpack://@web3auth/modal/external commonjs2 \"@babel/runtime/helpers/classCallCheck\"","webpack://@web3auth/modal/external commonjs2 \"@babel/runtime/helpers/createClass\"","webpack://@web3auth/modal/external commonjs2 \"@babel/runtime/helpers/assertThisInitialized\"","webpack://@web3auth/modal/external commonjs2 \"@babel/runtime/helpers/get\"","webpack://@web3auth/modal/external commonjs2 \"@babel/runtime/helpers/inherits\"","webpack://@web3auth/modal/external commonjs2 \"@babel/runtime/helpers/possibleConstructorReturn\"","webpack://@web3auth/modal/external commonjs2 \"@babel/runtime/helpers/getPrototypeOf\"","webpack://@web3auth/modal/external commonjs2 \"@babel/runtime/regenerator\"","webpack://@web3auth/modal/external commonjs2 \"@web3auth/core\"","webpack://@web3auth/modal/external commonjs2 \"@web3auth/ui\"","webpack://@web3auth/modal/./src/default.ts","webpack://@web3auth/modal/./src/utils.ts","webpack://@web3auth/modal/./src/modalManager.ts","webpack://@web3auth/modal/external commonjs2 \"@babel/runtime/helpers/defineProperty\"","webpack://@web3auth/modal/external commonjs2 \"@web3auth/base\"","webpack://@web3auth/modal/external commonjs2 \"@web3auth/metamask-adapter\"","webpack://@web3auth/modal/external commonjs2 \"@web3auth/openlogin-adapter\"","webpack://@web3auth/modal/external commonjs2 \"@web3auth/phantom-adapter\"","webpack://@web3auth/modal/external commonjs2 \"@web3auth/torus-evm-adapter\"","webpack://@web3auth/modal/external commonjs2 \"@web3auth/torus-solana-adapter\"","webpack://@web3auth/modal/external commonjs2 \"@web3auth/wallet-connect-v1-adapter\"","webpack://@web3auth/modal/webpack/bootstrap","webpack://@web3auth/modal/webpack/runtime/compat get default export","webpack://@web3auth/modal/webpack/runtime/create fake namespace object","webpack://@web3auth/modal/webpack/runtime/define property getters","webpack://@web3auth/modal/webpack/runtime/hasOwnProperty shorthand","webpack://@web3auth/modal/webpack/runtime/make namespace object","webpack://@web3auth/modal/./src/index.ts"],"sourcesContent":["import { CHAIN_NAMESPACES, EVM_ADAPTERS, SOLANA_ADAPTERS } from \"@web3auth/base\";\n\nimport { AdaptersModalConfig } from \"./interface\";\n\nexport const defaultSolanaDappModalConfig: AdaptersModalConfig = {\n chainNamespace: CHAIN_NAMESPACES.SOLANA,\n adapters: {\n [SOLANA_ADAPTERS.TORUS_SOLANA]: {\n label: \"Torus Wallet\",\n showOnModal: true,\n showOnMobile: true,\n showOnDesktop: true,\n },\n [SOLANA_ADAPTERS.OPENLOGIN]: {\n label: \"OpenLogin\",\n showOnModal: true,\n showOnMobile: true,\n showOnDesktop: true,\n },\n [SOLANA_ADAPTERS.PHANTOM]: {\n label: \"Phantom\",\n showOnModal: true,\n showOnMobile: false,\n showOnDesktop: true,\n },\n },\n};\n\nexport const defaultEvmDappModalConfig: AdaptersModalConfig = {\n chainNamespace: CHAIN_NAMESPACES.EIP155,\n adapters: {\n [EVM_ADAPTERS.TORUS_EVM]: {\n label: \"Torus Wallet\",\n showOnModal: true,\n showOnMobile: true,\n showOnDesktop: true,\n },\n [EVM_ADAPTERS.METAMASK]: {\n label: \"MetaMask\",\n showOnModal: true,\n showOnMobile: false,\n showOnDesktop: true,\n },\n [EVM_ADAPTERS.OPENLOGIN]: {\n label: \"OpenLogin\",\n showOnModal: true,\n showOnMobile: true,\n showOnDesktop: true,\n },\n [EVM_ADAPTERS.WALLET_CONNECT_V1]: {\n label: \"Wallet Connect\",\n showOnModal: true,\n showOnMobile: true,\n showOnDesktop: true,\n },\n },\n};\n\nexport const defaultSolanaWalletModalConfig: AdaptersModalConfig = {\n chainNamespace: CHAIN_NAMESPACES.SOLANA,\n adapters: {\n [SOLANA_ADAPTERS.OPENLOGIN]: {\n label: \"OpenLogin\",\n showOnModal: true,\n showOnMobile: true,\n showOnDesktop: true,\n },\n },\n};\n\nexport const defaultEvmWalletModalConfig: AdaptersModalConfig = {\n chainNamespace: CHAIN_NAMESPACES.EIP155,\n adapters: {\n [EVM_ADAPTERS.OPENLOGIN]: {\n label: \"OpenLogin\",\n showOnModal: true,\n showOnMobile: true,\n showOnDesktop: true,\n },\n },\n};\n\nexport const defaultOtherModalConfig: AdaptersModalConfig = {\n chainNamespace: CHAIN_NAMESPACES.OTHER,\n adapters: {\n [EVM_ADAPTERS.OPENLOGIN]: {\n label: \"OpenLogin\",\n showOnModal: true,\n showOnMobile: true,\n showOnDesktop: true,\n },\n },\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@babel/runtime/helpers/toConsumableArray\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@babel/runtime/helpers/asyncToGenerator\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@babel/runtime/helpers/classCallCheck\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@babel/runtime/helpers/createClass\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@babel/runtime/helpers/assertThisInitialized\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@babel/runtime/helpers/get\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@babel/runtime/helpers/inherits\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@babel/runtime/helpers/possibleConstructorReturn\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@babel/runtime/helpers/getPrototypeOf\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@babel/runtime/regenerator\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@web3auth/core\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@web3auth/ui\");","import type { OPENLOGIN_NETWORK_TYPE, OpenLoginOptions } from \"@toruslabs/openlogin\";\nimport { CHAIN_NAMESPACES, CustomChainConfig, getChainConfig, IAdapter, WALLET_ADAPTER_TYPE, WALLET_ADAPTERS } from \"@web3auth/base\";\n\n// warning: this function is not compatible with \"OTHER\" chain namespace.\nexport const getDefaultAdapterModule = async (params: {\n name: WALLET_ADAPTER_TYPE;\n clientId: string;\n customChainConfig: Partial<CustomChainConfig> & Pick<CustomChainConfig, \"chainNamespace\">;\n sessionTime?: number;\n web3AuthNetwork?: OPENLOGIN_NETWORK_TYPE;\n}): Promise<IAdapter<unknown>> => {\n const { name, customChainConfig, clientId, sessionTime, web3AuthNetwork } = params;\n if (!Object.values(CHAIN_NAMESPACES).includes(customChainConfig.chainNamespace))\n throw new Error(`Invalid chainNamespace: ${customChainConfig.chainNamespace}`);\n const finalChainConfig = {\n ...(getChainConfig(customChainConfig.chainNamespace, customChainConfig?.chainId) as CustomChainConfig),\n ...(customChainConfig || {}),\n };\n if (name === WALLET_ADAPTERS.TORUS_EVM) {\n const { TorusWalletAdapter } = await import(\"@web3auth/torus-evm-adapter\");\n const adapter = new TorusWalletAdapter({ chainConfig: finalChainConfig, clientId, sessionTime, web3AuthNetwork });\n return adapter;\n } else if (name === WALLET_ADAPTERS.TORUS_SOLANA) {\n const { SolanaWalletAdapter } = await import(\"@web3auth/torus-solana-adapter\");\n const adapter = new SolanaWalletAdapter({ chainConfig: finalChainConfig, clientId, sessionTime, web3AuthNetwork });\n return adapter;\n } else if (name === WALLET_ADAPTERS.METAMASK) {\n const { MetamaskAdapter } = await import(\"@web3auth/metamask-adapter\");\n const adapter = new MetamaskAdapter({ chainConfig: finalChainConfig, clientId, sessionTime, web3AuthNetwork });\n return adapter;\n } else if (name === WALLET_ADAPTERS.PHANTOM) {\n const { PhantomAdapter } = await import(\"@web3auth/phantom-adapter\");\n const adapter = new PhantomAdapter({ chainConfig: finalChainConfig, clientId, sessionTime, web3AuthNetwork });\n return adapter;\n } else if (name === WALLET_ADAPTERS.WALLET_CONNECT_V1) {\n const { WalletConnectV1Adapter } = await import(\"@web3auth/wallet-connect-v1-adapter\");\n const adapter = new WalletConnectV1Adapter({ chainConfig: finalChainConfig, clientId, sessionTime, web3AuthNetwork });\n return adapter;\n } else if (name === WALLET_ADAPTERS.OPENLOGIN) {\n const { OpenloginAdapter, getOpenloginDefaultOptions } = await import(\"@web3auth/openlogin-adapter\");\n const defaultOptions = getOpenloginDefaultOptions();\n const adapter = new OpenloginAdapter({\n ...defaultOptions,\n clientId,\n chainConfig: { ...finalChainConfig },\n adapterSettings: { ...(defaultOptions.adapterSettings as OpenLoginOptions), clientId, network: web3AuthNetwork },\n sessionTime,\n web3AuthNetwork,\n });\n return adapter;\n }\n throw new Error(\"Invalid wallet adapter name\");\n};\n","interface NavigatorLanguage {\n userLanguage?: string;\n}\n\nexport const languageMap = {\n en: \"english\",\n de: \"german\",\n ja: \"japanese\",\n ko: \"korean\",\n zh: \"mandarin\",\n es: \"spanish\",\n fr: \"french\",\n pt: \"portuguese\",\n};\n\nexport const getUserLanguage = (defaultLanguage: string | undefined) => {\n let userLanguage = defaultLanguage;\n if (!userLanguage) {\n const browserLanguage =\n typeof window !== \"undefined\" ? (window.navigator as NavigatorLanguage).userLanguage || window.navigator.language || \"en-US\" : \"en-US\";\n userLanguage = browserLanguage.split(\"-\")[0];\n }\n return Object.prototype.hasOwnProperty.call(languageMap, userLanguage) ? userLanguage : \"en\";\n};\n","import {\n ADAPTER_CATEGORY,\n ADAPTER_EVENTS,\n ADAPTER_STATUS,\n BaseAdapterConfig,\n CHAIN_NAMESPACES,\n CustomChainConfig,\n getChainConfig,\n log,\n SafeEventEmitterProvider,\n WALLET_ADAPTER_TYPE,\n WALLET_ADAPTERS,\n} from \"@web3auth/base\";\nimport { Web3AuthCore, Web3AuthCoreOptions } from \"@web3auth/core\";\nimport { getAdapterSocialLogins, LOGIN_MODAL_EVENTS, LoginModal, OPENLOGIN_PROVIDERS, UIConfig } from \"@web3auth/ui\";\n\nimport {\n defaultEvmDappModalConfig,\n defaultEvmWalletModalConfig,\n defaultOtherModalConfig,\n defaultSolanaDappModalConfig,\n defaultSolanaWalletModalConfig,\n} from \"./config\";\nimport { getDefaultAdapterModule } from \"./default\";\nimport { AdaptersModalConfig, IWeb3AuthModal, ModalConfig } from \"./interface\";\nimport { getUserLanguage } from \"./utils\";\n\nexport interface Web3AuthOptions extends Web3AuthCoreOptions {\n /**\n * web3auth instance provides different adapters for different type of usages. If you are dapp and want to\n * use external wallets like metamask, then you can use the `DAPP` authMode.\n * If you are a wallet and only want to use you own wallet implementations along with openlogin,\n * then you should use `WALLET` authMode.\n *\n * @defaultValue `DAPP`\n */\n authMode?: \"DAPP\" | \"WALLET\";\n /**\n * Config for configuring modal ui display properties\n */\n uiConfig?: Omit<UIConfig, \"adapterListener\">;\n}\n\nexport class Web3Auth extends Web3AuthCore implements IWeb3AuthModal {\n public loginModal: LoginModal;\n\n readonly options: Web3AuthOptions;\n\n private modalConfig: AdaptersModalConfig = defaultEvmDappModalConfig;\n\n constructor(options: Web3AuthOptions) {\n super(options);\n this.options = { ...options };\n const providedChainConfig = this.options.chainConfig;\n if (providedChainConfig.chainNamespace === CHAIN_NAMESPACES.SOLANA) {\n if (options.authMode === \"WALLET\") {\n // default config for solana wallet modal\n this.modalConfig = defaultSolanaWalletModalConfig;\n } else {\n // default config for solana dapp modal\n this.modalConfig = defaultSolanaDappModalConfig;\n }\n } else if (providedChainConfig.chainNamespace === CHAIN_NAMESPACES.EIP155) {\n if (options.authMode === \"WALLET\") {\n // default config for evm wallet modal\n this.modalConfig = defaultEvmWalletModalConfig;\n } else {\n // default config for evm dapp modal\n this.modalConfig = defaultEvmDappModalConfig;\n }\n } else if (providedChainConfig.chainNamespace === CHAIN_NAMESPACES.OTHER) {\n this.modalConfig = defaultOtherModalConfig;\n } else {\n throw new Error(`Invalid chainNamespace provided: ${providedChainConfig.chainNamespace}`);\n }\n\n // get userLanguage\n const defaultLanguage = getUserLanguage(this.options.uiConfig?.defaultLanguage);\n\n this.loginModal = new LoginModal({\n theme: this.options.uiConfig?.theme,\n appName: this.options.uiConfig?.appName || \"blockchain\",\n appLogo: this.options.uiConfig?.appLogo || \"\",\n adapterListener: this,\n displayErrorsOnModal: this.options.uiConfig?.displayErrorsOnModal,\n defaultLanguage,\n modalZIndex: this.options.uiConfig?.modalZIndex || \"99998\",\n });\n this.subscribeToLoginModalEvents();\n }\n\n public async initModal(params?: { modalConfig?: Record<WALLET_ADAPTER_TYPE, ModalConfig> }): Promise<void> {\n super.checkInitRequirements();\n await this.loginModal.initModal();\n const providedChainConfig = this.options.chainConfig;\n\n // merge default adapters with the custom configured adapters.\n const allAdapters = [...new Set([...Object.keys(this.modalConfig.adapters || {}), ...Object.keys(this.walletAdapters)])];\n\n const adapterConfigurationPromises = allAdapters.map(async (adapterName) => {\n // start with the default config of adapter.\n let adapterConfig = this.modalConfig.adapters?.[adapterName] || {\n label: adapterName,\n showOnModal: true,\n showOnMobile: true,\n showOnDesktop: true,\n };\n\n // override the default config of adapter if some config is being provided by the user.\n if (params?.modalConfig?.[adapterName]) {\n adapterConfig = { ...adapterConfig, ...params.modalConfig[adapterName] };\n }\n (this.modalConfig.adapters as Record<WALLET_ADAPTER_TYPE, ModalConfig>)[adapterName] = adapterConfig as ModalConfig;\n\n // check if adapter is configured/added by user and exist in walletAdapters map.\n const adapter = this.walletAdapters[adapterName];\n log.debug(\"adapter config\", adapterName, this.modalConfig.adapters?.[adapterName].showOnModal, adapter);\n\n // if adapter is not custom configured then check if it is available in default adapters.\n // and if adapter is not hidden by user\n if (!adapter && this.modalConfig.adapters?.[adapterName].showOnModal) {\n // if adapter is not configured and some default configuration is available, use it.\n const ad = await getDefaultAdapterModule({\n name: adapterName,\n customChainConfig: this.options.chainConfig,\n clientId: this.options.clientId,\n sessionTime: this.options.sessionTime,\n web3AuthNetwork: this.options.web3AuthNetwork,\n });\n\n this.walletAdapters[adapterName] = ad;\n\n return adapterName;\n } else if (adapter?.type === ADAPTER_CATEGORY.IN_APP || adapter?.type === ADAPTER_CATEGORY.EXTERNAL || adapterName === this.cachedAdapter) {\n if (!this.modalConfig.adapters?.[adapterName].showOnModal) return;\n // add client id to adapter, same web3auth client id can be used in adapter.\n // this id is being overridden if user is also passing client id in adapter's constructor.\n this.walletAdapters[adapterName].setAdapterSettings({\n clientId: this.options.clientId,\n sessionTime: this.options.sessionTime,\n web3AuthNetwork: this.options.web3AuthNetwork,\n });\n\n // if adapter doesn't have any chainConfig then we will set the chainConfig based of passed chainNamespace\n // and chainNamespace.\n if (!adapter.chainConfigProxy) {\n const chainConfig = {\n ...getChainConfig(providedChainConfig.chainNamespace, this.coreOptions.chainConfig?.chainId),\n ...this.coreOptions.chainConfig,\n } as CustomChainConfig;\n this.walletAdapters[adapterName].setAdapterSettings({ chainConfig });\n }\n\n return adapterName;\n }\n });\n\n const adapterNames = await Promise.all(adapterConfigurationPromises);\n const hasInAppWallets = Object.values(this.walletAdapters).some((adapter) => {\n if (adapter.type !== ADAPTER_CATEGORY.IN_APP) return false;\n if (this.modalConfig.adapters[adapter.name].showOnModal !== true) return false;\n if (!this.modalConfig.adapters[adapter.name].loginMethods) return true;\n const mergedLoginMethods = getAdapterSocialLogins(\n adapter.name,\n this.walletAdapters[adapter.name],\n (this.modalConfig.adapters as Record<WALLET_ADAPTER_TYPE, ModalConfig>)[adapter.name]?.loginMethods\n );\n if (Object.values(mergedLoginMethods).some((method) => method.showOnModal)) return true;\n return false;\n });\n log.debug(hasInAppWallets, this.walletAdapters, \"hasInAppWallets\");\n // Now, initialize the adapters.\n const initPromises = adapterNames.map(async (adapterName) => {\n if (!adapterName) return;\n try {\n const adapter = this.walletAdapters[adapterName];\n // only initialize a external adapter here if it is a cached adapter.\n if (this.cachedAdapter !== adapterName && adapter.type === ADAPTER_CATEGORY.EXTERNAL) {\n return;\n }\n // in-app wallets or cached wallet (being connected or already connected) are initialized first.\n // if adapter is configured thn only initialize in app or cached adapter.\n // external wallets are initialized on INIT_EXTERNAL_WALLET event.\n this.subscribeToAdapterEvents(adapter);\n if (adapter.status === ADAPTER_STATUS.NOT_READY) await adapter.init({ autoConnect: this.cachedAdapter === adapterName });\n // note: not adding cachedWallet to modal if it is external wallet.\n // adding it later if no in-app wallets are available.\n if (adapter.type === ADAPTER_CATEGORY.IN_APP) {\n this.initializeInAppWallet(adapterName);\n }\n } catch (error) {\n log.error(error, \"error while initializing adapter\");\n }\n });\n\n this.status = ADAPTER_STATUS.READY;\n await Promise.all(initPromises);\n\n const hasExternalWallets = allAdapters.some((adapterName) => {\n return this.walletAdapters[adapterName]?.type === ADAPTER_CATEGORY.EXTERNAL && this.modalConfig.adapters?.[adapterName].showOnModal;\n });\n\n if (hasExternalWallets) {\n this.loginModal.initExternalWalletContainer();\n }\n\n // variable to check if we have any in app wallets\n // currently all default in app and external wallets can be hidden or shown based on config.\n if (!hasInAppWallets && hasExternalWallets) {\n // if no in app wallet is available then initialize external wallets in modal\n await this.initExternalWalletAdapters(false, { showExternalWalletsOnly: true });\n }\n }\n\n public async connect(): Promise<SafeEventEmitterProvider | null> {\n // if (!this.loginModal.initialized) throw new Error(\"Login modal is not initialized\");\n // if already connected return provider\n if (this.provider) return this.provider;\n this.loginModal.open();\n return new Promise((resolve, reject) => {\n this.once(ADAPTER_EVENTS.CONNECTED, () => {\n return resolve(this.provider);\n });\n this.once(ADAPTER_EVENTS.ERRORED, (err: unknown) => {\n return reject(err);\n });\n });\n }\n\n private async initExternalWalletAdapters(externalWalletsInitialized: boolean, options?: { showExternalWalletsOnly: boolean }): Promise<void> {\n if (externalWalletsInitialized) return;\n const adaptersConfig: Record<string, BaseAdapterConfig> = {};\n Object.keys(this.walletAdapters).forEach(async (adapterName) => {\n const adapter = this.walletAdapters[adapterName];\n if (adapter?.type === ADAPTER_CATEGORY.EXTERNAL) {\n log.debug(\"init external wallet\", this.cachedAdapter, adapterName);\n this.subscribeToAdapterEvents(adapter);\n // we are not initializing cached adapter here as it is already being initialized in initModal before.\n if (this.cachedAdapter === adapterName) {\n return;\n }\n if (adapter.status === ADAPTER_STATUS.NOT_READY)\n await adapter\n .init({ autoConnect: this.cachedAdapter === adapterName })\n .then(() => {\n adaptersConfig[adapterName] = (this.modalConfig.adapters as Record<WALLET_ADAPTER_TYPE, ModalConfig>)[adapterName];\n this.loginModal.addWalletLogins(adaptersConfig, { showExternalWalletsOnly: !!options?.showExternalWalletsOnly });\n return undefined;\n })\n .catch((error) => log.error(error, \"error while initializing adapter\"));\n }\n });\n }\n\n private initializeInAppWallet(adapterName: string): void {\n log.info(\"adapterInitResults\", adapterName);\n if (this.walletAdapters[adapterName].type === ADAPTER_CATEGORY.IN_APP) {\n this.loginModal.addSocialLogins(\n adapterName,\n getAdapterSocialLogins(\n adapterName,\n this.walletAdapters[adapterName],\n (this.modalConfig.adapters as Record<WALLET_ADAPTER_TYPE, ModalConfig>)[adapterName]?.loginMethods\n ),\n this.options.uiConfig?.loginMethodsOrder || OPENLOGIN_PROVIDERS\n );\n }\n }\n\n private subscribeToLoginModalEvents(): void {\n this.loginModal.on(LOGIN_MODAL_EVENTS.LOGIN, async (params: { adapter: WALLET_ADAPTER_TYPE; loginParams: unknown }) => {\n try {\n await this.connectTo<unknown>(params.adapter, params.loginParams);\n } catch (error) {\n log.error(`Error while connecting to adapter: ${params.adapter}`, error);\n }\n });\n this.loginModal.on(LOGIN_MODAL_EVENTS.INIT_EXTERNAL_WALLETS, async (params: { externalWalletsInitialized: boolean }) => {\n await this.initExternalWalletAdapters(params.externalWalletsInitialized);\n });\n this.loginModal.on(LOGIN_MODAL_EVENTS.DISCONNECT, async () => {\n try {\n await this.logout();\n } catch (error) {\n log.error(`Error while disconnecting`, error);\n }\n });\n this.loginModal.on(LOGIN_MODAL_EVENTS.MODAL_VISIBILITY, async (visibility: boolean) => {\n log.debug(\"is login modal visible\", visibility);\n this.emit(LOGIN_MODAL_EVENTS.MODAL_VISIBILITY, visibility);\n const walletConnectStatus = this.walletAdapters[WALLET_ADAPTERS.WALLET_CONNECT_V1]?.status;\n if (visibility && walletConnectStatus === ADAPTER_STATUS.READY) {\n // refreshing session for wallet connect whenever modal is opened.\n try {\n this.walletAdapters[WALLET_ADAPTERS.WALLET_CONNECT_V1].connect();\n } catch (error) {\n log.error(`Error while disconnecting to wallet connect in core`, error);\n }\n }\n });\n }\n}\n","module.exports = require(\"@babel/runtime/helpers/defineProperty\");","module.exports = require(\"@web3auth/base\");","module.exports = require(\"@web3auth/metamask-adapter\");","module.exports = require(\"@web3auth/openlogin-adapter\");","module.exports = require(\"@web3auth/phantom-adapter\");","module.exports = require(\"@web3auth/torus-evm-adapter\");","module.exports = require(\"@web3auth/torus-solana-adapter\");","module.exports = require(\"@web3auth/wallet-connect-v1-adapter\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__);\nvar leafPrototypes;\n// create a fake namespace object\n// mode & 1: value is a module id, require it\n// mode & 2: merge all properties of value into the ns\n// mode & 4: return value when already ns object\n// mode & 16: return value when it's Promise-like\n// mode & 8|1: behave like require\n__webpack_require__.t = function(value, mode) {\n\tif(mode & 1) value = this(value);\n\tif(mode & 8) return value;\n\tif(typeof value === 'object' && value) {\n\t\tif((mode & 4) && value.__esModule) return value;\n\t\tif((mode & 16) && typeof value.then === 'function') return value;\n\t}\n\tvar ns = Object.create(null);\n\t__webpack_require__.r(ns);\n\tvar def = {};\n\tleafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)];\n\tfor(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) {\n\t\tObject.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key])));\n\t}\n\tdef['default'] = () => (value);\n\t__webpack_require__.d(ns, def);\n\treturn ns;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","export * from \"./config\";\nexport * from \"./interface\";\nexport * from \"./modalManager\";\n"],"names":["CHAIN_NAMESPACES","EVM_ADAPTERS","SOLANA_ADAPTERS","defaultSolanaDappModalConfig","chainNamespace","SOLANA","adapters","TORUS_SOLANA","label","showOnModal","showOnMobile","showOnDesktop","OPENLOGIN","PHANTOM","defaultEvmDappModalConfig","EIP155","TORUS_EVM","METAMASK","WALLET_CONNECT_V1","defaultSolanaWalletModalConfig","defaultEvmWalletModalConfig","defaultOtherModalConfig","OTHER","getChainConfig","WALLET_ADAPTERS","getDefaultAdapterModule","params","name","customChainConfig","clientId","sessionTime","web3AuthNetwork","Object","values","includes","Error","finalChainConfig","chainId","TorusWalletAdapter","adapter","chainConfig","SolanaWalletAdapter","MetamaskAdapter","PhantomAdapter","WalletConnectV1Adapter","OpenloginAdapter","getOpenloginDefaultOptions","defaultOptions","adapterSettings","network","languageMap","en","de","ja","ko","zh","es","fr","pt","getUserLanguage","defaultLanguage","userLanguage","browserLanguage","window","navigator","language","split","prototype","hasOwnProperty","call","ADAPTER_CATEGORY","ADAPTER_EVENTS","ADAPTER_STATUS","log","Web3AuthCore","getAdapterSocialLogins","LOGIN_MODAL_EVENTS","LoginModal","OPENLOGIN_PROVIDERS","Web3Auth","options","providedChainConfig","authMode","modalConfig","uiConfig","loginModal","theme","appName","appLogo","adapterListener","displayErrorsOnModal","modalZIndex","subscribeToLoginModalEvents","initModal","allAdapters","Set","keys","walletAdapters","adapterConfigurationPromises","map","adapterName","adapterConfig","debug","ad","type","IN_APP","EXTERNAL","cachedAdapter","setAdapterSettings","chainConfigProxy","coreOptions","Promise","all","adapterNames","hasInAppWallets","some","loginMethods","mergedLoginMethods","method","initPromises","subscribeToAdapterEvents","status","NOT_READY","init","autoConnect","initializeInAppWallet","error","READY","hasExternalWallets","initExternalWalletContainer","initExternalWalletAdapters","showExternalWalletsOnly","provider","open","resolve","reject","once","CONNECTED","ERRORED","err","externalWalletsInitialized","adaptersConfig","forEach","then","addWalletLogins","undefined","catch","info","addSocialLogins","loginMethodsOrder","on","LOGIN","connectTo","loginParams","INIT_EXTERNAL_WALLETS","DISCONNECT","logout","MODAL_VISIBILITY","visibility","emit","walletConnectStatus","connect"],"sourceRoot":""}
|
package/dist/modal.esm.js
CHANGED
|
@@ -87,15 +87,15 @@ var defaultOtherModalConfig = {
|
|
|
87
87
|
|
|
88
88
|
function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
89
89
|
function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$1(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
90
|
-
// warning: this function is not compatible with "OTHER"
|
|
90
|
+
// warning: this function is not compatible with "OTHER" chain namespace.
|
|
91
91
|
var getDefaultAdapterModule = /*#__PURE__*/function () {
|
|
92
92
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(params) {
|
|
93
|
-
var name, customChainConfig, clientId, finalChainConfig, _yield$import, TorusWalletAdapter, adapter, _yield$import2, SolanaWalletAdapter, _adapter, _yield$import3, MetamaskAdapter, _adapter2, _yield$import4, PhantomAdapter, _adapter3, _yield$import5, WalletConnectV1Adapter, _adapter4, _yield$import6, OpenloginAdapter, getOpenloginDefaultOptions, defaultOptions, _adapter5;
|
|
93
|
+
var name, customChainConfig, clientId, sessionTime, web3AuthNetwork, finalChainConfig, _yield$import, TorusWalletAdapter, adapter, _yield$import2, SolanaWalletAdapter, _adapter, _yield$import3, MetamaskAdapter, _adapter2, _yield$import4, PhantomAdapter, _adapter3, _yield$import5, WalletConnectV1Adapter, _adapter4, _yield$import6, OpenloginAdapter, getOpenloginDefaultOptions, defaultOptions, _adapter5;
|
|
94
94
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
95
95
|
while (1) {
|
|
96
96
|
switch (_context.prev = _context.next) {
|
|
97
97
|
case 0:
|
|
98
|
-
name = params.name, customChainConfig = params.customChainConfig, clientId = params.clientId;
|
|
98
|
+
name = params.name, customChainConfig = params.customChainConfig, clientId = params.clientId, sessionTime = params.sessionTime, web3AuthNetwork = params.web3AuthNetwork;
|
|
99
99
|
if (Object.values(CHAIN_NAMESPACES).includes(customChainConfig.chainNamespace)) {
|
|
100
100
|
_context.next = 3;
|
|
101
101
|
break;
|
|
@@ -114,7 +114,9 @@ var getDefaultAdapterModule = /*#__PURE__*/function () {
|
|
|
114
114
|
TorusWalletAdapter = _yield$import.TorusWalletAdapter;
|
|
115
115
|
adapter = new TorusWalletAdapter({
|
|
116
116
|
chainConfig: finalChainConfig,
|
|
117
|
-
clientId: clientId
|
|
117
|
+
clientId: clientId,
|
|
118
|
+
sessionTime: sessionTime,
|
|
119
|
+
web3AuthNetwork: web3AuthNetwork
|
|
118
120
|
});
|
|
119
121
|
return _context.abrupt("return", adapter);
|
|
120
122
|
case 13:
|
|
@@ -129,7 +131,9 @@ var getDefaultAdapterModule = /*#__PURE__*/function () {
|
|
|
129
131
|
SolanaWalletAdapter = _yield$import2.SolanaWalletAdapter;
|
|
130
132
|
_adapter = new SolanaWalletAdapter({
|
|
131
133
|
chainConfig: finalChainConfig,
|
|
132
|
-
clientId: clientId
|
|
134
|
+
clientId: clientId,
|
|
135
|
+
sessionTime: sessionTime,
|
|
136
|
+
web3AuthNetwork: web3AuthNetwork
|
|
133
137
|
});
|
|
134
138
|
return _context.abrupt("return", _adapter);
|
|
135
139
|
case 22:
|
|
@@ -144,7 +148,9 @@ var getDefaultAdapterModule = /*#__PURE__*/function () {
|
|
|
144
148
|
MetamaskAdapter = _yield$import3.MetamaskAdapter;
|
|
145
149
|
_adapter2 = new MetamaskAdapter({
|
|
146
150
|
chainConfig: finalChainConfig,
|
|
147
|
-
clientId: clientId
|
|
151
|
+
clientId: clientId,
|
|
152
|
+
sessionTime: sessionTime,
|
|
153
|
+
web3AuthNetwork: web3AuthNetwork
|
|
148
154
|
});
|
|
149
155
|
return _context.abrupt("return", _adapter2);
|
|
150
156
|
case 31:
|
|
@@ -159,7 +165,9 @@ var getDefaultAdapterModule = /*#__PURE__*/function () {
|
|
|
159
165
|
PhantomAdapter = _yield$import4.PhantomAdapter;
|
|
160
166
|
_adapter3 = new PhantomAdapter({
|
|
161
167
|
chainConfig: finalChainConfig,
|
|
162
|
-
clientId: clientId
|
|
168
|
+
clientId: clientId,
|
|
169
|
+
sessionTime: sessionTime,
|
|
170
|
+
web3AuthNetwork: web3AuthNetwork
|
|
163
171
|
});
|
|
164
172
|
return _context.abrupt("return", _adapter3);
|
|
165
173
|
case 40:
|
|
@@ -174,7 +182,9 @@ var getDefaultAdapterModule = /*#__PURE__*/function () {
|
|
|
174
182
|
WalletConnectV1Adapter = _yield$import5.WalletConnectV1Adapter;
|
|
175
183
|
_adapter4 = new WalletConnectV1Adapter({
|
|
176
184
|
chainConfig: finalChainConfig,
|
|
177
|
-
clientId: clientId
|
|
185
|
+
clientId: clientId,
|
|
186
|
+
sessionTime: sessionTime,
|
|
187
|
+
web3AuthNetwork: web3AuthNetwork
|
|
178
188
|
});
|
|
179
189
|
return _context.abrupt("return", _adapter4);
|
|
180
190
|
case 49:
|
|
@@ -190,10 +200,14 @@ var getDefaultAdapterModule = /*#__PURE__*/function () {
|
|
|
190
200
|
getOpenloginDefaultOptions = _yield$import6.getOpenloginDefaultOptions;
|
|
191
201
|
defaultOptions = getOpenloginDefaultOptions();
|
|
192
202
|
_adapter5 = new OpenloginAdapter(_objectSpread$1(_objectSpread$1({}, defaultOptions), {}, {
|
|
203
|
+
clientId: clientId,
|
|
193
204
|
chainConfig: _objectSpread$1({}, finalChainConfig),
|
|
194
205
|
adapterSettings: _objectSpread$1(_objectSpread$1({}, defaultOptions.adapterSettings), {}, {
|
|
195
|
-
clientId: clientId
|
|
196
|
-
|
|
206
|
+
clientId: clientId,
|
|
207
|
+
network: web3AuthNetwork
|
|
208
|
+
}),
|
|
209
|
+
sessionTime: sessionTime,
|
|
210
|
+
web3AuthNetwork: web3AuthNetwork
|
|
197
211
|
}));
|
|
198
212
|
return _context.abrupt("return", _adapter5);
|
|
199
213
|
case 58:
|
|
@@ -217,7 +231,8 @@ var languageMap = {
|
|
|
217
231
|
ko: "korean",
|
|
218
232
|
zh: "mandarin",
|
|
219
233
|
es: "spanish",
|
|
220
|
-
fr: "french"
|
|
234
|
+
fr: "french",
|
|
235
|
+
pt: "portuguese"
|
|
221
236
|
};
|
|
222
237
|
var getUserLanguage = function getUserLanguage(defaultLanguage) {
|
|
223
238
|
var userLanguage = defaultLanguage;
|
|
@@ -236,7 +251,7 @@ var Web3Auth = /*#__PURE__*/function (_Web3AuthCore) {
|
|
|
236
251
|
_inherits(Web3Auth, _Web3AuthCore);
|
|
237
252
|
var _super = _createSuper(Web3Auth);
|
|
238
253
|
function Web3Auth(options) {
|
|
239
|
-
var _this$options$uiConfi, _this$options$uiConfi2, _this$options$uiConfi3;
|
|
254
|
+
var _this$options$uiConfi, _this$options$uiConfi2, _this$options$uiConfi3, _this$options$uiConfi4, _this$options$uiConfi5, _this$options$uiConfi6;
|
|
240
255
|
var _this;
|
|
241
256
|
_classCallCheck(this, Web3Auth);
|
|
242
257
|
_this = _super.call(this, options);
|
|
@@ -270,11 +285,12 @@ var Web3Auth = /*#__PURE__*/function (_Web3AuthCore) {
|
|
|
270
285
|
var defaultLanguage = getUserLanguage((_this$options$uiConfi = _this.options.uiConfig) === null || _this$options$uiConfi === void 0 ? void 0 : _this$options$uiConfi.defaultLanguage);
|
|
271
286
|
_this.loginModal = new LoginModal({
|
|
272
287
|
theme: (_this$options$uiConfi2 = _this.options.uiConfig) === null || _this$options$uiConfi2 === void 0 ? void 0 : _this$options$uiConfi2.theme,
|
|
273
|
-
|
|
274
|
-
|
|
288
|
+
appName: ((_this$options$uiConfi3 = _this.options.uiConfig) === null || _this$options$uiConfi3 === void 0 ? void 0 : _this$options$uiConfi3.appName) || "blockchain",
|
|
289
|
+
appLogo: ((_this$options$uiConfi4 = _this.options.uiConfig) === null || _this$options$uiConfi4 === void 0 ? void 0 : _this$options$uiConfi4.appLogo) || "",
|
|
275
290
|
adapterListener: _assertThisInitialized(_this),
|
|
276
|
-
displayErrorsOnModal: _this.options.displayErrorsOnModal,
|
|
277
|
-
defaultLanguage: defaultLanguage
|
|
291
|
+
displayErrorsOnModal: (_this$options$uiConfi5 = _this.options.uiConfig) === null || _this$options$uiConfi5 === void 0 ? void 0 : _this$options$uiConfi5.displayErrorsOnModal,
|
|
292
|
+
defaultLanguage: defaultLanguage,
|
|
293
|
+
modalZIndex: ((_this$options$uiConfi6 = _this.options.uiConfig) === null || _this$options$uiConfi6 === void 0 ? void 0 : _this$options$uiConfi6.modalZIndex) || "99998"
|
|
278
294
|
});
|
|
279
295
|
_this.subscribeToLoginModalEvents();
|
|
280
296
|
return _this;
|
|
@@ -327,7 +343,9 @@ var Web3Auth = /*#__PURE__*/function (_Web3AuthCore) {
|
|
|
327
343
|
return getDefaultAdapterModule({
|
|
328
344
|
name: adapterName,
|
|
329
345
|
customChainConfig: _this2.options.chainConfig,
|
|
330
|
-
clientId: _this2.options.clientId
|
|
346
|
+
clientId: _this2.options.clientId,
|
|
347
|
+
sessionTime: _this2.options.sessionTime,
|
|
348
|
+
web3AuthNetwork: _this2.options.web3AuthNetwork
|
|
331
349
|
});
|
|
332
350
|
case 8:
|
|
333
351
|
ad = _context.sent;
|
|
@@ -595,8 +613,8 @@ var Web3Auth = /*#__PURE__*/function (_Web3AuthCore) {
|
|
|
595
613
|
value: function initializeInAppWallet(adapterName) {
|
|
596
614
|
log.info("adapterInitResults", adapterName);
|
|
597
615
|
if (this.walletAdapters[adapterName].type === ADAPTER_CATEGORY.IN_APP) {
|
|
598
|
-
var _this$modalConfig$ada, _this$options$
|
|
599
|
-
this.loginModal.addSocialLogins(adapterName, getAdapterSocialLogins(adapterName, this.walletAdapters[adapterName], (_this$modalConfig$ada = this.modalConfig.adapters[adapterName]) === null || _this$modalConfig$ada === void 0 ? void 0 : _this$modalConfig$ada.loginMethods), ((_this$options$
|
|
616
|
+
var _this$modalConfig$ada, _this$options$uiConfi7;
|
|
617
|
+
this.loginModal.addSocialLogins(adapterName, getAdapterSocialLogins(adapterName, this.walletAdapters[adapterName], (_this$modalConfig$ada = this.modalConfig.adapters[adapterName]) === null || _this$modalConfig$ada === void 0 ? void 0 : _this$modalConfig$ada.loginMethods), ((_this$options$uiConfi7 = this.options.uiConfig) === null || _this$options$uiConfi7 === void 0 ? void 0 : _this$options$uiConfi7.loginMethodsOrder) || OPENLOGIN_PROVIDERS);
|
|
600
618
|
}
|
|
601
619
|
}
|
|
602
620
|
}, {
|