@web3auth/modal 3.2.0 → 4.0.0-alpha.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 +9 -4
- package/dist/modal.cjs.js.map +1 -1
- package/dist/modal.esm.js +8 -4
- package/dist/modal.esm.js.map +1 -1
- package/dist/modal.umd.min.js +1 -1
- package/dist/modal.umd.min.js.LICENSE.txt +15 -0
- package/dist/modal.umd.min.js.map +1 -1
- package/package.json +12 -12
- package/src/default.ts +3 -2
- package/src/modalManager.ts +6 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@web3auth/modal",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0-alpha.0",
|
|
4
4
|
"homepage": "https://github.com/Web3Auth/Web3Auth#readme",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"main": "dist/modal.cjs.js",
|
|
@@ -19,19 +19,19 @@
|
|
|
19
19
|
"pre-commit": "lint-staged --cwd ."
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@web3auth/base": "^
|
|
23
|
-
"@web3auth/core": "^
|
|
24
|
-
"@web3auth/metamask-adapter": "^
|
|
25
|
-
"@web3auth/openlogin-adapter": "^
|
|
26
|
-
"@web3auth/phantom-adapter": "^
|
|
27
|
-
"@web3auth/torus-evm-adapter": "^
|
|
28
|
-
"@web3auth/torus-solana-adapter": "^
|
|
29
|
-
"@web3auth/ui": "^
|
|
30
|
-
"@web3auth/wallet-connect-v1-adapter": "^
|
|
22
|
+
"@web3auth/base": "^4.0.0-alpha.0",
|
|
23
|
+
"@web3auth/core": "^4.0.0-alpha.0",
|
|
24
|
+
"@web3auth/metamask-adapter": "^4.0.0-alpha.0",
|
|
25
|
+
"@web3auth/openlogin-adapter": "^4.0.0-alpha.0",
|
|
26
|
+
"@web3auth/phantom-adapter": "^4.0.0-alpha.0",
|
|
27
|
+
"@web3auth/torus-evm-adapter": "^4.0.0-alpha.0",
|
|
28
|
+
"@web3auth/torus-solana-adapter": "^4.0.0-alpha.0",
|
|
29
|
+
"@web3auth/ui": "^4.0.0-alpha.0",
|
|
30
|
+
"@web3auth/wallet-connect-v1-adapter": "^4.0.0-alpha.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@svgr/webpack": "^6.5.1",
|
|
34
|
-
"@toruslabs/openlogin": "^2.
|
|
34
|
+
"@toruslabs/openlogin": "^2.10.0",
|
|
35
35
|
"css-loader": "^6.7.2",
|
|
36
36
|
"isomorphic-style-loader": "^5.3.2",
|
|
37
37
|
"style-loader": "^3.3.1",
|
|
@@ -61,5 +61,5 @@
|
|
|
61
61
|
"publishConfig": {
|
|
62
62
|
"access": "public"
|
|
63
63
|
},
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "e53943258fb8082258c6bf382a350574637439f7"
|
|
65
65
|
}
|
package/src/default.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { OpenLoginOptions } from "@toruslabs/openlogin";
|
|
2
2
|
import { CHAIN_NAMESPACES, CustomChainConfig, getChainConfig, IAdapter, WALLET_ADAPTER_TYPE, WALLET_ADAPTERS } from "@web3auth/base";
|
|
3
3
|
|
|
4
|
+
// warning: this function is not compatible with "OTHER" chainnamespace.
|
|
4
5
|
export const getDefaultAdapterModule = async (params: {
|
|
5
6
|
name: WALLET_ADAPTER_TYPE;
|
|
6
7
|
clientId: string;
|
|
@@ -35,10 +36,10 @@ export const getDefaultAdapterModule = async (params: {
|
|
|
35
36
|
return adapter;
|
|
36
37
|
} else if (name === WALLET_ADAPTERS.OPENLOGIN) {
|
|
37
38
|
const { OpenloginAdapter, getOpenloginDefaultOptions } = await import("@web3auth/openlogin-adapter");
|
|
38
|
-
const defaultOptions = getOpenloginDefaultOptions(
|
|
39
|
+
const defaultOptions = getOpenloginDefaultOptions();
|
|
39
40
|
const adapter = new OpenloginAdapter({
|
|
40
41
|
...defaultOptions,
|
|
41
|
-
chainConfig: { ...
|
|
42
|
+
chainConfig: { ...finalChainConfig },
|
|
42
43
|
adapterSettings: { ...(defaultOptions.adapterSettings as OpenLoginOptions), clientId },
|
|
43
44
|
});
|
|
44
45
|
return adapter;
|
package/src/modalManager.ts
CHANGED
|
@@ -170,7 +170,11 @@ export class Web3Auth extends Web3AuthCore {
|
|
|
170
170
|
if (!this.modalConfig.adapters?.[adapterName].showOnModal) return;
|
|
171
171
|
// add client id to adapter, same web3auth client id can be used in adapter.
|
|
172
172
|
// this id is being overridden if user is also passing client id in adapter's constructor.
|
|
173
|
-
this.walletAdapters[adapterName].setAdapterSettings({
|
|
173
|
+
this.walletAdapters[adapterName].setAdapterSettings({
|
|
174
|
+
clientId: this.options.clientId,
|
|
175
|
+
sessionTime: this.options.sessionTime,
|
|
176
|
+
web3AuthNetwork: this.options.web3AuthNetwork,
|
|
177
|
+
});
|
|
174
178
|
|
|
175
179
|
// if adapter doesn't have any chainConfig then we will set the chainConfig based of passed chainNamespace
|
|
176
180
|
// and chainNamespace.
|
|
@@ -179,7 +183,7 @@ export class Web3Auth extends Web3AuthCore {
|
|
|
179
183
|
...getChainConfig(providedChainConfig.chainNamespace, this.coreOptions.chainConfig?.chainId),
|
|
180
184
|
...this.coreOptions.chainConfig,
|
|
181
185
|
} as CustomChainConfig;
|
|
182
|
-
this.walletAdapters[adapterName].
|
|
186
|
+
this.walletAdapters[adapterName].setAdapterSettings({ chainConfig });
|
|
183
187
|
}
|
|
184
188
|
|
|
185
189
|
return adapterName;
|