@dynamic-labs/webview-messages 4.30.0

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.
Files changed (49) hide show
  1. package/CHANGELOG.md +6064 -0
  2. package/LICENSE +21 -0
  3. package/README.md +3 -0
  4. package/package.cjs +8 -0
  5. package/package.js +4 -0
  6. package/package.json +30 -0
  7. package/src/index.cjs +23 -0
  8. package/src/index.d.ts +27 -0
  9. package/src/index.js +11 -0
  10. package/src/lib/AccountAbstractionMessages.d.ts +15 -0
  11. package/src/lib/AuthModuleMessages.cjs +14 -0
  12. package/src/lib/AuthModuleMessages.d.ts +21 -0
  13. package/src/lib/AuthModuleMessages.js +10 -0
  14. package/src/lib/ConsoleMessages.d.ts +13 -0
  15. package/src/lib/EmbeddedWalletsModuleMessages.cjs +10 -0
  16. package/src/lib/EmbeddedWalletsModuleMessages.d.ts +16 -0
  17. package/src/lib/EmbeddedWalletsModuleMessages.js +6 -0
  18. package/src/lib/EthMessages.d.ts +17 -0
  19. package/src/lib/ExternalAuthMessages.d.ts +19 -0
  20. package/src/lib/FetchMessages.d.ts +8 -0
  21. package/src/lib/MfaMessages.d.ts +22 -0
  22. package/src/lib/NetworksModuleMessages.d.ts +6 -0
  23. package/src/lib/OtpMessages.cjs +14 -0
  24. package/src/lib/OtpMessages.d.ts +29 -0
  25. package/src/lib/OtpMessages.js +9 -0
  26. package/src/lib/PasskeyMessages.d.ts +15 -0
  27. package/src/lib/PlatformServiceMessages.d.ts +17 -0
  28. package/src/lib/ProjectSettingsMessages.d.ts +6 -0
  29. package/src/lib/SdkModuleMessages.cjs +9 -0
  30. package/src/lib/SdkModuleMessages.d.ts +31 -0
  31. package/src/lib/SdkModuleMessages.js +5 -0
  32. package/src/lib/SocialAuthModuleMessages.d.ts +29 -0
  33. package/src/lib/SolanaMessages.d.ts +42 -0
  34. package/src/lib/StorageMessages.d.ts +19 -0
  35. package/src/lib/StoreKeys.d.ts +1 -0
  36. package/src/lib/SuiMessages.d.ts +21 -0
  37. package/src/lib/TurnkeyIframeEventProxyMessages.d.ts +9 -0
  38. package/src/lib/TurnkeyPasskeyMessages.d.ts +38 -0
  39. package/src/lib/UserInterfaceModuleMessages.cjs +12 -0
  40. package/src/lib/UserInterfaceModuleMessages.d.ts +16 -0
  41. package/src/lib/UserInterfaceModuleMessages.js +8 -0
  42. package/src/lib/ViemMessages.d.ts +51 -0
  43. package/src/lib/WaasMessages.d.ts +39 -0
  44. package/src/lib/WalletsModuleMessages.cjs +12 -0
  45. package/src/lib/WalletsModuleMessages.d.ts +59 -0
  46. package/src/lib/WalletsModuleMessages.js +8 -0
  47. package/src/lib/WebViewVisibilityMessages.d.ts +3 -0
  48. package/src/lib/ZeroDevExtensionMessages.d.ts +7 -0
  49. package/src/lib/index.d.ts +26 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 Dynamic Labs, Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,3 @@
