@dynamic-labs/wallet-connector-core 3.0.0-alpha.8 → 3.0.0
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 +622 -0
- package/_virtual/_tslib.cjs +13 -0
- package/_virtual/_tslib.js +13 -1
- package/package.json +7 -7
- package/src/index.cjs +11 -3
- package/src/index.d.ts +3 -3
- package/src/index.js +6 -3
- package/src/lib/IAccountAbstractionWalletConnector.d.ts +11 -2
- package/src/lib/IBitcoinWalletConnector.d.ts +1 -0
- package/src/lib/IHardwareWalletConnector.d.ts +2 -1
- package/src/lib/ISendBalanceWalletConnector.d.ts +2 -1
- package/src/lib/ISessionKeyCompatibleWalletConnector.d.ts +6 -2
- package/src/lib/ITurnkeyWalletConnector.d.ts +49 -0
- package/src/lib/ITurnkeyWalletConnectorStamper.d.ts +18 -0
- package/src/lib/WalletConnector.cjs +124 -21
- package/src/lib/WalletConnector.d.ts +47 -30
- package/src/lib/WalletConnector.js +124 -21
- package/src/lib/WalletConnectorExtension.d.ts +2 -2
- package/src/lib/index.d.ts +3 -1
- package/src/lib/wallets/Wallet/Wallet.cjs +119 -0
- package/src/lib/wallets/Wallet/Wallet.d.ts +65 -0
- package/src/lib/wallets/Wallet/Wallet.js +115 -0
- package/src/lib/wallets/Wallet/index.d.ts +1 -0
- package/src/lib/wallets/index.d.ts +1 -0
- package/src/utils/getChainInfo/getChainInfo.cjs +25 -0
- package/src/utils/getChainInfo/getChainInfo.d.ts +6 -0
- package/src/utils/getChainInfo/getChainInfo.js +24 -1
- package/src/utils/getChainInfo/index.d.ts +1 -1
- package/src/utils/getMobileExperience/getMobileExperience.cjs +24 -0
- package/src/utils/getMobileExperience/getMobileExperience.d.ts +7 -0
- package/src/utils/getMobileExperience/getMobileExperience.js +20 -0
- package/src/utils/getMobileExperience/index.d.ts +1 -0
- package/src/utils/getWalletConnectorByKey.d.ts +2 -2
- package/src/utils/index.d.ts +3 -2
- package/src/utils/isAccountAbstractionConnector/index.d.ts +1 -1
- package/src/utils/isConnectorMethodSupported/index.d.ts +1 -0
- package/src/utils/isConnectorMethodSupported/isConnectorMethodSupported.cjs +14 -0
- package/src/utils/isConnectorMethodSupported/isConnectorMethodSupported.d.ts +3 -0
- package/src/utils/isConnectorMethodSupported/isConnectorMethodSupported.js +10 -0
- package/src/utils/isHardwareWalletConnector/isHardwareWalletConnector.d.ts +1 -1
- package/src/utils/isSessionKeyCompatible/index.d.ts +2 -0
- package/src/utils/isSessionKeyCompatible/isSessionKeyCompatibleWallet/index.d.ts +1 -0
- package/src/utils/isSessionKeyCompatible/isSessionKeyCompatibleWallet/isSessionKeyCompatibleWallet.cjs +10 -0
- package/src/utils/isSessionKeyCompatible/isSessionKeyCompatibleWallet/isSessionKeyCompatibleWallet.d.ts +2 -0
- package/src/utils/isSessionKeyCompatible/isSessionKeyCompatibleWallet/isSessionKeyCompatibleWallet.js +6 -0
- package/src/utils/{isSessionKeyCompatibleWalletConnector → isSessionKeyCompatible/isSessionKeyCompatibleWalletConnector}/isSessionKeyCompatibleWalletConnector.d.ts +2 -1
- package/src/utils/isTurnkeyWalletConnector/index.d.ts +1 -0
- package/src/utils/isTurnkeyWalletConnector/isTurnkeyWalletConnector.cjs +17 -0
- package/src/utils/isTurnkeyWalletConnector/isTurnkeyWalletConnector.d.ts +2 -0
- package/src/utils/isTurnkeyWalletConnector/isTurnkeyWalletConnector.js +13 -0
- package/src/lib/SmartWalletConnector.d.ts +0 -4
- package/src/utils/isSmartWalletConnector/index.d.ts +0 -1
- package/src/utils/isSmartWalletConnector/isSmartWalletConnector.cjs +0 -8
- package/src/utils/isSmartWalletConnector/isSmartWalletConnector.d.ts +0 -2
- package/src/utils/isSmartWalletConnector/isSmartWalletConnector.js +0 -4
- /package/src/utils/{isSessionKeyCompatibleWalletConnector → isSessionKeyCompatible/isSessionKeyCompatibleWalletConnector}/index.d.ts +0 -0
- /package/src/utils/{isSessionKeyCompatibleWalletConnector → isSessionKeyCompatible/isSessionKeyCompatibleWalletConnector}/isSessionKeyCompatibleWalletConnector.cjs +0 -0
- /package/src/utils/{isSessionKeyCompatibleWalletConnector → isSessionKeyCompatible/isSessionKeyCompatibleWalletConnector}/isSessionKeyCompatibleWalletConnector.js +0 -0
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { __rest, __awaiter } from '../../../../_virtual/_tslib.js';
|
|
3
|
+
import { BaseWallet } from '@dynamic-labs/types';
|
|
4
|
+
import { logger } from '../../../utils/logger.js';
|
|
5
|
+
import { normalizeAddress } from '../../../utils/isSameAddress/utils/normalizeAddress/normalizeAddress.js';
|
|
6
|
+
import '@dynamic-labs/utils';
|
|
7
|
+
import '@dynamic-labs/wallet-book';
|
|
8
|
+
|
|
9
|
+
class Wallet extends BaseWallet {
|
|
10
|
+
constructor(_a) {
|
|
11
|
+
var { connector } = _a, props = __rest(_a, ["connector"]);
|
|
12
|
+
super(props);
|
|
13
|
+
this._connector = connector;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Gets the wallet connector.
|
|
17
|
+
*/
|
|
18
|
+
get connector() {
|
|
19
|
+
return this._connector;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Retrieves the balance of the wallet.
|
|
23
|
+
* @returns A promise that resolves to the balance of the wallet as a string,
|
|
24
|
+
* or undefined if the balance cannot be retrieved.
|
|
25
|
+
*/
|
|
26
|
+
getBalance() {
|
|
27
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
28
|
+
return this._connector.getBalance(this.address);
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Retrieves the name service data associated with the wallet.
|
|
33
|
+
* @returns A promise that resolves to the name service data of the wallet,
|
|
34
|
+
* or undefined if the data cannot be retrieved.
|
|
35
|
+
*/
|
|
36
|
+
getNameService() {
|
|
37
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
38
|
+
return this._connector.getNameService(this.address);
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Retrieves the network that the wallet is connected to.
|
|
43
|
+
* @returns A promise that resolves to the network value as a string or number,
|
|
44
|
+
* or undefined if the network cannot be retrieved.
|
|
45
|
+
*/
|
|
46
|
+
getNetwork() {
|
|
47
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
48
|
+
return this._connector.getNetwork();
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* If the wallet is connected.
|
|
53
|
+
* @returns A promise that resolves to true the wallet is connected or false if it's not connected.
|
|
54
|
+
*/
|
|
55
|
+
isConnected() {
|
|
56
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
57
|
+
try {
|
|
58
|
+
const connectedAccounts = yield this._connector.getConnectedAccounts();
|
|
59
|
+
return connectedAccounts
|
|
60
|
+
.map((address) => normalizeAddress(address, this.chain))
|
|
61
|
+
.includes(normalizeAddress(this.address, this.chain));
|
|
62
|
+
}
|
|
63
|
+
catch (error) {
|
|
64
|
+
logger.error('[Wallet] isConnected - Error detecting if wallet is connected', error);
|
|
65
|
+
return false;
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Proves ownership of the wallet by signing a message.
|
|
71
|
+
* @param messageToSign - The message to sign.
|
|
72
|
+
* @returns A promise that resolves to the signature of the message as a string,
|
|
73
|
+
* or undefined if the message cannot be signed.
|
|
74
|
+
*/
|
|
75
|
+
proveOwnership(messageToSign) {
|
|
76
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
77
|
+
return this._connector.proveOwnership(this.address, messageToSign);
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Signs a message using the wallet.
|
|
82
|
+
* @param messageToSign - The message to sign.
|
|
83
|
+
* @returns A promise that resolves to the signature of the message as a string,
|
|
84
|
+
* or undefined if the message cannot be signed.
|
|
85
|
+
*/
|
|
86
|
+
signMessage(messageToSign) {
|
|
87
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
88
|
+
yield this.sync();
|
|
89
|
+
return this._connector.signMessage(messageToSign, this.address);
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Switches the network that the wallet is connected to.
|
|
94
|
+
* @param networkChainId - The chain id of the network to switch to.
|
|
95
|
+
* @returns A promise that resolves when the network is switched.
|
|
96
|
+
*/
|
|
97
|
+
switchNetwork(networkChainId) {
|
|
98
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
99
|
+
return this._connector.switchNetwork({
|
|
100
|
+
networkChainId,
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Synchronizes the wallet with the connector.
|
|
106
|
+
* @returns A promise that resolves when the wallet is connected and active.
|
|
107
|
+
*/
|
|
108
|
+
sync() {
|
|
109
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
110
|
+
return this._connector.validateActiveWallet(this.address);
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export { Wallet };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Wallet';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Wallet';
|
|
@@ -54,10 +54,18 @@ const chainsInfo = [
|
|
|
54
54
|
},
|
|
55
55
|
];
|
|
56
56
|
const chainOverrides = {
|
|
57
|
+
algo: 'algorand',
|
|
58
|
+
bip122: 'bitcoin',
|
|
59
|
+
btc: 'bitcoin',
|
|
57
60
|
eip155: 'evm',
|
|
58
61
|
eth: 'evm',
|
|
62
|
+
sol: 'solana',
|
|
59
63
|
stark: 'starknet',
|
|
60
64
|
};
|
|
65
|
+
let chainInfoOverrides;
|
|
66
|
+
const setChainInfoOverrides = (overrides) => {
|
|
67
|
+
chainInfoOverrides = overrides;
|
|
68
|
+
};
|
|
61
69
|
const getChainInfo = (chain) => {
|
|
62
70
|
var _a;
|
|
63
71
|
const lowerCasedChain = chain.toLowerCase();
|
|
@@ -69,5 +77,22 @@ const getChainInfo = (chain) => {
|
|
|
69
77
|
}
|
|
70
78
|
return chainInfo;
|
|
71
79
|
};
|
|
80
|
+
const getChainInfoWithOverrides = (chain) => {
|
|
81
|
+
var _a, _b;
|
|
82
|
+
const chainInfo = getChainInfo(chain);
|
|
83
|
+
if (!chainInfo) {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
const overrides = chainInfoOverrides === null || chainInfoOverrides === void 0 ? void 0 : chainInfoOverrides[chainInfo.name];
|
|
87
|
+
const chainInfoClone = Object.assign({}, chainInfo);
|
|
88
|
+
if (overrides) {
|
|
89
|
+
chainInfoClone.blockchainName =
|
|
90
|
+
(_a = overrides.displayName) !== null && _a !== void 0 ? _a : chainInfo.blockchainName;
|
|
91
|
+
chainInfoClone.displayName = (_b = overrides.displayName) !== null && _b !== void 0 ? _b : chainInfo.displayName;
|
|
92
|
+
}
|
|
93
|
+
return chainInfoClone;
|
|
94
|
+
};
|
|
72
95
|
|
|
73
96
|
exports.getChainInfo = getChainInfo;
|
|
97
|
+
exports.getChainInfoWithOverrides = getChainInfoWithOverrides;
|
|
98
|
+
exports.setChainInfoOverrides = setChainInfoOverrides;
|
|
@@ -1,2 +1,8 @@
|
|
|
1
1
|
import { ChainInfo } from '../../lib';
|
|
2
|
+
export type ChainName = 'algorand' | 'bitcoin' | 'evm' | 'flow' | 'solana' | 'starknet' | 'cosmos';
|
|
3
|
+
export type ChainDisplayOverrides = Partial<Record<ChainName, {
|
|
4
|
+
displayName?: string;
|
|
5
|
+
}>>;
|
|
6
|
+
export declare const setChainInfoOverrides: (overrides?: ChainDisplayOverrides) => void;
|
|
2
7
|
export declare const getChainInfo: (chain: string) => ChainInfo | undefined;
|
|
8
|
+
export declare const getChainInfoWithOverrides: (chain: string) => ChainInfo | undefined;
|
|
@@ -50,10 +50,18 @@ const chainsInfo = [
|
|
|
50
50
|
},
|
|
51
51
|
];
|
|
52
52
|
const chainOverrides = {
|
|
53
|
+
algo: 'algorand',
|
|
54
|
+
bip122: 'bitcoin',
|
|
55
|
+
btc: 'bitcoin',
|
|
53
56
|
eip155: 'evm',
|
|
54
57
|
eth: 'evm',
|
|
58
|
+
sol: 'solana',
|
|
55
59
|
stark: 'starknet',
|
|
56
60
|
};
|
|
61
|
+
let chainInfoOverrides;
|
|
62
|
+
const setChainInfoOverrides = (overrides) => {
|
|
63
|
+
chainInfoOverrides = overrides;
|
|
64
|
+
};
|
|
57
65
|
const getChainInfo = (chain) => {
|
|
58
66
|
var _a;
|
|
59
67
|
const lowerCasedChain = chain.toLowerCase();
|
|
@@ -65,5 +73,20 @@ const getChainInfo = (chain) => {
|
|
|
65
73
|
}
|
|
66
74
|
return chainInfo;
|
|
67
75
|
};
|
|
76
|
+
const getChainInfoWithOverrides = (chain) => {
|
|
77
|
+
var _a, _b;
|
|
78
|
+
const chainInfo = getChainInfo(chain);
|
|
79
|
+
if (!chainInfo) {
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
const overrides = chainInfoOverrides === null || chainInfoOverrides === void 0 ? void 0 : chainInfoOverrides[chainInfo.name];
|
|
83
|
+
const chainInfoClone = Object.assign({}, chainInfo);
|
|
84
|
+
if (overrides) {
|
|
85
|
+
chainInfoClone.blockchainName =
|
|
86
|
+
(_a = overrides.displayName) !== null && _a !== void 0 ? _a : chainInfo.blockchainName;
|
|
87
|
+
chainInfoClone.displayName = (_b = overrides.displayName) !== null && _b !== void 0 ? _b : chainInfo.displayName;
|
|
88
|
+
}
|
|
89
|
+
return chainInfoClone;
|
|
90
|
+
};
|
|
68
91
|
|
|
69
|
-
export { getChainInfo };
|
|
92
|
+
export { getChainInfo, getChainInfoWithOverrides, setChainInfoOverrides };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { getChainInfo } from './getChainInfo';
|
|
1
|
+
export { getChainInfo, setChainInfoOverrides, getChainInfoWithOverrides, type ChainDisplayOverrides, } from './getChainInfo';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var walletBook = require('@dynamic-labs/wallet-book');
|
|
7
|
+
|
|
8
|
+
const getMobileExperience = ({ mobileExperienceProp, walletBook: walletBook$1, walletKey, }) => {
|
|
9
|
+
// if the legacy prop is set, use that
|
|
10
|
+
if (mobileExperienceProp && typeof mobileExperienceProp === 'string')
|
|
11
|
+
return mobileExperienceProp;
|
|
12
|
+
// if the wallet has a deeplink preference set from the DynamicContext, use that
|
|
13
|
+
if (mobileExperienceProp === null || mobileExperienceProp === void 0 ? void 0 : mobileExperienceProp[walletKey])
|
|
14
|
+
return mobileExperienceProp[walletKey];
|
|
15
|
+
// if the wallet has a deeplink preference set in the wallet book, use that
|
|
16
|
+
const walletRecord = walletBook.findWalletBookWallet(walletBook$1, walletKey);
|
|
17
|
+
if (walletRecord === null || walletRecord === void 0 ? void 0 : walletRecord.mobileExperience)
|
|
18
|
+
return walletRecord.mobileExperience;
|
|
19
|
+
if (mobileExperienceProp === null || mobileExperienceProp === void 0 ? void 0 : mobileExperienceProp.default)
|
|
20
|
+
return mobileExperienceProp.default;
|
|
21
|
+
return 'in-app-browser';
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
exports.getMobileExperience = getMobileExperience;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { MobileExperience } from '@dynamic-labs/types';
|
|
2
|
+
import { WalletBookSchema } from '@dynamic-labs/wallet-book';
|
|
3
|
+
export declare const getMobileExperience: ({ mobileExperienceProp, walletBook, walletKey, }: {
|
|
4
|
+
mobileExperienceProp?: MobileExperience;
|
|
5
|
+
walletBook: WalletBookSchema;
|
|
6
|
+
walletKey: string;
|
|
7
|
+
}) => MobileExperience;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { findWalletBookWallet } from '@dynamic-labs/wallet-book';
|
|
3
|
+
|
|
4
|
+
const getMobileExperience = ({ mobileExperienceProp, walletBook, walletKey, }) => {
|
|
5
|
+
// if the legacy prop is set, use that
|
|
6
|
+
if (mobileExperienceProp && typeof mobileExperienceProp === 'string')
|
|
7
|
+
return mobileExperienceProp;
|
|
8
|
+
// if the wallet has a deeplink preference set from the DynamicContext, use that
|
|
9
|
+
if (mobileExperienceProp === null || mobileExperienceProp === void 0 ? void 0 : mobileExperienceProp[walletKey])
|
|
10
|
+
return mobileExperienceProp[walletKey];
|
|
11
|
+
// if the wallet has a deeplink preference set in the wallet book, use that
|
|
12
|
+
const walletRecord = findWalletBookWallet(walletBook, walletKey);
|
|
13
|
+
if (walletRecord === null || walletRecord === void 0 ? void 0 : walletRecord.mobileExperience)
|
|
14
|
+
return walletRecord.mobileExperience;
|
|
15
|
+
if (mobileExperienceProp === null || mobileExperienceProp === void 0 ? void 0 : mobileExperienceProp.default)
|
|
16
|
+
return mobileExperienceProp.default;
|
|
17
|
+
return 'in-app-browser';
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export { getMobileExperience };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './getMobileExperience';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const getWalletConnectorByKey: (wallets:
|
|
1
|
+
import { InternalWalletConnector } from '../lib';
|
|
2
|
+
export declare const getWalletConnectorByKey: (wallets: InternalWalletConnector[], key: string) => InternalWalletConnector | null;
|
package/src/utils/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export * from './ProviderLookup';
|
|
|
3
3
|
export * from './getChainInfo';
|
|
4
4
|
export * from './isEmailOTPWalletConnector';
|
|
5
5
|
export * from './isEmailWalletConnector';
|
|
6
|
+
export * from './isTurnkeyWalletConnector';
|
|
6
7
|
export * from './isSameAddress';
|
|
7
8
|
export * from './isSocialWalletConnector';
|
|
8
9
|
export * from './encoding';
|
|
@@ -13,7 +14,6 @@ export * from './isEmbeddedConnector';
|
|
|
13
14
|
export * from './isMagicConnector';
|
|
14
15
|
export * from './isBloctoConnector';
|
|
15
16
|
export * from './isPasskeyWalletConnector';
|
|
16
|
-
export * from './isSmartWalletConnector';
|
|
17
17
|
export * from './isAccountAbstractionConnector';
|
|
18
18
|
export * from './isBitcoinConnector';
|
|
19
19
|
export * from './isHardwareWalletConnector';
|
|
@@ -24,4 +24,5 @@ export * from './getRpcUrlForChain';
|
|
|
24
24
|
export * from './isCoinbaseMpcWalletConnector';
|
|
25
25
|
export * from './isWalletConnectConnector';
|
|
26
26
|
export * from './isSendBalanceWalletConnector';
|
|
27
|
-
export * from './
|
|
27
|
+
export * from './isSessionKeyCompatible';
|
|
28
|
+
export * from './getMobileExperience';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from './isAccountAbstractionConnector';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { isConnectorMethodSupported } from './isConnectorMethodSupported';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var walletBook = require('@dynamic-labs/wallet-book');
|
|
7
|
+
|
|
8
|
+
const isConnectorMethodSupported = (connector, method, platform) => {
|
|
9
|
+
const walletBookWallet = connector.constructorProps.walletData ||
|
|
10
|
+
walletBook.getWalletBookWallet(connector.walletBook, connector.key);
|
|
11
|
+
return walletBook.isWalletMethodSupported(walletBookWallet, method, platform);
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
exports.isConnectorMethodSupported = isConnectorMethodSupported;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { WalletSchema } from '@dynamic-labs/wallet-book';
|
|
2
|
+
import { InternalWalletConnector } from '../../lib';
|
|
3
|
+
export declare const isConnectorMethodSupported: (connector: InternalWalletConnector, method: string, platform: keyof NonNullable<WalletSchema['walletLimitations']>) => boolean;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { getWalletBookWallet, isWalletMethodSupported } from '@dynamic-labs/wallet-book';
|
|
3
|
+
|
|
4
|
+
const isConnectorMethodSupported = (connector, method, platform) => {
|
|
5
|
+
const walletBookWallet = connector.constructorProps.walletData ||
|
|
6
|
+
getWalletBookWallet(connector.walletBook, connector.key);
|
|
7
|
+
return isWalletMethodSupported(walletBookWallet, method, platform);
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export { isConnectorMethodSupported };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { IHardwareWalletConnector, WalletConnector } from '../../lib';
|
|
2
|
-
export declare const isHardwareWalletConnector: (connector: WalletConnector | IHardwareWalletConnector) => connector is IHardwareWalletConnector
|
|
2
|
+
export declare const isHardwareWalletConnector: (connector: WalletConnector | IHardwareWalletConnector) => connector is IHardwareWalletConnector;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './isSessionKeyCompatibleWallet';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var isSessionKeyCompatibleWalletConnector = require('../isSessionKeyCompatibleWalletConnector/isSessionKeyCompatibleWalletConnector.cjs');
|
|
7
|
+
|
|
8
|
+
const isSessionKeyCompatibleWallet = (wallet) => isSessionKeyCompatibleWalletConnector.isSessionKeyCompatibleWalletConnector(wallet.connector);
|
|
9
|
+
|
|
10
|
+
exports.isSessionKeyCompatibleWallet = isSessionKeyCompatibleWallet;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { isSessionKeyCompatibleWalletConnector } from '../isSessionKeyCompatibleWalletConnector/isSessionKeyCompatibleWalletConnector.js';
|
|
3
|
+
|
|
4
|
+
const isSessionKeyCompatibleWallet = (wallet) => isSessionKeyCompatibleWalletConnector(wallet.connector);
|
|
5
|
+
|
|
6
|
+
export { isSessionKeyCompatibleWallet };
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import { ISessionKeyCompatibleWalletConnector
|
|
1
|
+
import { ISessionKeyCompatibleWalletConnector } from '../../../lib/ISessionKeyCompatibleWalletConnector';
|
|
2
|
+
import { WalletConnector } from '../../../lib/WalletConnector';
|
|
2
3
|
export declare const isSessionKeyCompatibleWalletConnector: (walletConnector: WalletConnector | ISessionKeyCompatibleWalletConnector | undefined | null) => walletConnector is ISessionKeyCompatibleWalletConnector;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { isTurnkeyWalletConnector } from './isTurnkeyWalletConnector';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
const isTurnkeyWalletConnector = (walletConnector) => {
|
|
7
|
+
const turnkeyWalletConnector = walletConnector;
|
|
8
|
+
return Boolean(turnkeyWalletConnector &&
|
|
9
|
+
turnkeyWalletConnector.key === 'turnkeyhd' &&
|
|
10
|
+
typeof turnkeyWalletConnector.getWebAuthnAttestation === 'function' &&
|
|
11
|
+
typeof turnkeyWalletConnector.getAuthenticatorHandler === 'function' &&
|
|
12
|
+
typeof turnkeyWalletConnector.getExportHandler === 'function' &&
|
|
13
|
+
typeof turnkeyWalletConnector.isSessionKeyCompatible === 'function' &&
|
|
14
|
+
typeof turnkeyWalletConnector.createOrRestoreSession === 'function');
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
exports.isTurnkeyWalletConnector = isTurnkeyWalletConnector;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
const isTurnkeyWalletConnector = (walletConnector) => {
|
|
3
|
+
const turnkeyWalletConnector = walletConnector;
|
|
4
|
+
return Boolean(turnkeyWalletConnector &&
|
|
5
|
+
turnkeyWalletConnector.key === 'turnkeyhd' &&
|
|
6
|
+
typeof turnkeyWalletConnector.getWebAuthnAttestation === 'function' &&
|
|
7
|
+
typeof turnkeyWalletConnector.getAuthenticatorHandler === 'function' &&
|
|
8
|
+
typeof turnkeyWalletConnector.getExportHandler === 'function' &&
|
|
9
|
+
typeof turnkeyWalletConnector.isSessionKeyCompatible === 'function' &&
|
|
10
|
+
typeof turnkeyWalletConnector.createOrRestoreSession === 'function');
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export { isTurnkeyWalletConnector };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './isSmartWalletConnector';
|
|
File without changes
|
|
File without changes
|