@dynamic-labs/multi-wallet 0.17.0-RC.1 → 0.17.0-RC.11
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 +121 -0
- package/package.json +7 -23
- package/src/index.cjs +0 -69
- package/src/index.d.ts +0 -18
- package/src/index.js +1 -23
- package/src/multi-wallet.cjs +29 -166
- package/src/multi-wallet.d.ts +0 -3
- package/src/multi-wallet.js +27 -163
- package/src/types.d.ts +11 -50
- package/src/utils/getApiProviders.cjs +15 -0
- package/src/utils/getApiProviders.d.ts +10 -0
- package/src/utils/getApiProviders.js +11 -0
- package/src/utils/message.cjs +3 -4
- package/src/utils/message.d.ts +2 -2
- package/src/utils/message.js +1 -2
- package/src/errors.cjs +0 -65
- package/src/errors.d.ts +0 -30
- package/src/errors.js +0 -53
- package/src/polyfills.cjs +0 -16
- package/src/polyfills.d.ts +0 -1
- package/src/polyfills.js +0 -14
- package/src/rpcProviders.cjs +0 -76
- package/src/rpcProviders.d.ts +0 -5
- package/src/rpcProviders.js +0 -69
- package/src/utils/CancellablePromise/CancellablePromise.cjs +0 -33
- package/src/utils/CancellablePromise/CancellablePromise.d.ts +0 -9
- package/src/utils/CancellablePromise/CancellablePromise.js +0 -29
- package/src/utils/CancellablePromise/index.d.ts +0 -1
- 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/convertors.cjs +0 -43
- package/src/utils/convertors.d.ts +0 -3
- package/src/utils/convertors.js +0 -38
- 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/extractNonce.cjs +0 -13
- package/src/utils/extractNonce.d.ts +0 -1
- package/src/utils/extractNonce.js +0 -9
- 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/localStorageAsync.cjs +0 -28
- package/src/utils/localStorageAsync.d.ts +0 -3
- package/src/utils/localStorageAsync.js +0 -22
- package/src/utils/logger.cjs +0 -9
- package/src/utils/logger.d.ts +0 -2
- package/src/utils/logger.js +0 -5
- 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 -30
- package/src/utils/walletConnect.d.ts +0 -4
- package/src/utils/walletConnect.js +0 -26
- 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/algorand/MyAlgoWalletConnector.cjs +0 -149
- package/src/wallets/algorand/MyAlgoWalletConnector.d.ts +0 -21
- package/src/wallets/algorand/MyAlgoWalletConnector.js +0 -143
- package/src/wallets/algorand/myalgoSigner.cjs +0 -24
- package/src/wallets/algorand/myalgoSigner.d.ts +0 -21
- package/src/wallets/algorand/myalgoSigner.js +0 -20
- 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 -204
- package/src/wallets/clients/walletConnect/walletConnect.d.ts +0 -22
- package/src/wallets/clients/walletConnect/walletConnect.js +0 -187
- package/src/wallets/constants.cjs +0 -16
- package/src/wallets/constants.d.ts +0 -4
- package/src/wallets/constants.js +0 -10
- package/src/wallets/cosmos/KeplrWalletConnect.cjs +0 -196
- package/src/wallets/cosmos/KeplrWalletConnect.d.ts +0 -46
- package/src/wallets/cosmos/KeplrWalletConnect.js +0 -194
- package/src/wallets/cosmos/KeplrWalletConnector.cjs +0 -193
- package/src/wallets/cosmos/KeplrWalletConnector.d.ts +0 -70
- package/src/wallets/cosmos/KeplrWalletConnector.js +0 -189
- package/src/wallets/cosmos/getKeplrConnector.cjs +0 -18
- package/src/wallets/cosmos/getKeplrConnector.d.ts +0 -6
- package/src/wallets/cosmos/getKeplrConnector.js +0 -14
- package/src/wallets/cosmos/index.d.ts +0 -1
- package/src/wallets/cosmos/utils/indexDB.cjs +0 -97
- package/src/wallets/cosmos/utils/indexDB.d.ts +0 -18
- package/src/wallets/cosmos/utils/indexDB.js +0 -93
- package/src/wallets/cosmos/wcClient.cjs +0 -333
- package/src/wallets/cosmos/wcClient.d.ts +0 -104
- package/src/wallets/cosmos/wcClient.js +0 -325
- package/src/wallets/ethereum/BloctoEvm.cjs +0 -111
- package/src/wallets/ethereum/BloctoEvm.d.ts +0 -25
- package/src/wallets/ethereum/BloctoEvm.js +0 -105
- package/src/wallets/ethereum/EthWalletConnector.cjs +0 -191
- package/src/wallets/ethereum/EthWalletConnector.d.ts +0 -35
- package/src/wallets/ethereum/EthWalletConnector.js +0 -187
- package/src/wallets/ethereum/MagicConnector/EmailMagicWalletConnector/EmailMagicWalletConnector.cjs +0 -63
- package/src/wallets/ethereum/MagicConnector/EmailMagicWalletConnector/EmailMagicWalletConnector.d.ts +0 -12
- package/src/wallets/ethereum/MagicConnector/EmailMagicWalletConnector/EmailMagicWalletConnector.js +0 -59
- 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 -102
- package/src/wallets/ethereum/MagicConnector/MagicClientNetworkHandler/MagicClientNetworkHandler.d.ts +0 -33
- package/src/wallets/ethereum/MagicConnector/MagicClientNetworkHandler/MagicClientNetworkHandler.js +0 -98
- package/src/wallets/ethereum/MagicConnector/MagicClientNetworkHandler/index.d.ts +0 -2
- package/src/wallets/ethereum/MagicConnector/MagicSocialWalletConnector/MagicSocialWalletConnector.cjs +0 -55
- package/src/wallets/ethereum/MagicConnector/MagicSocialWalletConnector/MagicSocialWalletConnector.d.ts +0 -12
- package/src/wallets/ethereum/MagicConnector/MagicSocialWalletConnector/MagicSocialWalletConnector.js +0 -51
- package/src/wallets/ethereum/MagicConnector/MagicSocialWalletConnector/index.d.ts +0 -1
- package/src/wallets/ethereum/MagicConnector/MagicWalletConnector/MagicWalletConnector.cjs +0 -175
- package/src/wallets/ethereum/MagicConnector/MagicWalletConnector/MagicWalletConnector.d.ts +0 -53
- package/src/wallets/ethereum/MagicConnector/MagicWalletConnector/MagicWalletConnector.js +0 -171
- 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 -65
- package/src/wallets/ethereum/coinbase.d.ts +0 -26
- package/src/wallets/ethereum/coinbase.js +0 -63
- package/src/wallets/ethereum/ethProviderHelper.cjs +0 -197
- package/src/wallets/ethereum/ethProviderHelper.d.ts +0 -40
- package/src/wallets/ethereum/ethProviderHelper.js +0 -193
- package/src/wallets/ethereum/evm-network.cjs +0 -20
- package/src/wallets/ethereum/evm-network.d.ts +0 -22
- package/src/wallets/ethereum/evm-network.js +0 -16
- package/src/wallets/ethereum/fortmatic.cjs +0 -75
- package/src/wallets/ethereum/fortmatic.d.ts +0 -26
- package/src/wallets/ethereum/fortmatic.js +0 -69
- package/src/wallets/ethereum/injected/BloctoInjected.cjs +0 -13
- package/src/wallets/ethereum/injected/BloctoInjected.d.ts +0 -6
- package/src/wallets/ethereum/injected/BloctoInjected.js +0 -11
- package/src/wallets/ethereum/injected/BraveEvm.cjs +0 -13
- package/src/wallets/ethereum/injected/BraveEvm.d.ts +0 -6
- package/src/wallets/ethereum/injected/BraveEvm.js +0 -11
- package/src/wallets/ethereum/injected/Dawn.cjs +0 -13
- package/src/wallets/ethereum/injected/Dawn.d.ts +0 -6
- package/src/wallets/ethereum/injected/Dawn.js +0 -11
- package/src/wallets/ethereum/injected/ExodusEvm.cjs +0 -13
- package/src/wallets/ethereum/injected/ExodusEvm.d.ts +0 -6
- package/src/wallets/ethereum/injected/ExodusEvm.js +0 -11
- package/src/wallets/ethereum/injected/Frame.cjs +0 -13
- package/src/wallets/ethereum/injected/Frame.d.ts +0 -6
- package/src/wallets/ethereum/injected/Frame.js +0 -11
- package/src/wallets/ethereum/injected/GameStop.cjs +0 -13
- package/src/wallets/ethereum/injected/GameStop.d.ts +0 -6
- package/src/wallets/ethereum/injected/GameStop.js +0 -11
- package/src/wallets/ethereum/injected/Opera.cjs +0 -13
- package/src/wallets/ethereum/injected/Opera.d.ts +0 -6
- package/src/wallets/ethereum/injected/Opera.js +0 -11
- package/src/wallets/ethereum/injected/PhantomEvm.cjs +0 -37
- package/src/wallets/ethereum/injected/PhantomEvm.d.ts +0 -7
- package/src/wallets/ethereum/injected/PhantomEvm.js +0 -35
- 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 -13
- package/src/wallets/ethereum/injected/UnknownInjectedWallet.d.ts +0 -6
- package/src/wallets/ethereum/injected/UnknownInjectedWallet.js +0 -11
- 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/ethereum/meta-mask.cjs +0 -63
- package/src/wallets/ethereum/meta-mask.d.ts +0 -26
- package/src/wallets/ethereum/meta-mask.js +0 -61
- package/src/wallets/flow/FlowWalletConnector.cjs +0 -163
- package/src/wallets/flow/FlowWalletConnector.d.ts +0 -29
- package/src/wallets/flow/FlowWalletConnector.js +0 -158
- package/src/wallets/flow/blocto.cjs +0 -22
- package/src/wallets/flow/blocto.d.ts +0 -7
- package/src/wallets/flow/blocto.js +0 -20
- package/src/wallets/flow/dapper.cjs +0 -22
- package/src/wallets/flow/dapper.d.ts +0 -7
- package/src/wallets/flow/dapper.js +0 -20
- package/src/wallets/flow/lilico.cjs +0 -42
- package/src/wallets/flow/lilico.d.ts +0 -8
- package/src/wallets/flow/lilico.js +0 -40
- package/src/wallets/getMobileOrInjectedWallet.cjs +0 -26
- package/src/wallets/getMobileOrInjectedWallet.d.ts +0 -8
- package/src/wallets/getMobileOrInjectedWallet.js +0 -22
- package/src/wallets/getWalletConnectConnector.cjs +0 -19
- package/src/wallets/getWalletConnectConnector.d.ts +0 -8
- package/src/wallets/getWalletConnectConnector.js +0 -15
- package/src/wallets/solana/CoinbaseSolana.cjs +0 -54
- package/src/wallets/solana/CoinbaseSolana.d.ts +0 -17
- package/src/wallets/solana/CoinbaseSolana.js +0 -52
- package/src/wallets/solana/glow.cjs +0 -51
- package/src/wallets/solana/glow.d.ts +0 -16
- package/src/wallets/solana/glow.js +0 -49
- package/src/wallets/solana/injected/BraveSol.cjs +0 -18
- package/src/wallets/solana/injected/BraveSol.d.ts +0 -6
- package/src/wallets/solana/injected/BraveSol.js +0 -16
- package/src/wallets/solana/injected/ExodusSol.cjs +0 -12
- package/src/wallets/solana/injected/ExodusSol.d.ts +0 -5
- package/src/wallets/solana/injected/ExodusSol.js +0 -10
- package/src/wallets/solana/phantom-ledger.cjs +0 -71
- package/src/wallets/solana/phantom-ledger.d.ts +0 -16
- package/src/wallets/solana/phantom-ledger.js +0 -65
- package/src/wallets/solana/phantom.cjs +0 -74
- package/src/wallets/solana/phantom.d.ts +0 -17
- package/src/wallets/solana/phantom.js +0 -72
- package/src/wallets/solana/slope.cjs +0 -96
- package/src/wallets/solana/slope.d.ts +0 -27
- package/src/wallets/solana/slope.js +0 -94
- package/src/wallets/solana/solProviderHelper.cjs +0 -164
- package/src/wallets/solana/solProviderHelper.d.ts +0 -29
- package/src/wallets/solana/solProviderHelper.js +0 -160
- package/src/wallets/solana/solWalletConnector.cjs +0 -57
- package/src/wallets/solana/solWalletConnector.d.ts +0 -18
- package/src/wallets/solana/solWalletConnector.js +0 -53
- package/src/wallets/solana/solflare.cjs +0 -65
- package/src/wallets/solana/solflare.d.ts +0 -14
- package/src/wallets/solana/solflare.js +0 -63
- package/src/wallets/starknet/argentx.cjs +0 -20
- package/src/wallets/starknet/argentx.d.ts +0 -7
- package/src/wallets/starknet/argentx.js +0 -18
- package/src/wallets/starknet/braavos.cjs +0 -33
- package/src/wallets/starknet/braavos.d.ts +0 -7
- package/src/wallets/starknet/braavos.js +0 -31
- package/src/wallets/starknet/ethereumContractAbi.cjs +0 -357
- package/src/wallets/starknet/ethereumContractAbi.js +0 -355
- package/src/wallets/starknet/starknetWalletConnector.cjs +0 -171
- package/src/wallets/starknet/starknetWalletConnector.d.ts +0 -34
- package/src/wallets/starknet/starknetWalletConnector.js +0 -169
- package/src/wallets/walletConnect/index.d.ts +0 -2
- package/src/wallets/walletConnect/walletConnect.cjs +0 -130
- package/src/wallets/walletConnect/walletConnect.d.ts +0 -34
- package/src/wallets/walletConnect/walletConnect.js +0 -124
- 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 -8
- package/src/wallets/window.d.ts +0 -95
package/src/multi-wallet.js
CHANGED
|
@@ -1,59 +1,10 @@
|
|
|
1
1
|
import { __awaiter } from 'tslib';
|
|
2
|
+
import { isEmailWalletConnector } from '@dynamic-labs/wallet-connector-core';
|
|
2
3
|
import { getWalletBookWallet } from '@dynamic-labs/wallet-book';
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import Slope from './wallets/solana/slope.js';
|
|
6
|
-
import Solflare from './wallets/solana/solflare.js';
|
|
7
|
-
import Glow from './wallets/solana/glow.js';
|
|
8
|
-
import Blocto from './wallets/flow/blocto.js';
|
|
9
|
-
import Dapper from './wallets/flow/dapper.js';
|
|
10
|
-
import { isMobile, isIPad, isIPhone } from './utils/isMobile.js';
|
|
11
|
-
import { fetchWalletConnectWallets } from './utils/walletConnect.js';
|
|
12
|
-
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
|
-
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
|
-
import ExodusSol from './wallets/solana/injected/ExodusSol.js';
|
|
20
|
-
import BloctoInjected from './wallets/ethereum/injected/BloctoInjected.js';
|
|
21
|
-
import ArgentX from './wallets/starknet/argentx.js';
|
|
22
|
-
import Braavos from './wallets/starknet/braavos.js';
|
|
23
|
-
import BloctoEvm from './wallets/ethereum/BloctoEvm.js';
|
|
24
|
-
import PhantomLedger from './wallets/solana/phantom-ledger.js';
|
|
25
|
-
export { walletName as phantomLedgerWalletName } from './wallets/solana/phantom-ledger.js';
|
|
26
|
-
import CoinbaseSolana from './wallets/solana/CoinbaseSolana.js';
|
|
27
|
-
import Frame from './wallets/ethereum/injected/Frame.js';
|
|
28
|
-
import Fortmatic from './wallets/ethereum/fortmatic.js';
|
|
29
|
-
import Lilico from './wallets/flow/lilico.js';
|
|
30
|
-
import { getWalletConnectConnector } from './wallets/getWalletConnectConnector.js';
|
|
31
|
-
import Dawn from './wallets/ethereum/injected/Dawn.js';
|
|
32
|
-
import PhantomEvm from './wallets/ethereum/injected/PhantomEvm.js';
|
|
33
|
-
import 'magic-sdk';
|
|
34
|
-
import 'ethers';
|
|
35
|
-
import '@dynamic-labs/wallet-connector-core';
|
|
36
|
-
import './utils/logger.js';
|
|
37
|
-
import { EmailOTPMagicWalletConnector } from './wallets/ethereum/MagicConnector/EmailOTPMagicWalletConnector/EmailOTPMagicWalletConnector.js';
|
|
38
|
-
import { MagicSocialWalletConnector } from './wallets/ethereum/MagicConnector/MagicSocialWalletConnector/MagicSocialWalletConnector.js';
|
|
39
|
-
import { isEmailWalletConnector } from './utils/isEmailWalletConnector/isEmailWalletConnector.js';
|
|
40
|
-
import { getKeplerConnector } from './wallets/cosmos/getKeplrConnector.js';
|
|
41
|
-
import Zerion from './wallets/ethereum/injected/Zerion.js';
|
|
42
|
-
import { getMobileOrInjectedWallet } from './wallets/getMobileOrInjectedWallet.js';
|
|
43
|
-
import MetaMask from './wallets/ethereum/meta-mask.js';
|
|
44
|
-
import Trust from './wallets/ethereum/injected/Trust.js';
|
|
4
|
+
import { isMobile, isIPad, isIPhone } from '@dynamic-labs/utils';
|
|
5
|
+
import { getApiProviders } from './utils/getApiProviders.js';
|
|
45
6
|
|
|
46
7
|
let wallets = [];
|
|
47
|
-
// These wallets are either not supported or implement their
|
|
48
|
-
// own WalletConnect connector
|
|
49
|
-
const filteredWalletConnectWallets = [
|
|
50
|
-
'MetaMask',
|
|
51
|
-
'Gnosis Safe',
|
|
52
|
-
'Trust',
|
|
53
|
-
'lilico',
|
|
54
|
-
'Keplr',
|
|
55
|
-
'Zerion',
|
|
56
|
-
];
|
|
57
8
|
const defaultWalletUiUtils = {
|
|
58
9
|
enableInternalSign: () => {
|
|
59
10
|
throw Error('enableInternalSign, not implemented');
|
|
@@ -65,106 +16,31 @@ const defaultWalletUiUtils = {
|
|
|
65
16
|
throw Error('signMessage not implemented');
|
|
66
17
|
},
|
|
67
18
|
};
|
|
68
|
-
const getSupportedWallets = (
|
|
69
|
-
appLogoUrl: '',
|
|
70
|
-
appName: '',
|
|
71
|
-
isWalletConnectV2Enabled: false,
|
|
72
|
-
networkConfigurations: { cosmos: [], evm: [], solana: [], starknet: [] },
|
|
73
|
-
skipMemo: false,
|
|
74
|
-
vendorCredentials: {},
|
|
75
|
-
walletConnectProjectId: '',
|
|
76
|
-
}) => __awaiter(void 0, void 0, void 0, function* () {
|
|
19
|
+
const getSupportedWallets = (args) => __awaiter(void 0, void 0, void 0, function* () {
|
|
20
|
+
const { appLogoUrl = '', appName = '', chainRpcProviders, isWalletConnectV2Enabled = false, networkConfigurations = { cosmos: [], evm: [], solana: [], starknet: [] }, customerApiProviders = [], skipMemo = false, walletConnectProjectId = '', walletConnectorsProp, walletUiUtils = undefined, } = args;
|
|
77
21
|
if (!skipMemo && wallets.length > 0) {
|
|
78
22
|
return wallets;
|
|
79
23
|
}
|
|
80
24
|
const evmNetworkConfigs = (networkConfigurations === null || networkConfigurations === void 0 ? void 0 : networkConfigurations.evm) || [];
|
|
81
25
|
const solanaNetworkConfigs = (networkConfigurations === null || networkConfigurations === void 0 ? void 0 : networkConfigurations.solana) || [];
|
|
82
26
|
const cosmosNetworkConfigs = (networkConfigurations === null || networkConfigurations === void 0 ? void 0 : networkConfigurations.cosmos) || [];
|
|
83
|
-
const
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
walletConnectName: 'Trust',
|
|
101
|
-
}),
|
|
102
|
-
new PhantomEvm({ evmNetworks: evmNetworkConfigs }),
|
|
103
|
-
new PhantomLedger({ solNetworks: solanaNetworkConfigs }),
|
|
104
|
-
new Coinbase({
|
|
105
|
-
appLogoUrl,
|
|
106
|
-
appName,
|
|
107
|
-
evmNetworks: evmNetworkConfigs,
|
|
108
|
-
}),
|
|
109
|
-
new Solflare({ solNetworks: solanaNetworkConfigs }),
|
|
110
|
-
new Glow({ solNetworks: solanaNetworkConfigs }),
|
|
111
|
-
new Slope({ solNetworks: solanaNetworkConfigs }),
|
|
112
|
-
new Dapper({ appLogoUrl, appName }),
|
|
113
|
-
new Blocto({ appLogoUrl, appName }),
|
|
114
|
-
new BloctoEvm({ evmNetworks: evmNetworkConfigs }),
|
|
115
|
-
new BloctoInjected({ evmNetworks: evmNetworkConfigs }),
|
|
116
|
-
getWalletConnectConnector({
|
|
117
|
-
evmNetworks: evmNetworkConfigs,
|
|
118
|
-
isWalletConnectV2Enabled,
|
|
119
|
-
projectId: walletConnectProjectId,
|
|
120
|
-
}),
|
|
121
|
-
new BraveSol({ solNetworks: solanaNetworkConfigs }),
|
|
122
|
-
new BraveEvm({ evmNetworks: evmNetworkConfigs }),
|
|
123
|
-
new UnknownInjectedWallet({ evmNetworks: evmNetworkConfigs }),
|
|
124
|
-
new GameStop({ evmNetworks: evmNetworkConfigs }),
|
|
125
|
-
new ExodusEvm({ evmNetworks: evmNetworkConfigs }),
|
|
126
|
-
new ExodusSol({ solNetworks: solanaNetworkConfigs }),
|
|
127
|
-
new Opera({ evmNetworks: evmNetworkConfigs }),
|
|
128
|
-
...(magicLinkApiKey
|
|
129
|
-
? [
|
|
130
|
-
new EmailOTPMagicWalletConnector({
|
|
131
|
-
apiKey: magicLinkApiKey,
|
|
132
|
-
config: magicLinkConfig,
|
|
133
|
-
evmNetworks: evmNetworkConfigs,
|
|
134
|
-
walletUiUtils: walletUiUtils || defaultWalletUiUtils,
|
|
135
|
-
}),
|
|
136
|
-
new MagicSocialWalletConnector({
|
|
137
|
-
apiKey: magicLinkApiKey,
|
|
138
|
-
config: magicLinkConfig,
|
|
139
|
-
evmNetworks: evmNetworkConfigs,
|
|
140
|
-
walletUiUtils: walletUiUtils || defaultWalletUiUtils,
|
|
141
|
-
}),
|
|
142
|
-
]
|
|
143
|
-
: []),
|
|
144
|
-
new MyAlgoWalletConnector(),
|
|
145
|
-
new ArgentX(),
|
|
146
|
-
new Braavos(),
|
|
147
|
-
new CoinbaseSolana({ solNetworks: solanaNetworkConfigs }),
|
|
148
|
-
new Frame({ evmNetworks: evmNetworkConfigs }),
|
|
149
|
-
new Lilico({ appLogoUrl, appName }),
|
|
150
|
-
getMobileOrInjectedWallet({
|
|
151
|
-
evmNetworks: evmNetworkConfigs,
|
|
152
|
-
injectedWallet: new Zerion({ evmNetworks: evmNetworkConfigs }),
|
|
153
|
-
isWalletConnectV2: isWalletConnectV2Enabled,
|
|
154
|
-
walletConnectName: 'Zerion',
|
|
155
|
-
}),
|
|
156
|
-
//TODO: https://linear.app/dynamic-labs/issue/DYN-2127/rename-evmnetworks-to-networks-across-the-application
|
|
157
|
-
getKeplerConnector({ evmNetworks: cosmosNetworkConfigs }),
|
|
158
|
-
...((vendorCredentials === null || vendorCredentials === void 0 ? void 0 : vendorCredentials.fortmatic)
|
|
159
|
-
? [
|
|
160
|
-
new Fortmatic({
|
|
161
|
-
apiKey: vendorCredentials.fortmatic,
|
|
162
|
-
evmNetworks: evmNetworkConfigs,
|
|
163
|
-
}),
|
|
164
|
-
]
|
|
165
|
-
: []),
|
|
166
|
-
...filtered,
|
|
167
|
-
];
|
|
27
|
+
const apiProviders = getApiProviders(customerApiProviders);
|
|
28
|
+
const opts = {
|
|
29
|
+
apiProviders,
|
|
30
|
+
appLogoUrl,
|
|
31
|
+
appName,
|
|
32
|
+
chainRpcProviders,
|
|
33
|
+
cosmosNetworks: cosmosNetworkConfigs,
|
|
34
|
+
evmNetworks: evmNetworkConfigs,
|
|
35
|
+
isWalletConnectV2Enabled,
|
|
36
|
+
projectId: walletConnectProjectId,
|
|
37
|
+
solNetworks: solanaNetworkConfigs,
|
|
38
|
+
walletUiUtils: walletUiUtils || defaultWalletUiUtils,
|
|
39
|
+
};
|
|
40
|
+
const allWallets = walletConnectorsProp
|
|
41
|
+
.map((walletConnector) => walletConnector(opts))
|
|
42
|
+
.flat()
|
|
43
|
+
.map((wallet) => new wallet(opts).getMobileOrInstalledWallet());
|
|
168
44
|
yield Promise.all(allWallets.map((wallet) => { var _a; return (_a = wallet.init) === null || _a === void 0 ? void 0 : _a.call(wallet); }));
|
|
169
45
|
// Memoize the wallets
|
|
170
46
|
const filteredWallets = filterWalletsForPlatform(allWallets);
|
|
@@ -193,20 +69,12 @@ const filterWalletsForPlatform = (wallets) => wallets.filter((wallet) => {
|
|
|
193
69
|
return true;
|
|
194
70
|
}
|
|
195
71
|
else {
|
|
196
|
-
return handleMobileWalletFilter(
|
|
72
|
+
return handleMobileWalletFilter(metadata);
|
|
197
73
|
}
|
|
198
74
|
});
|
|
199
|
-
const handleMobileWalletFilter = (
|
|
75
|
+
const handleMobileWalletFilter = (metadata) => {
|
|
200
76
|
if (!metadata.mobile)
|
|
201
77
|
return false;
|
|
202
|
-
/**
|
|
203
|
-
* Custom check added with DYN-1489 for mobile version only:
|
|
204
|
-
* it shows a WalletConnect listItem that wraps-up all the WalletConnect wallets
|
|
205
|
-
* in a new wallet-list view.
|
|
206
|
-
*/
|
|
207
|
-
if (wallet.isWalletConnect && wallet.name === 'WalletConnect') {
|
|
208
|
-
return true;
|
|
209
|
-
}
|
|
210
78
|
/**
|
|
211
79
|
* WalletConnect provides a "universal" and "native" deep link. They recommend using
|
|
212
80
|
* the universal deep link over the native one due to UX differences, and our current
|
|
@@ -265,14 +133,10 @@ const getSupportedChainsForWalletConnector = (walletConnector) => {
|
|
|
265
133
|
};
|
|
266
134
|
const getEnabledWallets = (props) => __awaiter(void 0, void 0, void 0, function* () {
|
|
267
135
|
const supportedWallets = yield getSupportedWallets(props.getSupportedWalletOpts);
|
|
268
|
-
const
|
|
269
|
-
|
|
270
|
-
wallet.isInstalledOnBrowser() === props.installed;
|
|
271
|
-
const allEnabledWallets = supportedWallets.filter((wallet) => isKeplrWalletEnabled(wallet) ||
|
|
272
|
-
(props.enabledChains.some((chain) => getSupportedChainsForWalletConnector(wallet).includes(chain)) &&
|
|
273
|
-
wallet.isInstalledOnBrowser() === props.installed) ||
|
|
136
|
+
const allEnabledWallets = supportedWallets.filter((wallet) => (props.enabledChains.some((chain) => getSupportedChainsForWalletConnector(wallet).includes(chain)) &&
|
|
137
|
+
wallet.isInstalledOnBrowser() === props.installed) ||
|
|
274
138
|
wallet.key === 'magiclink');
|
|
275
139
|
return allEnabledWallets;
|
|
276
140
|
});
|
|
277
141
|
|
|
278
|
-
export {
|
|
142
|
+
export { getEnabledWallets, getSupportedChainsForWalletConnector, getSupportedWallets };
|
package/src/types.d.ts
CHANGED
|
@@ -1,58 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import { WalletConnector, Chain } from '@dynamic-labs/wallet-connector-core';
|
|
6
|
-
import { EvmNetwork } from './wallets/ethereum/evm-network';
|
|
7
|
-
import { MagicLinkConfig } from './wallets/ethereum/MagicConnector';
|
|
8
|
-
export type VendorCredentials = {
|
|
9
|
-
fortmatic?: string;
|
|
10
|
-
};
|
|
11
|
-
export type EvmRpcProvider = {
|
|
12
|
-
chainId: number;
|
|
13
|
-
chainName: string;
|
|
14
|
-
provider: ethers.providers.JsonRpcProvider;
|
|
15
|
-
};
|
|
16
|
-
export type SolanaRpcProvider = {
|
|
17
|
-
chainId?: number;
|
|
18
|
-
chainName: string;
|
|
19
|
-
provider: Connection;
|
|
20
|
-
};
|
|
21
|
-
export type RpcProviders = {
|
|
22
|
-
evm?: EvmRpcProvider[];
|
|
23
|
-
solana?: SolanaRpcProvider[];
|
|
24
|
-
};
|
|
25
|
-
export type NetworkConfigurationMap = {
|
|
26
|
-
cosmos: EvmNetwork[] | undefined;
|
|
27
|
-
evm: EvmNetwork[] | undefined;
|
|
28
|
-
solana: NetworkConfiguration[] | undefined;
|
|
29
|
-
starknet: NetworkConfiguration[] | undefined;
|
|
30
|
-
};
|
|
1
|
+
import type { Provider } from '@dynamic-labs/sdk-api';
|
|
2
|
+
import { WalletConnector, Chain, WalletConnectorsMethod } from '@dynamic-labs/wallet-connector-core';
|
|
3
|
+
import { NetworkConfigurationMap, WalletUiUtils } from '@dynamic-labs/types';
|
|
4
|
+
import { ChainRpcProviders } from '@dynamic-labs/rpc-providers';
|
|
31
5
|
export type GetSupportedWalletsOpts = {
|
|
32
6
|
appLogoUrl?: string;
|
|
33
7
|
appName?: string;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
networkConfigurations
|
|
8
|
+
chainRpcProviders: typeof ChainRpcProviders;
|
|
9
|
+
customerApiProviders?: Provider[];
|
|
10
|
+
isWalletConnectV2Enabled?: boolean;
|
|
11
|
+
networkConfigurations?: NetworkConfigurationMap;
|
|
38
12
|
skipMemo?: boolean;
|
|
39
|
-
|
|
40
|
-
|
|
13
|
+
walletConnectProjectId?: string;
|
|
14
|
+
walletConnectorsProp: WalletConnectorsMethod[];
|
|
41
15
|
walletUiUtils?: WalletUiUtils;
|
|
42
16
|
};
|
|
43
|
-
export type GetSupportedWallets = (opts
|
|
44
|
-
export type WalletUiUtils = {
|
|
45
|
-
enableInternalSign: () => void;
|
|
46
|
-
sendTransaction: (props: {
|
|
47
|
-
handler: (transaction: ethers.utils.Deferrable<ethers.providers.TransactionRequest>) => Promise<ethers.providers.TransactionResponse>;
|
|
48
|
-
provider: ethers.providers.Web3Provider;
|
|
49
|
-
transaction: ethers.utils.Deferrable<ethers.providers.TransactionRequest>;
|
|
50
|
-
}) => Promise<ethers.providers.TransactionResponse>;
|
|
51
|
-
signMessage: (props: {
|
|
52
|
-
handler: (message: string | ethers.utils.Bytes) => Promise<string>;
|
|
53
|
-
message: string | ethers.utils.Bytes;
|
|
54
|
-
}) => Promise<string>;
|
|
55
|
-
};
|
|
17
|
+
export type GetSupportedWallets = (opts: GetSupportedWalletsOpts) => Promise<WalletConnector[]>;
|
|
56
18
|
export type ChainInfo = {
|
|
57
19
|
blockchainName: string;
|
|
58
20
|
displayName: string;
|
|
@@ -63,4 +25,3 @@ export type ChainWihtIcon = {
|
|
|
63
25
|
icon?: string;
|
|
64
26
|
name: string | undefined;
|
|
65
27
|
};
|
|
66
|
-
export type SocialOAuthProvider = OAuthProvider;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var sdkApi = require('@dynamic-labs/sdk-api');
|
|
6
|
+
|
|
7
|
+
const getApiProviders = (providers) => Object.values(sdkApi.ProviderEnum).reduce((acc, provider) => {
|
|
8
|
+
const foundProvider = providers.find((providerSetting) => providerSetting.provider === provider);
|
|
9
|
+
if (foundProvider) {
|
|
10
|
+
acc[provider] = foundProvider;
|
|
11
|
+
}
|
|
12
|
+
return acc;
|
|
13
|
+
}, {});
|
|
14
|
+
|
|
15
|
+
exports.getApiProviders = getApiProviders;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Provider, ProviderEnum } from '@dynamic-labs/sdk-api';
|
|
2
|
+
export declare const getApiProviders: (providers: Provider[]) => {
|
|
3
|
+
emailOnly?: Provider | undefined;
|
|
4
|
+
magicLink?: Provider | undefined;
|
|
5
|
+
google?: Provider | undefined;
|
|
6
|
+
facebook?: Provider | undefined;
|
|
7
|
+
twitter?: Provider | undefined;
|
|
8
|
+
discord?: Provider | undefined;
|
|
9
|
+
github?: Provider | undefined;
|
|
10
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ProviderEnum } from '@dynamic-labs/sdk-api';
|
|
2
|
+
|
|
3
|
+
const getApiProviders = (providers) => Object.values(ProviderEnum).reduce((acc, provider) => {
|
|
4
|
+
const foundProvider = providers.find((providerSetting) => providerSetting.provider === provider);
|
|
5
|
+
if (foundProvider) {
|
|
6
|
+
acc[provider] = foundProvider;
|
|
7
|
+
}
|
|
8
|
+
return acc;
|
|
9
|
+
}, {});
|
|
10
|
+
|
|
11
|
+
export { getApiProviders };
|
package/src/utils/message.cjs
CHANGED
|
@@ -3,15 +3,14 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var utils = require('ethers/lib/utils');
|
|
6
|
-
var
|
|
7
|
-
var getChainInfo = require('./getChainInfo/getChainInfo.cjs');
|
|
6
|
+
var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
|
|
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:
|
|
@@ -48,7 +47,7 @@ const getEip55Address = (publicKey, chainId) => {
|
|
|
48
47
|
}
|
|
49
48
|
}
|
|
50
49
|
catch (err) {
|
|
51
|
-
|
|
50
|
+
walletConnectorCore.logger.debug(`Error getting checksum, returning default ${publicKey}`);
|
|
52
51
|
}
|
|
53
52
|
return publicKey;
|
|
54
53
|
};
|
package/src/utils/message.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Chain } from '@dynamic-labs/wallet-connector-core';
|
|
2
2
|
export interface MessageParameters {
|
|
3
3
|
blockchain: Chain;
|
|
4
|
-
chainId?: number;
|
|
4
|
+
chainId?: number | string;
|
|
5
5
|
domain: string;
|
|
6
6
|
issuedAt?: string;
|
|
7
7
|
nonce: string;
|
|
@@ -12,4 +12,4 @@ export interface MessageParameters {
|
|
|
12
12
|
uri: string;
|
|
13
13
|
}
|
|
14
14
|
export declare const generateMessageToSign: ({ blockchain, domain, chainId, nonce, uri, publicKey, issuedAt, statement, requestId, resources, }: MessageParameters) => string;
|
|
15
|
-
export declare const getEip55Address: (publicKey: string, chainId?: number) => string;
|
|
15
|
+
export declare const getEip55Address: (publicKey: string, chainId?: number | string) => string;
|
package/src/utils/message.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { getAddress } from 'ethers/lib/utils.js';
|
|
2
|
-
import { logger } from '
|
|
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;
|
package/src/errors.cjs
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
class DynamicError extends Error {
|
|
6
|
-
}
|
|
7
|
-
class NotSupportedError extends DynamicError {
|
|
8
|
-
}
|
|
9
|
-
class EmailVerificationError extends DynamicError {
|
|
10
|
-
constructor(code) {
|
|
11
|
-
super();
|
|
12
|
-
this.name = 'EmailVerificationError';
|
|
13
|
-
this.code = code;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
class NoAccessError extends DynamicError {
|
|
17
|
-
constructor(walletPublicKey) {
|
|
18
|
-
super('User does not have access');
|
|
19
|
-
this.name = 'NoAccessError';
|
|
20
|
-
this.walletPublicKey = walletPublicKey;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
class ChainalysisError extends DynamicError {
|
|
24
|
-
constructor(walletPublicKey) {
|
|
25
|
-
super('This address is not approved for access');
|
|
26
|
-
this.name = 'ChainalysisError';
|
|
27
|
-
this.walletPublicKey = walletPublicKey;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
class EmailAlreadyExistsError extends DynamicError {
|
|
31
|
-
constructor() {
|
|
32
|
-
super('Email already exists');
|
|
33
|
-
this.name = 'EmailAlreadyExistsError';
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
class UsernameAlreadyExistsError extends DynamicError {
|
|
37
|
-
constructor() {
|
|
38
|
-
super('Username already exists');
|
|
39
|
-
this.name = 'UsernameAlreadyExistsError';
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
class WalletNotDeployedError extends DynamicError {
|
|
43
|
-
constructor() {
|
|
44
|
-
super('Wallet has not been deployed');
|
|
45
|
-
this.name = 'WalletNotDeployedError';
|
|
46
|
-
this.code = 'wallet_not_deployed';
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
class WalletUsedError extends DynamicError {
|
|
50
|
-
constructor(code) {
|
|
51
|
-
super();
|
|
52
|
-
this.name = 'WalletUsedError';
|
|
53
|
-
this.code = code;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
exports.ChainalysisError = ChainalysisError;
|
|
58
|
-
exports.DynamicError = DynamicError;
|
|
59
|
-
exports.EmailAlreadyExistsError = EmailAlreadyExistsError;
|
|
60
|
-
exports.EmailVerificationError = EmailVerificationError;
|
|
61
|
-
exports.NoAccessError = NoAccessError;
|
|
62
|
-
exports.NotSupportedError = NotSupportedError;
|
|
63
|
-
exports.UsernameAlreadyExistsError = UsernameAlreadyExistsError;
|
|
64
|
-
exports.WalletNotDeployedError = WalletNotDeployedError;
|
|
65
|
-
exports.WalletUsedError = WalletUsedError;
|
package/src/errors.d.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
export declare class DynamicError extends Error {
|
|
2
|
-
}
|
|
3
|
-
export declare class NotSupportedError extends DynamicError {
|
|
4
|
-
}
|
|
5
|
-
export declare class EmailVerificationError extends DynamicError {
|
|
6
|
-
code: string | undefined;
|
|
7
|
-
constructor(code: string);
|
|
8
|
-
}
|
|
9
|
-
export declare class NoAccessError extends DynamicError {
|
|
10
|
-
walletPublicKey: string | undefined;
|
|
11
|
-
constructor(walletPublicKey: string);
|
|
12
|
-
}
|
|
13
|
-
export declare class ChainalysisError extends DynamicError {
|
|
14
|
-
walletPublicKey: string | undefined;
|
|
15
|
-
constructor(walletPublicKey: string);
|
|
16
|
-
}
|
|
17
|
-
export declare class EmailAlreadyExistsError extends DynamicError {
|
|
18
|
-
constructor();
|
|
19
|
-
}
|
|
20
|
-
export declare class UsernameAlreadyExistsError extends DynamicError {
|
|
21
|
-
constructor();
|
|
22
|
-
}
|
|
23
|
-
export declare class WalletNotDeployedError extends DynamicError {
|
|
24
|
-
code: string | undefined;
|
|
25
|
-
constructor();
|
|
26
|
-
}
|
|
27
|
-
export declare class WalletUsedError extends DynamicError {
|
|
28
|
-
code: string | undefined;
|
|
29
|
-
constructor(code: string);
|
|
30
|
-
}
|
package/src/errors.js
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
class DynamicError extends Error {
|
|
2
|
-
}
|
|
3
|
-
class NotSupportedError extends DynamicError {
|
|
4
|
-
}
|
|
5
|
-
class EmailVerificationError extends DynamicError {
|
|
6
|
-
constructor(code) {
|
|
7
|
-
super();
|
|
8
|
-
this.name = 'EmailVerificationError';
|
|
9
|
-
this.code = code;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
class NoAccessError extends DynamicError {
|
|
13
|
-
constructor(walletPublicKey) {
|
|
14
|
-
super('User does not have access');
|
|
15
|
-
this.name = 'NoAccessError';
|
|
16
|
-
this.walletPublicKey = walletPublicKey;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
class ChainalysisError extends DynamicError {
|
|
20
|
-
constructor(walletPublicKey) {
|
|
21
|
-
super('This address is not approved for access');
|
|
22
|
-
this.name = 'ChainalysisError';
|
|
23
|
-
this.walletPublicKey = walletPublicKey;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
class EmailAlreadyExistsError extends DynamicError {
|
|
27
|
-
constructor() {
|
|
28
|
-
super('Email already exists');
|
|
29
|
-
this.name = 'EmailAlreadyExistsError';
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
class UsernameAlreadyExistsError extends DynamicError {
|
|
33
|
-
constructor() {
|
|
34
|
-
super('Username already exists');
|
|
35
|
-
this.name = 'UsernameAlreadyExistsError';
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
class WalletNotDeployedError extends DynamicError {
|
|
39
|
-
constructor() {
|
|
40
|
-
super('Wallet has not been deployed');
|
|
41
|
-
this.name = 'WalletNotDeployedError';
|
|
42
|
-
this.code = 'wallet_not_deployed';
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
class WalletUsedError extends DynamicError {
|
|
46
|
-
constructor(code) {
|
|
47
|
-
super();
|
|
48
|
-
this.name = 'WalletUsedError';
|
|
49
|
-
this.code = code;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
export { ChainalysisError, DynamicError, EmailAlreadyExistsError, EmailVerificationError, NoAccessError, NotSupportedError, UsernameAlreadyExistsError, WalletNotDeployedError, WalletUsedError };
|
package/src/polyfills.cjs
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var _ = require('buffer/');
|
|
4
|
-
|
|
5
|
-
/* eslint-disable */
|
|
6
|
-
/**
|
|
7
|
-
* @walletconnect/client and @walletconnect/qrcode-modal use `global` and `Buffer`, respectively.
|
|
8
|
-
* This issue is captured here: https://github.com/WalletConnect/walletconnect-monorepo/issues/341
|
|
9
|
-
* Here are some GH issues of others facing the same problem:
|
|
10
|
-
* * https://github.com/WalletConnect/walletconnect-monorepo/issues/734
|
|
11
|
-
* * https://github.com/WalletConnect/walletconnect-monorepo/issues/748
|
|
12
|
-
*/
|
|
13
|
-
if (typeof window !== 'undefined') {
|
|
14
|
-
window.global = globalThis;
|
|
15
|
-
Object.assign(window, { Buffer: _.Buffer });
|
|
16
|
-
}
|
package/src/polyfills.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/src/polyfills.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Buffer } from 'buffer/index.js';
|
|
2
|
-
|
|
3
|
-
/* eslint-disable */
|
|
4
|
-
/**
|
|
5
|
-
* @walletconnect/client and @walletconnect/qrcode-modal use `global` and `Buffer`, respectively.
|
|
6
|
-
* This issue is captured here: https://github.com/WalletConnect/walletconnect-monorepo/issues/341
|
|
7
|
-
* Here are some GH issues of others facing the same problem:
|
|
8
|
-
* * https://github.com/WalletConnect/walletconnect-monorepo/issues/734
|
|
9
|
-
* * https://github.com/WalletConnect/walletconnect-monorepo/issues/748
|
|
10
|
-
*/
|
|
11
|
-
if (typeof window !== 'undefined') {
|
|
12
|
-
window.global = globalThis;
|
|
13
|
-
Object.assign(window, { Buffer });
|
|
14
|
-
}
|
package/src/rpcProviders.cjs
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var web3_js = require('@solana/web3.js');
|
|
6
|
-
var ethers = require('ethers');
|
|
7
|
-
|
|
8
|
-
const getRpcProviders = (configurations) => {
|
|
9
|
-
const rpcProviders = {};
|
|
10
|
-
if (configurations === null || configurations === void 0 ? void 0 : configurations.evm) {
|
|
11
|
-
rpcProviders.evm = configurations.evm.map((network) => {
|
|
12
|
-
var _a;
|
|
13
|
-
const rpcUrl = ((_a = network.privateCustomerRpcUrls) === null || _a === void 0 ? void 0 : _a[0]) || network.rpcUrls[0];
|
|
14
|
-
const provider = new ethers.ethers.providers.JsonRpcProvider(rpcUrl, network.chainId);
|
|
15
|
-
return {
|
|
16
|
-
chainId: network.chainId,
|
|
17
|
-
chainName: network.chainName,
|
|
18
|
-
provider,
|
|
19
|
-
};
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
if (configurations === null || configurations === void 0 ? void 0 : configurations.solana) {
|
|
23
|
-
rpcProviders.solana = configurations.solana.map((network) => {
|
|
24
|
-
var _a;
|
|
25
|
-
const rpcUrl = ((_a = network.privateCustomerRpcUrls) === null || _a === void 0 ? void 0 : _a[0]) || network.rpcUrls[0];
|
|
26
|
-
const provider = new web3_js.Connection(rpcUrl);
|
|
27
|
-
return {
|
|
28
|
-
chainId: parseInt(network.chainId),
|
|
29
|
-
chainName: network.name,
|
|
30
|
-
provider,
|
|
31
|
-
};
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
if (Object.keys(rpcProviders).length === 0) {
|
|
35
|
-
return undefined;
|
|
36
|
-
}
|
|
37
|
-
return rpcProviders;
|
|
38
|
-
};
|
|
39
|
-
const getEvmDefaultRpcProvider = (configurations) => {
|
|
40
|
-
const rpcProviders = getRpcProviders(configurations);
|
|
41
|
-
if (!rpcProviders) {
|
|
42
|
-
return undefined;
|
|
43
|
-
}
|
|
44
|
-
if (!rpcProviders.evm) {
|
|
45
|
-
return undefined;
|
|
46
|
-
}
|
|
47
|
-
const defaultProvider = rpcProviders.evm.find((provider) => provider.chainId === 1);
|
|
48
|
-
return defaultProvider;
|
|
49
|
-
};
|
|
50
|
-
const getSolanaDefaultRpcProvider = (configurations) => {
|
|
51
|
-
const rpcProviders = getRpcProviders(configurations);
|
|
52
|
-
if (!rpcProviders) {
|
|
53
|
-
return undefined;
|
|
54
|
-
}
|
|
55
|
-
if (!rpcProviders.solana) {
|
|
56
|
-
return undefined;
|
|
57
|
-
}
|
|
58
|
-
const defaultProvider = rpcProviders.solana.find((provider) => provider.chainId === 101);
|
|
59
|
-
return defaultProvider;
|
|
60
|
-
};
|
|
61
|
-
const getEvmRpcProviderByChainId = (configurations, chainId) => {
|
|
62
|
-
const rpcProviders = getRpcProviders(configurations);
|
|
63
|
-
if (!rpcProviders) {
|
|
64
|
-
return undefined;
|
|
65
|
-
}
|
|
66
|
-
if (rpcProviders.evm) {
|
|
67
|
-
const evmRpcProvider = rpcProviders.evm.find((rpcProvider) => rpcProvider.chainId === chainId);
|
|
68
|
-
return evmRpcProvider;
|
|
69
|
-
}
|
|
70
|
-
return undefined;
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
exports.getEvmDefaultRpcProvider = getEvmDefaultRpcProvider;
|
|
74
|
-
exports.getEvmRpcProviderByChainId = getEvmRpcProviderByChainId;
|
|
75
|
-
exports.getRpcProviders = getRpcProviders;
|
|
76
|
-
exports.getSolanaDefaultRpcProvider = getSolanaDefaultRpcProvider;
|