@dynamic-labs/client 2.0.0-alpha.30 → 2.0.0-alpha.32
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 +15 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +3 -3
- package/src/client/client.cjs +3 -0
- package/src/client/client.d.ts +4 -0
- package/src/client/client.js +3 -0
- package/src/modules/authModule/authModule.cjs +28 -0
- package/src/modules/authModule/authModule.d.ts +6 -0
- package/src/modules/authModule/authModule.js +24 -0
- package/src/modules/authModule/index.d.ts +1 -0
- package/src/modules/walletsModule/walletsModule.cjs +1 -1
- package/src/modules/walletsModule/walletsModule.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,19 @@
|
|
|
1
1
|
|
|
2
|
+
## [2.0.0-alpha.32](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.31...v2.0.0-alpha.32) (2024-04-15)
|
|
3
|
+
|
|
4
|
+
## [2.0.0-alpha.31](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.30...v2.0.0-alpha.31) (2024-04-11)
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* support adding email for recovery to existing embedded wallet ([#5128](https://github.com/dynamic-labs/DynamicAuth/issues/5128)) ([477fd81](https://github.com/dynamic-labs/DynamicAuth/commit/477fd81ac00864284d9d2183c0b8c078a0a23a2b))
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
* issue where customer also tries to use i18n.init ([#5267](https://github.com/dynamic-labs/DynamicAuth/issues/5267)) ([7f81f1e](https://github.com/dynamic-labs/DynamicAuth/commit/7f81f1e010fbc6408f6a5d6a37608235e947befa))
|
|
15
|
+
* smart wallet not loading correctly upon refresh when using non-embedded eoa wallet ([#5301](https://github.com/dynamic-labs/DynamicAuth/issues/5301)) ([e957317](https://github.com/dynamic-labs/DynamicAuth/commit/e9573173f6209773a0be5f4af37323f2be8d7906))
|
|
16
|
+
|
|
2
17
|
## [2.0.0-alpha.30](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.29...v2.0.0-alpha.30) (2024-04-11)
|
|
3
18
|
|
|
4
19
|
|
package/package.cjs
CHANGED
package/package.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/client",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.32",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/dynamic-labs/DynamicAuth.git",
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"./package.json": "./package.json"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
|
-
"@dynamic-labs/message-transport": "2.0.0-alpha.
|
|
30
|
-
"@dynamic-labs/types": "2.0.0-alpha.
|
|
29
|
+
"@dynamic-labs/message-transport": "2.0.0-alpha.32",
|
|
30
|
+
"@dynamic-labs/types": "2.0.0-alpha.32",
|
|
31
31
|
"eventemitter3": "5.0.1"
|
|
32
32
|
}
|
|
33
33
|
}
|
package/src/client/client.cjs
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
var authModule = require('../modules/authModule/authModule.cjs');
|
|
5
6
|
var sdkModule = require('../modules/sdkModule/sdkModule.cjs');
|
|
6
7
|
var walletsModule = require('../modules/walletsModule/walletsModule.cjs');
|
|
7
8
|
var Extendable = require('../utils/Extendable/Extendable.cjs');
|
|
@@ -18,6 +19,8 @@ const createClient = (props) => {
|
|
|
18
19
|
const core$1 = core.createCore();
|
|
19
20
|
const baseExtendable = new Extendable.Extendable(core$1);
|
|
20
21
|
return baseExtendable.extend(() => ({
|
|
22
|
+
/** Module that gives access over authentication state, such as the auth token and user */
|
|
23
|
+
auth: authModule.createAuthModule(core$1),
|
|
21
24
|
/** Module that gives insight over the state of the SDK */
|
|
22
25
|
sdk: sdkModule.createSdkModule(core$1, props),
|
|
23
26
|
/** Module that provides access to user's wallets */
|
package/src/client/client.d.ts
CHANGED
|
@@ -15,6 +15,10 @@ export type ClientProps = {
|
|
|
15
15
|
* it will be used for.
|
|
16
16
|
*/
|
|
17
17
|
export declare const createClient: (props: ClientProps) => {
|
|
18
|
+
/** Module that gives access over authentication state, such as the auth token and user */
|
|
19
|
+
auth: import("dist/packages/message-transport/src").StoreStateGetters<import("dist/packages/message-transport/src").AuthModuleState> & Pick<import("eventemitter3").EventEmitter<import("dist/packages/message-transport/src").AuthModuleMessages & import("dist/packages/message-transport/src").StoreStateEvents<import("dist/packages/message-transport/src").AuthModuleState>, any>, "on" | "off" | "once"> & {
|
|
20
|
+
logout: () => Promise<void>;
|
|
21
|
+
};
|
|
18
22
|
/** Module that gives insight over the state of the SDK */
|
|
19
23
|
sdk: import("dist/packages/message-transport/src").StoreStateGetters<import("dist/packages/message-transport/src").SdkModuleState>;
|
|
20
24
|
/** Module that provides access to user's wallets */
|
package/src/client/client.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { createAuthModule } from '../modules/authModule/authModule.js';
|
|
1
2
|
import { createSdkModule } from '../modules/sdkModule/sdkModule.js';
|
|
2
3
|
import { createWalletsModule } from '../modules/walletsModule/walletsModule.js';
|
|
3
4
|
import { Extendable } from '../utils/Extendable/Extendable.js';
|
|
@@ -14,6 +15,8 @@ const createClient = (props) => {
|
|
|
14
15
|
const core = createCore();
|
|
15
16
|
const baseExtendable = new Extendable(core);
|
|
16
17
|
return baseExtendable.extend(() => ({
|
|
18
|
+
/** Module that gives access over authentication state, such as the auth token and user */
|
|
19
|
+
auth: createAuthModule(core),
|
|
17
20
|
/** Module that gives insight over the state of the SDK */
|
|
18
21
|
sdk: createSdkModule(core, props),
|
|
19
22
|
/** Module that provides access to user's wallets */
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var messageTransport = require('@dynamic-labs/message-transport');
|
|
6
|
+
var pickListenerActions = require('../../utils/pickListenerActions/pickListenerActions.cjs');
|
|
7
|
+
|
|
8
|
+
const createAuthModule = (core) => {
|
|
9
|
+
const store = messageTransport.createStore({
|
|
10
|
+
initialState: {
|
|
11
|
+
authToken: null,
|
|
12
|
+
authenticatedUser: null,
|
|
13
|
+
},
|
|
14
|
+
key: 'auth',
|
|
15
|
+
messageTransport: core.messageTransport,
|
|
16
|
+
});
|
|
17
|
+
const messageEvents = messageTransport.createEventEmitterForMessages({
|
|
18
|
+
initialEventEmitter: store.eventEmitter,
|
|
19
|
+
key: 'auth',
|
|
20
|
+
messageTransport: core.messageTransport,
|
|
21
|
+
});
|
|
22
|
+
const requestChannel = messageTransport.createRequestChannel(core.messageTransport);
|
|
23
|
+
return Object.assign(store.getters, pickListenerActions.pickListenerActions(messageEvents), {
|
|
24
|
+
logout: () => requestChannel.request('logout'),
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
exports.createAuthModule = createAuthModule;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { AuthModuleMessages, AuthModuleState } from '@dynamic-labs/message-transport';
|
|
2
|
+
import { Core } from '../../client/core';
|
|
3
|
+
export type AuthModule = ReturnType<typeof createAuthModule>;
|
|
4
|
+
export declare const createAuthModule: (core: Core) => import("@dynamic-labs/message-transport").StoreStateGetters<AuthModuleState> & Pick<import("eventemitter3").EventEmitter<AuthModuleMessages & import("@dynamic-labs/message-transport").StoreStateEvents<AuthModuleState>, any>, "on" | "off" | "once"> & {
|
|
5
|
+
logout: () => Promise<void>;
|
|
6
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { createStore, createEventEmitterForMessages, createRequestChannel } from '@dynamic-labs/message-transport';
|
|
2
|
+
import { pickListenerActions } from '../../utils/pickListenerActions/pickListenerActions.js';
|
|
3
|
+
|
|
4
|
+
const createAuthModule = (core) => {
|
|
5
|
+
const store = createStore({
|
|
6
|
+
initialState: {
|
|
7
|
+
authToken: null,
|
|
8
|
+
authenticatedUser: null,
|
|
9
|
+
},
|
|
10
|
+
key: 'auth',
|
|
11
|
+
messageTransport: core.messageTransport,
|
|
12
|
+
});
|
|
13
|
+
const messageEvents = createEventEmitterForMessages({
|
|
14
|
+
initialEventEmitter: store.eventEmitter,
|
|
15
|
+
key: 'auth',
|
|
16
|
+
messageTransport: core.messageTransport,
|
|
17
|
+
});
|
|
18
|
+
const requestChannel = createRequestChannel(core.messageTransport);
|
|
19
|
+
return Object.assign(store.getters, pickListenerActions(messageEvents), {
|
|
20
|
+
logout: () => requestChannel.request('logout'),
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export { createAuthModule };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './authModule';
|
|
@@ -7,7 +7,7 @@ var pickListenerActions = require('../../utils/pickListenerActions/pickListenerA
|
|
|
7
7
|
|
|
8
8
|
const createWalletsModule = (core) => {
|
|
9
9
|
const store = messageTransport.createStore({
|
|
10
|
-
initialState: {
|
|
10
|
+
initialState: { primary: undefined, userWallets: [] },
|
|
11
11
|
key: 'wallets',
|
|
12
12
|
messageTransport: core.messageTransport,
|
|
13
13
|
});
|
|
@@ -3,7 +3,7 @@ import { pickListenerActions } from '../../utils/pickListenerActions/pickListene
|
|
|
3
3
|
|
|
4
4
|
const createWalletsModule = (core) => {
|
|
5
5
|
const store = createStore({
|
|
6
|
-
initialState: {
|
|
6
|
+
initialState: { primary: undefined, userWallets: [] },
|
|
7
7
|
key: 'wallets',
|
|
8
8
|
messageTransport: core.messageTransport,
|
|
9
9
|
});
|