@dynamic-labs/multi-wallet 0.17.0-RC.2 → 0.17.0-RC.21
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 +242 -0
- package/package.json +10 -26
- package/src/index.cjs +0 -69
- package/src/index.d.ts +0 -18
- package/src/index.js +1 -23
- package/src/multi-wallet.cjs +38 -182
- package/src/multi-wallet.d.ts +1 -4
- package/src/multi-wallet.js +37 -180
- package/src/types.d.ts +12 -50
- package/src/utils/getApiProviders.cjs +15 -0
- package/src/utils/getApiProviders.d.ts +17 -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/utils/convertors.cjs
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var constants = require('../wallets/constants.cjs');
|
|
6
|
-
|
|
7
|
-
const bufferToBase64 = (buf) => {
|
|
8
|
-
const binstr = Array.prototype.map
|
|
9
|
-
.call(buf, (ch) => String.fromCharCode(ch))
|
|
10
|
-
.join('');
|
|
11
|
-
return btoa(binstr);
|
|
12
|
-
};
|
|
13
|
-
const defaultTypedData = Object.assign(Object.assign({}, constants.DEFAULT_STARKNET_TYPED_DATA_DOMAIN), { primaryType: 'Message', types: {
|
|
14
|
-
Message: [
|
|
15
|
-
{
|
|
16
|
-
name: 'message',
|
|
17
|
-
type: 'felt',
|
|
18
|
-
},
|
|
19
|
-
],
|
|
20
|
-
StarkNetDomain: [
|
|
21
|
-
{
|
|
22
|
-
name: 'name',
|
|
23
|
-
type: 'felt',
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
name: 'chainId',
|
|
27
|
-
type: 'felt',
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
name: 'version',
|
|
31
|
-
type: 'felt',
|
|
32
|
-
},
|
|
33
|
-
],
|
|
34
|
-
} });
|
|
35
|
-
const formatTypedDataMessage = (inputMessage, chainId = 'SN_MAIN') => {
|
|
36
|
-
const message = {
|
|
37
|
-
message: inputMessage.substring(0, 31),
|
|
38
|
-
};
|
|
39
|
-
return Object.assign(Object.assign({}, defaultTypedData), { domain: Object.assign(Object.assign({}, defaultTypedData.domain), { chainId }), message });
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
exports.bufferToBase64 = bufferToBase64;
|
|
43
|
-
exports.formatTypedDataMessage = formatTypedDataMessage;
|
package/src/utils/convertors.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { DEFAULT_STARKNET_TYPED_DATA_DOMAIN } from '../wallets/constants.js';
|
|
2
|
-
|
|
3
|
-
const bufferToBase64 = (buf) => {
|
|
4
|
-
const binstr = Array.prototype.map
|
|
5
|
-
.call(buf, (ch) => String.fromCharCode(ch))
|
|
6
|
-
.join('');
|
|
7
|
-
return btoa(binstr);
|
|
8
|
-
};
|
|
9
|
-
const defaultTypedData = Object.assign(Object.assign({}, DEFAULT_STARKNET_TYPED_DATA_DOMAIN), { primaryType: 'Message', types: {
|
|
10
|
-
Message: [
|
|
11
|
-
{
|
|
12
|
-
name: 'message',
|
|
13
|
-
type: 'felt',
|
|
14
|
-
},
|
|
15
|
-
],
|
|
16
|
-
StarkNetDomain: [
|
|
17
|
-
{
|
|
18
|
-
name: 'name',
|
|
19
|
-
type: 'felt',
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
name: 'chainId',
|
|
23
|
-
type: 'felt',
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
name: 'version',
|
|
27
|
-
type: 'felt',
|
|
28
|
-
},
|
|
29
|
-
],
|
|
30
|
-
} });
|
|
31
|
-
const formatTypedDataMessage = (inputMessage, chainId = 'SN_MAIN') => {
|
|
32
|
-
const message = {
|
|
33
|
-
message: inputMessage.substring(0, 31),
|
|
34
|
-
};
|
|
35
|
-
return Object.assign(Object.assign({}, defaultTypedData), { domain: Object.assign(Object.assign({}, defaultTypedData.domain), { chainId }), message });
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
export { bufferToBase64, formatTypedDataMessage };
|
package/src/utils/encoding.cjs
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
// taken from https://github.com/WalletConnect/walletconnect-utils/blob/master/misc/encoding/src/index.ts
|
|
6
|
-
const ENC_HEX = 'hex';
|
|
7
|
-
const ENC_UTF8 = 'utf8';
|
|
8
|
-
const utf8ToBuffer = (utf8) => Buffer.from(utf8, ENC_UTF8);
|
|
9
|
-
const addHexPrefix = (hex) => hex.startsWith('0x') ? hex : `0x${hex}`;
|
|
10
|
-
const bufferToHex = (buf, prefixed = false) => {
|
|
11
|
-
const hex = buf.toString(ENC_HEX);
|
|
12
|
-
return prefixed ? addHexPrefix(hex) : hex;
|
|
13
|
-
};
|
|
14
|
-
const utf8ToHex = (utf8, prefixed = false) => bufferToHex(utf8ToBuffer(utf8), prefixed);
|
|
15
|
-
|
|
16
|
-
exports.addHexPrefix = addHexPrefix;
|
|
17
|
-
exports.bufferToHex = bufferToHex;
|
|
18
|
-
exports.utf8ToHex = utf8ToHex;
|
package/src/utils/encoding.d.ts
DELETED
package/src/utils/encoding.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
// taken from https://github.com/WalletConnect/walletconnect-utils/blob/master/misc/encoding/src/index.ts
|
|
2
|
-
const ENC_HEX = 'hex';
|
|
3
|
-
const ENC_UTF8 = 'utf8';
|
|
4
|
-
const utf8ToBuffer = (utf8) => Buffer.from(utf8, ENC_UTF8);
|
|
5
|
-
const addHexPrefix = (hex) => hex.startsWith('0x') ? hex : `0x${hex}`;
|
|
6
|
-
const bufferToHex = (buf, prefixed = false) => {
|
|
7
|
-
const hex = buf.toString(ENC_HEX);
|
|
8
|
-
return prefixed ? addHexPrefix(hex) : hex;
|
|
9
|
-
};
|
|
10
|
-
const utf8ToHex = (utf8, prefixed = false) => bufferToHex(utf8ToBuffer(utf8), prefixed);
|
|
11
|
-
|
|
12
|
-
export { addHexPrefix, bufferToHex, utf8ToHex };
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
const extractNonce = (messageToSign) => {
|
|
6
|
-
const regex = messageToSign.match(/Nonce: (.*)/);
|
|
7
|
-
if (regex && regex.length === 2) {
|
|
8
|
-
return regex[1];
|
|
9
|
-
}
|
|
10
|
-
return undefined;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
exports.extractNonce = extractNonce;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const extractNonce: (messageToSign: string) => string | undefined;
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
const chainsInfo = [
|
|
6
|
-
{
|
|
7
|
-
blockchainName: 'Algorand',
|
|
8
|
-
displayName: 'Algorand',
|
|
9
|
-
name: 'algorand',
|
|
10
|
-
symbol: 'ALGO',
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
blockchainName: 'Ethereum',
|
|
14
|
-
displayName: 'EVM',
|
|
15
|
-
name: 'evm',
|
|
16
|
-
symbol: 'ETH',
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
blockchainName: 'Flow',
|
|
20
|
-
displayName: 'Flow',
|
|
21
|
-
name: 'flow',
|
|
22
|
-
symbol: 'FLOW',
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
blockchainName: 'Solana',
|
|
26
|
-
displayName: 'Solana',
|
|
27
|
-
name: 'solana',
|
|
28
|
-
symbol: 'SOL',
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
blockchainName: 'Starknet',
|
|
32
|
-
displayName: 'Starknet',
|
|
33
|
-
name: 'starknet',
|
|
34
|
-
symbol: 'STARK',
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
blockchainName: 'Cosmos',
|
|
38
|
-
displayName: 'Cosmos',
|
|
39
|
-
name: 'cosmos',
|
|
40
|
-
symbol: 'COSMOS',
|
|
41
|
-
},
|
|
42
|
-
];
|
|
43
|
-
const chainOverrides = {
|
|
44
|
-
eip155: 'evm',
|
|
45
|
-
eth: 'evm',
|
|
46
|
-
};
|
|
47
|
-
const getChainInfo = (chain) => {
|
|
48
|
-
var _a;
|
|
49
|
-
const lowerCasedChain = chain.toLowerCase();
|
|
50
|
-
const normalizedChain = (_a = chainOverrides[lowerCasedChain]) !== null && _a !== void 0 ? _a : lowerCasedChain;
|
|
51
|
-
const chainInfo = chainsInfo.find((info) => info.name === normalizedChain ||
|
|
52
|
-
info.symbol.toLocaleLowerCase() === normalizedChain);
|
|
53
|
-
if (!chainInfo) {
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
return chainInfo;
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
exports.getChainInfo = getChainInfo;
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
const chainsInfo = [
|
|
2
|
-
{
|
|
3
|
-
blockchainName: 'Algorand',
|
|
4
|
-
displayName: 'Algorand',
|
|
5
|
-
name: 'algorand',
|
|
6
|
-
symbol: 'ALGO',
|
|
7
|
-
},
|
|
8
|
-
{
|
|
9
|
-
blockchainName: 'Ethereum',
|
|
10
|
-
displayName: 'EVM',
|
|
11
|
-
name: 'evm',
|
|
12
|
-
symbol: 'ETH',
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
blockchainName: 'Flow',
|
|
16
|
-
displayName: 'Flow',
|
|
17
|
-
name: 'flow',
|
|
18
|
-
symbol: 'FLOW',
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
blockchainName: 'Solana',
|
|
22
|
-
displayName: 'Solana',
|
|
23
|
-
name: 'solana',
|
|
24
|
-
symbol: 'SOL',
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
blockchainName: 'Starknet',
|
|
28
|
-
displayName: 'Starknet',
|
|
29
|
-
name: 'starknet',
|
|
30
|
-
symbol: 'STARK',
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
blockchainName: 'Cosmos',
|
|
34
|
-
displayName: 'Cosmos',
|
|
35
|
-
name: 'cosmos',
|
|
36
|
-
symbol: 'COSMOS',
|
|
37
|
-
},
|
|
38
|
-
];
|
|
39
|
-
const chainOverrides = {
|
|
40
|
-
eip155: 'evm',
|
|
41
|
-
eth: 'evm',
|
|
42
|
-
};
|
|
43
|
-
const getChainInfo = (chain) => {
|
|
44
|
-
var _a;
|
|
45
|
-
const lowerCasedChain = chain.toLowerCase();
|
|
46
|
-
const normalizedChain = (_a = chainOverrides[lowerCasedChain]) !== null && _a !== void 0 ? _a : lowerCasedChain;
|
|
47
|
-
const chainInfo = chainsInfo.find((info) => info.name === normalizedChain ||
|
|
48
|
-
info.symbol.toLocaleLowerCase() === normalizedChain);
|
|
49
|
-
if (!chainInfo) {
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
52
|
-
return chainInfo;
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
export { getChainInfo };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { getChainInfo } from './getChainInfo';
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var normalizeWalletName = require('./normalizeWalletName/normalizeWalletName.cjs');
|
|
6
|
-
|
|
7
|
-
const filterWalletsByName = (wallets, names) => names
|
|
8
|
-
.flatMap((name) => wallets.find((w) => walletHasName(w, name)))
|
|
9
|
-
.filter(isWalletConnector);
|
|
10
|
-
const walletHasName = (wallet, name) => normalizeWalletName.normalizeWalletName(wallet.name) === name;
|
|
11
|
-
const isWalletConnector = (item) => Boolean(item);
|
|
12
|
-
const getWalletConnectorByName = (wallets, name) => {
|
|
13
|
-
const normalizedWalletname = normalizeWalletName.normalizeWalletName(name);
|
|
14
|
-
return filterWalletsByName(wallets, [normalizedWalletname]).length > 0
|
|
15
|
-
? filterWalletsByName(wallets, [normalizedWalletname])[0]
|
|
16
|
-
: null;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
exports.getWalletConnectorByName = getWalletConnectorByName;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { normalizeWalletName } from './normalizeWalletName/normalizeWalletName.js';
|
|
2
|
-
|
|
3
|
-
const filterWalletsByName = (wallets, names) => names
|
|
4
|
-
.flatMap((name) => wallets.find((w) => walletHasName(w, name)))
|
|
5
|
-
.filter(isWalletConnector);
|
|
6
|
-
const walletHasName = (wallet, name) => normalizeWalletName(wallet.name) === name;
|
|
7
|
-
const isWalletConnector = (item) => Boolean(item);
|
|
8
|
-
const getWalletConnectorByName = (wallets, name) => {
|
|
9
|
-
const normalizedWalletname = normalizeWalletName(name);
|
|
10
|
-
return filterWalletsByName(wallets, [normalizedWalletname]).length > 0
|
|
11
|
-
? filterWalletsByName(wallets, [normalizedWalletname])[0]
|
|
12
|
-
: null;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export { getWalletConnectorByName };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { isEmailOTPWalletConnector } from './isEmailOTPWalletConnector';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { isEmailWalletConnector } from './isEmailWalletConnector';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { isFunction } from './isFunction';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const isFunction: (value: Function | unknown) => value is Function;
|
package/src/utils/isMobile.cjs
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Sourced from http://detectmobilebrowsers.com/
|
|
7
|
-
*/
|
|
8
|
-
/* eslint-disable max-len, no-useless-escape */
|
|
9
|
-
const userAgentRegex1 = /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i;
|
|
10
|
-
const userAgentRegex2 = /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i;
|
|
11
|
-
// This is a regex that covers both iphone, android and any other mobile device.
|
|
12
|
-
const isMobile = (maxTouchPointsOverride) => {
|
|
13
|
-
if (typeof window === 'undefined' || typeof navigator === 'undefined') {
|
|
14
|
-
return false;
|
|
15
|
-
}
|
|
16
|
-
return (userAgentRegex1.test(navigator.userAgent) ||
|
|
17
|
-
userAgentRegex2.test(navigator.userAgent.substring(0, 4)) ||
|
|
18
|
-
isIPad(maxTouchPointsOverride) ||
|
|
19
|
-
isIPhone());
|
|
20
|
-
};
|
|
21
|
-
const isIPhone = () => typeof window === 'undefined' || typeof navigator === 'undefined'
|
|
22
|
-
? false
|
|
23
|
-
: /iPhone/.test(navigator.userAgent);
|
|
24
|
-
/**
|
|
25
|
-
* @param [optional] maxTouchPointsOverride - this is used for testing since
|
|
26
|
-
* it seems that JSDOM doesn't support maxTouchPoints, so it was impossible
|
|
27
|
-
* to mock it
|
|
28
|
-
*/
|
|
29
|
-
const isIPad = (maxTouchPointsOverride) => {
|
|
30
|
-
if (typeof window === 'undefined' || typeof navigator === 'undefined') {
|
|
31
|
-
return false;
|
|
32
|
-
}
|
|
33
|
-
const maxTouchPoints = maxTouchPointsOverride || navigator.maxTouchPoints;
|
|
34
|
-
return (/iPad/.test(navigator.userAgent) ||
|
|
35
|
-
(/Mac/.test(navigator.userAgent) && maxTouchPoints === 5));
|
|
36
|
-
};
|
|
37
|
-
const isIOS = (maxTouchPointsOverride) => {
|
|
38
|
-
if (typeof window === 'undefined' || typeof navigator === 'undefined') {
|
|
39
|
-
return false;
|
|
40
|
-
}
|
|
41
|
-
return isIPhone() || isIPad(maxTouchPointsOverride);
|
|
42
|
-
};
|
|
43
|
-
const isSamsungBrowser = () => {
|
|
44
|
-
if (typeof window === 'undefined' || typeof navigator === 'undefined') {
|
|
45
|
-
return false;
|
|
46
|
-
}
|
|
47
|
-
return navigator.userAgent.includes('SamsungBrowser');
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
exports.isIOS = isIOS;
|
|
51
|
-
exports.isIPad = isIPad;
|
|
52
|
-
exports.isIPhone = isIPhone;
|
|
53
|
-
exports.isMobile = isMobile;
|
|
54
|
-
exports.isSamsungBrowser = isSamsungBrowser;
|
package/src/utils/isMobile.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Sourced from http://detectmobilebrowsers.com/
|
|
3
|
-
*/
|
|
4
|
-
export declare const isMobile: (maxTouchPointsOverride?: number) => boolean;
|
|
5
|
-
export declare const isIPhone: () => boolean;
|
|
6
|
-
/**
|
|
7
|
-
* @param [optional] maxTouchPointsOverride - this is used for testing since
|
|
8
|
-
* it seems that JSDOM doesn't support maxTouchPoints, so it was impossible
|
|
9
|
-
* to mock it
|
|
10
|
-
*/
|
|
11
|
-
export declare const isIPad: (maxTouchPointsOverride?: number) => boolean;
|
|
12
|
-
export declare const isIOS: (maxTouchPointsOverride?: number) => boolean;
|
|
13
|
-
export declare const isSamsungBrowser: () => boolean;
|
package/src/utils/isMobile.js
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Sourced from http://detectmobilebrowsers.com/
|
|
3
|
-
*/
|
|
4
|
-
/* eslint-disable max-len, no-useless-escape */
|
|
5
|
-
const userAgentRegex1 = /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i;
|
|
6
|
-
const userAgentRegex2 = /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i;
|
|
7
|
-
// This is a regex that covers both iphone, android and any other mobile device.
|
|
8
|
-
const isMobile = (maxTouchPointsOverride) => {
|
|
9
|
-
if (typeof window === 'undefined' || typeof navigator === 'undefined') {
|
|
10
|
-
return false;
|
|
11
|
-
}
|
|
12
|
-
return (userAgentRegex1.test(navigator.userAgent) ||
|
|
13
|
-
userAgentRegex2.test(navigator.userAgent.substring(0, 4)) ||
|
|
14
|
-
isIPad(maxTouchPointsOverride) ||
|
|
15
|
-
isIPhone());
|
|
16
|
-
};
|
|
17
|
-
const isIPhone = () => typeof window === 'undefined' || typeof navigator === 'undefined'
|
|
18
|
-
? false
|
|
19
|
-
: /iPhone/.test(navigator.userAgent);
|
|
20
|
-
/**
|
|
21
|
-
* @param [optional] maxTouchPointsOverride - this is used for testing since
|
|
22
|
-
* it seems that JSDOM doesn't support maxTouchPoints, so it was impossible
|
|
23
|
-
* to mock it
|
|
24
|
-
*/
|
|
25
|
-
const isIPad = (maxTouchPointsOverride) => {
|
|
26
|
-
if (typeof window === 'undefined' || typeof navigator === 'undefined') {
|
|
27
|
-
return false;
|
|
28
|
-
}
|
|
29
|
-
const maxTouchPoints = maxTouchPointsOverride || navigator.maxTouchPoints;
|
|
30
|
-
return (/iPad/.test(navigator.userAgent) ||
|
|
31
|
-
(/Mac/.test(navigator.userAgent) && maxTouchPoints === 5));
|
|
32
|
-
};
|
|
33
|
-
const isIOS = (maxTouchPointsOverride) => {
|
|
34
|
-
if (typeof window === 'undefined' || typeof navigator === 'undefined') {
|
|
35
|
-
return false;
|
|
36
|
-
}
|
|
37
|
-
return isIPhone() || isIPad(maxTouchPointsOverride);
|
|
38
|
-
};
|
|
39
|
-
const isSamsungBrowser = () => {
|
|
40
|
-
if (typeof window === 'undefined' || typeof navigator === 'undefined') {
|
|
41
|
-
return false;
|
|
42
|
-
}
|
|
43
|
-
return navigator.userAgent.includes('SamsungBrowser');
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
export { isIOS, isIPad, isIPhone, isMobile, isSamsungBrowser };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { isSameAddress } from './isSameAddress';
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var normalizeAddress = require('./utils/normalizeAddress/normalizeAddress.cjs');
|
|
6
|
-
|
|
7
|
-
const isSameAddress = (left, right, chain) => normalizeAddress.normalizeAddress(left, chain) === normalizeAddress.normalizeAddress(right, chain);
|
|
8
|
-
|
|
9
|
-
exports.isSameAddress = isSameAddress;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const isSameAddress: (left: string, right: string, chain: string) => boolean;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './normalizeAddress';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { normalizeAddress } from './normalizeAddress';
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var shouldLowercaseAddress = require('../../../shouldLowercaseAddress.cjs');
|
|
6
|
-
|
|
7
|
-
const normalizeAddress = (rawAddress, chain) => {
|
|
8
|
-
if (rawAddress.startsWith('0x')) {
|
|
9
|
-
rawAddress = rawAddress.slice(2);
|
|
10
|
-
}
|
|
11
|
-
const address = shouldLowercaseAddress.shouldLowercaseAddress(chain)
|
|
12
|
-
? rawAddress.toLowerCase()
|
|
13
|
-
: rawAddress;
|
|
14
|
-
return address;
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
exports.normalizeAddress = normalizeAddress;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const normalizeAddress: (rawAddress: string, chain: string) => string;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { shouldLowercaseAddress } from '../../../shouldLowercaseAddress.js';
|
|
2
|
-
|
|
3
|
-
const normalizeAddress = (rawAddress, chain) => {
|
|
4
|
-
if (rawAddress.startsWith('0x')) {
|
|
5
|
-
rawAddress = rawAddress.slice(2);
|
|
6
|
-
}
|
|
7
|
-
const address = shouldLowercaseAddress(chain)
|
|
8
|
-
? rawAddress.toLowerCase()
|
|
9
|
-
: rawAddress;
|
|
10
|
-
return address;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export { normalizeAddress };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { isSocialWalletConnector } from './isSocialWalletConnector';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { isUnsupportedProviderError } from './isUnsupportedProviderError';
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
const isUnsupportedProviderError = (error) => {
|
|
6
|
-
const isObject = typeof error === 'object';
|
|
7
|
-
if (!isObject)
|
|
8
|
-
return false;
|
|
9
|
-
const isUnsupportedProviderErrorReason = error['reason'] === 'unsupported provider';
|
|
10
|
-
return isUnsupportedProviderErrorReason;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
exports.isUnsupportedProviderError = isUnsupportedProviderError;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
const isUnsupportedProviderError = (error) => {
|
|
2
|
-
const isObject = typeof error === 'object';
|
|
3
|
-
if (!isObject)
|
|
4
|
-
return false;
|
|
5
|
-
const isUnsupportedProviderErrorReason = error['reason'] === 'unsupported provider';
|
|
6
|
-
return isUnsupportedProviderErrorReason;
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
export { isUnsupportedProviderError };
|