@dynamic-labs/multi-wallet 0.16.18 → 0.16.19
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
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
|
|
2
|
+
### [0.16.19](https://github.com/dynamic-labs/DynamicAuth/compare/v0.16.18...v0.16.19) (2023-06-01)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Bug Fixes
|
|
6
|
+
|
|
7
|
+
* use wcv2 only if wallet supports it ([#2204](https://github.com/dynamic-labs/DynamicAuth/issues/2204)) ([f314d29](https://github.com/dynamic-labs/DynamicAuth/commit/f314d2940611fb130c43cb15526efe83e995d0ad))
|
|
8
|
+
|
|
2
9
|
### [0.16.18](https://github.com/dynamic-labs/DynamicAuth/compare/v0.16.17...v0.16.18) (2023-05-31)
|
|
3
10
|
|
|
4
11
|
|
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.19",
|
|
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.19",
|
|
32
|
+
"@dynamic-labs/wallet-connector-core": "0.16.19"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@walletconnect/types": "^2.2.1"
|
|
@@ -2,24 +2,29 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
var walletBook = require('@dynamic-labs/wallet-book');
|
|
5
6
|
var walletConnect = require('./walletConnect/walletConnect.cjs');
|
|
6
7
|
var walletConnectV2 = require('./walletConnect/walletConnectV2.cjs');
|
|
7
8
|
|
|
8
9
|
const getMobileOrInjectedWallet = ({ evmNetworks, injectedWallet, isWalletConnectV2 = false, walletConnectName, }) => {
|
|
10
|
+
var _a, _b;
|
|
9
11
|
if (injectedWallet.isInstalledOnBrowser()) {
|
|
10
12
|
return injectedWallet;
|
|
11
13
|
}
|
|
12
|
-
else if (isWalletConnectV2) {
|
|
13
|
-
return new walletConnectV2["default"]({
|
|
14
|
-
evmNetworks,
|
|
15
|
-
walletName: walletConnectName,
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
14
|
else {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
15
|
+
const wallet = walletBook.getWalletBookWallet(walletConnectName);
|
|
16
|
+
if (isWalletConnectV2 && ((_b = (_a = wallet.walletConnect) === null || _a === void 0 ? void 0 : _a.sdks) === null || _b === void 0 ? void 0 : _b.includes('sign_v2'))) {
|
|
17
|
+
return new walletConnectV2["default"]({
|
|
18
|
+
evmNetworks,
|
|
19
|
+
walletName: walletConnectName,
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
return new walletConnect({
|
|
24
|
+
evmNetworks,
|
|
25
|
+
walletName: walletConnectName,
|
|
26
|
+
});
|
|
27
|
+
}
|
|
23
28
|
}
|
|
24
29
|
};
|
|
25
30
|
|
|
@@ -1,21 +1,26 @@
|
|
|
1
|
+
import { getWalletBookWallet } from '@dynamic-labs/wallet-book';
|
|
1
2
|
import WalletConnect from './walletConnect/walletConnect.js';
|
|
2
3
|
import WalletConnectV2 from './walletConnect/walletConnectV2.js';
|
|
3
4
|
|
|
4
5
|
const getMobileOrInjectedWallet = ({ evmNetworks, injectedWallet, isWalletConnectV2 = false, walletConnectName, }) => {
|
|
6
|
+
var _a, _b;
|
|
5
7
|
if (injectedWallet.isInstalledOnBrowser()) {
|
|
6
8
|
return injectedWallet;
|
|
7
9
|
}
|
|
8
|
-
else if (isWalletConnectV2) {
|
|
9
|
-
return new WalletConnectV2({
|
|
10
|
-
evmNetworks,
|
|
11
|
-
walletName: walletConnectName,
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
10
|
else {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
11
|
+
const wallet = getWalletBookWallet(walletConnectName);
|
|
12
|
+
if (isWalletConnectV2 && ((_b = (_a = wallet.walletConnect) === null || _a === void 0 ? void 0 : _a.sdks) === null || _b === void 0 ? void 0 : _b.includes('sign_v2'))) {
|
|
13
|
+
return new WalletConnectV2({
|
|
14
|
+
evmNetworks,
|
|
15
|
+
walletName: walletConnectName,
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
return new WalletConnect({
|
|
20
|
+
evmNetworks,
|
|
21
|
+
walletName: walletConnectName,
|
|
22
|
+
});
|
|
23
|
+
}
|
|
19
24
|
}
|
|
20
25
|
};
|
|
21
26
|
|