@dynamic-labs/utils 2.1.0-alpha.23 → 2.1.0-alpha.25
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 +22 -0
- package/package.json +5 -5
- package/src/getTLD/getTLD.cjs +2 -2
- package/src/getTLD/getTLD.js +2 -2
- package/src/index.cjs +4 -6
- package/src/index.d.ts +1 -1
- package/src/index.js +2 -3
- package/src/services/PlatformService/PlatformService.cjs +26 -0
- package/src/services/PlatformService/PlatformService.d.ts +8 -0
- package/src/services/PlatformService/PlatformService.js +22 -0
- package/src/services/{LocationService/utils/createLocationFromWindow/createLocationFromWindow.cjs → PlatformService/createBrowserPlatformService/createBrowserPlatformService.cjs} +2 -2
- package/src/services/PlatformService/createBrowserPlatformService/createBrowserPlatformService.d.ts +2 -0
- package/src/services/{LocationService/utils/createLocationFromWindow/createLocationFromWindow.js → PlatformService/createBrowserPlatformService/createBrowserPlatformService.js} +2 -2
- package/src/services/PlatformService/createBrowserPlatformService/index.d.ts +1 -0
- package/src/services/PlatformService/index.d.ts +3 -0
- package/src/services/{LocationService → PlatformService}/types.d.ts +1 -1
- package/src/services/LocationService/LocationService.cjs +0 -26
- package/src/services/LocationService/LocationService.d.ts +0 -8
- package/src/services/LocationService/LocationService.js +0 -22
- package/src/services/LocationService/index.d.ts +0 -3
- package/src/services/LocationService/utils/createLocationFromOrigin/createLocationFromOrigin.cjs +0 -14
- package/src/services/LocationService/utils/createLocationFromOrigin/createLocationFromOrigin.d.ts +0 -2
- package/src/services/LocationService/utils/createLocationFromOrigin/createLocationFromOrigin.js +0 -10
- package/src/services/LocationService/utils/createLocationFromOrigin/index.d.ts +0 -1
- package/src/services/LocationService/utils/createLocationFromWindow/createLocationFromWindow.d.ts +0 -2
- package/src/services/LocationService/utils/createLocationFromWindow/index.d.ts +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,26 @@
|
|
|
1
1
|
|
|
2
|
+
## [2.1.0-alpha.25](https://github.com/dynamic-labs/DynamicAuth/compare/v2.1.0-alpha.24...v2.1.0-alpha.25) (2024-05-27)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Bug Fixes
|
|
6
|
+
|
|
7
|
+
* btc balance calculation ([#5737](https://github.com/dynamic-labs/DynamicAuth/issues/5737)) ([9b5ceb3](https://github.com/dynamic-labs/DynamicAuth/commit/9b5ceb32d543037f60d7104f0b81b3abc86ebd10))
|
|
8
|
+
|
|
9
|
+
## [2.1.0-alpha.24](https://github.com/dynamic-labs/DynamicAuth/compare/v2.1.0-alpha.23...v2.1.0-alpha.24) (2024-05-26)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Features
|
|
13
|
+
|
|
14
|
+
* add onMfaCompleteOnce to useMfa ([#5702](https://github.com/dynamic-labs/DynamicAuth/issues/5702)) ([6451e33](https://github.com/dynamic-labs/DynamicAuth/commit/6451e3369ef1b4ba116378f0dd3fe4e82007e670))
|
|
15
|
+
* prompt custom fields during onboarding ([#5302](https://github.com/dynamic-labs/DynamicAuth/issues/5302)) ([8664223](https://github.com/dynamic-labs/DynamicAuth/commit/86642232cf2b490a820169f48ba8dc093010e1a0))
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* correct text on pending signature screen to match the embedded widget modal text ([#5707](https://github.com/dynamic-labs/DynamicAuth/issues/5707)) ([44a6a06](https://github.com/dynamic-labs/DynamicAuth/commit/44a6a0664e08d4b9fc25dd86c0e30f8d585558e0))
|
|
21
|
+
* pass captcha token for farcaster login ([#5706](https://github.com/dynamic-labs/DynamicAuth/issues/5706)) ([32bcb6e](https://github.com/dynamic-labs/DynamicAuth/commit/32bcb6e0e06c6e273c07f32893dfd550deeb6a19))
|
|
22
|
+
* use coinbase provider to get connected accounts for consistency ([#5711](https://github.com/dynamic-labs/DynamicAuth/issues/5711)) ([b9e9170](https://github.com/dynamic-labs/DynamicAuth/commit/b9e9170dad1ac27a85a44a7177b82055ce0035cb))
|
|
23
|
+
|
|
2
24
|
## [2.1.0-alpha.23](https://github.com/dynamic-labs/DynamicAuth/compare/v2.1.0-alpha.22...v2.1.0-alpha.23) (2024-05-23)
|
|
3
25
|
|
|
4
26
|
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/utils",
|
|
3
|
-
"version": "2.1.0-alpha.
|
|
3
|
+
"version": "2.1.0-alpha.25",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
|
-
"url": "https://github.com/dynamic-labs/
|
|
6
|
+
"url": "git+https://github.com/dynamic-labs/dynamic-auth.git",
|
|
7
7
|
"directory": "packages/utils"
|
|
8
8
|
},
|
|
9
9
|
"description": "A React SDK for implementing wallet web3 authentication and authorization to your website.",
|
|
@@ -26,10 +26,10 @@
|
|
|
26
26
|
"./package.json": "./package.json"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@dynamic-labs/sdk-api-core": "0.0.
|
|
29
|
+
"@dynamic-labs/sdk-api-core": "0.0.453",
|
|
30
30
|
"tldts": "6.0.16",
|
|
31
|
-
"@dynamic-labs/logger": "2.1.0-alpha.
|
|
32
|
-
"@dynamic-labs/types": "2.1.0-alpha.
|
|
31
|
+
"@dynamic-labs/logger": "2.1.0-alpha.25",
|
|
32
|
+
"@dynamic-labs/types": "2.1.0-alpha.25",
|
|
33
33
|
"buffer": "6.0.3"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
package/src/getTLD/getTLD.cjs
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var PlatformService = require('../services/PlatformService/PlatformService.cjs');
|
|
7
7
|
require('tldts');
|
|
8
8
|
|
|
9
|
-
const getTLD = () =>
|
|
9
|
+
const getTLD = () => PlatformService.PlatformService.getTLD();
|
|
10
10
|
|
|
11
11
|
exports.getTLD = getTLD;
|
package/src/getTLD/getTLD.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client'
|
|
2
|
-
import {
|
|
2
|
+
import { PlatformService } from '../services/PlatformService/PlatformService.js';
|
|
3
3
|
import 'tldts';
|
|
4
4
|
|
|
5
|
-
const getTLD = () =>
|
|
5
|
+
const getTLD = () => PlatformService.getTLD();
|
|
6
6
|
|
|
7
7
|
export { getTLD };
|
package/src/index.cjs
CHANGED
|
@@ -55,9 +55,8 @@ var ceil = require('./ceil/ceil.cjs');
|
|
|
55
55
|
var trimEnd = require('./trimEnd/trimEnd.cjs');
|
|
56
56
|
var isLedgerAddressViaVerifiedCredentials = require('./isLedgerAddressViaVerifiedCredentials.cjs');
|
|
57
57
|
var runSafe = require('./runSafe/runSafe.cjs');
|
|
58
|
-
var
|
|
59
|
-
var
|
|
60
|
-
var createLocationFromOrigin = require('./services/LocationService/utils/createLocationFromOrigin/createLocationFromOrigin.cjs');
|
|
58
|
+
var PlatformService = require('./services/PlatformService/PlatformService.cjs');
|
|
59
|
+
var createBrowserPlatformService = require('./services/PlatformService/createBrowserPlatformService/createBrowserPlatformService.cjs');
|
|
61
60
|
var FetchService = require('./services/FetchService/FetchService.cjs');
|
|
62
61
|
|
|
63
62
|
|
|
@@ -128,7 +127,6 @@ exports.ceil = ceil.ceil;
|
|
|
128
127
|
exports.trimEnd = trimEnd.trimEnd;
|
|
129
128
|
exports.isLedgerAddressViaVerifiedCredentials = isLedgerAddressViaVerifiedCredentials.isLedgerAddressViaVerifiedCredentials;
|
|
130
129
|
exports.runSafe = runSafe.runSafe;
|
|
131
|
-
exports.
|
|
132
|
-
exports.
|
|
133
|
-
exports.createLocationFromOrigin = createLocationFromOrigin.createLocationFromOrigin;
|
|
130
|
+
exports.PlatformService = PlatformService.PlatformService;
|
|
131
|
+
exports.createBrowserPlatformService = createBrowserPlatformService.createBrowserPlatformService;
|
|
134
132
|
exports.FetchService = FetchService.FetchService;
|
package/src/index.d.ts
CHANGED
|
@@ -22,5 +22,5 @@ export * from './ceil';
|
|
|
22
22
|
export * from './trimEnd';
|
|
23
23
|
export * from './isLedgerAddressViaVerifiedCredentials';
|
|
24
24
|
export { runSafe } from './runSafe';
|
|
25
|
-
export {
|
|
25
|
+
export { PlatformService, createBrowserPlatformService, type IPlatformService, } from './services/PlatformService';
|
|
26
26
|
export { FetchService } from './services/FetchService';
|
package/src/index.js
CHANGED
|
@@ -51,7 +51,6 @@ export { ceil } from './ceil/ceil.js';
|
|
|
51
51
|
export { trimEnd } from './trimEnd/trimEnd.js';
|
|
52
52
|
export { isLedgerAddressViaVerifiedCredentials } from './isLedgerAddressViaVerifiedCredentials.js';
|
|
53
53
|
export { runSafe } from './runSafe/runSafe.js';
|
|
54
|
-
export {
|
|
55
|
-
export {
|
|
56
|
-
export { createLocationFromOrigin } from './services/LocationService/utils/createLocationFromOrigin/createLocationFromOrigin.js';
|
|
54
|
+
export { PlatformService } from './services/PlatformService/PlatformService.js';
|
|
55
|
+
export { createBrowserPlatformService } from './services/PlatformService/createBrowserPlatformService/createBrowserPlatformService.js';
|
|
57
56
|
export { FetchService } from './services/FetchService/FetchService.js';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var createBrowserPlatformService = require('./createBrowserPlatformService/createBrowserPlatformService.cjs');
|
|
7
|
+
|
|
8
|
+
class PlatformService {
|
|
9
|
+
static get implementation() {
|
|
10
|
+
if (!PlatformService._implementation) {
|
|
11
|
+
return createBrowserPlatformService.createBrowserPlatformService(window);
|
|
12
|
+
}
|
|
13
|
+
return PlatformService._implementation;
|
|
14
|
+
}
|
|
15
|
+
static setImplementation(implementation) {
|
|
16
|
+
PlatformService._implementation = implementation;
|
|
17
|
+
}
|
|
18
|
+
static get getHostname() {
|
|
19
|
+
return PlatformService.implementation.getHostname;
|
|
20
|
+
}
|
|
21
|
+
static get getTLD() {
|
|
22
|
+
return PlatformService.implementation.getTLD;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
exports.PlatformService = PlatformService;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IPlatformService } from './types';
|
|
2
|
+
export declare class PlatformService {
|
|
3
|
+
static _implementation: IPlatformService;
|
|
4
|
+
static get implementation(): IPlatformService;
|
|
5
|
+
static setImplementation(implementation: IPlatformService): void;
|
|
6
|
+
static get getHostname(): () => string;
|
|
7
|
+
static get getTLD(): () => string | undefined;
|
|
8
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { createBrowserPlatformService } from './createBrowserPlatformService/createBrowserPlatformService.js';
|
|
3
|
+
|
|
4
|
+
class PlatformService {
|
|
5
|
+
static get implementation() {
|
|
6
|
+
if (!PlatformService._implementation) {
|
|
7
|
+
return createBrowserPlatformService(window);
|
|
8
|
+
}
|
|
9
|
+
return PlatformService._implementation;
|
|
10
|
+
}
|
|
11
|
+
static setImplementation(implementation) {
|
|
12
|
+
PlatformService._implementation = implementation;
|
|
13
|
+
}
|
|
14
|
+
static get getHostname() {
|
|
15
|
+
return PlatformService.implementation.getHostname;
|
|
16
|
+
}
|
|
17
|
+
static get getTLD() {
|
|
18
|
+
return PlatformService.implementation.getTLD;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export { PlatformService };
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
|
|
6
6
|
var tldts = require('tldts');
|
|
7
7
|
|
|
8
|
-
const
|
|
8
|
+
const createBrowserPlatformService = (window) => ({
|
|
9
9
|
getHostname: () => window.location.hostname,
|
|
10
10
|
getTLD: () => {
|
|
11
11
|
// Passing the allowPrivateDomains option prevents returning the actual TLD
|
|
@@ -21,4 +21,4 @@ const createLocationFromWindow = (window) => ({
|
|
|
21
21
|
},
|
|
22
22
|
});
|
|
23
23
|
|
|
24
|
-
exports.
|
|
24
|
+
exports.createBrowserPlatformService = createBrowserPlatformService;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import { parse } from 'tldts';
|
|
3
3
|
|
|
4
|
-
const
|
|
4
|
+
const createBrowserPlatformService = (window) => ({
|
|
5
5
|
getHostname: () => window.location.hostname,
|
|
6
6
|
getTLD: () => {
|
|
7
7
|
// Passing the allowPrivateDomains option prevents returning the actual TLD
|
|
@@ -17,4 +17,4 @@ const createLocationFromWindow = (window) => ({
|
|
|
17
17
|
},
|
|
18
18
|
});
|
|
19
19
|
|
|
20
|
-
export {
|
|
20
|
+
export { createBrowserPlatformService };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { createBrowserPlatformService } from './createBrowserPlatformService';
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
'use strict';
|
|
3
|
-
|
|
4
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
-
|
|
6
|
-
var createLocationFromWindow = require('./utils/createLocationFromWindow/createLocationFromWindow.cjs');
|
|
7
|
-
|
|
8
|
-
class LocationService {
|
|
9
|
-
static get implementation() {
|
|
10
|
-
if (!LocationService._implementation) {
|
|
11
|
-
return createLocationFromWindow.createLocationFromWindow(window);
|
|
12
|
-
}
|
|
13
|
-
return LocationService._implementation;
|
|
14
|
-
}
|
|
15
|
-
static setImplementation(implementation) {
|
|
16
|
-
LocationService._implementation = implementation;
|
|
17
|
-
}
|
|
18
|
-
static get getHostname() {
|
|
19
|
-
return LocationService.implementation.getHostname;
|
|
20
|
-
}
|
|
21
|
-
static get getTLD() {
|
|
22
|
-
return LocationService.implementation.getTLD;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
exports.LocationService = LocationService;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ILocation } from './types';
|
|
2
|
-
export declare class LocationService {
|
|
3
|
-
static _implementation: ILocation;
|
|
4
|
-
static get implementation(): ILocation;
|
|
5
|
-
static setImplementation(implementation: ILocation): void;
|
|
6
|
-
static get getHostname(): () => string;
|
|
7
|
-
static get getTLD(): () => string | undefined;
|
|
8
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
import { createLocationFromWindow } from './utils/createLocationFromWindow/createLocationFromWindow.js';
|
|
3
|
-
|
|
4
|
-
class LocationService {
|
|
5
|
-
static get implementation() {
|
|
6
|
-
if (!LocationService._implementation) {
|
|
7
|
-
return createLocationFromWindow(window);
|
|
8
|
-
}
|
|
9
|
-
return LocationService._implementation;
|
|
10
|
-
}
|
|
11
|
-
static setImplementation(implementation) {
|
|
12
|
-
LocationService._implementation = implementation;
|
|
13
|
-
}
|
|
14
|
-
static get getHostname() {
|
|
15
|
-
return LocationService.implementation.getHostname;
|
|
16
|
-
}
|
|
17
|
-
static get getTLD() {
|
|
18
|
-
return LocationService.implementation.getTLD;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export { LocationService };
|
package/src/services/LocationService/utils/createLocationFromOrigin/createLocationFromOrigin.cjs
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
'use strict';
|
|
3
|
-
|
|
4
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
-
|
|
6
|
-
const createLocationFromOrigin = (origin) => {
|
|
7
|
-
const url = new URL(origin);
|
|
8
|
-
return {
|
|
9
|
-
getHostname: () => url.hostname,
|
|
10
|
-
getTLD: () => url.hostname,
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
exports.createLocationFromOrigin = createLocationFromOrigin;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { createLocationFromOrigin } from './createLocationFromOrigin';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { createLocationFromWindow } from './createLocationFromWindow';
|