@dynamic-labs/client
Advanced tools
Comparing version 2.1.0-alpha.18 to 2.1.0-alpha.19
'use client' | ||
var version = "2.1.0-alpha.18"; | ||
var version = "2.1.0-alpha.19"; | ||
export { version }; |
{ | ||
"name": "@dynamic-labs/client", | ||
"version": "2.1.0-alpha.18", | ||
"version": "2.1.0-alpha.19", | ||
"repository": { | ||
@@ -29,10 +29,10 @@ "type": "git", | ||
"dependencies": { | ||
"@dynamic-labs/message-transport": "2.1.0-alpha.18", | ||
"@dynamic-labs/message-transport": "2.1.0-alpha.19", | ||
"@vue/reactivity": "3.4.21" | ||
}, | ||
"peerDependencies": { | ||
"@dynamic-labs/logger": "2.1.0-alpha.18", | ||
"@dynamic-labs/types": "2.1.0-alpha.18", | ||
"@dynamic-labs/logger": "2.1.0-alpha.19", | ||
"@dynamic-labs/types": "2.1.0-alpha.19", | ||
"eventemitter3": "5.0.1" | ||
} | ||
} |
@@ -0,1 +1,2 @@ | ||
import { BaseWallet } from '@dynamic-labs/types'; | ||
export { type Core } from './client/core'; | ||
@@ -7,1 +8,2 @@ export { Extendable, type Extension } from './utils/Extendable'; | ||
export type { WalletsModule } from './modules/walletsModule'; | ||
export type Wallet = BaseWallet; |
import { AuthModuleMessages, AuthModuleState, StoreEventListeners } from '@dynamic-labs/message-transport'; | ||
import { Core } from '../../client/core'; | ||
import { SmsAuthModule } from '../smsAuthModule'; | ||
import { EmailAuthModule } from '../emailAuthModule'; | ||
export type AuthModule = AuthModuleState & StoreEventListeners<AuthModuleState> & Pick<AuthModuleMessages, 'logout'> & { | ||
import { SmsAuthModule } from './smsAuthModule'; | ||
import { EmailAuthModule } from './emailAuthModule'; | ||
type PublicAuthModuleMessages = Pick<AuthModuleMessages, 'logout'>; | ||
export type AuthModule = AuthModuleState & StoreEventListeners<AuthModuleState> & PublicAuthModuleMessages & { | ||
sms: SmsAuthModule; | ||
@@ -10,1 +11,2 @@ email: EmailAuthModule; | ||
export declare const createAuthModule: (core: Core) => AuthModule; | ||
export {}; |
'use client' | ||
import { createStore, createEventEmitterForMessages, createRequestChannel } from '@dynamic-labs/message-transport'; | ||
import { pickListenerActions } from '../../utils/pickListenerActions/pickListenerActions.js'; | ||
import { createSmsAuthModule } from '../smsAuthModule/smsAuthModule.js'; | ||
import { createEmailAuthModule } from '../emailAuthModule/emailAuthModule.js'; | ||
import { createSmsAuthModule } from './smsAuthModule/smsAuthModule.js'; | ||
import { createEmailAuthModule } from './emailAuthModule/emailAuthModule.js'; | ||
const createAuthModule = (core) => { | ||
const email = createEmailAuthModule(core); | ||
const sms = createSmsAuthModule(core); | ||
const store = createStore({ | ||
@@ -25,5 +23,5 @@ initialState: { | ||
return Object.assign(store.getters, pickListenerActions(messageEvents), { | ||
email, | ||
email: createEmailAuthModule(core), | ||
logout: () => requestChannel.request('logout'), | ||
sms, | ||
sms: createSmsAuthModule(core), | ||
}); | ||
@@ -30,0 +28,0 @@ }; |
@@ -1,4 +0,11 @@ | ||
import { StoreEventListeners, WalletsModuleState } from '@dynamic-labs/message-transport'; | ||
import { StoreEventListeners, WalletsModuleMessages, WalletsModuleState } from '@dynamic-labs/message-transport'; | ||
import { Core } from '../../client/core'; | ||
export type WalletsModule = WalletsModuleState & StoreEventListeners<WalletsModuleState>; | ||
import { EmbeddedWalletsModule } from './embeddedWalletsModule'; | ||
export type WalletsModule = WalletsModuleState & { | ||
embedded: EmbeddedWalletsModule; | ||
signMessage: WalletsModuleMessages['signMessage']; | ||
switchNetwork: WalletsModuleMessages['switchNetwork']; | ||
getBalance: WalletsModuleMessages['getBalance']; | ||
getNetwork: WalletsModuleMessages['getNetwork']; | ||
} & StoreEventListeners<WalletsModuleState>; | ||
export declare const createWalletsModule: (core: Core) => WalletsModule; |
'use client' | ||
import { createStore } from '@dynamic-labs/message-transport'; | ||
import { createRequestChannel, createStore } from '@dynamic-labs/message-transport'; | ||
import { pickListenerActions } from '../../utils/pickListenerActions/pickListenerActions.js'; | ||
import { createEmbeddedWalletsModule } from './embeddedWalletsModule/embeddedWalletsModule.js'; | ||
const createWalletsModule = (core) => { | ||
const requestChannel = createRequestChannel(core.messageTransport); | ||
const store = createStore({ | ||
@@ -11,5 +13,15 @@ initialState: { primary: undefined, userWallets: [] }, | ||
}); | ||
return Object.assign(store.getters, pickListenerActions(store.eventEmitter)); | ||
const signMessage = (params) => requestChannel.request('signMessage', params); | ||
const getBalance = (params) => requestChannel.request('getBalance', params); | ||
const switchNetwork = (params) => requestChannel.request('switchNetwork', params); | ||
const getNetwork = (params) => requestChannel.request('getNetwork', params); | ||
return Object.assign(store.getters, pickListenerActions(store.eventEmitter), { | ||
embedded: createEmbeddedWalletsModule(core), | ||
getBalance, | ||
getNetwork, | ||
signMessage, | ||
switchNetwork, | ||
}); | ||
}; | ||
export { createWalletsModule }; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
319300
80
1000
+ Added@dynamic-labs/logger@2.1.0-alpha.19(transitive)
+ Added@dynamic-labs/message-transport@2.1.0-alpha.19(transitive)
+ Added@dynamic-labs/sdk-api-core@0.0.444(transitive)
+ Added@dynamic-labs/types@2.1.0-alpha.19(transitive)
- Removed@dynamic-labs/logger@2.1.0-alpha.18(transitive)
- Removed@dynamic-labs/message-transport@2.1.0-alpha.18(transitive)
- Removed@dynamic-labs/sdk-api-core@0.0.433(transitive)
- Removed@dynamic-labs/types@2.1.0-alpha.18(transitive)