1
+ # Webview Messages
2
+
3
+ This package contains the message contract the webview-controller accepts from clients.
package/package.cjs ADDED
@@ -0,0 +1,8 @@
1
+ 'use client'
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ var version = "4.30.0";
7
+
8
+ exports.version = version;
package/package.js ADDED
@@ -0,0 +1,4 @@
1
+ 'use client'
2
+ var version = "4.30.0";
3
+
4
+ export { version };
package/package.json ADDED
@@ -0,0 +1,30 @@
1
+ {
2
+ "name": "@dynamic-labs/webview-messages",
3
+ "version": "4.30.0",
4
+ "description": "A package to define messages for the webview-controller",
5
+ "author": "Dynamic Labs, Inc.",
6
+ "license": "MIT",
7
+ "main": "./src/index.cjs",
8
+ "module": "./src/index.js",
9
+ "types": "./src/index.d.ts",
10
+ "type": "module",
11
+ "homepage": "https://www.dynamic.xyz/",
12
+ "exports": {
13
+ ".": {
14
+ "types": "./src/index.d.ts",
15
+ "import": "./src/index.js",
16
+ "require": "./src/index.cjs"
17
+ },
18
+ "./package.json": "./package.json"
19
+ },
20
+ "dependencies": {
21
+ "@dynamic-labs/sdk-api-core": "0.0.762",
22
+ "@dynamic-labs-sdk/client": "0.0.1-alpha.25",
23
+ "@dynamic-labs/assert-package-version": "4.30.0",
24
+ "@dynamic-labs/logger": "4.30.0",
25
+ "@dynamic-labs/message-transport": "4.30.0",
26
+ "@dynamic-labs/types": "4.30.0",
27
+ "@dynamic-labs/webauthn": "4.30.0"
28
+ },
29
+ "peerDependencies": {}
30
+ }
package/src/index.cjs ADDED
@@ -0,0 +1,23 @@
1
+ 'use client'
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ var assertPackageVersion = require('@dynamic-labs/assert-package-version');
7
+ var _package = require('../package.cjs');
8
+ var AuthModuleMessages = require('./lib/AuthModuleMessages.cjs');
9
+ var EmbeddedWalletsModuleMessages = require('./lib/EmbeddedWalletsModuleMessages.cjs');
10
+ var OtpMessages = require('./lib/OtpMessages.cjs');
11
+ var SdkModuleMessages = require('./lib/SdkModuleMessages.cjs');
12
+ var UserInterfaceModuleMessages = require('./lib/UserInterfaceModuleMessages.cjs');
13
+ var WalletsModuleMessages = require('./lib/WalletsModuleMessages.cjs');
14
+
15
+ assertPackageVersion.assertPackageVersion('@dynamic-labs/webview-messages', _package.version);
16
+
17
+ exports.authEventNames = AuthModuleMessages.authEventNames;
18
+ exports.embeddedWalletsEventNames = EmbeddedWalletsModuleMessages.embeddedWalletsEventNames;
19
+ exports.emailEventNames = OtpMessages.emailEventNames;
20
+ exports.smsEventNames = OtpMessages.smsEventNames;
21
+ exports.sdkHasLoadedEventName = SdkModuleMessages.sdkHasLoadedEventName;
22
+ exports.userInterfaceEventNames = UserInterfaceModuleMessages.userInterfaceEventNames;
23
+ exports.userWalletsEventNames = WalletsModuleMessages.userWalletsEventNames;
package/src/index.d.ts ADDED
@@ -0,0 +1,27 @@
1
+ export * from './lib/AccountAbstractionMessages';
2
+ export * from './lib/AuthModuleMessages';
3
+ export * from './lib/ConsoleMessages';
4
+ export * from './lib/EmbeddedWalletsModuleMessages';
5
+ export * from './lib/EthMessages';
6
+ export * from './lib/ExternalAuthMessages';
7
+ export * from './lib/FetchMessages';
8
+ export * from './lib/MfaMessages';
9
+ export * from './lib/NetworksModuleMessages';
10
+ export * from './lib/OtpMessages';
11
+ export * from './lib/PasskeyMessages';
12
+ export * from './lib/PlatformServiceMessages';
13
+ export * from './lib/ProjectSettingsMessages';
14
+ export * from './lib/SdkModuleMessages';
15
+ export * from './lib/SocialAuthModuleMessages';
16
+ export * from './lib/SolanaMessages';
17
+ export * from './lib/StorageMessages';
18
+ export * from './lib/SuiMessages';
19
+ export * from './lib/TurnkeyIframeEventProxyMessages';
20
+ export * from './lib/TurnkeyPasskeyMessages';
21
+ export * from './lib/UserInterfaceModuleMessages';
22
+ export * from './lib/ViemMessages';
23
+ export * from './lib/WaasMessages';
24
+ export * from './lib/WalletsModuleMessages';
25
+ export * from './lib/WebViewVisibilityMessages';
26
+ export * from './lib/ZeroDevExtensionMessages';
27
+ export * from './lib/StoreKeys';
package/src/index.js ADDED
@@ -0,0 +1,11 @@
1
+ 'use client'
2
+ import { assertPackageVersion } from '@dynamic-labs/assert-package-version';
3
+ import { version } from '../package.js';
4
+ export { authEventNames } from './lib/AuthModuleMessages.js';
5
+ export { embeddedWalletsEventNames } from './lib/EmbeddedWalletsModuleMessages.js';
6
+ export { emailEventNames, smsEventNames } from './lib/OtpMessages.js';
7
+ export { sdkHasLoadedEventName } from './lib/SdkModuleMessages.js';
8
+ export { userInterfaceEventNames } from './lib/UserInterfaceModuleMessages.js';
9
+ export { userWalletsEventNames } from './lib/WalletsModuleMessages.js';
10
+
11
+ assertPackageVersion('@dynamic-labs/webview-messages', version);
@@ -0,0 +1,15 @@
1
+ import { BaseWallet } from '@dynamic-labs/types';
2
+ export type AccountAbstractionIsSmartWalletArgs = {
3
+ wallet: BaseWallet;
4
+ };
5
+ export type AccountAbstractionGetEOAWalletArgs = {
6
+ wallet: BaseWallet;
7
+ };
8
+ export type AccountAbstractionGetSmartWalletArgs = {
9
+ wallet: BaseWallet;
10
+ };
11
+ export type AccountAbstractionMessages = {
12
+ isSmartWallet: (args: AccountAbstractionIsSmartWalletArgs) => Promise<boolean>;
13
+ getEOAWallet: (args: AccountAbstractionGetEOAWalletArgs) => Promise<BaseWallet | null>;
14
+ getSmartWallet: (args: AccountAbstractionGetSmartWalletArgs) => Promise<BaseWallet | null>;
15
+ };
@@ -0,0 +1,14 @@
1
+ 'use client'
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ const authEventNames = [
7
+ 'authSuccess',
8
+ 'authFailed',
9
+ 'authInit',
10
+ 'loggedOut',
11
+ 'userProfileUpdated',
12
+ ];
13
+
14
+ exports.authEventNames = authEventNames;
@@ -0,0 +1,21 @@
1
+ import type { AuthEventPayload, UserProfile } from '@dynamic-labs/types';
2
+ export type AuthModuleState = {
3
+ token: string | null;
4
+ authenticatedUser: UserProfile | null;
5
+ };
6
+ export type AuthModuleMessages = {
7
+ logout: () => Promise<void>;
8
+ refreshUser: () => Promise<UserProfile | null>;
9
+ handleAuthenticatedUser: (params: {
10
+ user: UserProfile;
11
+ }) => Promise<void>;
12
+ permanentlyDeleteCurrentUser: () => Promise<void>;
13
+ authSuccess: (user: UserProfile) => void;
14
+ authFailed: (data: AuthEventPayload, reason: 'user-cancelled' | {
15
+ error: unknown;
16
+ }) => void;
17
+ authInit: (data: AuthEventPayload) => void;
18
+ loggedOut: (user: UserProfile | null) => void;
19
+ userProfileUpdated: (user: UserProfile) => void;
20
+ };
21
+ export declare const authEventNames: ("authSuccess" | "authFailed" | "authInit" | "loggedOut" | "userProfileUpdated")[];
@@ -0,0 +1,10 @@
1
+ 'use client'
2
+ const authEventNames = [
3
+ 'authSuccess',
4
+ 'authFailed',
5
+ 'authInit',
6
+ 'loggedOut',
7
+ 'userProfileUpdated',
8
+ ];
9
+
10
+ export { authEventNames };
@@ -0,0 +1,13 @@
1
+ import { LogLevel } from '@dynamic-labs/logger';
2
+ import { SerializedError } from '@dynamic-labs/message-transport';
3
+ export type ConsoleMessages = {
4
+ error: (serializedError: SerializedError, props: {
5
+ /**
6
+ * Describes the severity of the error sent to the host.
7
+ * fatal: The error has not been handled and the SDK is unusable.
8
+ * log-only: The error has been handled but should still be logged.
9
+ */
10
+ severity: 'fatal' | 'log-only';
11
+ }) => void;
12
+ log: (level: LogLevel, message: string) => void;
13
+ };
@@ -0,0 +1,10 @@
1
+ 'use client'
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ const embeddedWalletsEventNames = [
7
+ 'embeddedWalletCreated',
8
+ ];
9
+
10
+ exports.embeddedWalletsEventNames = embeddedWalletsEventNames;
@@ -0,0 +1,16 @@
1
+ import { EmbeddedWalletChainEnum, JwtVerifiedCredential } from '@dynamic-labs/sdk-api-core';
2
+ import { BaseWallet } from '@dynamic-labs/types';
3
+ export type CreateEmbeddedWalletArgs = {
4
+ chain?: keyof typeof EmbeddedWalletChainEnum;
5
+ };
6
+ export type EmbeddedWalletsModuleState = {
7
+ hasWallet: boolean;
8
+ };
9
+ export type EmbeddedWalletsModuleMessages = {
10
+ getWallet: () => Promise<BaseWallet | null>;
11
+ createWallet: (args?: CreateEmbeddedWalletArgs) => Promise<BaseWallet>;
12
+ embeddedWalletCreated: (verifiedCredential: JwtVerifiedCredential | null) => void;
13
+ };
14
+ type EmbeddedWalletsEventNames = 'embeddedWalletCreated';
15
+ export declare const embeddedWalletsEventNames: EmbeddedWalletsEventNames[];
16
+ export {};
@@ -0,0 +1,6 @@
1
+ 'use client'
2
+ const embeddedWalletsEventNames = [
3
+ 'embeddedWalletCreated',
4
+ ];
5
+
6
+ export { embeddedWalletsEventNames };
@@ -0,0 +1,17 @@
1
+ export type EthRequestWithAddressParams = {
2
+ method: string;
3
+ params: readonly unknown[];
4
+ address: string;
5
+ };
6
+ export type EthRequestWithChainIdParams = {
7
+ method: string;
8
+ params: readonly unknown[];
9
+ chainId: number;
10
+ };
11
+ export type EthRequestParams = EthRequestWithAddressParams | EthRequestWithChainIdParams;
12
+ /**
13
+ * Messages exchanged for evm requests.
14
+ */
15
+ export type EthMessages = {
16
+ ethRequest(props: EthRequestParams): Promise<string>;
17
+ };
@@ -0,0 +1,19 @@
1
+ import { UserProfile } from '@dynamic-labs/types';
2
+ export type SignInWithExternalJwtParams = {
3
+ externalUserId: string;
4
+ externalJwt: string;
5
+ };
6
+ export type VerifyWithExternalJwtParams = {
7
+ externalUserId: string;
8
+ externalJwt: string;
9
+ };
10
+ export type ExternalAuthMessages = {
11
+ /**
12
+ * Initiates sign in with an externally provided JWT
13
+ */
14
+ signInWithExternalJwt: (props: SignInWithExternalJwtParams) => Promise<UserProfile | null>;
15
+ /**
16
+ * Initiates verification with an externally provided JWT
17
+ */
18
+ verifyWithExternalJwt: (props: VerifyWithExternalJwtParams) => Promise<UserProfile | null>;
19
+ };
@@ -0,0 +1,8 @@
1
+ export type FetchMessages = {
2
+ fetch: (input: RequestInfo, init?: RequestInit) => Promise<{
3
+ body: string;
4
+ status: number;
5
+ statusText: string;
6
+ headers: Record<string, string>;
7
+ }>;
8
+ };
@@ -0,0 +1,22 @@
1
+ import { CreateMfaToken, MFADevice, MFADeviceType } from '@dynamic-labs/sdk-api-core';
2
+ export type MfaMessages = {
3
+ authRecoveryCode: (code: string) => Promise<boolean>;
4
+ completeAcknowledgement: () => Promise<void>;
5
+ deleteUserDevice: (deviceId: string, mfaAuthToken: string) => Promise<void>;
6
+ getRecoveryCodes: (generateNewCodes?: boolean) => Promise<string[]>;
7
+ getUserDevices: () => Promise<MFADevice[]>;
8
+ updateUserDevice: (deviceId: string) => Promise<void>;
9
+ verifyDevice: (code: string, type?: MFADeviceType) => Promise<MFADevice>;
10
+ addDevice: (type?: MFADeviceType) => Promise<{
11
+ id: string;
12
+ secret: string;
13
+ uri: string;
14
+ }>;
15
+ authDevice: (code: string, type?: MFADeviceType, deviceId?: string) => Promise<boolean>;
16
+ authenticateDevice: ({ code, type, deviceId, createMfaToken, }: {
17
+ code: string;
18
+ type?: MFADeviceType;
19
+ deviceId?: string;
20
+ createMfaToken?: CreateMfaToken;
21
+ }) => Promise<string | null>;
22
+ };
@@ -0,0 +1,6 @@
1
+ import { GenericNetwork } from '@dynamic-labs/types';
2
+ export type NetworksModuleState = {
3
+ evm: GenericNetwork[];
4
+ solana: GenericNetwork[];
5
+ sui: GenericNetwork[];
6
+ };
@@ -0,0 +1,14 @@
1
+ 'use client'
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ const emailEventNames = [
7
+ 'emailVerificationFinished',
8
+ ];
9
+ const smsEventNames = [
10
+ 'smsVerificationFinished',
11
+ ];
12
+
13
+ exports.emailEventNames = emailEventNames;
14
+ exports.smsEventNames = smsEventNames;
@@ -0,0 +1,29 @@
1
+ import { VerifyResponse } from '@dynamic-labs/sdk-api-core';
2
+ import { OtpDestination, PhoneData } from '@dynamic-labs/types';
3
+ export type EmailOtpParams = {
4
+ destination: Extract<OtpDestination, 'email'>;
5
+ target: string;
6
+ };
7
+ export type SmsOtpParams = {
8
+ destination: Extract<OtpDestination, 'sms'>;
9
+ target: PhoneData;
10
+ };
11
+ export type OtpData = EmailOtpParams | SmsOtpParams;
12
+ export type OtpMessages = {
13
+ /** Request to send an OTP to a destination for verification */
14
+ sendOTP: (data: OtpData) => Promise<void>;
15
+ /** Performs verification for the latest send OTP */
16
+ verifyOTP: (token: string) => Promise<VerifyResponse | void>;
17
+ /** Re-sends the OTP for verification */
18
+ resendOTP: () => Promise<void>;
19
+ emailVerificationFinished: (params: {
20
+ isSuccess: boolean;
21
+ destination: string;
22
+ }) => void;
23
+ smsVerificationFinished: (params: {
24
+ isSuccess: boolean;
25
+ destination: PhoneData;
26
+ }) => void;
27
+ };
28
+ export declare const emailEventNames: "emailVerificationFinished"[];
29
+ export declare const smsEventNames: "smsVerificationFinished"[];
@@ -0,0 +1,9 @@
1
+ 'use client'
2
+ const emailEventNames = [
3
+ 'emailVerificationFinished',
4
+ ];
5
+ const smsEventNames = [
6
+ 'smsVerificationFinished',
7
+ ];
8
+
9
+ export { emailEventNames, smsEventNames };
@@ -0,0 +1,15 @@
1
+ import type { PasskeyService } from '@dynamic-labs-sdk/client/core';
2
+ import { CreateMfaToken, UserPasskey, VerifyResponse } from '@dynamic-labs/sdk-api-core';
3
+ export type PasskeyMessages = {
4
+ authenticatePasskeyMFA: (props?: {
5
+ createMfaToken?: CreateMfaToken;
6
+ }) => Promise<VerifyResponse>;
7
+ getPasskeys: () => Promise<UserPasskey[]>;
8
+ registerPasskey: () => Promise<VerifyResponse>;
9
+ signInWithPasskey: () => Promise<VerifyResponse>;
10
+ /**
11
+ * Methods that run in the device native API
12
+ */
13
+ passkey_register: PasskeyService['register'];
14
+ passkey_authenticate: PasskeyService['authenticate'];
15
+ };
@@ -0,0 +1,17 @@
1
+ export type PlatformServiceMessages = {
2
+ /**
3
+ * Origin: Webview.
4
+ * Requests that a deeplink be open by whichever platform the client is running in.
5
+ */
6
+ openURL: (url: string) => Promise<void>;
7
+ /**
8
+ * Origin: Webview.
9
+ * Opens the URL in a secure browser window for authentication.
10
+ *
11
+ * Resolves with the URL used to deeplink back to this app.
12
+ */
13
+ openAuthenticationWindow: (props: {
14
+ url: string;
15
+ redirectUrl?: string;
16
+ }) => Promise<string>;
17
+ };
@@ -0,0 +1,6 @@
1
+ import { ProjectSettings } from '@dynamic-labs/sdk-api-core';
2
+ export type ProjectSettingsMessages = {
3
+ getProjectSettings: () => Promise<{
4
+ projectSettings: ProjectSettings;
5
+ }>;
6
+ };
@@ -0,0 +1,9 @@
1
+ 'use client'
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ /** Easy access to the event name that indicates the SDK has loaded */
7
+ const sdkHasLoadedEventName = 'sdk__loadedChanged';
8
+
9
+ exports.sdkHasLoadedEventName = sdkHasLoadedEventName;
@@ -0,0 +1,31 @@
1
+ import { LogLevel } from '@dynamic-labs/logger';
2
+ /**
3
+ * Defines the settings required by the SDK to be properly initialized
4
+ * inside the webview
5
+ */
6
+ export type ClientManifest = {
7
+ apiBaseUrl?: string;
8
+ appLogoUrl?: string;
9
+ appName?: string;
10
+ appOrigin?: string;
11
+ clientVersion: string;
12
+ cssOverrides?: string;
13
+ environmentId: string;
14
+ platform: 'browser' | 'react-native' | 'flutter' | 'swift';
15
+ redirectUrl: string;
16
+ debug?: {
17
+ webview?: boolean;
18
+ messageTransport?: boolean;
19
+ loggerLevel?: LogLevel;
20
+ };
21
+ };
22
+ export type SdkModuleState = {
23
+ /** Indicates the SDK is set up and ready for requests */
24
+ loaded: boolean;
25
+ };
26
+ export type SdkModuleMessages = {
27
+ /** Sent from the webview app to request the SDK settings */
28
+ manifest: () => Promise<ClientManifest>;
29
+ };
30
+ /** Easy access to the event name that indicates the SDK has loaded */
31
+ export declare const sdkHasLoadedEventName = "sdk__loadedChanged";
@@ -0,0 +1,5 @@
1
+ 'use client'
2
+ /** Easy access to the event name that indicates the SDK has loaded */
3
+ const sdkHasLoadedEventName = 'sdk__loadedChanged';
4
+
5
+ export { sdkHasLoadedEventName };
@@ -0,0 +1,29 @@
1
+ import { ProviderEnum } from '@dynamic-labs/sdk-api-core';
2
+ export type SocialProvider = 'apple' | 'coinbaseSocial' | 'discord' | 'epicgames' | 'facebook' | 'farcaster' | 'github' | 'google' | 'kraken' | 'line' | 'telegram' | 'tiktok' | 'twitch' | 'twitter' | 'shopify' | 'spotify';
3
+ type ConnectWithSocialOnHostArgs = {
4
+ clientId?: string;
5
+ oauthLoginUrl: string;
6
+ provider: ProviderEnum;
7
+ state: string;
8
+ };
9
+ export type SocialAuthModuleMessages = {
10
+ connectWithSocial: (args: {
11
+ /**
12
+ * Provider with which to connect
13
+ */
14
+ provider: SocialProvider;
15
+ /**
16
+ * When using expo-router, which pathname to redirect back to after social connection.
17
+ *
18
+ * The router will create another stack when redirecting back to a different pathname than your
19
+ * app was at originally, which in iOS devices will cause visual flickering. To avoid this, pass
20
+ * `usePathname()` to this property.
21
+ */
22
+ redirectPathname?: string;
23
+ }) => Promise<void>;
24
+ /**
25
+ * Trigger a social auth connection on the host/native side
26
+ */
27
+ connectWithSocialOnHost: (args: ConnectWithSocialOnHostArgs) => Promise<void>;
28
+ };
29
+ export {};
@@ -0,0 +1,42 @@
1
+ type Commitment = 'processed' | 'confirmed' | 'finalized' | 'recent' | 'single' | 'singleGossip' | 'root' | 'max';
2
+ type SendOptions = {
3
+ skipPreflight?: boolean;
4
+ preflightCommitment?: Commitment;
5
+ maxRetries?: number;
6
+ minContextSlot?: number;
7
+ };
8
+ type EncodedTransaction = {
9
+ type: 'legacy' | 'versioned';
10
+ transaction: string;
11
+ };
12
+ /**
13
+ * Messages exchanged for solana requests.
14
+ */
15
+ export type SolanaMessages = {
16
+ solana_signMessage: (arg: {
17
+ message: string;
18
+ walletId: string;
19
+ }) => Promise<{
20
+ signature: string;
21
+ }>;
22
+ solana_signAndSendTransaction: (arg: {
23
+ walletId: string;
24
+ options?: SendOptions;
25
+ encodedTransaction: EncodedTransaction;
26
+ }) => Promise<{
27
+ signature: string;
28
+ }>;
29
+ solana_signTransaction: (arg: {
30
+ walletId: string;
31
+ encodedTransaction: EncodedTransaction;
32
+ }) => Promise<{
33
+ encodedTransaction: EncodedTransaction;
34
+ }>;
35
+ solana_signAllTransactions: (arg: {
36
+ walletId: string;
37
+ encodedTransactions: EncodedTransaction[];
38
+ }) => Promise<{
39
+ encodedTransactions: EncodedTransaction[];
40
+ }>;
41
+ };
42
+ 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
+ };
@@ -0,0 +1 @@
1
+ export type StoreKeys = 'auth' | 'sdk' | 'wallets' | 'embeddedWallets' | 'platform' | 'userInterface' | 'otp' | 'networks';
@@ -0,0 +1,21 @@
1
+ export type SuiNetworkName = 'mainnet' | 'testnet' | 'devnet';
2
+ /**
3
+ * Messages exchanged for sui requests.
4
+ */
5
+ export type SuiMessages = {
6
+ sui_signMessage: (arg: {
7
+ message: string;
8
+ walletId: string;
9
+ }) => Promise<{
10
+ signature: string;
11
+ }>;
12
+ sui_signTransaction: (arg: {
13
+ transaction: string;
14
+ walletId: string;
15
+ }) => Promise<{
16
+ signature: string;
17
+ }>;
18
+ sui_getNetworkName: (arg: {
19
+ walletId: string;
20
+ }) => Promise<SuiNetworkName>;
21
+ };
@@ -0,0 +1,9 @@
1
+ export type TurnkeyIframeEventProxyMessages = {
2
+ initializeTurnkeyIframeEventProxy: (args: {
3
+ origins: string[];
4
+ }) => Promise<void>;
5
+ proxyEmitterTurnkeyIframeEvent: (args: {
6
+ origin: string;
7
+ data: any;
8
+ }) => Promise<void>;
9
+ };
@@ -0,0 +1,38 @@
1
+ import { CreateWebauthnCredentialOptions, convertAttestationResultToTurnkey } from '@dynamic-labs/webauthn';
2
+ type CustomPublicKeyCredentialUserEntity = Omit<PublicKeyCredentialUserEntity, 'id'> & {
3
+ id: string;
4
+ };
5
+ type CustomPublicKeyCredentialRpEntity = Omit<PublicKeyCredentialRpEntity, 'id'> & {
6
+ id: string;
7
+ };
8
+ export type TurnkeyPasskeyMessages = {
9
+ createPasskey: (params: {
10
+ publicKey: {
11
+ authenticatorName: string;
12
+ attestation?: AttestationConveyancePreference;
13
+ authenticatorSelection?: AuthenticatorSelectionCriteria;
14
+ challenge?: string;
15
+ pubKeyCredParams: PublicKeyCredentialParameters[];
16
+ rp: CustomPublicKeyCredentialRpEntity;
17
+ timeout?: number;
18
+ user: CustomPublicKeyCredentialUserEntity;
19
+ };
20
+ }) => Promise<{
21
+ attestation: {
22
+ credentialId: string;
23
+ clientDataJson: string;
24
+ attestationObject: string;
25
+ transports: ('AUTHENTICATOR_TRANSPORT_BLE' | 'AUTHENTICATOR_TRANSPORT_INTERNAL' | 'AUTHENTICATOR_TRANSPORT_NFC' | 'AUTHENTICATOR_TRANSPORT_USB' | 'AUTHENTICATOR_TRANSPORT_HYBRID')[];
26
+ };
27
+ }>;
28
+ createPasskeyOnBrowser: (params: {
29
+ publicKey: CreateWebauthnCredentialOptions;
30
+ }) => Promise<{
31
+ attestation: ReturnType<typeof convertAttestationResultToTurnkey>;
32
+ }>;
33
+ passkeyStamp: (rdId: string, payload: string) => Promise<{
34
+ stampHeaderName: string;
35
+ stampHeaderValue: string;
36
+ }>;
37
+ };
38
+ export {};