@dynamic-labs/message-transport 4.0.0-alpha.14 → 4.0.0-alpha.16

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 CHANGED
@@ -1,4 +1,17 @@
1
1
 
2
+ ## [4.0.0-alpha.16](https://github.com/dynamic-labs/dynamic-auth/compare/v4.0.0-alpha.15...v4.0.0-alpha.16) (2024-10-27)
3
+
4
+
5
+ ### Features
6
+
7
+ * add passkey to web-extension ([#7096](https://github.com/dynamic-labs/dynamic-auth/issues/7096)) ([a4b4643](https://github.com/dynamic-labs/dynamic-auth/commit/a4b4643e5307358425c878067bae095090f322ca))
8
+ * add social to web extension ([#7106](https://github.com/dynamic-labs/dynamic-auth/issues/7106)) ([422bc8e](https://github.com/dynamic-labs/dynamic-auth/commit/422bc8e2d276d960a7a76ad55a7b244c3fd83173))
9
+ * add support for compass and leap wallets ([9738749](https://github.com/dynamic-labs/dynamic-auth/commit/9738749bb5ed8e07a2582df255f683e4d408db93))
10
+ * add support for epicgames social ([#7220](https://github.com/dynamic-labs/dynamic-auth/issues/7220)) ([cb5bc30](https://github.com/dynamic-labs/dynamic-auth/commit/cb5bc30bc17d063bdaa9b427a9358b30124c4589))
11
+ * add web-extension to client ([#7180](https://github.com/dynamic-labs/dynamic-auth/issues/7180)) ([e2ccbb7](https://github.com/dynamic-labs/dynamic-auth/commit/e2ccbb77bdd0250d000a6cc4d89a2e5d7d2f4bb2))
12
+
13
+ ## [4.0.0-alpha.15](https://github.com/dynamic-labs/dynamic-auth/compare/v4.0.0-alpha.14...v4.0.0-alpha.15) (2024-10-19)
14
+
2
15
  ## [4.0.0-alpha.14](https://github.com/dynamic-labs/dynamic-auth/compare/v4.0.0-alpha.13...v4.0.0-alpha.14) (2024-10-18)
3
16
 
4
17
  ## [4.0.0-alpha.13](https://github.com/dynamic-labs/dynamic-auth/compare/v4.0.0-alpha.12...v4.0.0-alpha.13) (2024-10-18)
package/package.cjs CHANGED
@@ -3,6 +3,6 @@
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
- var version = "4.0.0-alpha.14";
6
+ var version = "4.0.0-alpha.16";
7
7
 
8
8
  exports.version = version;
package/package.js CHANGED
@@ -1,4 +1,4 @@
1
1
  'use client'
2
- var version = "4.0.0-alpha.14";
2
+ var version = "4.0.0-alpha.16";
3
3
 
4
4
  export { version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/message-transport",
3
- "version": "4.0.0-alpha.14",
3
+ "version": "4.0.0-alpha.16",
4
4
  "description": "Defines the interface to communicate with dynamic's webview",
5
5
  "author": "Dynamic Labs, Inc.",
6
6
  "license": "MIT",
@@ -18,14 +18,14 @@
18
18
  },
19
19
  "homepage": "https://www.dynamic.xyz/",
20
20
  "dependencies": {
21
- "@dynamic-labs/sdk-api-core": "0.0.547",
21
+ "@dynamic-labs/sdk-api-core": "0.0.555",
22
22
  "@vue/reactivity": "3.4.21",
23
- "@dynamic-labs/types": "4.0.0-alpha.14",
23
+ "@dynamic-labs/types": "4.0.0-alpha.16",
24
24
  "eventemitter3": "5.0.1"
25
25
  },
26
26
  "peerDependencies": {
27
- "@dynamic-labs/assert-package-version": "4.0.0-alpha.14",
28
- "@dynamic-labs/logger": "4.0.0-alpha.14",
29
- "@dynamic-labs/utils": "4.0.0-alpha.14"
27
+ "@dynamic-labs/assert-package-version": "4.0.0-alpha.16",
28
+ "@dynamic-labs/logger": "4.0.0-alpha.16",
29
+ "@dynamic-labs/utils": "4.0.0-alpha.16"
30
30
  }
31
31
  }
package/src/index.d.ts CHANGED
@@ -6,4 +6,4 @@ export { serializeErrorForTransport } from './utils/serializeErrorForTransport';
6
6
  export { createEventEmitterForMessages, createStore, createStoreSetter, type CreateStoreProps, } from './store';
7
7
  export type { Store, StoreEventListeners, StoreKeys, StoreSetter, StoreStateChangeEvent, StoreStateEvents, StoreStateGetters, } from './store/types';
8
8
  export type { PickedEventListeners } from './types';
9
- export { authEventNames, emailEventNames, embeddedWalletsEventNames, sdkHasLoadedEventName, smsEventNames, userInterfaceEventNames, userWalletsEventNames, type AccountAbstractionGetEOAWalletArgs, type AccountAbstractionGetSmartWalletArgs, type AccountAbstractionIsSmartWalletArgs, type AccountAbstractionMessages, type AuthModuleMessages, type AuthModuleState, type ClientManifest, type ConsoleMessages, type CreateEmbeddedWalletArgs, type EmailOtpParams, type EmbeddedWalletsModuleMessages, type EmbeddedWalletsModuleState, type EthMessages, type EthRequestParams, type EthRequestWithAddressParams, type EthRequestWithChainIdParams, type ExternalAuthMessages, type FetchMessages, type KernelAccountSettings, type NetworksModuleState, type OtpData, type OtpMessages, type PasskeyMessages, type PlatformServiceMessages, type ProjectSettingsMessages, type SdkModuleMessages, type SdkModuleState, type SecureStorageMessages, type SignInWithExternalJwtParams, type SmsOtpParams, type SocialAuthModuleMessages, type SocialProvider, type SolanaMessages, type UserInterfaceModuleMessages, type VerifyWithExternalJwtParams, type WalletEvents, type WalletsModuleMessages, type WalletsModuleState, type WebViewVisibilityMessages, type ZeroDevExtensionMessages, } from './messageTypes';
9
+ export { authEventNames, emailEventNames, embeddedWalletsEventNames, sdkHasLoadedEventName, smsEventNames, userInterfaceEventNames, userWalletsEventNames, type AccountAbstractionGetEOAWalletArgs, type AccountAbstractionGetSmartWalletArgs, type AccountAbstractionIsSmartWalletArgs, type AccountAbstractionMessages, type AuthModuleMessages, type AuthModuleState, type ClientManifest, type ConsoleMessages, type CreateEmbeddedWalletArgs, type DeleteStorageItemArgs, type StorageMessageSource, type EmailOtpParams, type EmbeddedWalletsModuleMessages, type EmbeddedWalletsModuleState, type EthMessages, type EthRequestParams, type EthRequestWithAddressParams, type EthRequestWithChainIdParams, type ExternalAuthMessages, type FetchMessages, type GetStorageItemArgs, type KernelAccountSettings, type NetworksModuleState, type OtpData, type OtpMessages, type PasskeyMessages, type PlatformServiceMessages, type ProjectSettingsMessages, type SdkModuleMessages, type SdkModuleState, type SetStorageItemArgs, type SignInWithExternalJwtParams, type SmsOtpParams, type SocialAuthModuleMessages, type SocialProvider, type SolanaMessages, type StorageMessages, type UserInterfaceModuleMessages, type VerifyWithExternalJwtParams, type WalletEvents, type WalletsModuleMessages, type WalletsModuleState, type WebViewVisibilityMessages, type ZeroDevExtensionMessages, } from './messageTypes';
@@ -38,9 +38,7 @@ const makeWaitForUnblock = ({ messageTransport, bypassBlockIf = () => false, })
38
38
  messageTransport.emit(message);
39
39
  onEmit === null || onEmit === void 0 ? void 0 : onEmit();
40
40
  },
41
- get isBlocked() {
42
- return blocked;
43
- },
41
+ isBlocked: () => blocked,
44
42
  off: (callback) => messageTransport.off(callback),
45
43
  on: (callback) => messageTransport.on(callback),
46
44
  unblock: () => {
@@ -17,7 +17,7 @@ export type WithBlock<M extends MessageTransport> = M & {
17
17
  onEmit?: VoidFunction;
18
18
  }) => void;
19
19
  unblock: () => void;
20
- isBlocked: boolean;
20
+ isBlocked: () => boolean;
21
21
  };
22
22
  /**
23
23
  * Decorator that adds the following features to a MessageTransport:
@@ -34,9 +34,7 @@ const makeWaitForUnblock = ({ messageTransport, bypassBlockIf = () => false, })
34
34
  messageTransport.emit(message);
35
35
  onEmit === null || onEmit === void 0 ? void 0 : onEmit();
36
36
  },
37
- get isBlocked() {
38
- return blocked;
39
- },
37
+ isBlocked: () => blocked,
40
38
  off: (callback) => messageTransport.off(callback),
41
39
  on: (callback) => messageTransport.on(callback),
42
40
  unblock: () => {
@@ -1,4 +1,11 @@
1
- export type SocialProvider = 'apple' | 'coinbaseSocial' | 'discord' | 'facebook' | 'farcaster' | 'github' | 'google' | 'telegram' | 'twitch' | 'twitter';
1
+ import { ProviderEnum } from '@dynamic-labs/sdk-api-core';
2
+ export type SocialProvider = 'apple' | 'coinbaseSocial' | 'discord' | 'epicgames' | 'facebook' | 'farcaster' | 'github' | 'google' | 'telegram' | 'twitch' | 'twitter' | 'spotify';
3
+ type ConnectWithSocialOnHostArgs = {
4
+ clientId?: string;
5
+ oauthLoginUrl: string;
6
+ provider: ProviderEnum;
7
+ state: string;
8
+ };
2
9
  export type SocialAuthModuleMessages = {
3
10
  connectWithSocial: (args: {
4
11
  /**
@@ -14,4 +21,9 @@ export type SocialAuthModuleMessages = {
14
21
  */
15
22
  redirectPathname?: string;
16
23
  }) => Promise<void>;
24
+ /**
25
+ * Trigger a social auth connection on the host/native side
26
+ */
27
+ connectWithSocialOnHost: (args: ConnectWithSocialOnHostArgs) => Promise<void>;
17
28
  };
29
+ export {};
@@ -0,0 +1,19 @@
1
+ export type StorageMessageSource = 'localStorage' | 'sessionStorage' | 'secureStorage';
2
+ export type GetStorageItemArgs = {
3
+ source: StorageMessageSource;
4
+ key: string;
5
+ };
6
+ export type SetStorageItemArgs = {
7
+ source: StorageMessageSource;
8
+ key: string;
9
+ data: string;
10
+ };
11
+ export type DeleteStorageItemArgs = {
12
+ source: StorageMessageSource;
13
+ key: string;
14
+ };
15
+ export type StorageMessages = {
16
+ getItem: (args: GetStorageItemArgs) => Promise<string | null>;
17
+ setItem: (args: SetStorageItemArgs) => Promise<void>;
18
+ deleteItem: (args: DeleteStorageItemArgs) => Promise<void>;
19
+ };
@@ -11,7 +11,7 @@ export * from './PasskeyMessages';
11
11
  export * from './PlatformServiceMessages';
12
12
  export * from './ProjectSettingsMessages';
13
13
  export * from './SdkModuleMessages';
14
- export * from './SecureStorageMessages';
14
+ export * from './StorageMessages';
15
15
  export * from './SocialAuthModuleMessages';
16
16
  export * from './SolanaMessages';
17
17
  export * from './UserInterfaceModuleMessages';
@@ -28,7 +28,9 @@ const createRequestChannelMessageSender = ({ requestType, messageSessionId, time
28
28
  };
29
29
  // If this message transport is currently blocked, we must only start
30
30
  // the timeout once the message is actually emitted
31
- if ('isBlocked' in messageTransport && messageTransport.isBlocked) {
31
+ // We don't just default to this because the onEmit option is only
32
+ // present in the message transport if has the block decorator
33
+ if ('isBlocked' in messageTransport && messageTransport.isBlocked()) {
32
34
  messageTransport.emit(message, { onEmit: startTimer });
33
35
  return;
34
36
  }
@@ -24,7 +24,9 @@ const createRequestChannelMessageSender = ({ requestType, messageSessionId, time
24
24
  };
25
25
  // If this message transport is currently blocked, we must only start
26
26
  // the timeout once the message is actually emitted
27
- if ('isBlocked' in messageTransport && messageTransport.isBlocked) {
27
+ // We don't just default to this because the onEmit option is only
28
+ // present in the message transport if has the block decorator
29
+ if ('isBlocked' in messageTransport && messageTransport.isBlocked()) {
28
30
  messageTransport.emit(message, { onEmit: startTimer });
29
31
  return;
30
32
  }
@@ -1,5 +0,0 @@
1
- export type SecureStorageMessages = {
2
- getSecureItem: (key: string) => Promise<string | null>;
3
- setSecureItem: (key: string, data: string) => Promise<void>;
4
- deleteSecureItem: (key: string) => Promise<void>;
5
- };