@dynamic-labs/utils 4.8.4 → 4.8.6
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 +20 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +4 -4
- package/src/index.cjs +2 -0
- package/src/index.d.ts +1 -0
- package/src/index.js +1 -0
- package/src/services/PlatformEventsService/PlatformEventsService.cjs +33 -0
- package/src/services/PlatformEventsService/PlatformEventsService.d.ts +9 -0
- package/src/services/PlatformEventsService/PlatformEventsService.js +29 -0
- package/src/services/PlatformEventsService/createBrowserPlatformEventsService/createBrowserPlatformEventsService.cjs +30 -0
- package/src/services/PlatformEventsService/createBrowserPlatformEventsService/createBrowserPlatformEventsService.d.ts +2 -0
- package/src/services/PlatformEventsService/createBrowserPlatformEventsService/createBrowserPlatformEventsService.js +22 -0
- package/src/services/PlatformEventsService/createBrowserPlatformEventsService/index.d.ts +1 -0
- package/src/services/PlatformEventsService/index.d.ts +2 -0
- package/src/services/PlatformEventsService/types.d.ts +5 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,24 @@
|
|
|
1
1
|
|
|
2
|
+
### [4.8.6](https://github.com/dynamic-labs/dynamic-auth/compare/v4.8.5...v4.8.6) (2025-03-07)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Bug Fixes
|
|
6
|
+
|
|
7
|
+
* farcaster connection improvements ([#8230](https://github.com/dynamic-labs/dynamic-auth/issues/8230)) ([d235484](https://github.com/dynamic-labs/dynamic-auth/commit/d235484c4d979df959f4f99b1e190cd6e3f8d668))
|
|
8
|
+
|
|
9
|
+
### [4.8.5](https://github.com/dynamic-labs/dynamic-auth/compare/v4.8.4...v4.8.5) (2025-03-06)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Features
|
|
13
|
+
|
|
14
|
+
* evm connector can sign arbitrary transactions ([#8217](https://github.com/dynamic-labs/dynamic-auth/issues/8217)) ([c5b227c](https://github.com/dynamic-labs/dynamic-auth/commit/c5b227c5a5d527f3fc74b8c1c9d0247eaf35a016))
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* optimize shadow dom re-renders ([#8193](https://github.com/dynamic-labs/dynamic-auth/issues/8193)) ([c97310c](https://github.com/dynamic-labs/dynamic-auth/commit/c97310c9f3eb73b9f69b0b48a79e6bbd93d2e94a))
|
|
20
|
+
* show multichain wallets with zerodev ([#8220](https://github.com/dynamic-labs/dynamic-auth/issues/8220)) ([a48689d](https://github.com/dynamic-labs/dynamic-auth/commit/a48689da1303512551bdf8114de45493d33221a3))
|
|
21
|
+
|
|
2
22
|
### [4.8.4](https://github.com/dynamic-labs/dynamic-auth/compare/v4.8.3...v4.8.4) (2025-03-05)
|
|
3
23
|
|
|
4
24
|
|
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.6",
|
|
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.6",
|
|
24
|
+
"@dynamic-labs/logger": "4.8.6",
|
|
25
|
+
"@dynamic-labs/types": "4.8.6",
|
|
26
26
|
"buffer": "6.0.3",
|
|
27
27
|
"eventemitter3": "5.0.1"
|
|
28
28
|
},
|
package/src/index.cjs
CHANGED
|
@@ -91,6 +91,7 @@ var template = require('./template/template.cjs');
|
|
|
91
91
|
var phantomRedirect = require('./consts/phantomRedirect.cjs');
|
|
92
92
|
var PlatformService = require('./services/PlatformService/PlatformService.cjs');
|
|
93
93
|
var createBrowserPlatformService = require('./services/PlatformService/createBrowserPlatformService/createBrowserPlatformService.cjs');
|
|
94
|
+
var PlatformEventsService = require('./services/PlatformEventsService/PlatformEventsService.cjs');
|
|
94
95
|
var FetchService = require('./services/FetchService/FetchService.cjs');
|
|
95
96
|
var Oauth2Service = require('./services/Oauth2Service/Oauth2Service.cjs');
|
|
96
97
|
var createWindowOauth2Service = require('./services/Oauth2Service/createWindowOauth2Service/createWindowOauth2Service.cjs');
|
|
@@ -211,6 +212,7 @@ exports.template = template.template;
|
|
|
211
212
|
exports.PHANTOM_REDIRECT_CONNECTION_TYPE_KEY = phantomRedirect.PHANTOM_REDIRECT_CONNECTION_TYPE_KEY;
|
|
212
213
|
exports.PlatformService = PlatformService.PlatformService;
|
|
213
214
|
exports.createBrowserPlatformService = createBrowserPlatformService.createBrowserPlatformService;
|
|
215
|
+
exports.PlatformEventsService = PlatformEventsService.PlatformEventsService;
|
|
214
216
|
exports.FetchService = FetchService.FetchService;
|
|
215
217
|
exports.Oauth2Service = Oauth2Service.Oauth2Service;
|
|
216
218
|
exports.createWindowOauth2Service = createWindowOauth2Service.createWindowOauth2Service;
|
package/src/index.d.ts
CHANGED
|
@@ -38,6 +38,7 @@ export { runSafe } from './runSafe';
|
|
|
38
38
|
export { template } from './template';
|
|
39
39
|
export { PHANTOM_REDIRECT_CONNECTION_TYPE_KEY, type PhantomRedirectConnectionType, } from './consts/phantomRedirect';
|
|
40
40
|
export { PlatformService, createBrowserPlatformService, type IPlatformService, } from './services/PlatformService';
|
|
41
|
+
export { PlatformEventsService, type IPlatformEvents, type IPlatformEventsService, } from './services/PlatformEventsService';
|
|
41
42
|
export { FetchService } from './services/FetchService';
|
|
42
43
|
export { Oauth2Service, type GetOauthCodeError, type GetOauthCodeProps, type IOauth2Service, createWindowOauth2Service, } from './services/Oauth2Service';
|
|
43
44
|
export { type IStorageService, type StorageOptions, StorageService, createStorageService, applyPostfixToStorageService, } from './services/StorageService';
|
package/src/index.js
CHANGED
|
@@ -87,6 +87,7 @@ export { template } from './template/template.js';
|
|
|
87
87
|
export { PHANTOM_REDIRECT_CONNECTION_TYPE_KEY } from './consts/phantomRedirect.js';
|
|
88
88
|
export { PlatformService } from './services/PlatformService/PlatformService.js';
|
|
89
89
|
export { createBrowserPlatformService } from './services/PlatformService/createBrowserPlatformService/createBrowserPlatformService.js';
|
|
90
|
+
export { PlatformEventsService } from './services/PlatformEventsService/PlatformEventsService.js';
|
|
90
91
|
export { FetchService } from './services/FetchService/FetchService.js';
|
|
91
92
|
export { Oauth2Service } from './services/Oauth2Service/Oauth2Service.js';
|
|
92
93
|
export { createWindowOauth2Service } from './services/Oauth2Service/createWindowOauth2Service/createWindowOauth2Service.js';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var _tslib = require('../../../_virtual/_tslib.cjs');
|
|
7
|
+
var createBrowserPlatformEventsService = require('./createBrowserPlatformEventsService/createBrowserPlatformEventsService.cjs');
|
|
8
|
+
|
|
9
|
+
var _a, _PlatformEventsService_implementation;
|
|
10
|
+
class PlatformEventsService {
|
|
11
|
+
static get implementation() {
|
|
12
|
+
if (!_tslib.__classPrivateFieldGet(_a, _a, "f", _PlatformEventsService_implementation)) {
|
|
13
|
+
_tslib.__classPrivateFieldSet(_a, _a, createBrowserPlatformEventsService.createBrowserPlatformEventsService(window), "f", _PlatformEventsService_implementation);
|
|
14
|
+
}
|
|
15
|
+
return _tslib.__classPrivateFieldGet(_a, _a, "f", _PlatformEventsService_implementation);
|
|
16
|
+
}
|
|
17
|
+
static set implementation(implementation) {
|
|
18
|
+
_tslib.__classPrivateFieldSet(_a, _a, implementation, "f", _PlatformEventsService_implementation);
|
|
19
|
+
}
|
|
20
|
+
static get on() {
|
|
21
|
+
return _a.implementation.on.bind(_a.implementation);
|
|
22
|
+
}
|
|
23
|
+
static get off() {
|
|
24
|
+
return _a.implementation.off.bind(_a.implementation);
|
|
25
|
+
}
|
|
26
|
+
static get once() {
|
|
27
|
+
return _a.implementation.once.bind(_a.implementation);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
_a = PlatformEventsService;
|
|
31
|
+
_PlatformEventsService_implementation = { value: void 0 };
|
|
32
|
+
|
|
33
|
+
exports.PlatformEventsService = PlatformEventsService;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IPlatformEventsService } from './types';
|
|
2
|
+
export declare class PlatformEventsService {
|
|
3
|
+
#private;
|
|
4
|
+
static get implementation(): IPlatformEventsService;
|
|
5
|
+
static set implementation(implementation: IPlatformEventsService | undefined);
|
|
6
|
+
static get on(): <T extends "appFocused">(event: T, fn: (...args: import("eventemitter3").EventEmitter.ArgumentMap<import("./types").IPlatformEvents>[Extract<T, "appFocused">]) => void, context?: any) => import("eventemitter3").EventEmitter<import("./types").IPlatformEvents, any>;
|
|
7
|
+
static get off(): <T extends "appFocused">(event: T, fn?: ((...args: import("eventemitter3").EventEmitter.ArgumentMap<import("./types").IPlatformEvents>[Extract<T, "appFocused">]) => void) | undefined, context?: any, once?: boolean | undefined) => import("eventemitter3").EventEmitter<import("./types").IPlatformEvents, any>;
|
|
8
|
+
static get once(): <T extends "appFocused">(event: T, fn: (...args: import("eventemitter3").EventEmitter.ArgumentMap<import("./types").IPlatformEvents>[Extract<T, "appFocused">]) => void, context?: any) => import("eventemitter3").EventEmitter<import("./types").IPlatformEvents, any>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { __classPrivateFieldGet, __classPrivateFieldSet } from '../../../_virtual/_tslib.js';
|
|
3
|
+
import { createBrowserPlatformEventsService } from './createBrowserPlatformEventsService/createBrowserPlatformEventsService.js';
|
|
4
|
+
|
|
5
|
+
var _a, _PlatformEventsService_implementation;
|
|
6
|
+
class PlatformEventsService {
|
|
7
|
+
static get implementation() {
|
|
8
|
+
if (!__classPrivateFieldGet(_a, _a, "f", _PlatformEventsService_implementation)) {
|
|
9
|
+
__classPrivateFieldSet(_a, _a, createBrowserPlatformEventsService(window), "f", _PlatformEventsService_implementation);
|
|
10
|
+
}
|
|
11
|
+
return __classPrivateFieldGet(_a, _a, "f", _PlatformEventsService_implementation);
|
|
12
|
+
}
|
|
13
|
+
static set implementation(implementation) {
|
|
14
|
+
__classPrivateFieldSet(_a, _a, implementation, "f", _PlatformEventsService_implementation);
|
|
15
|
+
}
|
|
16
|
+
static get on() {
|
|
17
|
+
return _a.implementation.on.bind(_a.implementation);
|
|
18
|
+
}
|
|
19
|
+
static get off() {
|
|
20
|
+
return _a.implementation.off.bind(_a.implementation);
|
|
21
|
+
}
|
|
22
|
+
static get once() {
|
|
23
|
+
return _a.implementation.once.bind(_a.implementation);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
_a = PlatformEventsService;
|
|
27
|
+
_PlatformEventsService_implementation = { value: void 0 };
|
|
28
|
+
|
|
29
|
+
export { PlatformEventsService };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var EventEmitter = require('eventemitter3');
|
|
7
|
+
|
|
8
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
9
|
+
|
|
10
|
+
var EventEmitter__default = /*#__PURE__*/_interopDefaultLegacy(EventEmitter);
|
|
11
|
+
|
|
12
|
+
const createBrowserPlatformEventsService = (window) => {
|
|
13
|
+
const emitter = new EventEmitter__default["default"]();
|
|
14
|
+
/**
|
|
15
|
+
* This map ensure the when a new value is added to
|
|
16
|
+
* IPlatformEvents it will be required to implement here too
|
|
17
|
+
*/
|
|
18
|
+
const mapPlatformEventsToRequestChannel = {
|
|
19
|
+
appFocused: () => {
|
|
20
|
+
window.addEventListener('focus', () => {
|
|
21
|
+
emitter.emit('appFocused');
|
|
22
|
+
});
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
// Setup all events
|
|
26
|
+
Object.values(mapPlatformEventsToRequestChannel).forEach((handler) => handler());
|
|
27
|
+
return emitter;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
exports.createBrowserPlatformEventsService = createBrowserPlatformEventsService;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import EventEmitter from 'eventemitter3';
|
|
3
|
+
|
|
4
|
+
const createBrowserPlatformEventsService = (window) => {
|
|
5
|
+
const emitter = new EventEmitter();
|
|
6
|
+
/**
|
|
7
|
+
* This map ensure the when a new value is added to
|
|
8
|
+
* IPlatformEvents it will be required to implement here too
|
|
9
|
+
*/
|
|
10
|
+
const mapPlatformEventsToRequestChannel = {
|
|
11
|
+
appFocused: () => {
|
|
12
|
+
window.addEventListener('focus', () => {
|
|
13
|
+
emitter.emit('appFocused');
|
|
14
|
+
});
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
// Setup all events
|
|
18
|
+
Object.values(mapPlatformEventsToRequestChannel).forEach((handler) => handler());
|
|
19
|
+
return emitter;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export { createBrowserPlatformEventsService };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { createBrowserPlatformEventsService } from './createBrowserPlatformEventsService';
|