@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
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
import { __awaiter } from 'tslib';
|
|
2
|
-
import { currentUser, config, send, script, decode } from '@onflow/fcl';
|
|
3
|
-
import { WalletConnectorBase } from '@dynamic-labs/wallet-connector-core';
|
|
4
|
-
import { DynamicError } from '../../errors.js';
|
|
5
|
-
import { logger } from '../../utils/logger.js';
|
|
6
|
-
|
|
7
|
-
const get = (key) => {
|
|
8
|
-
if (typeof window === 'undefined') {
|
|
9
|
-
return undefined;
|
|
10
|
-
}
|
|
11
|
-
const value = window.localStorage.getItem(key);
|
|
12
|
-
try {
|
|
13
|
-
if (value) {
|
|
14
|
-
return JSON.parse(value);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
catch (e) {
|
|
18
|
-
logger.error(e);
|
|
19
|
-
}
|
|
20
|
-
return undefined;
|
|
21
|
-
};
|
|
22
|
-
const set = (key, value) => {
|
|
23
|
-
if (typeof window !== 'undefined') {
|
|
24
|
-
window.localStorage.setItem(key, JSON.stringify(value));
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
const LOCAL_STORAGE = {
|
|
28
|
-
can: true,
|
|
29
|
-
get: (key) => __awaiter(void 0, void 0, void 0, function* () { return get(key); }),
|
|
30
|
-
put: (key, value) => __awaiter(void 0, void 0, void 0, function* () { return set(key, value); }),
|
|
31
|
-
};
|
|
32
|
-
class FlowWalletConnector extends WalletConnectorBase {
|
|
33
|
-
constructor({ appName, appLogoUrl, }) {
|
|
34
|
-
super();
|
|
35
|
-
this.connectedChain = 'FLOW';
|
|
36
|
-
this.supportedChains = ['FLOW'];
|
|
37
|
-
this.appName = appName;
|
|
38
|
-
this.appLogoUrl = appLogoUrl;
|
|
39
|
-
}
|
|
40
|
-
connect() {
|
|
41
|
-
var _a;
|
|
42
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
43
|
-
this.setupConfig();
|
|
44
|
-
const { addr } = yield currentUser().authenticate();
|
|
45
|
-
if (addr) {
|
|
46
|
-
yield ((_a = this.onAccountChange) === null || _a === void 0 ? void 0 : _a.call(this, [addr]));
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
setupEventListeners(listeners) {
|
|
51
|
-
this.onAccountChange = listeners.onAccountChange;
|
|
52
|
-
}
|
|
53
|
-
setupConfig() {
|
|
54
|
-
this.baseConfig();
|
|
55
|
-
}
|
|
56
|
-
baseConfig() {
|
|
57
|
-
config()
|
|
58
|
-
.put('app.detail.title', this.appName)
|
|
59
|
-
.put('app.detail.icon', this.appLogoUrl)
|
|
60
|
-
.put('accessNode.api', 'https://rest-mainnet.onflow.org')
|
|
61
|
-
.put('flow.network', 'mainnet')
|
|
62
|
-
.put('fcl.storage', LOCAL_STORAGE);
|
|
63
|
-
}
|
|
64
|
-
fetchPublicAddress() {
|
|
65
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
66
|
-
try {
|
|
67
|
-
yield this.connect();
|
|
68
|
-
const user = yield currentUser().snapshot();
|
|
69
|
-
return user.addr;
|
|
70
|
-
}
|
|
71
|
-
catch (error) {
|
|
72
|
-
logger.error(error);
|
|
73
|
-
return undefined;
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
proveOwnership(messageToSign) {
|
|
78
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
79
|
-
try {
|
|
80
|
-
yield this.connect();
|
|
81
|
-
yield this.signDelay();
|
|
82
|
-
const signedMessage = yield this.signMessage(messageToSign);
|
|
83
|
-
if (!signedMessage) {
|
|
84
|
-
return undefined;
|
|
85
|
-
}
|
|
86
|
-
const data = {
|
|
87
|
-
appName: this.appName,
|
|
88
|
-
signedMessage: JSON.parse(signedMessage),
|
|
89
|
-
};
|
|
90
|
-
return JSON.stringify(data);
|
|
91
|
-
}
|
|
92
|
-
catch (error) {
|
|
93
|
-
logger.error(error);
|
|
94
|
-
return undefined;
|
|
95
|
-
}
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
signMessage(messageToSign) {
|
|
99
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
100
|
-
const message = Buffer.from(messageToSign).toString('hex');
|
|
101
|
-
const signedMessage = yield currentUser().signUserMessage(message);
|
|
102
|
-
if (signedMessage.includes('Declined')) {
|
|
103
|
-
throw new DynamicError('User declined the signature');
|
|
104
|
-
}
|
|
105
|
-
return JSON.stringify(signedMessage);
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
getBalance() {
|
|
109
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
110
|
-
this.baseConfig();
|
|
111
|
-
const address = yield this.fetchPublicAddress();
|
|
112
|
-
if (address) {
|
|
113
|
-
const code = `
|
|
114
|
-
pub fun main(): UFix64 {
|
|
115
|
-
let account = getAccount(${address});
|
|
116
|
-
return account.balance;
|
|
117
|
-
}
|
|
118
|
-
`;
|
|
119
|
-
try {
|
|
120
|
-
return yield send([script(code)]).then(decode);
|
|
121
|
-
}
|
|
122
|
-
catch (error) {
|
|
123
|
-
logger.error(error);
|
|
124
|
-
return undefined;
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
else {
|
|
128
|
-
return undefined;
|
|
129
|
-
}
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
endSession() {
|
|
133
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
134
|
-
currentUser().unauthenticate();
|
|
135
|
-
});
|
|
136
|
-
}
|
|
137
|
-
switchNetwork() {
|
|
138
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
139
|
-
throw new DynamicError('Not supported');
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
|
-
getConnectedAccounts() {
|
|
143
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
144
|
-
const user = yield currentUser().snapshot();
|
|
145
|
-
if (user.addr) {
|
|
146
|
-
return [user.addr];
|
|
147
|
-
}
|
|
148
|
-
return [];
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
|
-
signDelay() {
|
|
152
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
153
|
-
return Promise.resolve();
|
|
154
|
-
});
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
export { FlowWalletConnector, LOCAL_STORAGE };
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var fcl = require('@onflow/fcl');
|
|
4
|
-
var FlowWalletConnector = require('./FlowWalletConnector.cjs');
|
|
5
|
-
|
|
6
|
-
class Blocto extends FlowWalletConnector.FlowWalletConnector {
|
|
7
|
-
constructor() {
|
|
8
|
-
super(...arguments);
|
|
9
|
-
this.name = 'Blocto';
|
|
10
|
-
this.canConnectViaCustodialService = true;
|
|
11
|
-
}
|
|
12
|
-
setupConfig() {
|
|
13
|
-
super.setupConfig();
|
|
14
|
-
fcl.config()
|
|
15
|
-
.put('challenge.scope', 'email')
|
|
16
|
-
.put('discovery.wallet', 'https://flow-wallet.blocto.app/authn')
|
|
17
|
-
.put('service.OpenID.scopes', 'email!')
|
|
18
|
-
.put('discovery.wallet.method', undefined);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
module.exports = Blocto;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { config } from '@onflow/fcl';
|
|
2
|
-
import { FlowWalletConnector } from './FlowWalletConnector.js';
|
|
3
|
-
|
|
4
|
-
class Blocto extends FlowWalletConnector {
|
|
5
|
-
constructor() {
|
|
6
|
-
super(...arguments);
|
|
7
|
-
this.name = 'Blocto';
|
|
8
|
-
this.canConnectViaCustodialService = true;
|
|
9
|
-
}
|
|
10
|
-
setupConfig() {
|
|
11
|
-
super.setupConfig();
|
|
12
|
-
config()
|
|
13
|
-
.put('challenge.scope', 'email')
|
|
14
|
-
.put('discovery.wallet', 'https://flow-wallet.blocto.app/authn')
|
|
15
|
-
.put('service.OpenID.scopes', 'email!')
|
|
16
|
-
.put('discovery.wallet.method', undefined);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export { Blocto as default };
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var fcl = require('@onflow/fcl');
|
|
4
|
-
var FlowWalletConnector = require('./FlowWalletConnector.cjs');
|
|
5
|
-
|
|
6
|
-
class Dapper extends FlowWalletConnector.FlowWalletConnector {
|
|
7
|
-
constructor() {
|
|
8
|
-
super(...arguments);
|
|
9
|
-
this.name = 'Dapper';
|
|
10
|
-
this.canConnectViaCustodialService = true;
|
|
11
|
-
}
|
|
12
|
-
setupConfig() {
|
|
13
|
-
super.setupConfig();
|
|
14
|
-
fcl.config()
|
|
15
|
-
.put('challenge.scope', undefined)
|
|
16
|
-
.put('discovery.wallet', 'https://accounts.meetdapper.com/fcl/authn-restricted')
|
|
17
|
-
.put('service.OpenID.scopes', undefined)
|
|
18
|
-
.put('discovery.wallet.method', 'POP/RPC');
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
module.exports = Dapper;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { config } from '@onflow/fcl';
|
|
2
|
-
import { FlowWalletConnector } from './FlowWalletConnector.js';
|
|
3
|
-
|
|
4
|
-
class Dapper extends FlowWalletConnector {
|
|
5
|
-
constructor() {
|
|
6
|
-
super(...arguments);
|
|
7
|
-
this.name = 'Dapper';
|
|
8
|
-
this.canConnectViaCustodialService = true;
|
|
9
|
-
}
|
|
10
|
-
setupConfig() {
|
|
11
|
-
super.setupConfig();
|
|
12
|
-
config()
|
|
13
|
-
.put('challenge.scope', undefined)
|
|
14
|
-
.put('discovery.wallet', 'https://accounts.meetdapper.com/fcl/authn-restricted')
|
|
15
|
-
.put('service.OpenID.scopes', undefined)
|
|
16
|
-
.put('discovery.wallet.method', 'POP/RPC');
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export { Dapper as default };
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var tslib = require('tslib');
|
|
4
|
-
var fcl = require('@onflow/fcl');
|
|
5
|
-
var isMobile = require('../../utils/isMobile.cjs');
|
|
6
|
-
var FlowWalletConnector = require('./FlowWalletConnector.cjs');
|
|
7
|
-
|
|
8
|
-
class Lilico extends FlowWalletConnector.FlowWalletConnector {
|
|
9
|
-
constructor() {
|
|
10
|
-
super(...arguments);
|
|
11
|
-
this.name = 'Lilico';
|
|
12
|
-
}
|
|
13
|
-
setupConfig() {
|
|
14
|
-
super.setupConfig();
|
|
15
|
-
fcl.config()
|
|
16
|
-
.put('challenge.scope', undefined)
|
|
17
|
-
.put('discovery.wallet', 'chrome-extension://hpclkefagolihohboafpheddmmgdffjm/popup.html')
|
|
18
|
-
.put('service.OpenID.scopes', undefined)
|
|
19
|
-
.put('discovery.wallet.method', 'EXT/RPC');
|
|
20
|
-
}
|
|
21
|
-
isInstalledOnBrowser() {
|
|
22
|
-
var _a;
|
|
23
|
-
if (typeof window === 'undefined') {
|
|
24
|
-
return false;
|
|
25
|
-
}
|
|
26
|
-
return Boolean((_a = window.fcl_extensions) === null || _a === void 0 ? void 0 : _a.some((ext) => ext.id === 'hpclkefagolihohboafpheddmmgdffjm'));
|
|
27
|
-
}
|
|
28
|
-
signDelay() {
|
|
29
|
-
return tslib.__awaiter(this, void 0, void 0, function* () {
|
|
30
|
-
if (isMobile.isMobile()) {
|
|
31
|
-
return Promise.resolve();
|
|
32
|
-
}
|
|
33
|
-
return new Promise((resolve) => {
|
|
34
|
-
setTimeout(() => {
|
|
35
|
-
resolve();
|
|
36
|
-
}, 500);
|
|
37
|
-
});
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
module.exports = Lilico;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { __awaiter } from 'tslib';
|
|
2
|
-
import { config } from '@onflow/fcl';
|
|
3
|
-
import { isMobile } from '../../utils/isMobile.js';
|
|
4
|
-
import { FlowWalletConnector } from './FlowWalletConnector.js';
|
|
5
|
-
|
|
6
|
-
class Lilico extends FlowWalletConnector {
|
|
7
|
-
constructor() {
|
|
8
|
-
super(...arguments);
|
|
9
|
-
this.name = 'Lilico';
|
|
10
|
-
}
|
|
11
|
-
setupConfig() {
|
|
12
|
-
super.setupConfig();
|
|
13
|
-
config()
|
|
14
|
-
.put('challenge.scope', undefined)
|
|
15
|
-
.put('discovery.wallet', 'chrome-extension://hpclkefagolihohboafpheddmmgdffjm/popup.html')
|
|
16
|
-
.put('service.OpenID.scopes', undefined)
|
|
17
|
-
.put('discovery.wallet.method', 'EXT/RPC');
|
|
18
|
-
}
|
|
19
|
-
isInstalledOnBrowser() {
|
|
20
|
-
var _a;
|
|
21
|
-
if (typeof window === 'undefined') {
|
|
22
|
-
return false;
|
|
23
|
-
}
|
|
24
|
-
return Boolean((_a = window.fcl_extensions) === null || _a === void 0 ? void 0 : _a.some((ext) => ext.id === 'hpclkefagolihohboafpheddmmgdffjm'));
|
|
25
|
-
}
|
|
26
|
-
signDelay() {
|
|
27
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
28
|
-
if (isMobile()) {
|
|
29
|
-
return Promise.resolve();
|
|
30
|
-
}
|
|
31
|
-
return new Promise((resolve) => {
|
|
32
|
-
setTimeout(() => {
|
|
33
|
-
resolve();
|
|
34
|
-
}, 500);
|
|
35
|
-
});
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export { Lilico as default };
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var walletConnect = require('./walletConnect/walletConnect.cjs');
|
|
6
|
-
var walletConnectV2 = require('./walletConnect/walletConnectV2.cjs');
|
|
7
|
-
|
|
8
|
-
const getMobileOrInjectedWallet = ({ evmNetworks, injectedWallet, isWalletConnectV2 = false, walletConnectName, }) => {
|
|
9
|
-
if (injectedWallet.isInstalledOnBrowser()) {
|
|
10
|
-
return injectedWallet;
|
|
11
|
-
}
|
|
12
|
-
else if (isWalletConnectV2) {
|
|
13
|
-
return new walletConnectV2({
|
|
14
|
-
evmNetworks,
|
|
15
|
-
walletName: walletConnectName,
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
else {
|
|
19
|
-
return new walletConnect({
|
|
20
|
-
evmNetworks,
|
|
21
|
-
walletName: walletConnectName,
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
exports.getMobileOrInjectedWallet = getMobileOrInjectedWallet;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { WalletConnector } from '@dynamic-labs/wallet-connector-core';
|
|
2
|
-
import { EvmNetwork } from './ethereum/evm-network';
|
|
3
|
-
export declare const getMobileOrInjectedWallet: ({ evmNetworks, injectedWallet, isWalletConnectV2, walletConnectName, }: {
|
|
4
|
-
evmNetworks: EvmNetwork[];
|
|
5
|
-
injectedWallet: WalletConnector;
|
|
6
|
-
isWalletConnectV2?: boolean | undefined;
|
|
7
|
-
walletConnectName: string;
|
|
8
|
-
}) => WalletConnector;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import WalletConnect from './walletConnect/walletConnect.js';
|
|
2
|
-
import WalletConnectV2 from './walletConnect/walletConnectV2.js';
|
|
3
|
-
|
|
4
|
-
const getMobileOrInjectedWallet = ({ evmNetworks, injectedWallet, isWalletConnectV2 = false, walletConnectName, }) => {
|
|
5
|
-
if (injectedWallet.isInstalledOnBrowser()) {
|
|
6
|
-
return injectedWallet;
|
|
7
|
-
}
|
|
8
|
-
else if (isWalletConnectV2) {
|
|
9
|
-
return new WalletConnectV2({
|
|
10
|
-
evmNetworks,
|
|
11
|
-
walletName: walletConnectName,
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
else {
|
|
15
|
-
return new WalletConnect({
|
|
16
|
-
evmNetworks,
|
|
17
|
-
walletName: walletConnectName,
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export { getMobileOrInjectedWallet };
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var walletConnect = require('./walletConnect/walletConnect.cjs');
|
|
6
|
-
var walletConnectV2 = require('./walletConnect/walletConnectV2.cjs');
|
|
7
|
-
|
|
8
|
-
const getWalletConnectConnector = ({ evmNetworks, isWalletConnectV2Enabled, projectId, }) => isWalletConnectV2Enabled
|
|
9
|
-
? new walletConnectV2({
|
|
10
|
-
evmNetworks,
|
|
11
|
-
projectId,
|
|
12
|
-
walletName: 'WalletConnect',
|
|
13
|
-
})
|
|
14
|
-
: new walletConnect({
|
|
15
|
-
evmNetworks,
|
|
16
|
-
walletName: 'WalletConnect',
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
exports.getWalletConnectConnector = getWalletConnectConnector;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { EvmNetwork } from './ethereum/evm-network';
|
|
2
|
-
import WalletConnect from './walletConnect';
|
|
3
|
-
import WalletConnectV2 from './walletConnect/walletConnectV2';
|
|
4
|
-
export declare const getWalletConnectConnector: ({ evmNetworks, isWalletConnectV2Enabled, projectId, }: {
|
|
5
|
-
evmNetworks: EvmNetwork[];
|
|
6
|
-
isWalletConnectV2Enabled: boolean;
|
|
7
|
-
projectId?: string | undefined;
|
|
8
|
-
}) => WalletConnectV2 | WalletConnect;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import WalletConnect from './walletConnect/walletConnect.js';
|
|
2
|
-
import WalletConnectV2 from './walletConnect/walletConnectV2.js';
|
|
3
|
-
|
|
4
|
-
const getWalletConnectConnector = ({ evmNetworks, isWalletConnectV2Enabled, projectId, }) => isWalletConnectV2Enabled
|
|
5
|
-
? new WalletConnectV2({
|
|
6
|
-
evmNetworks,
|
|
7
|
-
projectId,
|
|
8
|
-
walletName: 'WalletConnect',
|
|
9
|
-
})
|
|
10
|
-
: new WalletConnect({
|
|
11
|
-
evmNetworks,
|
|
12
|
-
walletName: 'WalletConnect',
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
export { getWalletConnectConnector };
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var tslib = require('tslib');
|
|
4
|
-
var solWalletConnector = require('./solWalletConnector.cjs');
|
|
5
|
-
var solProviderHelper = require('./solProviderHelper.cjs');
|
|
6
|
-
|
|
7
|
-
class CoinbaseSolana extends solWalletConnector.SolWalletConnector {
|
|
8
|
-
constructor() {
|
|
9
|
-
super(...arguments);
|
|
10
|
-
this.name = 'CoinbaseSolana';
|
|
11
|
-
this.solProviderHelper = new solProviderHelper.SolProviderHelper();
|
|
12
|
-
}
|
|
13
|
-
setupEventListeners(listeners) {
|
|
14
|
-
return tslib.__awaiter(this, void 0, void 0, function* () {
|
|
15
|
-
return this.solProviderHelper._setupEventListeners(listeners, this.solProviderHelper.findProvider(this.name));
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
teardownEventListeners() {
|
|
19
|
-
this.solProviderHelper._teardownEventListeners(this.name);
|
|
20
|
-
}
|
|
21
|
-
connect() {
|
|
22
|
-
return tslib.__awaiter(this, void 0, void 0, function* () {
|
|
23
|
-
yield this.solProviderHelper.connectWithName(this.name);
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
getSigner() {
|
|
27
|
-
return tslib.__awaiter(this, void 0, void 0, function* () {
|
|
28
|
-
return this.solProviderHelper.connectWithName(this.name);
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
isInstalledOnBrowser() {
|
|
32
|
-
return this.solProviderHelper.isInstalledHelper(this.name);
|
|
33
|
-
}
|
|
34
|
-
fetchPublicAddress() {
|
|
35
|
-
return tslib.__awaiter(this, void 0, void 0, function* () {
|
|
36
|
-
if (this.isInstalledOnBrowser()) {
|
|
37
|
-
return this.solProviderHelper.fetchPublicAddressWithName(this.name);
|
|
38
|
-
}
|
|
39
|
-
return;
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
signMessage(messageToSign) {
|
|
43
|
-
return tslib.__awaiter(this, void 0, void 0, function* () {
|
|
44
|
-
return this.solProviderHelper.signMessageWithName(messageToSign, this.name);
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
getConnectedAccounts() {
|
|
48
|
-
return tslib.__awaiter(this, void 0, void 0, function* () {
|
|
49
|
-
return this.solProviderHelper.getConnectedAccountsWithName(this.name);
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
module.exports = CoinbaseSolana;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { WalletEventListeners } from '@dynamic-labs/wallet-connector-core';
|
|
2
|
-
import { ISolana } from '../window';
|
|
3
|
-
import { SolWalletConnector } from './solWalletConnector';
|
|
4
|
-
import { SolProviderHelper } from './solProviderHelper';
|
|
5
|
-
declare class CoinbaseSolana extends SolWalletConnector {
|
|
6
|
-
name: string;
|
|
7
|
-
solProviderHelper: SolProviderHelper;
|
|
8
|
-
setupEventListeners(listeners: WalletEventListeners): Promise<() => void>;
|
|
9
|
-
teardownEventListeners(): void;
|
|
10
|
-
connect(): Promise<void>;
|
|
11
|
-
getSigner(): Promise<ISolana | undefined>;
|
|
12
|
-
isInstalledOnBrowser(): boolean;
|
|
13
|
-
fetchPublicAddress(): Promise<string | undefined>;
|
|
14
|
-
signMessage(messageToSign: string): Promise<string | undefined>;
|
|
15
|
-
getConnectedAccounts(): Promise<string[]>;
|
|
16
|
-
}
|
|
17
|
-
export default CoinbaseSolana;
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { __awaiter } from 'tslib';
|
|
2
|
-
import { SolWalletConnector } from './solWalletConnector.js';
|
|
3
|
-
import { SolProviderHelper } from './solProviderHelper.js';
|
|
4
|
-
|
|
5
|
-
class CoinbaseSolana extends SolWalletConnector {
|
|
6
|
-
constructor() {
|
|
7
|
-
super(...arguments);
|
|
8
|
-
this.name = 'CoinbaseSolana';
|
|
9
|
-
this.solProviderHelper = new SolProviderHelper();
|
|
10
|
-
}
|
|
11
|
-
setupEventListeners(listeners) {
|
|
12
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
13
|
-
return this.solProviderHelper._setupEventListeners(listeners, this.solProviderHelper.findProvider(this.name));
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
teardownEventListeners() {
|
|
17
|
-
this.solProviderHelper._teardownEventListeners(this.name);
|
|
18
|
-
}
|
|
19
|
-
connect() {
|
|
20
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
21
|
-
yield this.solProviderHelper.connectWithName(this.name);
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
getSigner() {
|
|
25
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
26
|
-
return this.solProviderHelper.connectWithName(this.name);
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
isInstalledOnBrowser() {
|
|
30
|
-
return this.solProviderHelper.isInstalledHelper(this.name);
|
|
31
|
-
}
|
|
32
|
-
fetchPublicAddress() {
|
|
33
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
34
|
-
if (this.isInstalledOnBrowser()) {
|
|
35
|
-
return this.solProviderHelper.fetchPublicAddressWithName(this.name);
|
|
36
|
-
}
|
|
37
|
-
return;
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
signMessage(messageToSign) {
|
|
41
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
42
|
-
return this.solProviderHelper.signMessageWithName(messageToSign, this.name);
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
getConnectedAccounts() {
|
|
46
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
47
|
-
return this.solProviderHelper.getConnectedAccountsWithName(this.name);
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export { CoinbaseSolana as default };
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var tslib = require('tslib');
|
|
4
|
-
var solWalletConnector = require('./solWalletConnector.cjs');
|
|
5
|
-
var solProviderHelper = require('./solProviderHelper.cjs');
|
|
6
|
-
|
|
7
|
-
class Glow extends solWalletConnector.SolWalletConnector {
|
|
8
|
-
constructor() {
|
|
9
|
-
super(...arguments);
|
|
10
|
-
this.name = 'Glow';
|
|
11
|
-
this.solProviderHelper = new solProviderHelper.SolProviderHelper();
|
|
12
|
-
}
|
|
13
|
-
setupEventListeners(listeners) {
|
|
14
|
-
return tslib.__awaiter(this, void 0, void 0, function* () {
|
|
15
|
-
return this.solProviderHelper._setupEventListeners(listeners, this.solProviderHelper.findProvider(this.name));
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
teardownEventListeners() {
|
|
19
|
-
this.solProviderHelper._teardownEventListeners(this.name);
|
|
20
|
-
}
|
|
21
|
-
connect() {
|
|
22
|
-
return tslib.__awaiter(this, void 0, void 0, function* () {
|
|
23
|
-
yield this.solProviderHelper.connectWithName(this.name);
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
getSigner() {
|
|
27
|
-
return tslib.__awaiter(this, void 0, void 0, function* () {
|
|
28
|
-
return this.solProviderHelper.connectWithName(this.name);
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
isInstalledOnBrowser() {
|
|
32
|
-
return this.solProviderHelper.isInstalledHelper(this.name);
|
|
33
|
-
}
|
|
34
|
-
fetchPublicAddress() {
|
|
35
|
-
return tslib.__awaiter(this, void 0, void 0, function* () {
|
|
36
|
-
return this.solProviderHelper.fetchPublicAddressWithName(this.name);
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
signMessage(messageToSign) {
|
|
40
|
-
return tslib.__awaiter(this, void 0, void 0, function* () {
|
|
41
|
-
return this.solProviderHelper.signMessageWithName(messageToSign, this.name);
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
getConnectedAccounts() {
|
|
45
|
-
return tslib.__awaiter(this, void 0, void 0, function* () {
|
|
46
|
-
return this.solProviderHelper.getConnectedAccountsWithName(this.name);
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
module.exports = Glow;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { WalletEventListeners } from '@dynamic-labs/wallet-connector-core';
|
|
2
|
-
import { SolWalletConnector } from './solWalletConnector';
|
|
3
|
-
import { SolProviderHelper } from './solProviderHelper';
|
|
4
|
-
declare class Glow extends SolWalletConnector {
|
|
5
|
-
name: string;
|
|
6
|
-
solProviderHelper: SolProviderHelper;
|
|
7
|
-
setupEventListeners(listeners: WalletEventListeners): Promise<() => void>;
|
|
8
|
-
teardownEventListeners(): void;
|
|
9
|
-
connect(): Promise<void>;
|
|
10
|
-
getSigner(): Promise<import("../window").ISolana | undefined>;
|
|
11
|
-
isInstalledOnBrowser(): boolean;
|
|
12
|
-
fetchPublicAddress(): Promise<string | undefined>;
|
|
13
|
-
signMessage(messageToSign: string): Promise<string | undefined>;
|
|
14
|
-
getConnectedAccounts(): Promise<string[]>;
|
|
15
|
-
}
|
|
16
|
-
export default Glow;
|