@dynamic-labs/multi-wallet 0.17.0-RC.8 → 0.17.0-RC.9
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/CHANGELOG.md +15 -0
- package/package.json +7 -12
- package/src/index.cjs +0 -44
- package/src/index.d.ts +0 -11
- package/src/index.js +1 -16
- package/src/multi-wallet.cjs +16 -64
- package/src/multi-wallet.d.ts +0 -1
- package/src/multi-wallet.js +12 -59
- package/src/types.d.ts +0 -2
- package/src/utils/message.cjs +1 -2
- package/src/utils/message.js +1 -2
- package/src/wallets/constants.cjs +0 -2
- package/src/wallets/constants.js +1 -2
- package/src/wallets/cosmos/KeplrWalletConnect.cjs +4 -6
- package/src/wallets/cosmos/KeplrWalletConnect.d.ts +4 -1
- package/src/wallets/cosmos/KeplrWalletConnect.js +2 -4
- package/src/wallets/cosmos/KeplrWalletConnector.d.ts +1 -2
- package/src/wallets/cosmos/wcClient.lib.cjs +45 -4
- package/src/wallets/cosmos/wcClient.lib.js +42 -3
- package/src/wallets/flow/lilico.cjs +2 -2
- package/src/wallets/flow/lilico.js +1 -1
- package/src/wallets/solana/phantom.cjs +3 -3
- package/src/wallets/solana/phantom.js +1 -1
- package/src/wallets/solana/solProviderHelper.cjs +3 -4
- package/src/wallets/solana/solProviderHelper.d.ts +3 -3
- package/src/wallets/solana/solProviderHelper.js +1 -2
- package/src/wallets/starknet/braavos.cjs +2 -2
- package/src/wallets/starknet/braavos.js +1 -1
- package/src/wallets/window.d.ts +10 -22
- package/src/utils/assignConfirmationScreenToProvider/assignConfirmationScreenToProvider.cjs +0 -54
- package/src/utils/assignConfirmationScreenToProvider/assignConfirmationScreenToProvider.d.ts +0 -3
- package/src/utils/assignConfirmationScreenToProvider/assignConfirmationScreenToProvider.js +0 -50
- package/src/utils/assignConfirmationScreenToProvider/index.d.ts +0 -1
- package/src/utils/encoding.cjs +0 -18
- package/src/utils/encoding.d.ts +0 -4
- package/src/utils/encoding.js +0 -12
- package/src/utils/getChainInfo/getChainInfo.cjs +0 -59
- package/src/utils/getChainInfo/getChainInfo.d.ts +0 -2
- package/src/utils/getChainInfo/getChainInfo.js +0 -55
- package/src/utils/getChainInfo/index.d.ts +0 -1
- package/src/utils/getWalletConnectorByName.cjs +0 -19
- package/src/utils/getWalletConnectorByName.d.ts +0 -2
- package/src/utils/getWalletConnectorByName.js +0 -15
- package/src/utils/isEmailOTPWalletConnector/index.d.ts +0 -1
- package/src/utils/isEmailOTPWalletConnector/isEmailOTPWalletConnector.cjs +0 -7
- package/src/utils/isEmailOTPWalletConnector/isEmailOTPWalletConnector.d.ts +0 -2
- package/src/utils/isEmailOTPWalletConnector/isEmailOTPWalletConnector.js +0 -3
- package/src/utils/isEmailWalletConnector/index.d.ts +0 -1
- package/src/utils/isEmailWalletConnector/isEmailWalletConnector.cjs +0 -7
- package/src/utils/isEmailWalletConnector/isEmailWalletConnector.d.ts +0 -2
- package/src/utils/isEmailWalletConnector/isEmailWalletConnector.js +0 -3
- package/src/utils/isFunction/index.d.ts +0 -1
- package/src/utils/isFunction/isFunction.cjs +0 -8
- package/src/utils/isFunction/isFunction.d.ts +0 -1
- package/src/utils/isFunction/isFunction.js +0 -4
- package/src/utils/isMobile.cjs +0 -54
- package/src/utils/isMobile.d.ts +0 -13
- package/src/utils/isMobile.js +0 -46
- package/src/utils/isSameAddress/index.d.ts +0 -1
- package/src/utils/isSameAddress/isSameAddress.cjs +0 -9
- package/src/utils/isSameAddress/isSameAddress.d.ts +0 -1
- package/src/utils/isSameAddress/isSameAddress.js +0 -5
- package/src/utils/isSameAddress/utils/index.d.ts +0 -1
- package/src/utils/isSameAddress/utils/normalizeAddress/index.d.ts +0 -1
- package/src/utils/isSameAddress/utils/normalizeAddress/normalizeAddress.cjs +0 -17
- package/src/utils/isSameAddress/utils/normalizeAddress/normalizeAddress.d.ts +0 -1
- package/src/utils/isSameAddress/utils/normalizeAddress/normalizeAddress.js +0 -13
- package/src/utils/isSocialWalletConnector/index.d.ts +0 -1
- package/src/utils/isSocialWalletConnector/isSocialWalletConnector.cjs +0 -7
- package/src/utils/isSocialWalletConnector/isSocialWalletConnector.d.ts +0 -2
- package/src/utils/isSocialWalletConnector/isSocialWalletConnector.js +0 -3
- package/src/utils/isUnsupportedProviderError/index.d.ts +0 -1
- package/src/utils/isUnsupportedProviderError/isUnsupportedProviderError.cjs +0 -13
- package/src/utils/isUnsupportedProviderError/isUnsupportedProviderError.d.ts +0 -6
- package/src/utils/isUnsupportedProviderError/isUnsupportedProviderError.js +0 -9
- package/src/utils/normalizeWalletName/index.d.ts +0 -1
- package/src/utils/normalizeWalletName/normalizeWalletName.cjs +0 -7
- package/src/utils/normalizeWalletName/normalizeWalletName.d.ts +0 -1
- package/src/utils/normalizeWalletName/normalizeWalletName.js +0 -3
- package/src/utils/shouldLowercaseAddress.cjs +0 -11
- package/src/utils/shouldLowercaseAddress.d.ts +0 -1
- package/src/utils/shouldLowercaseAddress.js +0 -7
- package/src/utils/walletConnect.cjs +0 -33
- package/src/utils/walletConnect.d.ts +0 -4
- package/src/utils/walletConnect.js +0 -29
- package/src/wallets/ProviderLookup.cjs +0 -18
- package/src/wallets/ProviderLookup.d.ts +0 -4
- package/src/wallets/ProviderLookup.js +0 -14
- package/src/wallets/clients/coinbase/coinbase.cjs +0 -73
- package/src/wallets/clients/coinbase/coinbase.d.ts +0 -6
- package/src/wallets/clients/coinbase/coinbase.js +0 -66
- package/src/wallets/clients/coinbase/index.d.ts +0 -2
- package/src/wallets/clients/coinbase/types.d.ts +0 -14
- package/src/wallets/clients/walletConnect/index.d.ts +0 -1
- package/src/wallets/clients/walletConnect/types.d.ts +0 -4
- package/src/wallets/clients/walletConnect/walletConnect.cjs +0 -229
- package/src/wallets/clients/walletConnect/walletConnect.d.ts +0 -21
- package/src/wallets/clients/walletConnect/walletConnect.js +0 -213
- package/src/wallets/ethereum/BloctoEvm.cjs +0 -109
- package/src/wallets/ethereum/BloctoEvm.d.ts +0 -20
- package/src/wallets/ethereum/BloctoEvm.js +0 -103
- package/src/wallets/ethereum/EthWalletConnector.cjs +0 -206
- package/src/wallets/ethereum/EthWalletConnector.d.ts +0 -39
- package/src/wallets/ethereum/EthWalletConnector.js +0 -202
- package/src/wallets/ethereum/MagicConnector/EmailMagicWalletConnector/EmailMagicWalletConnector.cjs +0 -61
- package/src/wallets/ethereum/MagicConnector/EmailMagicWalletConnector/EmailMagicWalletConnector.d.ts +0 -12
- package/src/wallets/ethereum/MagicConnector/EmailMagicWalletConnector/EmailMagicWalletConnector.js +0 -57
- package/src/wallets/ethereum/MagicConnector/EmailMagicWalletConnector/index.d.ts +0 -1
- package/src/wallets/ethereum/MagicConnector/EmailOTPMagicWalletConnector/EmailOTPMagicWalletConnector.cjs +0 -62
- package/src/wallets/ethereum/MagicConnector/EmailOTPMagicWalletConnector/EmailOTPMagicWalletConnector.d.ts +0 -11
- package/src/wallets/ethereum/MagicConnector/EmailOTPMagicWalletConnector/EmailOTPMagicWalletConnector.js +0 -58
- package/src/wallets/ethereum/MagicConnector/EmailOTPMagicWalletConnector/index.d.ts +0 -1
- package/src/wallets/ethereum/MagicConnector/MagicClientNetworkHandler/MagicClientNetworkHandler.cjs +0 -78
- package/src/wallets/ethereum/MagicConnector/MagicClientNetworkHandler/MagicClientNetworkHandler.d.ts +0 -31
- package/src/wallets/ethereum/MagicConnector/MagicClientNetworkHandler/MagicClientNetworkHandler.js +0 -74
- package/src/wallets/ethereum/MagicConnector/MagicClientNetworkHandler/index.d.ts +0 -2
- package/src/wallets/ethereum/MagicConnector/MagicSocialWalletConnector/MagicSocialWalletConnector.cjs +0 -61
- package/src/wallets/ethereum/MagicConnector/MagicSocialWalletConnector/MagicSocialWalletConnector.d.ts +0 -12
- package/src/wallets/ethereum/MagicConnector/MagicSocialWalletConnector/MagicSocialWalletConnector.js +0 -57
- package/src/wallets/ethereum/MagicConnector/MagicSocialWalletConnector/index.d.ts +0 -1
- package/src/wallets/ethereum/MagicConnector/MagicWalletConnector/MagicWalletConnector.cjs +0 -179
- package/src/wallets/ethereum/MagicConnector/MagicWalletConnector/MagicWalletConnector.d.ts +0 -54
- package/src/wallets/ethereum/MagicConnector/MagicWalletConnector/MagicWalletConnector.js +0 -175
- package/src/wallets/ethereum/MagicConnector/MagicWalletConnector/index.d.ts +0 -2
- package/src/wallets/ethereum/MagicConnector/index.d.ts +0 -5
- package/src/wallets/ethereum/coinbase.cjs +0 -63
- package/src/wallets/ethereum/coinbase.d.ts +0 -22
- package/src/wallets/ethereum/coinbase.js +0 -61
- package/src/wallets/ethereum/ethProviderHelper.cjs +0 -199
- package/src/wallets/ethereum/ethProviderHelper.d.ts +0 -33
- package/src/wallets/ethereum/ethProviderHelper.js +0 -195
- package/src/wallets/ethereum/evm-network.cjs +0 -20
- package/src/wallets/ethereum/evm-network.d.ts +0 -6
- package/src/wallets/ethereum/evm-network.js +0 -16
- package/src/wallets/ethereum/injected/BloctoInjected.cjs +0 -12
- package/src/wallets/ethereum/injected/BloctoInjected.d.ts +0 -5
- package/src/wallets/ethereum/injected/BloctoInjected.js +0 -10
- package/src/wallets/ethereum/injected/BraveEvm.cjs +0 -12
- package/src/wallets/ethereum/injected/BraveEvm.d.ts +0 -5
- package/src/wallets/ethereum/injected/BraveEvm.js +0 -10
- package/src/wallets/ethereum/injected/Dawn.cjs +0 -12
- package/src/wallets/ethereum/injected/Dawn.d.ts +0 -5
- package/src/wallets/ethereum/injected/Dawn.js +0 -10
- package/src/wallets/ethereum/injected/ExodusEvm.cjs +0 -12
- package/src/wallets/ethereum/injected/ExodusEvm.d.ts +0 -5
- package/src/wallets/ethereum/injected/ExodusEvm.js +0 -10
- package/src/wallets/ethereum/injected/Frame.cjs +0 -12
- package/src/wallets/ethereum/injected/Frame.d.ts +0 -5
- package/src/wallets/ethereum/injected/Frame.js +0 -10
- package/src/wallets/ethereum/injected/GameStop.cjs +0 -12
- package/src/wallets/ethereum/injected/GameStop.d.ts +0 -5
- package/src/wallets/ethereum/injected/GameStop.js +0 -10
- package/src/wallets/ethereum/injected/InjectedWalletBase.cjs +0 -74
- package/src/wallets/ethereum/injected/InjectedWalletBase.d.ts +0 -24
- package/src/wallets/ethereum/injected/InjectedWalletBase.js +0 -72
- package/src/wallets/ethereum/injected/MetaMask.cjs +0 -13
- package/src/wallets/ethereum/injected/MetaMask.d.ts +0 -6
- package/src/wallets/ethereum/injected/MetaMask.js +0 -11
- package/src/wallets/ethereum/injected/Opera.cjs +0 -12
- package/src/wallets/ethereum/injected/Opera.d.ts +0 -5
- package/src/wallets/ethereum/injected/Opera.js +0 -10
- package/src/wallets/ethereum/injected/PhantomEvm.cjs +0 -36
- package/src/wallets/ethereum/injected/PhantomEvm.d.ts +0 -6
- package/src/wallets/ethereum/injected/PhantomEvm.js +0 -34
- package/src/wallets/ethereum/injected/Trust.cjs +0 -13
- package/src/wallets/ethereum/injected/Trust.d.ts +0 -6
- package/src/wallets/ethereum/injected/Trust.js +0 -11
- package/src/wallets/ethereum/injected/UnknownInjectedWallet.cjs +0 -12
- package/src/wallets/ethereum/injected/UnknownInjectedWallet.d.ts +0 -5
- package/src/wallets/ethereum/injected/UnknownInjectedWallet.js +0 -10
- package/src/wallets/ethereum/injected/Zerion.cjs +0 -13
- package/src/wallets/ethereum/injected/Zerion.d.ts +0 -6
- package/src/wallets/ethereum/injected/Zerion.js +0 -11
- package/src/wallets/getWalletConnectConnector.cjs +0 -16
- package/src/wallets/getWalletConnectConnector.d.ts +0 -5
- package/src/wallets/getWalletConnectConnector.js +0 -12
- package/src/wallets/walletConnect/index.d.ts +0 -2
- package/src/wallets/walletConnect/walletConnect.cjs +0 -133
- package/src/wallets/walletConnect/walletConnect.d.ts +0 -34
- package/src/wallets/walletConnect/walletConnect.js +0 -127
- package/src/wallets/walletConnect/walletConnectV2.cjs +0 -268
- package/src/wallets/walletConnect/walletConnectV2.d.ts +0 -38
- package/src/wallets/walletConnect/walletConnectV2.js +0 -262
- package/src/wallets/walletConnect/zerion.d.ts +0 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,19 @@
|
|
|
1
1
|
|
|
2
|
+
## [0.17.0-RC.9](https://github.com/dynamic-labs/DynamicAuth/compare/v0.17.0-RC.8...v0.17.0-RC.9) (2023-05-05)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* **DYN-2231:** show in the user profile all existing fields ([#1988](https://github.com/dynamic-labs/DynamicAuth/issues/1988)) ([1f8cee2](https://github.com/dynamic-labs/DynamicAuth/commit/1f8cee22cf8338bd518961288c570c40e807cd52))
|
|
8
|
+
* **TransactionModal:** add insufficient funds warning ([#2031](https://github.com/dynamic-labs/DynamicAuth/issues/2031)) ([bf868e2](https://github.com/dynamic-labs/DynamicAuth/commit/bf868e239e74f4cd0ceda5e09b7538d97d4e431d))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **DYN-1820:** use missing_from_list error code ([#2040](https://github.com/dynamic-labs/DynamicAuth/issues/2040)) ([92c7ad5](https://github.com/dynamic-labs/DynamicAuth/commit/92c7ad565376573d963c65fa821c97a2102ec8d7))
|
|
14
|
+
* **MagicClientNetworkHandler:** save last used network id ([#2045](https://github.com/dynamic-labs/DynamicAuth/issues/2045)) ([6e1c571](https://github.com/dynamic-labs/DynamicAuth/commit/6e1c57127a824cd02d4b785fb8a387e4f221f044))
|
|
15
|
+
* **TransactionModal:** ensure alchemy will not fail when estimating for gas ([#2034](https://github.com/dynamic-labs/DynamicAuth/issues/2034)) ([86c0d7c](https://github.com/dynamic-labs/DynamicAuth/commit/86c0d7cc7b20ff12bc9fc2e33961e177d9decf2a))
|
|
16
|
+
|
|
2
17
|
## [0.17.0-RC.8](https://github.com/dynamic-labs/DynamicAuth/compare/v0.17.0-RC.7...v0.17.0-RC.8) (2023-05-03)
|
|
3
18
|
|
|
4
19
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/multi-wallet",
|
|
3
|
-
"version": "0.17.0-RC.
|
|
3
|
+
"version": "0.17.0-RC.9",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/dynamic-labs/DynamicAuth.git",
|
|
@@ -11,28 +11,23 @@
|
|
|
11
11
|
"deepmerge": "^4.3.1",
|
|
12
12
|
"@dynamic-labs/sdk-api": "0.0.183",
|
|
13
13
|
"@dynamic-labs/wallet-book": "^0.0.14",
|
|
14
|
-
"@magic-ext/oauth": "^10.2.0",
|
|
15
14
|
"starknet": "^3.19.0",
|
|
16
15
|
"ethers": "^5.7.2",
|
|
17
16
|
"@randlabs/myalgo-connect": "^1.4.2",
|
|
18
17
|
"@solana/web3.js": "^1.70.1",
|
|
19
|
-
"@coinbase/wallet-sdk": "^3.6.4",
|
|
20
18
|
"@walletconnect/client": "^1.8.0",
|
|
21
19
|
"@walletconnect/utils": "^1.8.0",
|
|
22
|
-
"@blocto/sdk": "^0.3.3",
|
|
23
20
|
"@onflow/fcl": "^1.3.2",
|
|
24
21
|
"get-starknet": "^1.5.0",
|
|
25
|
-
"@walletconnect/ethereum-provider": "^1.8.0",
|
|
26
|
-
"@walletconnect/universal-provider": "^2.4.2",
|
|
27
22
|
"tslib": "^2.4.1",
|
|
28
|
-
"magic-sdk": "^16.0.1",
|
|
29
23
|
"@keplr-wallet/provider": "0.11.56",
|
|
30
24
|
"@keplr-wallet/types": "^0.11.51",
|
|
31
|
-
"@dynamic-labs/
|
|
32
|
-
"@dynamic-labs/
|
|
33
|
-
"@dynamic-labs/
|
|
34
|
-
"@dynamic-labs/
|
|
35
|
-
"@dynamic-labs/
|
|
25
|
+
"@dynamic-labs/ethereum-all": "0.17.0-RC.9",
|
|
26
|
+
"@dynamic-labs/magic": "0.17.0-RC.9",
|
|
27
|
+
"@dynamic-labs/rpc-providers": "0.17.0-RC.9",
|
|
28
|
+
"@dynamic-labs/types": "0.17.0-RC.9",
|
|
29
|
+
"@dynamic-labs/utils": "0.17.0-RC.9",
|
|
30
|
+
"@dynamic-labs/wallet-connector-core": "0.17.0-RC.9"
|
|
36
31
|
},
|
|
37
32
|
"devDependencies": {
|
|
38
33
|
"@walletconnect/types": "^2.2.1"
|
package/src/index.cjs
CHANGED
|
@@ -4,61 +4,17 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
require('./polyfills.cjs');
|
|
6
6
|
var multiWallet = require('./multi-wallet.cjs');
|
|
7
|
-
var EmailMagicWalletConnector = require('./wallets/ethereum/MagicConnector/EmailMagicWalletConnector/EmailMagicWalletConnector.cjs');
|
|
8
|
-
var MagicWalletConnector = require('./wallets/ethereum/MagicConnector/MagicWalletConnector/MagicWalletConnector.cjs');
|
|
9
|
-
var EmailOTPMagicWalletConnector = require('./wallets/ethereum/MagicConnector/EmailOTPMagicWalletConnector/EmailOTPMagicWalletConnector.cjs');
|
|
10
|
-
var MagicClientNetworkHandler = require('./wallets/ethereum/MagicConnector/MagicClientNetworkHandler/MagicClientNetworkHandler.cjs');
|
|
11
|
-
var MagicSocialWalletConnector = require('./wallets/ethereum/MagicConnector/MagicSocialWalletConnector/MagicSocialWalletConnector.cjs');
|
|
12
7
|
var message = require('./utils/message.cjs');
|
|
13
|
-
var isMobile = require('./utils/isMobile.cjs');
|
|
14
|
-
var normalizeWalletName = require('./utils/normalizeWalletName/normalizeWalletName.cjs');
|
|
15
|
-
var isEmailWalletConnector = require('./utils/isEmailWalletConnector/isEmailWalletConnector.cjs');
|
|
16
|
-
var isEmailOTPWalletConnector = require('./utils/isEmailOTPWalletConnector/isEmailOTPWalletConnector.cjs');
|
|
17
|
-
var isSocialWalletConnector = require('./utils/isSocialWalletConnector/isSocialWalletConnector.cjs');
|
|
18
|
-
var getChainInfo = require('./utils/getChainInfo/getChainInfo.cjs');
|
|
19
|
-
var getWalletConnectorByName = require('./utils/getWalletConnectorByName.cjs');
|
|
20
|
-
var walletConnect = require('./wallets/clients/walletConnect/walletConnect.cjs');
|
|
21
|
-
var coinbase = require('./wallets/clients/coinbase/coinbase.cjs');
|
|
22
8
|
var KeplrWalletConnector = require('./wallets/cosmos/KeplrWalletConnector.cjs');
|
|
23
|
-
var isSameAddress = require('./utils/isSameAddress/isSameAddress.cjs');
|
|
24
9
|
var constants = require('./wallets/constants.cjs');
|
|
25
10
|
var phantomLedger = require('./wallets/solana/phantom-ledger.cjs');
|
|
26
11
|
|
|
27
12
|
|
|
28
13
|
|
|
29
|
-
exports.filteredWalletConnectWallets = multiWallet.filteredWalletConnectWallets;
|
|
30
14
|
exports.getEnabledWallets = multiWallet.getEnabledWallets;
|
|
31
15
|
exports.getSupportedChainsForWalletConnector = multiWallet.getSupportedChainsForWalletConnector;
|
|
32
16
|
exports.getSupportedWallets = multiWallet.getSupportedWallets;
|
|
33
|
-
exports.EmailMagicWalletConnector = EmailMagicWalletConnector.EmailMagicWalletConnector;
|
|
34
|
-
exports.MagicWalletConnector = MagicWalletConnector.MagicWalletConnector;
|
|
35
|
-
exports.EmailOTPMagicWalletConnector = EmailOTPMagicWalletConnector.EmailOTPMagicWalletConnector;
|
|
36
|
-
exports.MagicClientNetworkHandler = MagicClientNetworkHandler.MagicClientNetworkHandler;
|
|
37
|
-
exports.MagicSocialWalletConnector = MagicSocialWalletConnector.MagicSocialWalletConnector;
|
|
38
17
|
exports.generateMessageToSign = message.generateMessageToSign;
|
|
39
|
-
exports.isIPad = isMobile.isIPad;
|
|
40
|
-
exports.isIPhone = isMobile.isIPhone;
|
|
41
|
-
exports.isMobile = isMobile.isMobile;
|
|
42
|
-
exports.normalizeWalletName = normalizeWalletName.normalizeWalletName;
|
|
43
|
-
exports.isEmailWalletConnector = isEmailWalletConnector.isEmailWalletConnector;
|
|
44
|
-
exports.isEmailOTPWalletConnector = isEmailOTPWalletConnector.isEmailOTPWalletConnector;
|
|
45
|
-
exports.isSocialWalletConnector = isSocialWalletConnector.isSocialWalletConnector;
|
|
46
|
-
exports.getChainInfo = getChainInfo.getChainInfo;
|
|
47
|
-
exports.getWalletConnectorByName = getWalletConnectorByName.getWalletConnectorByName;
|
|
48
|
-
exports.createSession = walletConnect.createSession;
|
|
49
|
-
exports.fetchWalletConnectEVMPublicAddress = walletConnect.fetchWalletConnectEVMPublicAddress;
|
|
50
|
-
exports.getDeepLink = walletConnect.getDeepLink;
|
|
51
|
-
exports.initClient = walletConnect.initClient;
|
|
52
|
-
exports.killWalletConnectSession = walletConnect.killWalletConnectSession;
|
|
53
|
-
exports.setupWalletConnectEventListeners = walletConnect.setupWalletConnectEventListeners;
|
|
54
|
-
exports.signWalletConnectPersonalMessage = walletConnect.signWalletConnectPersonalMessage;
|
|
55
|
-
exports.teardownWalletConnectEventListeners = walletConnect.teardownWalletConnectEventListeners;
|
|
56
|
-
exports.useDeepLink = walletConnect.useDeepLink;
|
|
57
|
-
exports.fetchPublicAddress = coinbase.fetchPublicAddress;
|
|
58
|
-
exports.getCoinbaseProvider = coinbase.getCoinbaseProvider;
|
|
59
|
-
exports.killCoinbaseSession = coinbase.killCoinbaseSession;
|
|
60
|
-
exports.signMessage = coinbase.signMessage;
|
|
61
18
|
exports.KeplrWalletConnector = KeplrWalletConnector.KeplrWalletConnector;
|
|
62
|
-
exports.isSameAddress = isSameAddress.isSameAddress;
|
|
63
19
|
exports.defaultStarknetTypedDataDomain = constants.DEFAULT_STARKNET_TYPED_DATA_DOMAIN;
|
|
64
20
|
exports.phantomLedgerWalletName = phantomLedger.walletName;
|
package/src/index.d.ts
CHANGED
|
@@ -1,17 +1,6 @@
|
|
|
1
1
|
import './polyfills';
|
|
2
2
|
export * from './multi-wallet';
|
|
3
3
|
export * from './types';
|
|
4
|
-
export * from './wallets/ethereum/MagicConnector';
|
|
5
4
|
export { generateMessageToSign } from './utils/message';
|
|
6
|
-
export { isIPad, isIPhone, isMobile } from './utils/isMobile';
|
|
7
|
-
export { normalizeWalletName } from './utils/normalizeWalletName';
|
|
8
|
-
export { isEmailWalletConnector } from './utils/isEmailWalletConnector';
|
|
9
|
-
export { isEmailOTPWalletConnector } from './utils/isEmailOTPWalletConnector';
|
|
10
|
-
export { isSocialWalletConnector } from './utils/isSocialWalletConnector';
|
|
11
|
-
export { getChainInfo } from './utils/getChainInfo';
|
|
12
|
-
export { getWalletConnectorByName } from './utils/getWalletConnectorByName';
|
|
13
|
-
export * from './wallets/clients/walletConnect';
|
|
14
|
-
export * from './wallets/clients/coinbase';
|
|
15
5
|
export { KeplrWalletConnector } from './wallets/cosmos/KeplrWalletConnector';
|
|
16
|
-
export * from './utils/isSameAddress';
|
|
17
6
|
export { DEFAULT_STARKNET_TYPED_DATA_DOMAIN as defaultStarknetTypedDataDomain } from './wallets/constants';
|
package/src/index.js
CHANGED
|
@@ -1,21 +1,6 @@
|
|
|
1
1
|
import './polyfills.js';
|
|
2
|
-
export {
|
|
3
|
-
export { EmailMagicWalletConnector } from './wallets/ethereum/MagicConnector/EmailMagicWalletConnector/EmailMagicWalletConnector.js';
|
|
4
|
-
export { MagicWalletConnector } from './wallets/ethereum/MagicConnector/MagicWalletConnector/MagicWalletConnector.js';
|
|
5
|
-
export { EmailOTPMagicWalletConnector } from './wallets/ethereum/MagicConnector/EmailOTPMagicWalletConnector/EmailOTPMagicWalletConnector.js';
|
|
6
|
-
export { MagicClientNetworkHandler } from './wallets/ethereum/MagicConnector/MagicClientNetworkHandler/MagicClientNetworkHandler.js';
|
|
7
|
-
export { MagicSocialWalletConnector } from './wallets/ethereum/MagicConnector/MagicSocialWalletConnector/MagicSocialWalletConnector.js';
|
|
2
|
+
export { getEnabledWallets, getSupportedChainsForWalletConnector, getSupportedWallets } from './multi-wallet.js';
|
|
8
3
|
export { generateMessageToSign } from './utils/message.js';
|
|
9
|
-
export { isIPad, isIPhone, isMobile } from './utils/isMobile.js';
|
|
10
|
-
export { normalizeWalletName } from './utils/normalizeWalletName/normalizeWalletName.js';
|
|
11
|
-
export { isEmailWalletConnector } from './utils/isEmailWalletConnector/isEmailWalletConnector.js';
|
|
12
|
-
export { isEmailOTPWalletConnector } from './utils/isEmailOTPWalletConnector/isEmailOTPWalletConnector.js';
|
|
13
|
-
export { isSocialWalletConnector } from './utils/isSocialWalletConnector/isSocialWalletConnector.js';
|
|
14
|
-
export { getChainInfo } from './utils/getChainInfo/getChainInfo.js';
|
|
15
|
-
export { getWalletConnectorByName } from './utils/getWalletConnectorByName.js';
|
|
16
|
-
export { createSession, fetchWalletConnectEVMPublicAddress, getDeepLink, initClient, killWalletConnectSession, setupWalletConnectEventListeners, signWalletConnectPersonalMessage, teardownWalletConnectEventListeners, useDeepLink } from './wallets/clients/walletConnect/walletConnect.js';
|
|
17
|
-
export { fetchPublicAddress, getCoinbaseProvider, killCoinbaseSession, signMessage } from './wallets/clients/coinbase/coinbase.js';
|
|
18
4
|
export { KeplrWalletConnector } from './wallets/cosmos/KeplrWalletConnector.js';
|
|
19
|
-
export { isSameAddress } from './utils/isSameAddress/isSameAddress.js';
|
|
20
5
|
export { DEFAULT_STARKNET_TYPED_DATA_DOMAIN as defaultStarknetTypedDataDomain } from './wallets/constants.js';
|
|
21
6
|
export { walletName as phantomLedgerWalletName } from './wallets/solana/phantom-ledger.js';
|
package/src/multi-wallet.cjs
CHANGED
|
@@ -3,59 +3,29 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var tslib = require('tslib');
|
|
6
|
+
var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
|
|
6
7
|
var walletBook = require('@dynamic-labs/wallet-book');
|
|
8
|
+
var magic = require('@dynamic-labs/magic');
|
|
9
|
+
var utils = require('@dynamic-labs/utils');
|
|
10
|
+
var ethereumAll = require('@dynamic-labs/ethereum-all');
|
|
7
11
|
var phantom = require('./wallets/solana/phantom.cjs');
|
|
8
|
-
var coinbase = require('./wallets/ethereum/coinbase.cjs');
|
|
9
12
|
var slope = require('./wallets/solana/slope.cjs');
|
|
10
13
|
var solflare = require('./wallets/solana/solflare.cjs');
|
|
11
14
|
var glow = require('./wallets/solana/glow.cjs');
|
|
12
15
|
var blocto = require('./wallets/flow/blocto.cjs');
|
|
13
16
|
var dapper = require('./wallets/flow/dapper.cjs');
|
|
14
|
-
var isMobile = require('./utils/isMobile.cjs');
|
|
15
|
-
var walletConnect = require('./utils/walletConnect.cjs');
|
|
16
17
|
var MyAlgoWalletConnector = require('./wallets/algorand/MyAlgoWalletConnector.cjs');
|
|
17
|
-
var BraveEvm = require('./wallets/ethereum/injected/BraveEvm.cjs');
|
|
18
|
-
var Opera = require('./wallets/ethereum/injected/Opera.cjs');
|
|
19
18
|
var BraveSol = require('./wallets/solana/injected/BraveSol.cjs');
|
|
20
|
-
var UnknownInjectedWallet = require('./wallets/ethereum/injected/UnknownInjectedWallet.cjs');
|
|
21
|
-
var GameStop = require('./wallets/ethereum/injected/GameStop.cjs');
|
|
22
|
-
var ExodusEvm = require('./wallets/ethereum/injected/ExodusEvm.cjs');
|
|
23
19
|
var ExodusSol = require('./wallets/solana/injected/ExodusSol.cjs');
|
|
24
|
-
var BloctoInjected = require('./wallets/ethereum/injected/BloctoInjected.cjs');
|
|
25
20
|
var argentx = require('./wallets/starknet/argentx.cjs');
|
|
26
21
|
var braavos = require('./wallets/starknet/braavos.cjs');
|
|
27
|
-
var BloctoEvm = require('./wallets/ethereum/BloctoEvm.cjs');
|
|
28
22
|
var phantomLedger = require('./wallets/solana/phantom-ledger.cjs');
|
|
29
23
|
var CoinbaseSolana = require('./wallets/solana/CoinbaseSolana.cjs');
|
|
30
|
-
var Frame = require('./wallets/ethereum/injected/Frame.cjs');
|
|
31
24
|
var lilico = require('./wallets/flow/lilico.cjs');
|
|
32
|
-
var getWalletConnectConnector = require('./wallets/getWalletConnectConnector.cjs');
|
|
33
|
-
var Dawn = require('./wallets/ethereum/injected/Dawn.cjs');
|
|
34
|
-
var PhantomEvm = require('./wallets/ethereum/injected/PhantomEvm.cjs');
|
|
35
|
-
require('magic-sdk');
|
|
36
|
-
require('ethers');
|
|
37
|
-
require('@dynamic-labs/wallet-connector-core');
|
|
38
|
-
require('@dynamic-labs/utils');
|
|
39
|
-
var EmailOTPMagicWalletConnector = require('./wallets/ethereum/MagicConnector/EmailOTPMagicWalletConnector/EmailOTPMagicWalletConnector.cjs');
|
|
40
|
-
var MagicSocialWalletConnector = require('./wallets/ethereum/MagicConnector/MagicSocialWalletConnector/MagicSocialWalletConnector.cjs');
|
|
41
|
-
var isEmailWalletConnector = require('./utils/isEmailWalletConnector/isEmailWalletConnector.cjs');
|
|
42
|
-
var Zerion = require('./wallets/ethereum/injected/Zerion.cjs');
|
|
43
|
-
var Trust = require('./wallets/ethereum/injected/Trust.cjs');
|
|
44
25
|
var KeplrWalletConnector = require('./wallets/cosmos/KeplrWalletConnector.cjs');
|
|
45
|
-
var MetaMask = require('./wallets/ethereum/injected/MetaMask.cjs');
|
|
46
26
|
var getApiProviders = require('./utils/getApiProviders.cjs');
|
|
47
27
|
|
|
48
28
|
let wallets = [];
|
|
49
|
-
// These wallets are either not supported or implement their
|
|
50
|
-
// own WalletConnect connector
|
|
51
|
-
const filteredWalletConnectWallets = [
|
|
52
|
-
'MetaMask',
|
|
53
|
-
'Gnosis Safe',
|
|
54
|
-
'Trust',
|
|
55
|
-
'lilico',
|
|
56
|
-
'Keplr',
|
|
57
|
-
'Zerion',
|
|
58
|
-
];
|
|
59
29
|
const defaultWalletUiUtils = {
|
|
60
30
|
enableInternalSign: () => {
|
|
61
31
|
throw Error('enableInternalSign, not implemented');
|
|
@@ -85,53 +55,36 @@ const getSupportedWallets = (args) => tslib.__awaiter(void 0, void 0, void 0, fu
|
|
|
85
55
|
cosmosNetworks: cosmosNetworkConfigs,
|
|
86
56
|
evmNetworks: evmNetworkConfigs,
|
|
87
57
|
isWalletConnectV2Enabled,
|
|
58
|
+
projectId: walletConnectProjectId,
|
|
88
59
|
solNetworks: solanaNetworkConfigs,
|
|
89
60
|
walletUiUtils: walletUiUtils || defaultWalletUiUtils,
|
|
90
61
|
};
|
|
91
|
-
const
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
// temporary hack to filter out metamask, which currently has walletconnect
|
|
95
|
-
// functionality built-in
|
|
96
|
-
const filtered = walletConnectWallets.filter(({ name }) => !filteredWalletConnectWallets.includes(name));
|
|
62
|
+
const importedWallets = [
|
|
63
|
+
...ethereumAll.EthereumWalletConnectors(opts),
|
|
64
|
+
].map((wallet) => new wallet(opts));
|
|
97
65
|
const allWallets = [
|
|
98
|
-
|
|
66
|
+
...importedWallets,
|
|
99
67
|
new phantom(opts),
|
|
100
|
-
new MetaMask(opts),
|
|
101
|
-
new Trust(opts),
|
|
102
|
-
new PhantomEvm(opts),
|
|
103
68
|
new phantomLedger["default"](opts),
|
|
104
|
-
new coinbase(opts),
|
|
105
69
|
new solflare(opts),
|
|
106
70
|
new glow(opts),
|
|
107
71
|
new slope(opts),
|
|
108
72
|
new dapper(opts),
|
|
109
73
|
new blocto(opts),
|
|
110
|
-
new BloctoEvm(opts),
|
|
111
|
-
new BloctoInjected(opts),
|
|
112
|
-
getWalletConnectConnector.getWalletConnectConnector(Object.assign(Object.assign({}, opts), { isWalletConnectV2Enabled, projectId: walletConnectProjectId })),
|
|
113
74
|
new BraveSol(opts),
|
|
114
|
-
new BraveEvm(opts),
|
|
115
|
-
new UnknownInjectedWallet(opts),
|
|
116
|
-
new GameStop(opts),
|
|
117
|
-
new ExodusEvm(opts),
|
|
118
75
|
new ExodusSol(opts),
|
|
119
|
-
new Opera(opts),
|
|
120
76
|
...(((_a = apiProviders.magicLink) === null || _a === void 0 ? void 0 : _a.providerProjectId)
|
|
121
77
|
? [
|
|
122
|
-
new
|
|
123
|
-
new
|
|
78
|
+
new magic.EmailOTPMagicWalletConnector(Object.assign({}, opts)),
|
|
79
|
+
new magic.MagicSocialWalletConnector(Object.assign({}, opts)),
|
|
124
80
|
]
|
|
125
81
|
: []),
|
|
126
82
|
new MyAlgoWalletConnector(),
|
|
127
83
|
new argentx(),
|
|
128
84
|
new braavos(),
|
|
129
85
|
new CoinbaseSolana(opts),
|
|
130
|
-
new Frame(opts),
|
|
131
86
|
new lilico(opts),
|
|
132
|
-
new Zerion(opts),
|
|
133
87
|
new KeplrWalletConnector.KeplrWalletConnector(opts),
|
|
134
|
-
...filtered,
|
|
135
88
|
].map((wallet) => wallet.getMobileOrInstalledWallet());
|
|
136
89
|
yield Promise.all(allWallets.map((wallet) => { var _a; return (_a = wallet.init) === null || _a === void 0 ? void 0 : _a.call(wallet); }));
|
|
137
90
|
// Memoize the wallets
|
|
@@ -151,20 +104,20 @@ const filterWalletsForPlatform = (wallets) => wallets.filter((wallet) => {
|
|
|
151
104
|
if (wallet.isInstalledOnBrowser()) {
|
|
152
105
|
return true;
|
|
153
106
|
}
|
|
154
|
-
else if (
|
|
107
|
+
else if (walletConnectorCore.isEmailWalletConnector(wallet)) {
|
|
155
108
|
return true;
|
|
156
109
|
}
|
|
157
110
|
else if (metadata.showOnlyIfInstalled) {
|
|
158
111
|
return false;
|
|
159
112
|
}
|
|
160
|
-
else if (!
|
|
113
|
+
else if (!utils.isMobile()) {
|
|
161
114
|
return true;
|
|
162
115
|
}
|
|
163
116
|
else {
|
|
164
|
-
return handleMobileWalletFilter(
|
|
117
|
+
return handleMobileWalletFilter(metadata);
|
|
165
118
|
}
|
|
166
119
|
});
|
|
167
|
-
const handleMobileWalletFilter = (
|
|
120
|
+
const handleMobileWalletFilter = (metadata) => {
|
|
168
121
|
if (!metadata.mobile)
|
|
169
122
|
return false;
|
|
170
123
|
/**
|
|
@@ -180,7 +133,7 @@ const handleMobileWalletFilter = (wallet, metadata) => {
|
|
|
180
133
|
* if a wallet has a non-empty value for ios, that means that wallet has an ios app
|
|
181
134
|
* and we support that app. the same goes for android
|
|
182
135
|
*/
|
|
183
|
-
if (
|
|
136
|
+
if (utils.isIPad() || utils.isIPhone()) {
|
|
184
137
|
const hasIOSLink = metadata.mobile.iosId !== undefined;
|
|
185
138
|
return !isWalletConnectWallet
|
|
186
139
|
? hasIOSLink
|
|
@@ -232,7 +185,6 @@ const getEnabledWallets = (props) => tslib.__awaiter(void 0, void 0, void 0, fun
|
|
|
232
185
|
});
|
|
233
186
|
|
|
234
187
|
exports.phantomLedgerWalletName = phantomLedger.walletName;
|
|
235
|
-
exports.filteredWalletConnectWallets = filteredWalletConnectWallets;
|
|
236
188
|
exports.getEnabledWallets = getEnabledWallets;
|
|
237
189
|
exports.getSupportedChainsForWalletConnector = getSupportedChainsForWalletConnector;
|
|
238
190
|
exports.getSupportedWallets = getSupportedWallets;
|
package/src/multi-wallet.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Chain, WalletConnector } from '@dynamic-labs/wallet-connector-core';
|
|
2
2
|
import { GetSupportedWallets, GetSupportedWalletsOpts } from './types';
|
|
3
3
|
export { walletName as phantomLedgerWalletName } from './wallets/solana/phantom-ledger';
|
|
4
|
-
export declare const filteredWalletConnectWallets: string[];
|
|
5
4
|
export declare const getSupportedWallets: GetSupportedWallets;
|
|
6
5
|
export declare const getSupportedChainsForWalletConnector: (walletConnector: WalletConnector) => Chain[];
|
|
7
6
|
export declare const getEnabledWallets: (props: {
|
package/src/multi-wallet.js
CHANGED
|
@@ -1,58 +1,28 @@
|
|
|
1
1
|
import { __awaiter } from 'tslib';
|
|
2
|
+
import { isEmailWalletConnector } from '@dynamic-labs/wallet-connector-core';
|
|
2
3
|
import { getWalletBookWallet } from '@dynamic-labs/wallet-book';
|
|
4
|
+
import { EmailOTPMagicWalletConnector, MagicSocialWalletConnector } from '@dynamic-labs/magic';
|
|
5
|
+
import { isMobile, isIPad, isIPhone } from '@dynamic-labs/utils';
|
|
6
|
+
import { EthereumWalletConnectors } from '@dynamic-labs/ethereum-all';
|
|
3
7
|
import Phantom from './wallets/solana/phantom.js';
|
|
4
|
-
import Coinbase from './wallets/ethereum/coinbase.js';
|
|
5
8
|
import Slope from './wallets/solana/slope.js';
|
|
6
9
|
import Solflare from './wallets/solana/solflare.js';
|
|
7
10
|
import Glow from './wallets/solana/glow.js';
|
|
8
11
|
import Blocto from './wallets/flow/blocto.js';
|
|
9
12
|
import Dapper from './wallets/flow/dapper.js';
|
|
10
|
-
import { isMobile, isIPad, isIPhone } from './utils/isMobile.js';
|
|
11
|
-
import { fetchWalletConnectWallets } from './utils/walletConnect.js';
|
|
12
13
|
import MyAlgoWalletConnector from './wallets/algorand/MyAlgoWalletConnector.js';
|
|
13
|
-
import BraveEvm from './wallets/ethereum/injected/BraveEvm.js';
|
|
14
|
-
import Opera from './wallets/ethereum/injected/Opera.js';
|
|
15
14
|
import BraveSol from './wallets/solana/injected/BraveSol.js';
|
|
16
|
-
import UnknownInjectedWallet from './wallets/ethereum/injected/UnknownInjectedWallet.js';
|
|
17
|
-
import GameStop from './wallets/ethereum/injected/GameStop.js';
|
|
18
|
-
import ExodusEvm from './wallets/ethereum/injected/ExodusEvm.js';
|
|
19
15
|
import ExodusSol from './wallets/solana/injected/ExodusSol.js';
|
|
20
|
-
import BloctoInjected from './wallets/ethereum/injected/BloctoInjected.js';
|
|
21
16
|
import ArgentX from './wallets/starknet/argentx.js';
|
|
22
17
|
import Braavos from './wallets/starknet/braavos.js';
|
|
23
|
-
import BloctoEvm from './wallets/ethereum/BloctoEvm.js';
|
|
24
18
|
import PhantomLedger from './wallets/solana/phantom-ledger.js';
|
|
25
19
|
export { walletName as phantomLedgerWalletName } from './wallets/solana/phantom-ledger.js';
|
|
26
20
|
import CoinbaseSolana from './wallets/solana/CoinbaseSolana.js';
|
|
27
|
-
import Frame from './wallets/ethereum/injected/Frame.js';
|
|
28
21
|
import Lilico from './wallets/flow/lilico.js';
|
|
29
|
-
import { getWalletConnectConnector } from './wallets/getWalletConnectConnector.js';
|
|
30
|
-
import Dawn from './wallets/ethereum/injected/Dawn.js';
|
|
31
|
-
import PhantomEvm from './wallets/ethereum/injected/PhantomEvm.js';
|
|
32
|
-
import 'magic-sdk';
|
|
33
|
-
import 'ethers';
|
|
34
|
-
import '@dynamic-labs/wallet-connector-core';
|
|
35
|
-
import '@dynamic-labs/utils';
|
|
36
|
-
import { EmailOTPMagicWalletConnector } from './wallets/ethereum/MagicConnector/EmailOTPMagicWalletConnector/EmailOTPMagicWalletConnector.js';
|
|
37
|
-
import { MagicSocialWalletConnector } from './wallets/ethereum/MagicConnector/MagicSocialWalletConnector/MagicSocialWalletConnector.js';
|
|
38
|
-
import { isEmailWalletConnector } from './utils/isEmailWalletConnector/isEmailWalletConnector.js';
|
|
39
|
-
import Zerion from './wallets/ethereum/injected/Zerion.js';
|
|
40
|
-
import Trust from './wallets/ethereum/injected/Trust.js';
|
|
41
22
|
import { KeplrWalletConnector } from './wallets/cosmos/KeplrWalletConnector.js';
|
|
42
|
-
import MetaMask from './wallets/ethereum/injected/MetaMask.js';
|
|
43
23
|
import { getApiProviders } from './utils/getApiProviders.js';
|
|
44
24
|
|
|
45
25
|
let wallets = [];
|
|
46
|
-
// These wallets are either not supported or implement their
|
|
47
|
-
// own WalletConnect connector
|
|
48
|
-
const filteredWalletConnectWallets = [
|
|
49
|
-
'MetaMask',
|
|
50
|
-
'Gnosis Safe',
|
|
51
|
-
'Trust',
|
|
52
|
-
'lilico',
|
|
53
|
-
'Keplr',
|
|
54
|
-
'Zerion',
|
|
55
|
-
];
|
|
56
26
|
const defaultWalletUiUtils = {
|
|
57
27
|
enableInternalSign: () => {
|
|
58
28
|
throw Error('enableInternalSign, not implemented');
|
|
@@ -82,38 +52,24 @@ const getSupportedWallets = (args) => __awaiter(void 0, void 0, void 0, function
|
|
|
82
52
|
cosmosNetworks: cosmosNetworkConfigs,
|
|
83
53
|
evmNetworks: evmNetworkConfigs,
|
|
84
54
|
isWalletConnectV2Enabled,
|
|
55
|
+
projectId: walletConnectProjectId,
|
|
85
56
|
solNetworks: solanaNetworkConfigs,
|
|
86
57
|
walletUiUtils: walletUiUtils || defaultWalletUiUtils,
|
|
87
58
|
};
|
|
88
|
-
const
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
// temporary hack to filter out metamask, which currently has walletconnect
|
|
92
|
-
// functionality built-in
|
|
93
|
-
const filtered = walletConnectWallets.filter(({ name }) => !filteredWalletConnectWallets.includes(name));
|
|
59
|
+
const importedWallets = [
|
|
60
|
+
...EthereumWalletConnectors(opts),
|
|
61
|
+
].map((wallet) => new wallet(opts));
|
|
94
62
|
const allWallets = [
|
|
95
|
-
|
|
63
|
+
...importedWallets,
|
|
96
64
|
new Phantom(opts),
|
|
97
|
-
new MetaMask(opts),
|
|
98
|
-
new Trust(opts),
|
|
99
|
-
new PhantomEvm(opts),
|
|
100
65
|
new PhantomLedger(opts),
|
|
101
|
-
new Coinbase(opts),
|
|
102
66
|
new Solflare(opts),
|
|
103
67
|
new Glow(opts),
|
|
104
68
|
new Slope(opts),
|
|
105
69
|
new Dapper(opts),
|
|
106
70
|
new Blocto(opts),
|
|
107
|
-
new BloctoEvm(opts),
|
|
108
|
-
new BloctoInjected(opts),
|
|
109
|
-
getWalletConnectConnector(Object.assign(Object.assign({}, opts), { isWalletConnectV2Enabled, projectId: walletConnectProjectId })),
|
|
110
71
|
new BraveSol(opts),
|
|
111
|
-
new BraveEvm(opts),
|
|
112
|
-
new UnknownInjectedWallet(opts),
|
|
113
|
-
new GameStop(opts),
|
|
114
|
-
new ExodusEvm(opts),
|
|
115
72
|
new ExodusSol(opts),
|
|
116
|
-
new Opera(opts),
|
|
117
73
|
...(((_a = apiProviders.magicLink) === null || _a === void 0 ? void 0 : _a.providerProjectId)
|
|
118
74
|
? [
|
|
119
75
|
new EmailOTPMagicWalletConnector(Object.assign({}, opts)),
|
|
@@ -124,11 +80,8 @@ const getSupportedWallets = (args) => __awaiter(void 0, void 0, void 0, function
|
|
|
124
80
|
new ArgentX(),
|
|
125
81
|
new Braavos(),
|
|
126
82
|
new CoinbaseSolana(opts),
|
|
127
|
-
new Frame(opts),
|
|
128
83
|
new Lilico(opts),
|
|
129
|
-
new Zerion(opts),
|
|
130
84
|
new KeplrWalletConnector(opts),
|
|
131
|
-
...filtered,
|
|
132
85
|
].map((wallet) => wallet.getMobileOrInstalledWallet());
|
|
133
86
|
yield Promise.all(allWallets.map((wallet) => { var _a; return (_a = wallet.init) === null || _a === void 0 ? void 0 : _a.call(wallet); }));
|
|
134
87
|
// Memoize the wallets
|
|
@@ -158,10 +111,10 @@ const filterWalletsForPlatform = (wallets) => wallets.filter((wallet) => {
|
|
|
158
111
|
return true;
|
|
159
112
|
}
|
|
160
113
|
else {
|
|
161
|
-
return handleMobileWalletFilter(
|
|
114
|
+
return handleMobileWalletFilter(metadata);
|
|
162
115
|
}
|
|
163
116
|
});
|
|
164
|
-
const handleMobileWalletFilter = (
|
|
117
|
+
const handleMobileWalletFilter = (metadata) => {
|
|
165
118
|
if (!metadata.mobile)
|
|
166
119
|
return false;
|
|
167
120
|
/**
|
|
@@ -228,4 +181,4 @@ const getEnabledWallets = (props) => __awaiter(void 0, void 0, void 0, function*
|
|
|
228
181
|
return allEnabledWallets;
|
|
229
182
|
});
|
|
230
183
|
|
|
231
|
-
export {
|
|
184
|
+
export { getEnabledWallets, getSupportedChainsForWalletConnector, getSupportedWallets };
|
package/src/types.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { OAuthProvider } from '@magic-ext/oauth';
|
|
2
1
|
import type { Provider } from '@dynamic-labs/sdk-api';
|
|
3
2
|
import { WalletConnector, Chain } from '@dynamic-labs/wallet-connector-core';
|
|
4
3
|
import { NetworkConfigurationMap, WalletUiUtils } from '@dynamic-labs/types';
|
|
@@ -25,4 +24,3 @@ export type ChainWihtIcon = {
|
|
|
25
24
|
icon?: string;
|
|
26
25
|
name: string | undefined;
|
|
27
26
|
};
|
|
28
|
-
export type SocialOAuthProvider = OAuthProvider;
|
package/src/utils/message.cjs
CHANGED
|
@@ -4,14 +4,13 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var utils = require('ethers/lib/utils');
|
|
6
6
|
var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
|
|
7
|
-
var getChainInfo = require('./getChainInfo/getChainInfo.cjs');
|
|
8
7
|
|
|
9
8
|
const generateMessageToSign = ({ blockchain, domain, chainId, nonce, uri, publicKey, issuedAt = new Date().toISOString(), statement, requestId, resources, }) => {
|
|
10
9
|
var _a, _b;
|
|
11
10
|
if (blockchain === 'STARK') {
|
|
12
11
|
return nonce;
|
|
13
12
|
}
|
|
14
|
-
const blockchainName = (_b = (_a =
|
|
13
|
+
const blockchainName = (_b = (_a = walletConnectorCore.getChainInfo(blockchain)) === null || _a === void 0 ? void 0 : _a.blockchainName) !== null && _b !== void 0 ? _b : 'Ethereum';
|
|
15
14
|
// This format follows the sign-in with ethereum (SIWE) standard,
|
|
16
15
|
// but we are using it also for non-ethereum wallets for now (eg. Solana)
|
|
17
16
|
// for more context on format and fields, please see:
|
package/src/utils/message.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { getAddress } from 'ethers/lib/utils.js';
|
|
2
|
-
import { logger } from '@dynamic-labs/wallet-connector-core';
|
|
3
|
-
import { getChainInfo } from './getChainInfo/getChainInfo.js';
|
|
2
|
+
import { getChainInfo, logger } from '@dynamic-labs/wallet-connector-core';
|
|
4
3
|
|
|
5
4
|
const generateMessageToSign = ({ blockchain, domain, chainId, nonce, uri, publicKey, issuedAt = new Date().toISOString(), statement, requestId, resources, }) => {
|
|
6
5
|
var _a, _b;
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const infuraId = '87939db78f824920ada5c872db3e56b8';
|
|
6
5
|
const ETH_STARKNET_ADDRESS = '0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7';
|
|
7
6
|
const DEFAULT_STARKNET_TYPED_DATA_DOMAIN = {
|
|
8
7
|
domain: {
|
|
@@ -13,4 +12,3 @@ const DEFAULT_STARKNET_TYPED_DATA_DOMAIN = {
|
|
|
13
12
|
|
|
14
13
|
exports.DEFAULT_STARKNET_TYPED_DATA_DOMAIN = DEFAULT_STARKNET_TYPED_DATA_DOMAIN;
|
|
15
14
|
exports.ETH_STARKNET_ADDRESS = ETH_STARKNET_ADDRESS;
|
|
16
|
-
exports.infuraId = infuraId;
|
package/src/wallets/constants.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
const infuraId = '87939db78f824920ada5c872db3e56b8';
|
|
2
1
|
const ETH_STARKNET_ADDRESS = '0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7';
|
|
3
2
|
const DEFAULT_STARKNET_TYPED_DATA_DOMAIN = {
|
|
4
3
|
domain: {
|
|
@@ -7,4 +6,4 @@ const DEFAULT_STARKNET_TYPED_DATA_DOMAIN = {
|
|
|
7
6
|
},
|
|
8
7
|
};
|
|
9
8
|
|
|
10
|
-
export { DEFAULT_STARKNET_TYPED_DATA_DOMAIN, ETH_STARKNET_ADDRESS
|
|
9
|
+
export { DEFAULT_STARKNET_TYPED_DATA_DOMAIN, ETH_STARKNET_ADDRESS };
|
|
@@ -4,8 +4,6 @@ var tslib = require('tslib');
|
|
|
4
4
|
var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
|
|
5
5
|
var walletBook = require('@dynamic-labs/wallet-book');
|
|
6
6
|
var utils = require('@dynamic-labs/utils');
|
|
7
|
-
var walletConnect = require('../clients/walletConnect/walletConnect.cjs');
|
|
8
|
-
var isMobile = require('../../utils/isMobile.cjs');
|
|
9
7
|
var wcClient = require('./wcClient.cjs');
|
|
10
8
|
var wcClient_lib = require('./wcClient.lib.cjs');
|
|
11
9
|
|
|
@@ -161,11 +159,11 @@ class KeplrWalletConnect extends walletConnectorCore.WalletConnectorBase {
|
|
|
161
159
|
getDeepLink() {
|
|
162
160
|
var _a;
|
|
163
161
|
const wallet = walletBook.getWalletBookWallet(this.name);
|
|
164
|
-
if (!
|
|
162
|
+
if (!utils.isMobile() && !((_a = wallet.desktop) === null || _a === void 0 ? void 0 : _a.native)) {
|
|
165
163
|
return undefined;
|
|
166
164
|
}
|
|
167
165
|
return wcClient_lib.getDeepLink(this.getClient().uri, wallet, {
|
|
168
|
-
removeWCUri:
|
|
166
|
+
removeWCUri: utils.isIOS() && this.key === 'cryptocom',
|
|
169
167
|
});
|
|
170
168
|
}
|
|
171
169
|
getRpcProvider() {
|
|
@@ -181,14 +179,14 @@ class KeplrWalletConnect extends walletConnectorCore.WalletConnectorBase {
|
|
|
181
179
|
return this.getProvider();
|
|
182
180
|
}
|
|
183
181
|
setupEventListeners(listeners) {
|
|
184
|
-
|
|
182
|
+
wcClient_lib.setupWalletConnectEventListeners({
|
|
185
183
|
onAccountChange: listeners.onAccountChange,
|
|
186
184
|
onChainChange: listeners.onChainChange,
|
|
187
185
|
onDisconnect: listeners.onDisconnect,
|
|
188
186
|
}, this.getClient());
|
|
189
187
|
}
|
|
190
188
|
teardownEventListeners() {
|
|
191
|
-
|
|
189
|
+
wcClient_lib.teardownWalletConnectEventListeners(this.getClient());
|
|
192
190
|
}
|
|
193
191
|
supportsNetworkSwitching() {
|
|
194
192
|
return true;
|
|
@@ -2,11 +2,14 @@ import Client from '@walletconnect/client';
|
|
|
2
2
|
import { OfflineAminoSigner } from '@keplr-wallet/types';
|
|
3
3
|
import { Chain, FetchPublicAddressOpts, WalletConnectorBase, WalletEventListeners } from '@dynamic-labs/wallet-connector-core';
|
|
4
4
|
import { EvmNetwork, GenericNetwork } from '@dynamic-labs/types';
|
|
5
|
-
import { SwitchNetworkOps } from '../ethereum/EthWalletConnector';
|
|
6
5
|
import { KeplrWalletConnectV1 } from './wcClient';
|
|
7
6
|
export type KeplrWalletConnectProps = {
|
|
8
7
|
cosmosNetworks: GenericNetwork[];
|
|
9
8
|
};
|
|
9
|
+
export type SwitchNetworkOps = {
|
|
10
|
+
networkChainId?: number;
|
|
11
|
+
networkName?: string;
|
|
12
|
+
};
|
|
10
13
|
declare class KeplrWalletConnect extends WalletConnectorBase {
|
|
11
14
|
constructor(props: KeplrWalletConnectProps);
|
|
12
15
|
name: string;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { __awaiter } from 'tslib';
|
|
2
2
|
import { WalletConnectorBase, logger } from '@dynamic-labs/wallet-connector-core';
|
|
3
3
|
import { getWalletBookWallet } from '@dynamic-labs/wallet-book';
|
|
4
|
-
import { parseEvmNetworks, parseChainId } from '@dynamic-labs/utils';
|
|
5
|
-
import { setupWalletConnectEventListeners, teardownWalletConnectEventListeners } from '../clients/walletConnect/walletConnect.js';
|
|
6
|
-
import { isMobile, isIOS } from '../../utils/isMobile.js';
|
|
4
|
+
import { parseEvmNetworks, parseChainId, isMobile, isIOS } from '@dynamic-labs/utils';
|
|
7
5
|
import { KeplrWalletConnectV1 } from './wcClient.js';
|
|
8
|
-
import { initClient, fetchWalletConnectCosmosPublicAddress, killWalletConnectSession, getDeepLink } from './wcClient.lib.js';
|
|
6
|
+
import { initClient, fetchWalletConnectCosmosPublicAddress, killWalletConnectSession, getDeepLink, setupWalletConnectEventListeners, teardownWalletConnectEventListeners } from './wcClient.lib.js';
|
|
9
7
|
|
|
10
8
|
const DYNAMIC_KEPLR_NETWORK_ID = 'dynamic_keplr_wc_network_id';
|
|
11
9
|
class KeplrWalletConnect extends WalletConnectorBase {
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { Keplr as KeplrWallet } from '@keplr-wallet/types';
|
|
2
2
|
import { Chain, WalletConnectorBase, WalletEventListeners } from '@dynamic-labs/wallet-connector-core';
|
|
3
3
|
import { EvmNetwork, GenericNetwork } from '@dynamic-labs/types';
|
|
4
|
-
import { SwitchNetworkOps } from '
|
|
5
|
-
import KeplrWalletConnect from './KeplrWalletConnect';
|
|
4
|
+
import KeplrWalletConnect, { SwitchNetworkOps } from './KeplrWalletConnect';
|
|
6
5
|
export interface IFetchBalanceResponse {
|
|
7
6
|
balances: IFetchBalanceBalance[];
|
|
8
7
|
pagination: IFetchBalancePagination;
|