@dynamic-labs/multi-wallet 0.16.21 → 0.16.22
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 +6 -0
- package/package.json +3 -3
- package/src/multi-wallet.cjs +7 -7
- package/src/multi-wallet.d.ts +1 -1
- package/src/multi-wallet.js +7 -7
- package/src/types.d.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
|
|
2
|
+
### [0.16.22](https://github.com/dynamic-labs/DynamicAuth/compare/v0.16.21...v0.16.22) (2023-06-06)
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* load primary wallet on first render ([#2263](https://github.com/dynamic-labs/DynamicAuth/pull/2263)) ([8079097](https://github.com/dynamic-labs/DynamicAuth/commit/8079097ade98ab3e302d14dc971792531cd2286d))
|
|
7
|
+
*
|
|
2
8
|
### [0.16.21](https://github.com/dynamic-labs/DynamicAuth/compare/v0.16.20...v0.16.21) (2023-06-05)
|
|
3
9
|
|
|
4
10
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/multi-wallet",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.22",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/dynamic-labs/DynamicAuth.git",
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
"magic-sdk": "^16.0.1",
|
|
29
29
|
"@keplr-wallet/provider": "0.11.56",
|
|
30
30
|
"@keplr-wallet/types": "^0.11.51",
|
|
31
|
-
"@dynamic-labs/logger": "0.16.
|
|
32
|
-
"@dynamic-labs/wallet-connector-core": "0.16.
|
|
31
|
+
"@dynamic-labs/logger": "0.16.22",
|
|
32
|
+
"@dynamic-labs/wallet-connector-core": "0.16.22"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@walletconnect/types": "^2.2.1"
|
package/src/multi-wallet.cjs
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var tslib = require('tslib');
|
|
6
5
|
var walletBook = require('@dynamic-labs/wallet-book');
|
|
7
6
|
var phantom = require('./wallets/solana/phantom.cjs');
|
|
8
7
|
var coinbase = require('./wallets/ethereum/coinbase.cjs');
|
|
@@ -34,6 +33,7 @@ var getWalletConnectConnector = require('./wallets/getWalletConnectConnector.cjs
|
|
|
34
33
|
var initializeWalletProviders = require('./wallets/initializeWalletProviders.cjs');
|
|
35
34
|
var Dawn = require('./wallets/ethereum/injected/Dawn.cjs');
|
|
36
35
|
var PhantomEvm = require('./wallets/ethereum/injected/PhantomEvm.cjs');
|
|
36
|
+
require('tslib');
|
|
37
37
|
require('ethers');
|
|
38
38
|
require('./utils/logger.cjs');
|
|
39
39
|
require('./wallets/ethereum/MagicConnector/MagicClientNetworkHandler/MagicClientNetworkHandler.cjs');
|
|
@@ -75,7 +75,7 @@ const getSupportedWallets = ({ appLogoUrl, appName, isWalletConnectV2Enabled, ne
|
|
|
75
75
|
skipMemo: false,
|
|
76
76
|
vendorCredentials: {},
|
|
77
77
|
walletConnectProjectId: '',
|
|
78
|
-
}) =>
|
|
78
|
+
}) => {
|
|
79
79
|
if (!skipMemo && wallets.length > 0) {
|
|
80
80
|
return wallets;
|
|
81
81
|
}
|
|
@@ -160,7 +160,7 @@ const getSupportedWallets = ({ appLogoUrl, appName, isWalletConnectV2Enabled, ne
|
|
|
160
160
|
: []),
|
|
161
161
|
...filtered,
|
|
162
162
|
];
|
|
163
|
-
|
|
163
|
+
initializeWalletProviders.initializeWalletProviders({
|
|
164
164
|
evmNetworks: evmNetworkConfigs,
|
|
165
165
|
isWalletConnectV2Enabled,
|
|
166
166
|
walletConnectProjectId,
|
|
@@ -169,7 +169,7 @@ const getSupportedWallets = ({ appLogoUrl, appName, isWalletConnectV2Enabled, ne
|
|
|
169
169
|
const filteredWallets = filterWalletsForPlatform(allWallets);
|
|
170
170
|
wallets = applyLinksOverrides(filteredWallets);
|
|
171
171
|
return wallets;
|
|
172
|
-
}
|
|
172
|
+
};
|
|
173
173
|
const applyLinksOverrides = (wallets) => wallets.map((wallet) => {
|
|
174
174
|
const metadata = walletBook.getWalletBookWallet(wallet.name);
|
|
175
175
|
if (metadata.switchNetworkOnlyFromWallet !== undefined) {
|
|
@@ -248,8 +248,8 @@ const getSupportedChainsForWalletConnector = (walletConnector) => {
|
|
|
248
248
|
});
|
|
249
249
|
return [...chainSet];
|
|
250
250
|
};
|
|
251
|
-
const getEnabledWallets = (props) =>
|
|
252
|
-
const supportedWallets =
|
|
251
|
+
const getEnabledWallets = (props) => {
|
|
252
|
+
const supportedWallets = getSupportedWallets(props.getSupportedWalletOpts);
|
|
253
253
|
const isKeplrWalletEnabled = (wallet) => wallet.name.includes('Keplr') &&
|
|
254
254
|
props.enabledNetworks.includes(wallet.networkId) &&
|
|
255
255
|
wallet.isInstalledOnBrowser() === props.installed;
|
|
@@ -258,7 +258,7 @@ const getEnabledWallets = (props) => tslib.__awaiter(void 0, void 0, void 0, fun
|
|
|
258
258
|
wallet.isInstalledOnBrowser() === props.installed) ||
|
|
259
259
|
wallet.key === 'magiclink');
|
|
260
260
|
return allEnabledWallets;
|
|
261
|
-
}
|
|
261
|
+
};
|
|
262
262
|
|
|
263
263
|
exports.phantomLedgerWalletName = phantomLedger.walletName;
|
|
264
264
|
exports.filteredWalletConnectWallets = filteredWalletConnectWallets;
|
package/src/multi-wallet.d.ts
CHANGED
package/src/multi-wallet.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { __awaiter } from 'tslib';
|
|
2
1
|
import { getWalletBookWallet, getWalletLinks } from '@dynamic-labs/wallet-book';
|
|
3
2
|
import Phantom from './wallets/solana/phantom.js';
|
|
4
3
|
import Coinbase from './wallets/ethereum/coinbase.js';
|
|
@@ -31,6 +30,7 @@ import { getWalletConnectConnector } from './wallets/getWalletConnectConnector.j
|
|
|
31
30
|
import { initializeWalletProviders } from './wallets/initializeWalletProviders.js';
|
|
32
31
|
import Dawn from './wallets/ethereum/injected/Dawn.js';
|
|
33
32
|
import PhantomEvm from './wallets/ethereum/injected/PhantomEvm.js';
|
|
33
|
+
import 'tslib';
|
|
34
34
|
import 'ethers';
|
|
35
35
|
import './utils/logger.js';
|
|
36
36
|
import './wallets/ethereum/MagicConnector/MagicClientNetworkHandler/MagicClientNetworkHandler.js';
|
|
@@ -72,7 +72,7 @@ const getSupportedWallets = ({ appLogoUrl, appName, isWalletConnectV2Enabled, ne
|
|
|
72
72
|
skipMemo: false,
|
|
73
73
|
vendorCredentials: {},
|
|
74
74
|
walletConnectProjectId: '',
|
|
75
|
-
}) =>
|
|
75
|
+
}) => {
|
|
76
76
|
if (!skipMemo && wallets.length > 0) {
|
|
77
77
|
return wallets;
|
|
78
78
|
}
|
|
@@ -157,7 +157,7 @@ const getSupportedWallets = ({ appLogoUrl, appName, isWalletConnectV2Enabled, ne
|
|
|
157
157
|
: []),
|
|
158
158
|
...filtered,
|
|
159
159
|
];
|
|
160
|
-
|
|
160
|
+
initializeWalletProviders({
|
|
161
161
|
evmNetworks: evmNetworkConfigs,
|
|
162
162
|
isWalletConnectV2Enabled,
|
|
163
163
|
walletConnectProjectId,
|
|
@@ -166,7 +166,7 @@ const getSupportedWallets = ({ appLogoUrl, appName, isWalletConnectV2Enabled, ne
|
|
|
166
166
|
const filteredWallets = filterWalletsForPlatform(allWallets);
|
|
167
167
|
wallets = applyLinksOverrides(filteredWallets);
|
|
168
168
|
return wallets;
|
|
169
|
-
}
|
|
169
|
+
};
|
|
170
170
|
const applyLinksOverrides = (wallets) => wallets.map((wallet) => {
|
|
171
171
|
const metadata = getWalletBookWallet(wallet.name);
|
|
172
172
|
if (metadata.switchNetworkOnlyFromWallet !== undefined) {
|
|
@@ -245,8 +245,8 @@ const getSupportedChainsForWalletConnector = (walletConnector) => {
|
|
|
245
245
|
});
|
|
246
246
|
return [...chainSet];
|
|
247
247
|
};
|
|
248
|
-
const getEnabledWallets = (props) =>
|
|
249
|
-
const supportedWallets =
|
|
248
|
+
const getEnabledWallets = (props) => {
|
|
249
|
+
const supportedWallets = getSupportedWallets(props.getSupportedWalletOpts);
|
|
250
250
|
const isKeplrWalletEnabled = (wallet) => wallet.name.includes('Keplr') &&
|
|
251
251
|
props.enabledNetworks.includes(wallet.networkId) &&
|
|
252
252
|
wallet.isInstalledOnBrowser() === props.installed;
|
|
@@ -255,6 +255,6 @@ const getEnabledWallets = (props) => __awaiter(void 0, void 0, void 0, function*
|
|
|
255
255
|
wallet.isInstalledOnBrowser() === props.installed) ||
|
|
256
256
|
wallet.key === 'magiclink');
|
|
257
257
|
return allEnabledWallets;
|
|
258
|
-
}
|
|
258
|
+
};
|
|
259
259
|
|
|
260
260
|
export { filteredWalletConnectWallets, getEnabledWallets, getSupportedChainsForWalletConnector, getSupportedWallets };
|
package/src/types.d.ts
CHANGED
|
@@ -39,7 +39,7 @@ export type GetSupportedWalletsOpts = {
|
|
|
39
39
|
walletConnectProjectId: string | undefined;
|
|
40
40
|
walletUiUtils?: WalletUiUtils;
|
|
41
41
|
};
|
|
42
|
-
export type GetSupportedWallets = (opts?: GetSupportedWalletsOpts) =>
|
|
42
|
+
export type GetSupportedWallets = (opts?: GetSupportedWalletsOpts) => WalletConnector[];
|
|
43
43
|
export type WalletUiUtils = {
|
|
44
44
|
enableInternalSign: () => void;
|
|
45
45
|
sendTransaction: (props: {
|