@dynamic-labs/utils 4.8.3 → 4.8.4
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 +13 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +4 -4
- package/src/handleMobileWalletRedirect/handleMobileWalletRedirect.cjs +2 -2
- package/src/handleMobileWalletRedirect/handleMobileWalletRedirect.js +2 -2
- package/src/services/PlatformService/PlatformService.cjs +8 -0
- package/src/services/PlatformService/PlatformService.d.ts +6 -0
- package/src/services/PlatformService/PlatformService.js +8 -0
- package/src/services/PlatformService/createBrowserPlatformService/createBrowserPlatformService.cjs +1 -0
- package/src/services/PlatformService/createBrowserPlatformService/createBrowserPlatformService.js +1 -0
- package/src/services/PlatformService/types.d.ts +6 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,17 @@
|
|
|
1
1
|
|
|
2
|
+
### [4.8.4](https://github.com/dynamic-labs/dynamic-auth/compare/v4.8.3...v4.8.4) (2025-03-05)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* add iframe deeplink support for iOS Safari ([#8168](https://github.com/dynamic-labs/dynamic-auth/issues/8168)) ([cc4a6b9](https://github.com/dynamic-labs/dynamic-auth/commit/cc4a6b94b8e1b36b303ea5bf86734ba2e73bcef9))
|
|
8
|
+
* add binance bitcoin wallet support ([#8089](ttps://github.com/dynamic-labs/dynamic-auth/issues/8089)) ([c8a3a41](https://github.com/dynamic-labs/dynamic-auth/commit/c8a3a418e4f431b3442e5bc7332530b777e223c8))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* mobile wallet iframe redirects ([#8213](https://github.com/dynamic-labs/dynamic-auth/issues/8213)) ([96ea428](https://github.com/dynamic-labs/dynamic-auth/commit/96ea428375232e57379faef6e2a61dd818325777))
|
|
14
|
+
|
|
2
15
|
### [4.8.3](https://github.com/dynamic-labs/dynamic-auth/compare/v4.8.2...v4.8.3) (2025-03-04)
|
|
3
16
|
|
|
4
17
|
|
package/package.cjs
CHANGED
package/package.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/utils",
|
|
3
|
-
"version": "4.8.
|
|
3
|
+
"version": "4.8.4",
|
|
4
4
|
"description": "A React SDK for implementing wallet web3 authentication and authorization to your website.",
|
|
5
5
|
"author": "Dynamic Labs, Inc.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@dynamic-labs/sdk-api-core": "0.0.638",
|
|
22
22
|
"tldts": "6.0.16",
|
|
23
|
-
"@dynamic-labs/assert-package-version": "4.8.
|
|
24
|
-
"@dynamic-labs/logger": "4.8.
|
|
25
|
-
"@dynamic-labs/types": "4.8.
|
|
23
|
+
"@dynamic-labs/assert-package-version": "4.8.4",
|
|
24
|
+
"@dynamic-labs/logger": "4.8.4",
|
|
25
|
+
"@dynamic-labs/types": "4.8.4",
|
|
26
26
|
"buffer": "6.0.3",
|
|
27
27
|
"eventemitter3": "5.0.1"
|
|
28
28
|
},
|
|
@@ -9,8 +9,8 @@ require('../../_virtual/_tslib.cjs');
|
|
|
9
9
|
require('tldts');
|
|
10
10
|
|
|
11
11
|
const handleMobileWalletRedirect = ({ nativeLink, universalLink, }) => {
|
|
12
|
-
const url = encodeURIComponent(
|
|
13
|
-
const ref = encodeURIComponent(
|
|
12
|
+
const url = encodeURIComponent(PlatformService.PlatformService.getUrl().href);
|
|
13
|
+
const ref = encodeURIComponent(PlatformService.PlatformService.getOrigin());
|
|
14
14
|
// samsung browser only supports native links, not universal links
|
|
15
15
|
if (isMobile.isSamsungBrowser()) {
|
|
16
16
|
PlatformService.PlatformService.openURL(`${nativeLink}/${url}?ref=${ref}`);
|
|
@@ -5,8 +5,8 @@ import '../../_virtual/_tslib.js';
|
|
|
5
5
|
import 'tldts';
|
|
6
6
|
|
|
7
7
|
const handleMobileWalletRedirect = ({ nativeLink, universalLink, }) => {
|
|
8
|
-
const url = encodeURIComponent(
|
|
9
|
-
const ref = encodeURIComponent(
|
|
8
|
+
const url = encodeURIComponent(PlatformService.getUrl().href);
|
|
9
|
+
const ref = encodeURIComponent(PlatformService.getOrigin());
|
|
10
10
|
// samsung browser only supports native links, not universal links
|
|
11
11
|
if (isSamsungBrowser()) {
|
|
12
12
|
PlatformService.openURL(`${nativeLink}/${url}?ref=${ref}`);
|
|
@@ -56,6 +56,14 @@ class PlatformService {
|
|
|
56
56
|
static get getHostname() {
|
|
57
57
|
return _a.implementation.getHostname;
|
|
58
58
|
}
|
|
59
|
+
/**
|
|
60
|
+
* Gets the current URL.
|
|
61
|
+
*
|
|
62
|
+
* @example new URL(window.location.href)
|
|
63
|
+
*/
|
|
64
|
+
static get getUrl() {
|
|
65
|
+
return _a.implementation.getUrl;
|
|
66
|
+
}
|
|
59
67
|
static get getTLD() {
|
|
60
68
|
return _a.implementation.getTLD;
|
|
61
69
|
}
|
|
@@ -32,6 +32,12 @@ export declare class PlatformService {
|
|
|
32
32
|
* @example window.location.hostname
|
|
33
33
|
*/
|
|
34
34
|
static get getHostname(): () => string;
|
|
35
|
+
/**
|
|
36
|
+
* Gets the current URL.
|
|
37
|
+
*
|
|
38
|
+
* @example new URL(window.location.href)
|
|
39
|
+
*/
|
|
40
|
+
static get getUrl(): () => URL;
|
|
35
41
|
static get getTLD(): () => string | undefined;
|
|
36
42
|
/**
|
|
37
43
|
* Opens a URL. If possible, should avoid new windows.
|
|
@@ -52,6 +52,14 @@ class PlatformService {
|
|
|
52
52
|
static get getHostname() {
|
|
53
53
|
return _a.implementation.getHostname;
|
|
54
54
|
}
|
|
55
|
+
/**
|
|
56
|
+
* Gets the current URL.
|
|
57
|
+
*
|
|
58
|
+
* @example new URL(window.location.href)
|
|
59
|
+
*/
|
|
60
|
+
static get getUrl() {
|
|
61
|
+
return _a.implementation.getUrl;
|
|
62
|
+
}
|
|
55
63
|
static get getTLD() {
|
|
56
64
|
return _a.implementation.getTLD;
|
|
57
65
|
}
|
package/src/services/PlatformService/createBrowserPlatformService/createBrowserPlatformService.cjs
CHANGED
|
@@ -23,6 +23,7 @@ const createBrowserPlatformService = (window) => ({
|
|
|
23
23
|
});
|
|
24
24
|
return data.domain || undefined;
|
|
25
25
|
},
|
|
26
|
+
getUrl: () => new URL(window.location.href),
|
|
26
27
|
isNativeMobile: false,
|
|
27
28
|
openURL: (url_1, ...args_1) => _tslib.__awaiter(void 0, [url_1, ...args_1], void 0, function* (url, target = 'self', features = '') {
|
|
28
29
|
if (target === 'blank') {
|
package/src/services/PlatformService/createBrowserPlatformService/createBrowserPlatformService.js
CHANGED
|
@@ -19,6 +19,7 @@ const createBrowserPlatformService = (window) => ({
|
|
|
19
19
|
});
|
|
20
20
|
return data.domain || undefined;
|
|
21
21
|
},
|
|
22
|
+
getUrl: () => new URL(window.location.href),
|
|
22
23
|
isNativeMobile: false,
|
|
23
24
|
openURL: (url_1, ...args_1) => __awaiter(void 0, [url_1, ...args_1], void 0, function* (url, target = 'self', features = '') {
|
|
24
25
|
if (target === 'blank') {
|
|
@@ -16,6 +16,12 @@ export interface IPlatformService {
|
|
|
16
16
|
* @example window.location.host
|
|
17
17
|
*/
|
|
18
18
|
getHost(): string;
|
|
19
|
+
/**
|
|
20
|
+
* Gets the current URL.
|
|
21
|
+
*
|
|
22
|
+
* @example new URL(window.location.href)
|
|
23
|
+
*/
|
|
24
|
+
getUrl(): URL;
|
|
19
25
|
/**
|
|
20
26
|
* Gets the origin of the current location.
|
|
21
27
|
*
|