@dynamic-labs/wallet-connector-core 0.17.14 → 0.17.16
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 +14 -0
- package/package.json +5 -5
- package/src/utils/walletConnectDeepLinks/performPlatformSpecificConnectionMethod.cjs +2 -2
- package/src/utils/walletConnectDeepLinks/performPlatformSpecificConnectionMethod.d.ts +1 -1
- package/src/utils/walletConnectDeepLinks/performPlatformSpecificConnectionMethod.js +2 -2
- package/src/utils/walletConnectDeepLinks/walletConnectDeepLinks.cjs +13 -9
- package/src/utils/walletConnectDeepLinks/walletConnectDeepLinks.d.ts +2 -1
- package/src/utils/walletConnectDeepLinks/walletConnectDeepLinks.js +13 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,18 @@
|
|
|
1
1
|
|
|
2
|
+
### [0.17.16](https://github.com/dynamic-labs/DynamicAuth/compare/v0.17.15...v0.17.16) (2023-06-28)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Bug Fixes
|
|
6
|
+
|
|
7
|
+
* flip native and universal on WC1 ([#2509](https://github.com/dynamic-labs/DynamicAuth/issues/2509)) ([fdc6728](https://github.com/dynamic-labs/DynamicAuth/commit/fdc672877ecfc44ee93d8e0e24e007de625c03a6))
|
|
8
|
+
|
|
9
|
+
### [0.17.15](https://github.com/dynamic-labs/DynamicAuth/compare/v0.17.14...v0.17.15) (2023-06-28)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
* **wc_v1_bridget:** disable WC v2 when WC v1 bridge is set ([#2505](https://github.com/dynamic-labs/DynamicAuth/issues/2505)) ([#2506](https://github.com/dynamic-labs/DynamicAuth/issues/2506)) ([ed7dcf2](https://github.com/dynamic-labs/DynamicAuth/commit/ed7dcf2168f5486a780933060e61eff3fe0ff59e))
|
|
15
|
+
|
|
2
16
|
### [0.17.14](https://github.com/dynamic-labs/DynamicAuth/compare/v0.17.13...v0.17.14) (2023-06-27)
|
|
3
17
|
|
|
4
18
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/wallet-connector-core",
|
|
3
|
-
"version": "0.17.
|
|
3
|
+
"version": "0.17.16",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/dynamic-labs/DynamicAuth.git",
|
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {},
|
|
29
29
|
"peerDependencies": {
|
|
30
|
-
"@dynamic-labs/logger": "0.17.
|
|
31
|
-
"@dynamic-labs/rpc-providers": "0.17.
|
|
32
|
-
"@dynamic-labs/utils": "0.17.
|
|
33
|
-
"@dynamic-labs/wallet-book": "0.17.
|
|
30
|
+
"@dynamic-labs/logger": "0.17.16",
|
|
31
|
+
"@dynamic-labs/rpc-providers": "0.17.16",
|
|
32
|
+
"@dynamic-labs/utils": "0.17.16",
|
|
33
|
+
"@dynamic-labs/wallet-book": "0.17.16"
|
|
34
34
|
}
|
|
35
35
|
}
|
|
@@ -5,9 +5,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var utils = require('@dynamic-labs/utils');
|
|
6
6
|
var walletConnectDeepLinks = require('./walletConnectDeepLinks.cjs');
|
|
7
7
|
|
|
8
|
-
const performPlatformSpecificConnectionMethod = (uri, metadata, opts) => {
|
|
8
|
+
const performPlatformSpecificConnectionMethod = (uri, metadata, opts, isWC2) => {
|
|
9
9
|
var _a, _b, _c;
|
|
10
|
-
const deepLink = walletConnectDeepLinks.getDeepLink({ metadata, mode: 'connection', uri });
|
|
10
|
+
const deepLink = walletConnectDeepLinks.getDeepLink({ isWC2, metadata, mode: 'connection', uri });
|
|
11
11
|
if (utils.isMobile()) {
|
|
12
12
|
window.location.href = deepLink;
|
|
13
13
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { WalletSchema } from '@dynamic-labs/wallet-book';
|
|
2
2
|
import type { FetchPublicAddressOpts } from '../../lib';
|
|
3
|
-
export declare const performPlatformSpecificConnectionMethod: (uri: string, metadata: WalletSchema, opts: Pick<FetchPublicAddressOpts, 'onDesktopUri' | 'onDisplayUri'
|
|
3
|
+
export declare const performPlatformSpecificConnectionMethod: (uri: string, metadata: WalletSchema, opts: Pick<FetchPublicAddressOpts, 'onDesktopUri' | 'onDisplayUri'>, isWC2: boolean) => void;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { isMobile } from '@dynamic-labs/utils';
|
|
2
2
|
import { getDeepLink } from './walletConnectDeepLinks.js';
|
|
3
3
|
|
|
4
|
-
const performPlatformSpecificConnectionMethod = (uri, metadata, opts) => {
|
|
4
|
+
const performPlatformSpecificConnectionMethod = (uri, metadata, opts, isWC2) => {
|
|
5
5
|
var _a, _b, _c;
|
|
6
|
-
const deepLink = getDeepLink({ metadata, mode: 'connection', uri });
|
|
6
|
+
const deepLink = getDeepLink({ isWC2, metadata, mode: 'connection', uri });
|
|
7
7
|
if (isMobile()) {
|
|
8
8
|
window.location.href = deepLink;
|
|
9
9
|
}
|
|
@@ -4,32 +4,36 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var utils = require('@dynamic-labs/utils');
|
|
6
6
|
|
|
7
|
-
const getConnectionDeepLink = (uri, metadata) => {
|
|
7
|
+
const getConnectionDeepLink = (uri, metadata, isWC2) => {
|
|
8
8
|
// on android, the connection deeplink is simply the uri
|
|
9
9
|
// see: https://docs.walletconnect.com/mobile-linking#for-android
|
|
10
10
|
if (utils.isAndroid()) {
|
|
11
11
|
return uri;
|
|
12
12
|
}
|
|
13
|
-
const deepLink = getRegularDeepLink(uri, metadata);
|
|
13
|
+
const deepLink = getRegularDeepLink(uri, metadata, isWC2);
|
|
14
14
|
return `${deepLink}?uri=${encodeURIComponent(uri)}`;
|
|
15
15
|
};
|
|
16
|
-
const getRegularDeepLink = (uri, metadata) => {
|
|
17
|
-
var _a, _b;
|
|
16
|
+
const getRegularDeepLink = (uri, metadata, isWC2) => {
|
|
17
|
+
var _a, _b, _c, _d;
|
|
18
18
|
if (utils.isAndroid()) {
|
|
19
19
|
// on android, the deeplink is simply the uri, without the query params
|
|
20
20
|
// see: https://docs.walletconnect.com/mobile-linking#for-android
|
|
21
21
|
return uri.split('?')[0];
|
|
22
22
|
}
|
|
23
23
|
const index = utils.isMobile() ? 'mobile' : 'desktop';
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
if (isWC2) {
|
|
25
|
+
return ((_a = metadata[index]) === null || _a === void 0 ? void 0 : _a.native) || ((_b = metadata[index]) === null || _b === void 0 ? void 0 : _b.universal) || '';
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
return ((_c = metadata[index]) === null || _c === void 0 ? void 0 : _c.universal) || ((_d = metadata[index]) === null || _d === void 0 ? void 0 : _d.native) || '';
|
|
29
|
+
}
|
|
26
30
|
};
|
|
27
|
-
const getDeepLink = ({ mode, uri = '', metadata, }) => {
|
|
31
|
+
const getDeepLink = ({ mode, uri = '', metadata, isWC2, }) => {
|
|
28
32
|
switch (mode) {
|
|
29
33
|
case 'connection':
|
|
30
|
-
return getConnectionDeepLink(uri, metadata);
|
|
34
|
+
return getConnectionDeepLink(uri, metadata, isWC2);
|
|
31
35
|
case 'regular':
|
|
32
|
-
return getRegularDeepLink(uri, metadata);
|
|
36
|
+
return getRegularDeepLink(uri, metadata, isWC2);
|
|
33
37
|
}
|
|
34
38
|
};
|
|
35
39
|
|
|
@@ -3,6 +3,7 @@ type GetDeepLinkArgs = {
|
|
|
3
3
|
metadata: WalletSchema;
|
|
4
4
|
mode: 'connection' | 'regular';
|
|
5
5
|
uri?: string;
|
|
6
|
+
isWC2: boolean;
|
|
6
7
|
};
|
|
7
|
-
export declare const getDeepLink: ({ mode, uri, metadata, }: GetDeepLinkArgs) => string;
|
|
8
|
+
export declare const getDeepLink: ({ mode, uri, metadata, isWC2, }: GetDeepLinkArgs) => string;
|
|
8
9
|
export {};
|
|
@@ -1,31 +1,35 @@
|
|
|
1
1
|
import { isAndroid, isMobile } from '@dynamic-labs/utils';
|
|
2
2
|
|
|
3
|
-
const getConnectionDeepLink = (uri, metadata) => {
|
|
3
|
+
const getConnectionDeepLink = (uri, metadata, isWC2) => {
|
|
4
4
|
// on android, the connection deeplink is simply the uri
|
|
5
5
|
// see: https://docs.walletconnect.com/mobile-linking#for-android
|
|
6
6
|
if (isAndroid()) {
|
|
7
7
|
return uri;
|
|
8
8
|
}
|
|
9
|
-
const deepLink = getRegularDeepLink(uri, metadata);
|
|
9
|
+
const deepLink = getRegularDeepLink(uri, metadata, isWC2);
|
|
10
10
|
return `${deepLink}?uri=${encodeURIComponent(uri)}`;
|
|
11
11
|
};
|
|
12
|
-
const getRegularDeepLink = (uri, metadata) => {
|
|
13
|
-
var _a, _b;
|
|
12
|
+
const getRegularDeepLink = (uri, metadata, isWC2) => {
|
|
13
|
+
var _a, _b, _c, _d;
|
|
14
14
|
if (isAndroid()) {
|
|
15
15
|
// on android, the deeplink is simply the uri, without the query params
|
|
16
16
|
// see: https://docs.walletconnect.com/mobile-linking#for-android
|
|
17
17
|
return uri.split('?')[0];
|
|
18
18
|
}
|
|
19
19
|
const index = isMobile() ? 'mobile' : 'desktop';
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
if (isWC2) {
|
|
21
|
+
return ((_a = metadata[index]) === null || _a === void 0 ? void 0 : _a.native) || ((_b = metadata[index]) === null || _b === void 0 ? void 0 : _b.universal) || '';
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
return ((_c = metadata[index]) === null || _c === void 0 ? void 0 : _c.universal) || ((_d = metadata[index]) === null || _d === void 0 ? void 0 : _d.native) || '';
|
|
25
|
+
}
|
|
22
26
|
};
|
|
23
|
-
const getDeepLink = ({ mode, uri = '', metadata, }) => {
|
|
27
|
+
const getDeepLink = ({ mode, uri = '', metadata, isWC2, }) => {
|
|
24
28
|
switch (mode) {
|
|
25
29
|
case 'connection':
|
|
26
|
-
return getConnectionDeepLink(uri, metadata);
|
|
30
|
+
return getConnectionDeepLink(uri, metadata, isWC2);
|
|
27
31
|
case 'regular':
|
|
28
|
-
return getRegularDeepLink(uri, metadata);
|
|
32
|
+
return getRegularDeepLink(uri, metadata, isWC2);
|
|
29
33
|
}
|
|
30
34
|
};
|
|
31
35
|
|