@web3auth/no-modal 10.0.0-alpha.2 → 10.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib.cjs/base/connector/baseConnector.js +1 -0
- package/dist/lib.cjs/base/constants.js +19 -0
- package/dist/lib.cjs/base/loglevel.js +3 -0
- package/dist/lib.cjs/base/utils.js +29 -3
- package/dist/lib.cjs/base/wallet/index.js +4 -2
- package/dist/lib.cjs/connectors/auth-connector/authConnector.js +68 -20
- package/dist/lib.cjs/connectors/base-evm-connector/baseEvmConnector.js +1 -1
- package/dist/lib.cjs/connectors/base-solana-connector/baseSolanaConnector.js +1 -1
- package/dist/lib.cjs/connectors/coinbase-connector/coinbaseConnector.js +1 -1
- package/dist/lib.cjs/connectors/injected-evm-connector/injectedEvmConnector.js +3 -1
- package/dist/lib.cjs/connectors/injected-solana-connector/walletStandardConnector.js +2 -2
- 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 +1 -2
- package/dist/lib.cjs/connectors/wallet-connect-v2-connector/config.js +4 -59
- package/dist/lib.cjs/connectors/wallet-connect-v2-connector/walletConnectV2Connector.js +7 -17
- package/dist/lib.cjs/connectors/wallet-connect-v2-connector/walletConnectV2Utils.js +1 -1
- package/dist/lib.cjs/index.js +31 -24
- package/dist/lib.cjs/noModal.js +126 -29
- package/dist/lib.cjs/plugins/nft-checkout-plugin/plugin.js +1 -1
- package/dist/lib.cjs/plugins/wallet-services-plugin/plugin.js +2 -2
- package/dist/lib.cjs/providers/account-abstraction-provider/providers/AccountAbstractionProvider.js +19 -13
- package/dist/lib.cjs/providers/account-abstraction-provider/providers/utils.js +1 -1
- package/dist/lib.cjs/providers/ethereum-mpc-provider/providers/signingProviders/EthereumSigningProvider.js +1 -1
- package/dist/lib.cjs/providers/ethereum-mpc-provider/providers/signingProviders/signingUtils.js +1 -1
- package/dist/lib.cjs/providers/ethereum-provider/providers/privateKeyProviders/TransactionFormatter/formatter.js +1 -1
- package/dist/lib.cjs/providers/solana-provider/providers/injectedProviders/base/baseInjectedProvider.js +1 -1
- package/dist/lib.cjs/providers/solana-provider/providers/injectedProviders/walletStandardProvider.js +1 -1
- package/dist/lib.cjs/providers/solana-provider/rpc/solanaRpcMiddlewares.js +1 -1
- package/dist/lib.cjs/providers/xrpl-provider/providers/privateKeyProviders/xrplPrivateKeyProvider.js +1 -1
- package/dist/lib.cjs/react/no-modal/Web3AuthInnerContext.js +1 -1
- package/dist/lib.cjs/react/no-modal/hooks/useWeb3Auth.js +1 -1
- package/dist/lib.cjs/react/wallet-services-plugin/WalletServicesContext.js +1 -1
- package/dist/lib.cjs/react/wallet-services-plugin/hooks/useWalletServicesPlugin.js +1 -1
- package/dist/lib.cjs/types/base/chain/IChainInterface.d.ts +3 -45
- package/dist/lib.cjs/types/base/connector/baseConnector.d.ts +1 -0
- package/dist/lib.cjs/types/base/connector/interfaces.d.ts +23 -4
- package/dist/lib.cjs/types/base/constants.d.ts +13 -0
- package/dist/lib.cjs/types/base/core/IWeb3Auth.d.ts +10 -4
- package/dist/lib.cjs/types/base/index.d.ts +1 -1
- package/dist/lib.cjs/types/base/interfaces.d.ts +68 -9
- package/dist/lib.cjs/types/base/loglevel.d.ts +2 -1
- package/dist/lib.cjs/types/base/utils.d.ts +12 -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 +5 -3
- package/dist/lib.cjs/types/connectors/injected-evm-connector/injectedEvmConnector.d.ts +1 -0
- 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.cjs/vue/no-modal/Web3AuthProvider.js +1 -1
- package/dist/lib.cjs/vue/no-modal/composables/useWeb3Auth.js +1 -1
- package/dist/lib.cjs/vue/wallet-services-plugin/WalletServicesProvider.js +1 -1
- package/dist/lib.cjs/vue/wallet-services-plugin/composables/useWalletServicesPlugin.js +1 -1
- package/dist/lib.esm/base/connector/baseConnector.js +1 -0
- package/dist/lib.esm/base/constants.js +15 -0
- package/dist/lib.esm/base/loglevel.js +3 -0
- package/dist/lib.esm/base/utils.js +29 -4
- package/dist/lib.esm/base/wallet/index.js +4 -2
- package/dist/lib.esm/connectors/auth-connector/authConnector.js +68 -20
- package/dist/lib.esm/connectors/base-evm-connector/baseEvmConnector.js +1 -1
- package/dist/lib.esm/connectors/base-solana-connector/baseSolanaConnector.js +1 -1
- package/dist/lib.esm/connectors/coinbase-connector/coinbaseConnector.js +1 -1
- package/dist/lib.esm/connectors/injected-evm-connector/injectedEvmConnector.js +3 -1
- package/dist/lib.esm/connectors/injected-solana-connector/walletStandardConnector.js +2 -2
- 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 +2 -3
- package/dist/lib.esm/connectors/wallet-connect-v2-connector/config.js +2 -57
- package/dist/lib.esm/connectors/wallet-connect-v2-connector/walletConnectV2Connector.js +7 -17
- package/dist/lib.esm/connectors/wallet-connect-v2-connector/walletConnectV2Utils.js +2 -2
- package/dist/lib.esm/index.js +3 -4
- package/dist/lib.esm/noModal.js +127 -30
- package/dist/lib.esm/plugins/nft-checkout-plugin/plugin.js +1 -1
- package/dist/lib.esm/plugins/wallet-services-plugin/plugin.js +2 -2
- package/dist/lib.esm/providers/account-abstraction-provider/providers/AccountAbstractionProvider.js +19 -13
- package/dist/lib.esm/providers/account-abstraction-provider/providers/utils.js +1 -1
- package/dist/lib.esm/providers/ethereum-mpc-provider/providers/signingProviders/EthereumSigningProvider.js +1 -1
- package/dist/lib.esm/providers/ethereum-mpc-provider/providers/signingProviders/signingUtils.js +1 -1
- package/dist/lib.esm/providers/ethereum-provider/providers/privateKeyProviders/TransactionFormatter/formatter.js +1 -1
- package/dist/lib.esm/providers/solana-provider/providers/injectedProviders/base/baseInjectedProvider.js +1 -1
- package/dist/lib.esm/providers/solana-provider/providers/injectedProviders/walletStandardProvider.js +1 -1
- package/dist/lib.esm/providers/solana-provider/rpc/solanaRpcMiddlewares.js +1 -1
- package/dist/lib.esm/providers/xrpl-provider/providers/privateKeyProviders/xrplPrivateKeyProvider.js +1 -1
- package/dist/lib.esm/react/no-modal/Web3AuthInnerContext.js +1 -1
- package/dist/lib.esm/react/no-modal/hooks/useWeb3Auth.js +1 -1
- package/dist/lib.esm/react/wallet-services-plugin/WalletServicesContext.js +1 -1
- package/dist/lib.esm/react/wallet-services-plugin/hooks/useWalletServicesPlugin.js +1 -1
- package/dist/lib.esm/vue/no-modal/Web3AuthProvider.js +1 -1
- package/dist/lib.esm/vue/no-modal/composables/useWeb3Auth.js +1 -1
- package/dist/lib.esm/vue/wallet-services-plugin/WalletServicesProvider.js +1 -1
- package/dist/lib.esm/vue/wallet-services-plugin/composables/useWalletServicesPlugin.js +1 -1
- package/dist/noModal.umd.min.js +1 -1
- package/package.json +11 -8
- package/dist/lib.cjs/base/chain/config.js +0 -322
- 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/base/chain/config.d.ts +0 -5
- 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/base/chain/config.js +0 -317
- 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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@web3auth/no-modal",
|
|
3
|
-
"version": "10.0.0-
|
|
3
|
+
"version": "10.0.0-beta.1",
|
|
4
4
|
"description": "Multi chain wallet aggregator for web3Auth",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"web3Auth/no-modal",
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
],
|
|
34
34
|
"peerDependencies": {
|
|
35
35
|
"@babel/runtime": "^7.x",
|
|
36
|
-
"@coinbase/wallet-sdk": "^4.
|
|
37
|
-
"react": "^18
|
|
36
|
+
"@coinbase/wallet-sdk": "^4.3.x",
|
|
37
|
+
"react": "^18 || ^19",
|
|
38
38
|
"vue": "^3.x"
|
|
39
39
|
},
|
|
40
40
|
"peerDependenciesMeta": {
|
|
@@ -50,14 +50,16 @@
|
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
52
|
"@ethereumjs/util": "^9.1.0",
|
|
53
|
+
"@metamask/sdk": "^0.32.1",
|
|
53
54
|
"@solana/wallet-standard-features": "^1.3.0",
|
|
54
55
|
"@solana/web3.js": "^1.98.0",
|
|
55
56
|
"@toruslabs/base-controllers": "^8.0.0",
|
|
56
57
|
"@toruslabs/bs58": "^1.0.0",
|
|
57
58
|
"@toruslabs/constants": "^15.0.0",
|
|
58
59
|
"@toruslabs/eccrypto": "^6.0.2",
|
|
59
|
-
"@toruslabs/ethereum-controllers": "^8.
|
|
60
|
+
"@toruslabs/ethereum-controllers": "^8.1.0",
|
|
60
61
|
"@toruslabs/http-helpers": "^8.1.1",
|
|
62
|
+
"@toruslabs/loglevel-sentry": "^8.1.0",
|
|
61
63
|
"@toruslabs/secure-pub-sub": "3.0.2",
|
|
62
64
|
"@toruslabs/tweetnacl-js": "^1.0.4",
|
|
63
65
|
"@wallet-standard/app": "^1.1.0",
|
|
@@ -66,8 +68,8 @@
|
|
|
66
68
|
"@walletconnect/sign-client": "^2.19.1",
|
|
67
69
|
"@walletconnect/types": "^2.19.1",
|
|
68
70
|
"@walletconnect/utils": "^2.19.1",
|
|
69
|
-
"@web3auth/auth": "^10.
|
|
70
|
-
"@web3auth/ws-embed": "
|
|
71
|
+
"@web3auth/auth": "^10.3.0",
|
|
72
|
+
"@web3auth/ws-embed": "^5.0.0",
|
|
71
73
|
"assert": "^2.1.0",
|
|
72
74
|
"bignumber.js": "^9.1.2",
|
|
73
75
|
"bn.js": "^5.2.1",
|
|
@@ -89,7 +91,8 @@
|
|
|
89
91
|
"@coinbase/wallet-sdk": "^4.3.x",
|
|
90
92
|
"@types/elliptic": "6.4.18",
|
|
91
93
|
"@types/json-rpc-random-id": "^1.0.3",
|
|
92
|
-
"react": "^18.
|
|
94
|
+
"@types/react": "^18.3.12",
|
|
95
|
+
"react": "^18 || ^19",
|
|
93
96
|
"vue": "^3.x"
|
|
94
97
|
},
|
|
95
98
|
"exports": {
|
|
@@ -139,5 +142,5 @@
|
|
|
139
142
|
"node": ">=20.x",
|
|
140
143
|
"npm": ">=9.x"
|
|
141
144
|
},
|
|
142
|
-
"gitHead": "
|
|
145
|
+
"gitHead": "bf100ac6d05a53acee76944e3de4a7b8766845d8"
|
|
143
146
|
}
|
|
@@ -1,322 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var index = require('../errors/index.js');
|
|
4
|
-
var baseControllers = require('@toruslabs/base-controllers');
|
|
5
|
-
|
|
6
|
-
const INFURA_PROXY_URL = "https://api.web3auth.io/infura-service/v1";
|
|
7
|
-
const getDefaultNetworkId = chainNamespace => {
|
|
8
|
-
if (chainNamespace === baseControllers.CHAIN_NAMESPACES.EIP155) {
|
|
9
|
-
return 1;
|
|
10
|
-
}
|
|
11
|
-
if (chainNamespace === baseControllers.CHAIN_NAMESPACES.SOLANA) {
|
|
12
|
-
return 1;
|
|
13
|
-
}
|
|
14
|
-
if (chainNamespace === baseControllers.CHAIN_NAMESPACES.XRPL) {
|
|
15
|
-
return 1;
|
|
16
|
-
}
|
|
17
|
-
throw index.WalletInitializationError.invalidParams(`Chain namespace ${chainNamespace} is not supported`);
|
|
18
|
-
};
|
|
19
|
-
// TODO: remove this function and get this from dashboard instead
|
|
20
|
-
const getEvmChainConfig = (chainId, web3AuthClientId = "") => {
|
|
21
|
-
const chainNamespace = baseControllers.CHAIN_NAMESPACES.EIP155;
|
|
22
|
-
const infuraRpcTarget = `${INFURA_PROXY_URL}/${chainId}/${web3AuthClientId}`;
|
|
23
|
-
if (chainId === 1) {
|
|
24
|
-
return {
|
|
25
|
-
logo: "https://images.toruswallet.io/eth.svg",
|
|
26
|
-
chainNamespace,
|
|
27
|
-
chainId: "0x1",
|
|
28
|
-
rpcTarget: infuraRpcTarget,
|
|
29
|
-
displayName: "Ethereum Mainnet",
|
|
30
|
-
blockExplorerUrl: "https://etherscan.io/",
|
|
31
|
-
ticker: "ETH",
|
|
32
|
-
tickerName: "Ethereum",
|
|
33
|
-
decimals: 18
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
if (chainId === 10) {
|
|
37
|
-
return {
|
|
38
|
-
chainNamespace: baseControllers.CHAIN_NAMESPACES.EIP155,
|
|
39
|
-
decimals: 18,
|
|
40
|
-
blockExplorerUrl: "https://optimistic.etherscan.io",
|
|
41
|
-
chainId: "0xa",
|
|
42
|
-
displayName: "Optimism",
|
|
43
|
-
logo: "optimism.svg",
|
|
44
|
-
rpcTarget: infuraRpcTarget,
|
|
45
|
-
ticker: "ETH",
|
|
46
|
-
tickerName: "Ethereum"
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
if (chainId === 8453) {
|
|
50
|
-
return {
|
|
51
|
-
chainNamespace: baseControllers.CHAIN_NAMESPACES.EIP155,
|
|
52
|
-
decimals: 18,
|
|
53
|
-
blockExplorerUrl: "https://basescan.org",
|
|
54
|
-
chainId: "0x2105",
|
|
55
|
-
displayName: "Base",
|
|
56
|
-
logo: "base.svg",
|
|
57
|
-
rpcTarget: infuraRpcTarget,
|
|
58
|
-
ticker: "ETH",
|
|
59
|
-
tickerName: "Ethereum"
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
if (chainId === 42161) {
|
|
63
|
-
return {
|
|
64
|
-
chainNamespace: baseControllers.CHAIN_NAMESPACES.EIP155,
|
|
65
|
-
decimals: 18,
|
|
66
|
-
blockExplorerUrl: "https://arbiscan.io",
|
|
67
|
-
chainId: "0xa4b1",
|
|
68
|
-
displayName: "Arbitrum One",
|
|
69
|
-
logo: "arbitrum.svg",
|
|
70
|
-
rpcTarget: infuraRpcTarget,
|
|
71
|
-
ticker: "ETH",
|
|
72
|
-
tickerName: "Ethereum"
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
if (chainId === 59144) {
|
|
76
|
-
return {
|
|
77
|
-
chainNamespace: baseControllers.CHAIN_NAMESPACES.EIP155,
|
|
78
|
-
decimals: 18,
|
|
79
|
-
blockExplorerUrl: "https://lineascan.build",
|
|
80
|
-
chainId: "0xe708",
|
|
81
|
-
logo: "https://images.toruswallet.io/eth.svg",
|
|
82
|
-
rpcTarget: infuraRpcTarget,
|
|
83
|
-
ticker: "ETH",
|
|
84
|
-
tickerName: "Ethereum"
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
if (chainId === 11155111) {
|
|
88
|
-
return {
|
|
89
|
-
logo: "https://images.toruswallet.io/eth.svg",
|
|
90
|
-
chainNamespace,
|
|
91
|
-
chainId: "0xaa36a7",
|
|
92
|
-
rpcTarget: infuraRpcTarget,
|
|
93
|
-
displayName: "Sepolia Testnet",
|
|
94
|
-
blockExplorerUrl: "https://sepolia.etherscan.io/",
|
|
95
|
-
ticker: "ETH",
|
|
96
|
-
tickerName: "Ethereum",
|
|
97
|
-
decimals: 18
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
|
-
if (chainId === 137) {
|
|
101
|
-
return {
|
|
102
|
-
logo: "https://images.toruswallet.io/polygon.svg",
|
|
103
|
-
chainNamespace,
|
|
104
|
-
chainId: "0x89",
|
|
105
|
-
rpcTarget: infuraRpcTarget,
|
|
106
|
-
displayName: "Polygon Mainnet",
|
|
107
|
-
blockExplorerUrl: "https://polygonscan.com",
|
|
108
|
-
ticker: "POL",
|
|
109
|
-
tickerName: "Polygon Ecosystem Token"
|
|
110
|
-
};
|
|
111
|
-
}
|
|
112
|
-
if (chainId === 80002) {
|
|
113
|
-
return {
|
|
114
|
-
logo: "https://images.toruswallet.io/polygon.svg",
|
|
115
|
-
chainNamespace,
|
|
116
|
-
chainId: "0x13882",
|
|
117
|
-
rpcTarget: infuraRpcTarget,
|
|
118
|
-
displayName: "Polygon Amoy Testnet",
|
|
119
|
-
blockExplorerUrl: "https://www.oklink.com/amoy",
|
|
120
|
-
ticker: "POL",
|
|
121
|
-
tickerName: "Polygon Ecosystem Token",
|
|
122
|
-
decimals: 18
|
|
123
|
-
};
|
|
124
|
-
}
|
|
125
|
-
if (chainId === 56) {
|
|
126
|
-
return {
|
|
127
|
-
logo: "https://images.toruswallet.io/bnb.png",
|
|
128
|
-
chainNamespace,
|
|
129
|
-
chainId: "0x38",
|
|
130
|
-
rpcTarget: infuraRpcTarget,
|
|
131
|
-
displayName: "Binance SmartChain Mainnet",
|
|
132
|
-
blockExplorerUrl: "https://bscscan.com",
|
|
133
|
-
ticker: "BNB",
|
|
134
|
-
tickerName: "Binance SmartChain",
|
|
135
|
-
decimals: 18
|
|
136
|
-
};
|
|
137
|
-
}
|
|
138
|
-
if (chainId === 97) {
|
|
139
|
-
return {
|
|
140
|
-
logo: "https://images.toruswallet.io/bnb.png",
|
|
141
|
-
chainNamespace,
|
|
142
|
-
chainId: "0x61",
|
|
143
|
-
rpcTarget: infuraRpcTarget,
|
|
144
|
-
displayName: "Binance SmartChain Testnet",
|
|
145
|
-
blockExplorerUrl: "https://testnet.bscscan.com",
|
|
146
|
-
ticker: "BNB",
|
|
147
|
-
tickerName: "Binance SmartChain",
|
|
148
|
-
decimals: 18
|
|
149
|
-
};
|
|
150
|
-
}
|
|
151
|
-
if (chainId === 25) {
|
|
152
|
-
return {
|
|
153
|
-
logo: "https://images.toruswallet.io/cro.svg",
|
|
154
|
-
chainNamespace,
|
|
155
|
-
chainId: "0x19",
|
|
156
|
-
rpcTarget: "https://rpc.cronos.org",
|
|
157
|
-
displayName: "Cronos Mainnet",
|
|
158
|
-
blockExplorerUrl: "https://cronoscan.com/",
|
|
159
|
-
ticker: "CRO",
|
|
160
|
-
tickerName: "Cronos"
|
|
161
|
-
};
|
|
162
|
-
}
|
|
163
|
-
if (chainId === 338) {
|
|
164
|
-
return {
|
|
165
|
-
logo: "https://images.toruswallet.io/cro.svg",
|
|
166
|
-
chainNamespace,
|
|
167
|
-
chainId: "0x152",
|
|
168
|
-
rpcTarget: "https://rpc-t3.cronos.org/",
|
|
169
|
-
displayName: "Cronos Testnet",
|
|
170
|
-
blockExplorerUrl: "https://cronoscan.com/",
|
|
171
|
-
ticker: "CRO",
|
|
172
|
-
tickerName: "Cronos",
|
|
173
|
-
decimals: 18
|
|
174
|
-
};
|
|
175
|
-
}
|
|
176
|
-
if (chainId === 8217) {
|
|
177
|
-
return {
|
|
178
|
-
logo: "https://images.toruswallet.io/klay.svg",
|
|
179
|
-
chainNamespace,
|
|
180
|
-
chainId: "0x2019",
|
|
181
|
-
rpcTarget: "https://public-node-api.klaytnapi.com/v1/cypress",
|
|
182
|
-
displayName: "Klaytn Mainnet",
|
|
183
|
-
blockExplorerUrl: "https://scope.klaytn.com",
|
|
184
|
-
ticker: "KLAY",
|
|
185
|
-
tickerName: "Klaytn",
|
|
186
|
-
decimals: 18
|
|
187
|
-
};
|
|
188
|
-
}
|
|
189
|
-
if (chainId === 1946) {
|
|
190
|
-
return {
|
|
191
|
-
chainNamespace: baseControllers.CHAIN_NAMESPACES.EIP155,
|
|
192
|
-
chainId: "0x79a",
|
|
193
|
-
rpcTarget: "https://rpc.minato.soneium.org",
|
|
194
|
-
displayName: "Soneium Minato Testnet",
|
|
195
|
-
blockExplorerUrl: "https://explorer-testnet.soneium.org",
|
|
196
|
-
ticker: "ETH",
|
|
197
|
-
tickerName: "ETH",
|
|
198
|
-
logo: "https://iili.io/2i5xce2.png"
|
|
199
|
-
};
|
|
200
|
-
}
|
|
201
|
-
if (chainId === 1868) {
|
|
202
|
-
return {
|
|
203
|
-
chainNamespace: baseControllers.CHAIN_NAMESPACES.EIP155,
|
|
204
|
-
chainId: "0x74c",
|
|
205
|
-
rpcTarget: "https://rpc.soneium.org",
|
|
206
|
-
displayName: "Soneium Mainnet",
|
|
207
|
-
blockExplorerUrl: "https://soneium.blockscout.com",
|
|
208
|
-
ticker: "ETH",
|
|
209
|
-
tickerName: "ETH",
|
|
210
|
-
logo: "https://iili.io/2i5xce2.png"
|
|
211
|
-
};
|
|
212
|
-
}
|
|
213
|
-
return null;
|
|
214
|
-
};
|
|
215
|
-
const getSolanaChainConfig = chainId => {
|
|
216
|
-
const chainNamespace = baseControllers.CHAIN_NAMESPACES.SOLANA;
|
|
217
|
-
// support both cross chain id and base solana chain id from 1
|
|
218
|
-
if (chainId === 101 || chainId === 1) {
|
|
219
|
-
return {
|
|
220
|
-
logo: "https://images.toruswallet.io/sol.svg",
|
|
221
|
-
chainNamespace,
|
|
222
|
-
chainId: "0x65",
|
|
223
|
-
rpcTarget: "https://api.mainnet-beta.solana.com",
|
|
224
|
-
displayName: "Solana Mainnet",
|
|
225
|
-
blockExplorerUrl: "https://explorer.solana.com",
|
|
226
|
-
ticker: "SOL",
|
|
227
|
-
tickerName: "Solana",
|
|
228
|
-
decimals: 9
|
|
229
|
-
};
|
|
230
|
-
} else if (chainId === 102 || chainId === 2) {
|
|
231
|
-
return {
|
|
232
|
-
logo: "https://images.toruswallet.io/sol.svg",
|
|
233
|
-
chainNamespace,
|
|
234
|
-
chainId: "0x66",
|
|
235
|
-
rpcTarget: "https://api.testnet.solana.com",
|
|
236
|
-
displayName: "Solana Testnet",
|
|
237
|
-
blockExplorerUrl: "https://explorer.solana.com?cluster=testnet",
|
|
238
|
-
ticker: "SOL",
|
|
239
|
-
tickerName: "Solana",
|
|
240
|
-
decimals: 9
|
|
241
|
-
};
|
|
242
|
-
} else if (chainId === 103 || chainId === 3) {
|
|
243
|
-
return {
|
|
244
|
-
logo: "https://images.toruswallet.io/sol.svg",
|
|
245
|
-
chainNamespace,
|
|
246
|
-
chainId: "0x67",
|
|
247
|
-
rpcTarget: "https://api.devnet.solana.com",
|
|
248
|
-
displayName: "Solana Devnet",
|
|
249
|
-
blockExplorerUrl: "https://explorer.solana.com?cluster=devnet",
|
|
250
|
-
ticker: "SOL",
|
|
251
|
-
tickerName: "Solana",
|
|
252
|
-
decimals: 9
|
|
253
|
-
};
|
|
254
|
-
}
|
|
255
|
-
return null;
|
|
256
|
-
};
|
|
257
|
-
const getXrplChainConfig = chainId => {
|
|
258
|
-
const chainNamespace = baseControllers.CHAIN_NAMESPACES.XRPL;
|
|
259
|
-
if (chainId === 1) {
|
|
260
|
-
return {
|
|
261
|
-
chainNamespace,
|
|
262
|
-
decimals: 15,
|
|
263
|
-
chainId: "0x1",
|
|
264
|
-
logo: "https://images.toruswallet.io/XRP.svg",
|
|
265
|
-
rpcTarget: "https://ripple-node.tor.us",
|
|
266
|
-
wsTarget: "wss://s2.ripple.com",
|
|
267
|
-
ticker: "XRP",
|
|
268
|
-
tickerName: "XRPL",
|
|
269
|
-
displayName: "xrpl mainnet",
|
|
270
|
-
blockExplorerUrl: "https://livenet.xrpl.org"
|
|
271
|
-
};
|
|
272
|
-
}
|
|
273
|
-
if (chainId === 2) {
|
|
274
|
-
return {
|
|
275
|
-
chainNamespace,
|
|
276
|
-
decimals: 15,
|
|
277
|
-
chainId: "0x2",
|
|
278
|
-
logo: "https://images.toruswallet.io/XRP.svg",
|
|
279
|
-
rpcTarget: "https://testnet-ripple-node.tor.us",
|
|
280
|
-
wsTarget: "wss://s.altnet.rippletest.net",
|
|
281
|
-
ticker: "XRP",
|
|
282
|
-
tickerName: "XRPL",
|
|
283
|
-
displayName: "xrpl testnet",
|
|
284
|
-
blockExplorerUrl: "https://testnet.xrpl.org",
|
|
285
|
-
isTestnet: true
|
|
286
|
-
};
|
|
287
|
-
}
|
|
288
|
-
if (chainId === 3) {
|
|
289
|
-
return {
|
|
290
|
-
chainNamespace,
|
|
291
|
-
decimals: 15,
|
|
292
|
-
chainId: "0x3",
|
|
293
|
-
logo: "https://images.toruswallet.io/XRP.svg",
|
|
294
|
-
rpcTarget: "https://devnet-ripple-node.tor.us",
|
|
295
|
-
wsTarget: "wss://s.devnet.rippletest.net/",
|
|
296
|
-
ticker: "XRP",
|
|
297
|
-
tickerName: "XRPL",
|
|
298
|
-
displayName: "xrpl devnet",
|
|
299
|
-
blockExplorerUrl: "https://devnet.xrpl.org",
|
|
300
|
-
isTestnet: true
|
|
301
|
-
};
|
|
302
|
-
}
|
|
303
|
-
return null;
|
|
304
|
-
};
|
|
305
|
-
const getChainConfig = (chainNamespace, chainId, web3AuthClientId) => {
|
|
306
|
-
if (chainNamespace === baseControllers.CHAIN_NAMESPACES.OTHER) return null;
|
|
307
|
-
const finalChainId = chainId ? typeof chainId === "number" ? chainId : parseInt(chainId, 16) : getDefaultNetworkId(chainNamespace);
|
|
308
|
-
if (chainNamespace === baseControllers.CHAIN_NAMESPACES.EIP155) {
|
|
309
|
-
return getEvmChainConfig(finalChainId, web3AuthClientId);
|
|
310
|
-
} else if (chainNamespace === baseControllers.CHAIN_NAMESPACES.SOLANA) {
|
|
311
|
-
return getSolanaChainConfig(finalChainId);
|
|
312
|
-
}
|
|
313
|
-
if (chainNamespace === baseControllers.CHAIN_NAMESPACES.XRPL) {
|
|
314
|
-
return getXrplChainConfig(finalChainId);
|
|
315
|
-
}
|
|
316
|
-
return null;
|
|
317
|
-
};
|
|
318
|
-
|
|
319
|
-
exports.getChainConfig = getChainConfig;
|
|
320
|
-
exports.getEvmChainConfig = getEvmChainConfig;
|
|
321
|
-
exports.getSolanaChainConfig = getSolanaChainConfig;
|
|
322
|
-
exports.getXrplChainConfig = getXrplChainConfig;
|
|
@@ -1,216 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var auth = require('@web3auth/auth');
|
|
4
|
-
var configBuild = require('./config-build.js');
|
|
5
|
-
var configEnv = require('./config-env.js');
|
|
6
|
-
|
|
7
|
-
const getAuthConnectionConfig = (environment, network) => {
|
|
8
|
-
const currentConfigEnv = configEnv.configEnv[network];
|
|
9
|
-
const currentBuildEnv = configBuild.configBuild[environment];
|
|
10
|
-
if (!currentConfigEnv || !currentBuildEnv) {
|
|
11
|
-
throw new Error("Invalid environment settings");
|
|
12
|
-
}
|
|
13
|
-
return [{
|
|
14
|
-
authConnectionId: currentConfigEnv.verifierSubIdentifier || currentConfigEnv.googleVerifier,
|
|
15
|
-
authConnection: auth.AUTH_CONNECTION.GOOGLE,
|
|
16
|
-
name: auth.AUTH_CONNECTION.GOOGLE,
|
|
17
|
-
description: "login.verifier-google-desc",
|
|
18
|
-
clientId: currentConfigEnv.googleClientId,
|
|
19
|
-
groupedAuthConnectionId: currentConfigEnv.verifierSubIdentifier ? currentConfigEnv.googleVerifier : "",
|
|
20
|
-
mainOption: true,
|
|
21
|
-
// For torus only
|
|
22
|
-
walletAuthConnectionId: currentConfigEnv.walletGoogleVerifier
|
|
23
|
-
}, {
|
|
24
|
-
authConnectionId: currentConfigEnv.verifierSubIdentifier || currentConfigEnv.facebookVerifier,
|
|
25
|
-
authConnection: auth.AUTH_CONNECTION.FACEBOOK,
|
|
26
|
-
name: auth.AUTH_CONNECTION.FACEBOOK,
|
|
27
|
-
description: "",
|
|
28
|
-
clientId: currentConfigEnv.facebookClientId,
|
|
29
|
-
groupedAuthConnectionId: currentConfigEnv.verifierSubIdentifier ? currentConfigEnv.facebookVerifier : "",
|
|
30
|
-
mainOption: true,
|
|
31
|
-
// For torus only
|
|
32
|
-
walletAuthConnectionId: currentConfigEnv.walletFacebookVerifier
|
|
33
|
-
}, {
|
|
34
|
-
authConnectionId: currentConfigEnv.verifierSubIdentifier || currentConfigEnv.twitterVerifier,
|
|
35
|
-
authConnection: auth.AUTH_CONNECTION.TWITTER,
|
|
36
|
-
name: auth.AUTH_CONNECTION.TWITTER,
|
|
37
|
-
description: "",
|
|
38
|
-
clientId: currentConfigEnv.twitterClientId,
|
|
39
|
-
groupedAuthConnectionId: currentConfigEnv.verifierSubIdentifier ? currentConfigEnv.twitterVerifier : "",
|
|
40
|
-
mainOption: true,
|
|
41
|
-
jwtParameters: {
|
|
42
|
-
domain: currentConfigEnv.loginDomain,
|
|
43
|
-
connection: "twitter",
|
|
44
|
-
isUserIdCaseSensitive: false
|
|
45
|
-
},
|
|
46
|
-
// For torus only
|
|
47
|
-
walletAuthConnectionId: currentConfigEnv.walletTwitterVerifier
|
|
48
|
-
}, {
|
|
49
|
-
authConnectionId: currentConfigEnv.verifierSubIdentifier || currentConfigEnv.discordVerifier,
|
|
50
|
-
authConnection: auth.AUTH_CONNECTION.DISCORD,
|
|
51
|
-
name: auth.AUTH_CONNECTION.DISCORD,
|
|
52
|
-
description: "",
|
|
53
|
-
clientId: currentConfigEnv.discordClientId,
|
|
54
|
-
groupedAuthConnectionId: currentConfigEnv.verifierSubIdentifier ? currentConfigEnv.discordVerifier : "",
|
|
55
|
-
// For torus only
|
|
56
|
-
walletAuthConnectionId: currentConfigEnv.walletDiscordVerifier
|
|
57
|
-
}, {
|
|
58
|
-
authConnectionId: currentConfigEnv.verifierSubIdentifier || currentConfigEnv.lineVerifier,
|
|
59
|
-
authConnection: auth.AUTH_CONNECTION.LINE,
|
|
60
|
-
name: auth.AUTH_CONNECTION.LINE,
|
|
61
|
-
description: "",
|
|
62
|
-
clientId: currentConfigEnv.lineClientId,
|
|
63
|
-
groupedAuthConnectionId: currentConfigEnv.verifierSubIdentifier ? currentConfigEnv.lineVerifier : "",
|
|
64
|
-
mainOption: false,
|
|
65
|
-
jwtParameters: {
|
|
66
|
-
domain: currentConfigEnv.loginDomain,
|
|
67
|
-
connection: "line",
|
|
68
|
-
prompt: "consent"
|
|
69
|
-
},
|
|
70
|
-
// For torus only
|
|
71
|
-
walletAuthConnectionId: currentConfigEnv.walletLineVerifier
|
|
72
|
-
}, {
|
|
73
|
-
authConnectionId: currentConfigEnv.verifierSubIdentifier || currentConfigEnv.redditVerifier,
|
|
74
|
-
authConnection: auth.AUTH_CONNECTION.REDDIT,
|
|
75
|
-
name: auth.AUTH_CONNECTION.REDDIT,
|
|
76
|
-
description: "",
|
|
77
|
-
clientId: currentConfigEnv.redditClientId,
|
|
78
|
-
groupedAuthConnectionId: currentConfigEnv.verifierSubIdentifier ? currentConfigEnv.redditVerifier : "",
|
|
79
|
-
mainOption: false,
|
|
80
|
-
jwtParameters: {
|
|
81
|
-
domain: currentConfigEnv.loginDomain,
|
|
82
|
-
userIdField: "name",
|
|
83
|
-
connection: "Reddit"
|
|
84
|
-
},
|
|
85
|
-
// For torus only
|
|
86
|
-
walletAuthConnectionId: currentConfigEnv.walletRedditVerifier
|
|
87
|
-
}, {
|
|
88
|
-
authConnectionId: currentConfigEnv.verifierSubIdentifier || currentConfigEnv.appleVerifier,
|
|
89
|
-
authConnection: auth.AUTH_CONNECTION.APPLE,
|
|
90
|
-
name: auth.AUTH_CONNECTION.APPLE,
|
|
91
|
-
description: "",
|
|
92
|
-
clientId: currentConfigEnv.appleClientId,
|
|
93
|
-
groupedAuthConnectionId: currentConfigEnv.verifierSubIdentifier ? currentConfigEnv.appleVerifier : "",
|
|
94
|
-
mainOption: false,
|
|
95
|
-
jwtParameters: {
|
|
96
|
-
domain: currentConfigEnv.loginDomain,
|
|
97
|
-
connection: "apple"
|
|
98
|
-
},
|
|
99
|
-
// For torus only
|
|
100
|
-
walletAuthConnectionId: currentConfigEnv.walletAppleVerifier
|
|
101
|
-
}, {
|
|
102
|
-
authConnectionId: currentConfigEnv.verifierSubIdentifier || currentConfigEnv.githubVerifier,
|
|
103
|
-
authConnection: auth.AUTH_CONNECTION.GITHUB,
|
|
104
|
-
description: "",
|
|
105
|
-
name: auth.AUTH_CONNECTION.GITHUB,
|
|
106
|
-
clientId: currentConfigEnv.githubClientId,
|
|
107
|
-
groupedAuthConnectionId: currentConfigEnv.verifierSubIdentifier ? currentConfigEnv.githubVerifier : "",
|
|
108
|
-
mainOption: false,
|
|
109
|
-
jwtParameters: {
|
|
110
|
-
domain: currentConfigEnv.loginDomain,
|
|
111
|
-
connection: "github",
|
|
112
|
-
isUserIdCaseSensitive: false
|
|
113
|
-
},
|
|
114
|
-
// For torus only
|
|
115
|
-
walletAuthConnectionId: currentConfigEnv.walletGithubVerifier
|
|
116
|
-
}, {
|
|
117
|
-
authConnectionId: currentConfigEnv.verifierSubIdentifier || currentConfigEnv.twitchVerifier,
|
|
118
|
-
authConnection: auth.AUTH_CONNECTION.TWITCH,
|
|
119
|
-
description: "",
|
|
120
|
-
name: auth.AUTH_CONNECTION.TWITCH,
|
|
121
|
-
clientId: currentConfigEnv.twitchClientId,
|
|
122
|
-
groupedAuthConnectionId: currentConfigEnv.verifierSubIdentifier ? currentConfigEnv.twitchVerifier : "",
|
|
123
|
-
mainOption: false,
|
|
124
|
-
// For torus only
|
|
125
|
-
walletAuthConnectionId: currentConfigEnv.walletTwitchVerifier
|
|
126
|
-
}, {
|
|
127
|
-
authConnectionId: currentConfigEnv.verifierSubIdentifier || currentConfigEnv.linkedinVerifier,
|
|
128
|
-
authConnection: auth.AUTH_CONNECTION.LINKEDIN,
|
|
129
|
-
description: "",
|
|
130
|
-
name: auth.AUTH_CONNECTION.LINKEDIN,
|
|
131
|
-
clientId: currentConfigEnv.linkedinClientId,
|
|
132
|
-
groupedAuthConnectionId: currentConfigEnv.verifierSubIdentifier ? currentConfigEnv.linkedinVerifier : "",
|
|
133
|
-
mainOption: false,
|
|
134
|
-
jwtParameters: {
|
|
135
|
-
domain: currentConfigEnv.loginDomain,
|
|
136
|
-
connection: "linkedin"
|
|
137
|
-
},
|
|
138
|
-
// For torus only
|
|
139
|
-
walletAuthConnectionId: currentConfigEnv.walletLinkedinVerifier
|
|
140
|
-
}, {
|
|
141
|
-
authConnectionId: currentConfigEnv.verifierSubIdentifier || currentConfigEnv.wechatVerifier,
|
|
142
|
-
authConnection: auth.AUTH_CONNECTION.WECHAT,
|
|
143
|
-
description: "",
|
|
144
|
-
name: auth.AUTH_CONNECTION.WECHAT,
|
|
145
|
-
clientId: currentConfigEnv.wechatClientId,
|
|
146
|
-
groupedAuthConnectionId: currentConfigEnv.verifierSubIdentifier ? currentConfigEnv.wechatVerifier : "",
|
|
147
|
-
mainOption: false,
|
|
148
|
-
showOnSocialBackupFactor: true,
|
|
149
|
-
jwtParameters: {
|
|
150
|
-
domain: currentConfigEnv.loginDomain,
|
|
151
|
-
connection: "Wechat"
|
|
152
|
-
},
|
|
153
|
-
// For torus only
|
|
154
|
-
walletAuthConnectionId: currentConfigEnv.walletWechatVerifier
|
|
155
|
-
}, {
|
|
156
|
-
authConnectionId: currentConfigEnv.verifierSubIdentifier || currentConfigEnv.kakaoVerifier,
|
|
157
|
-
authConnection: auth.AUTH_CONNECTION.KAKAO,
|
|
158
|
-
description: "",
|
|
159
|
-
name: auth.AUTH_CONNECTION.KAKAO,
|
|
160
|
-
clientId: currentConfigEnv.kakaoClientId,
|
|
161
|
-
groupedAuthConnectionId: currentConfigEnv.verifierSubIdentifier ? currentConfigEnv.kakaoVerifier : "",
|
|
162
|
-
mainOption: false,
|
|
163
|
-
jwtParameters: {
|
|
164
|
-
domain: currentConfigEnv.loginDomain,
|
|
165
|
-
connection: "Kakao"
|
|
166
|
-
},
|
|
167
|
-
// For torus only
|
|
168
|
-
walletAuthConnectionId: currentConfigEnv.walletKakaoVerifier
|
|
169
|
-
}, {
|
|
170
|
-
authConnectionId: currentConfigEnv.verifierSubIdentifier || currentConfigEnv.hostedEmailPasswordlessVerifier,
|
|
171
|
-
description: "login.verifier-email-desc",
|
|
172
|
-
authConnection: auth.AUTH_CONNECTION.EMAIL_PASSWORDLESS,
|
|
173
|
-
name: "email",
|
|
174
|
-
clientId: currentConfigEnv.hostedEmailPasswordlessClientId,
|
|
175
|
-
groupedAuthConnectionId: currentConfigEnv.verifierSubIdentifier ? currentConfigEnv.hostedEmailPasswordlessVerifier : "",
|
|
176
|
-
mainOption: false,
|
|
177
|
-
jwtParameters: {
|
|
178
|
-
domain: currentBuildEnv.passwordlessHost,
|
|
179
|
-
userIdField: "name",
|
|
180
|
-
isUserIdCaseSensitive: false,
|
|
181
|
-
flow_type: auth.EMAIL_FLOW.code
|
|
182
|
-
},
|
|
183
|
-
// For torus only
|
|
184
|
-
walletAuthConnectionId: currentConfigEnv.walletHostedEmailPasswordlessVerifier
|
|
185
|
-
}, {
|
|
186
|
-
authConnectionId: currentConfigEnv.verifierSubIdentifier || currentConfigEnv.hostedSmsPasswordlessVerifier,
|
|
187
|
-
description: "login.verifier-sms-desc-2",
|
|
188
|
-
authConnection: auth.AUTH_CONNECTION.SMS_PASSWORDLESS,
|
|
189
|
-
name: "mobile",
|
|
190
|
-
clientId: currentConfigEnv.hostedSmsPasswordlessClientId,
|
|
191
|
-
groupedAuthConnectionId: currentConfigEnv.verifierSubIdentifier ? currentConfigEnv.hostedSmsPasswordlessVerifier : "",
|
|
192
|
-
mainOption: false,
|
|
193
|
-
jwtParameters: {
|
|
194
|
-
domain: currentBuildEnv.passwordlessHost,
|
|
195
|
-
userIdField: "name",
|
|
196
|
-
isVerifierIdCaseSensitive: false
|
|
197
|
-
},
|
|
198
|
-
// for torus only.
|
|
199
|
-
walletAuthConnectionId: currentConfigEnv.walletHostedSmsPasswordlessVerifier
|
|
200
|
-
}, {
|
|
201
|
-
authConnectionId: currentConfigEnv.verifierSubIdentifier || currentConfigEnv.hostedFarcasterVerifier,
|
|
202
|
-
description: "",
|
|
203
|
-
authConnection: auth.AUTH_CONNECTION.FARCASTER,
|
|
204
|
-
name: "Farcaster",
|
|
205
|
-
clientId: currentConfigEnv.hostedFarcasterClientId,
|
|
206
|
-
groupedAuthConnectionId: currentConfigEnv.verifierSubIdentifier ? currentConfigEnv.hostedFarcasterVerifier : "",
|
|
207
|
-
mainOption: false,
|
|
208
|
-
jwtParameters: {
|
|
209
|
-
domain: currentConfigEnv.farcasterLoginDomain
|
|
210
|
-
},
|
|
211
|
-
// For torus only
|
|
212
|
-
walletAuthConnectionId: ""
|
|
213
|
-
}];
|
|
214
|
-
};
|
|
215
|
-
|
|
216
|
-
exports.getAuthConnectionConfig = getAuthConnectionConfig;
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var auth = require('@web3auth/auth');
|
|
4
|
-
|
|
5
|
-
// Passwordless backend service
|
|
6
|
-
const PASSWORDLESS_SERVER_API_URL = "https://api.web3auth.io/passwordless-service";
|
|
7
|
-
const DEVELOP_PASSWORDLESS_SERVER_API_URL = "https://api-develop.web3auth.io/passwordless-service";
|
|
8
|
-
// Auth backend service
|
|
9
|
-
const AUTH_SERVER_URL = "https://api.web3auth.io/auth-service";
|
|
10
|
-
const DEVELOP_AUTH_SERVER_URL = "https://api-develop.web3auth.io/auth-service";
|
|
11
|
-
const configBuild = {
|
|
12
|
-
[auth.BUILD_ENV.DEVELOPMENT]: {
|
|
13
|
-
apiHost: `${DEVELOP_AUTH_SERVER_URL}`,
|
|
14
|
-
logLevel: "debug",
|
|
15
|
-
passwordlessBackendHost: `${DEVELOP_PASSWORDLESS_SERVER_API_URL}/api/v3/`,
|
|
16
|
-
passwordlessHost: "https://develop-passwordless.web3auth.io",
|
|
17
|
-
sentrySampleRate: "0",
|
|
18
|
-
sentryTransactionSampleRate: "0",
|
|
19
|
-
supportsVersioning: false
|
|
20
|
-
},
|
|
21
|
-
[auth.BUILD_ENV.STAGING]: {
|
|
22
|
-
apiHost: AUTH_SERVER_URL,
|
|
23
|
-
logLevel: "debug",
|
|
24
|
-
passwordlessBackendHost: `${PASSWORDLESS_SERVER_API_URL}/api/v3/`,
|
|
25
|
-
passwordlessHost: "https://staging-passwordless.web3auth.io/v6",
|
|
26
|
-
sentrySampleRate: "0.1",
|
|
27
|
-
sentryTransactionSampleRate: "0.1",
|
|
28
|
-
supportsVersioning: true
|
|
29
|
-
},
|
|
30
|
-
[auth.BUILD_ENV.PRODUCTION]: {
|
|
31
|
-
apiHost: AUTH_SERVER_URL,
|
|
32
|
-
logLevel: "error",
|
|
33
|
-
passwordlessBackendHost: `${PASSWORDLESS_SERVER_API_URL}/api/v3/`,
|
|
34
|
-
passwordlessHost: "https://passwordless.web3auth.io/v6",
|
|
35
|
-
sentrySampleRate: "0.5",
|
|
36
|
-
sentryTransactionSampleRate: "0.001",
|
|
37
|
-
supportsVersioning: true
|
|
38
|
-
},
|
|
39
|
-
[auth.BUILD_ENV.TESTING]: {
|
|
40
|
-
apiHost: DEVELOP_AUTH_SERVER_URL,
|
|
41
|
-
logLevel: "debug",
|
|
42
|
-
passwordlessBackendHost: `${DEVELOP_PASSWORDLESS_SERVER_API_URL}/api/v3/`,
|
|
43
|
-
passwordlessHost: "https://develop-passwordless.web3auth.io",
|
|
44
|
-
sentrySampleRate: "1",
|
|
45
|
-
sentryTransactionSampleRate: "0.1",
|
|
46
|
-
supportsVersioning: false
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
exports.AUTH_SERVER_URL = AUTH_SERVER_URL;
|
|
51
|
-
exports.DEVELOP_AUTH_SERVER_URL = DEVELOP_AUTH_SERVER_URL;
|
|
52
|
-
exports.DEVELOP_PASSWORDLESS_SERVER_API_URL = DEVELOP_PASSWORDLESS_SERVER_API_URL;
|
|
53
|
-
exports.PASSWORDLESS_SERVER_API_URL = PASSWORDLESS_SERVER_API_URL;
|
|
54
|
-
exports.configBuild = configBuild;
|