@moon-x/core 0.3.0 → 0.5.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 (44) hide show
  1. package/README.md +1 -1
  2. package/dist/{chunk-CDT4MC7S.mjs → chunk-I56GRKAG.mjs} +19 -39
  3. package/dist/{chunk-VVL65GIB.mjs → chunk-JU5MWLXH.mjs} +14 -0
  4. package/dist/index.d.mts +2 -3
  5. package/dist/index.d.ts +2 -3
  6. package/dist/index.js +14 -0
  7. package/dist/index.mjs +1 -1
  8. package/dist/{interfaces-Bm7fGOAI.d.ts → interfaces-1vfik3Ef.d.ts} +24 -1
  9. package/dist/{interfaces-CYtJHALV.d.mts → interfaces-BdIeMGGD.d.mts} +24 -1
  10. package/dist/lib/index.d.mts +33 -3
  11. package/dist/lib/index.d.ts +33 -3
  12. package/dist/lib/index.js +23 -47
  13. package/dist/lib/index.mjs +7 -15
  14. package/dist/passkey-cache-WnDFQ-v4.d.mts +26 -0
  15. package/dist/passkey-cache-WnDFQ-v4.d.ts +26 -0
  16. package/dist/{post-message-CmgAfkOS.d.mts → post-message-Z6cLf0mS.d.mts} +3 -0
  17. package/dist/{post-message-CmgAfkOS.d.ts → post-message-Z6cLf0mS.d.ts} +3 -0
  18. package/dist/react/ethereum.d.mts +0 -1
  19. package/dist/react/ethereum.d.ts +0 -1
  20. package/dist/react/index.d.mts +41 -3
  21. package/dist/react/index.d.ts +41 -3
  22. package/dist/react/index.js +138 -12
  23. package/dist/react/index.mjs +137 -12
  24. package/dist/react/solana.d.mts +0 -1
  25. package/dist/react/solana.d.ts +0 -1
  26. package/dist/sdk/index.d.mts +87 -16
  27. package/dist/sdk/index.d.ts +87 -16
  28. package/dist/sdk/index.js +456 -102
  29. package/dist/sdk/index.mjs +440 -80
  30. package/dist/types/index.d.mts +135 -12
  31. package/dist/types/index.d.ts +135 -12
  32. package/dist/utils/index.d.mts +1 -1
  33. package/dist/utils/index.d.ts +1 -1
  34. package/dist/utils/index.js +14 -0
  35. package/dist/utils/index.mjs +1 -1
  36. package/dist/web/index.d.mts +2 -2
  37. package/dist/web/index.d.ts +2 -2
  38. package/dist/web/index.js +29 -0
  39. package/dist/web/index.mjs +30 -1
  40. package/package.json +3 -1
  41. package/dist/chain-C9dvKXUY.d.mts +0 -48
  42. package/dist/chain-C9dvKXUY.d.ts +0 -48
  43. package/dist/passkey-cache-B9PT3AWX.d.mts +0 -47
  44. package/dist/passkey-cache-B9PT3AWX.d.ts +0 -47
@@ -1,16 +1,14 @@
1
- import { T as Transport, P as PasskeyAssertor, K as KvStorage } from '../interfaces-CYtJHALV.mjs';
2
- export { O as OAuthOpener, a as PlatformImpls, W as WebAuthnAssertionResponse, b as WebAuthnRequestOptions } from '../interfaces-CYtJHALV.mjs';
3
- import { C as CachedAssertion } from '../passkey-cache-B9PT3AWX.mjs';
4
- import { EthereumSignMessageParams, EthereumSignMessageResult, EthereumSignTransactionParams, EthereumSignTransactionResult, EthereumSignTypedDataParams, EthereumSignTypedDataResult, EthereumSignHashParams, EthereumSignHashResult, EthereumSign7702AuthorizationParams, EthereumSign7702AuthorizationResult, EthereumSendTransactionParams, EthereumSendTransactionResult, EthereumGetBalanceParams, EthereumGetBalanceResult, EthereumGetTokenAccountsByOwnerParams, EthereumGetTokenAccountsByOwnerResult, SolanaSignMessageParams, SolanaSignMessageResult, SolanaSignTransactionParams, SolanaSignTransactionResult, SolanaSendTransactionParams, SolanaSendTransactionResult, SolanaGetBalanceParams, SolanaGetBalanceResult, SolanaGetTokenAccountsByOwnerParams, SolanaGetTokenAccountsByOwnerResult, SendEmailOtpResponse, PublicWallet } from '../types/index.mjs';
5
- import '../post-message-CmgAfkOS.mjs';
6
- import '../chain-C9dvKXUY.mjs';
1
+ import { T as Transport, P as PasskeyAssertor, K as KvStorage } from '../interfaces-BdIeMGGD.mjs';
2
+ export { O as OAuthOpener, a as PlatformImpls, W as WebAuthnAssertionResponse, b as WebAuthnRequestOptions } from '../interfaces-BdIeMGGD.mjs';
3
+ import { C as CachedAssertion } from '../passkey-cache-WnDFQ-v4.mjs';
4
+ import { EthereumSignMessageParams, EthereumSignMessageResult, EthereumSignTransactionParams, EthereumSignTransactionResult, EthereumSignTypedDataParams, EthereumSignTypedDataResult, EthereumSignHashParams, EthereumSignHashResult, EthereumSign7702AuthorizationParams, EthereumSign7702AuthorizationResult, EthereumSendTransactionParams, EthereumSendTransactionResult, EthereumGetBalanceParams, EthereumGetBalanceResult, EthereumGetTokenAccountsByOwnerParams, EthereumGetTokenAccountsByOwnerResult, SolanaSignMessageParams, SolanaSignMessageResult, SolanaSignTransactionParams, SolanaSignTransactionResult, SolanaSendTransactionParams, SolanaSendTransactionResult, SolanaGetBalanceParams, SolanaGetBalanceResult, SolanaGetTokenAccountsByOwnerParams, SolanaGetTokenAccountsByOwnerResult, SendEmailOtpResponse, PublicWallet, ProvisionEphemeralSignerParams, ProvisionEphemeralSignerResult, ListEphemeralSignersResult, RevokeEphemeralSignerParams } from '../types/index.mjs';
5
+ import '../post-message-Z6cLf0mS.mjs';
7
6
 
8
7
  type AssertPasskeyInParentResult = CachedAssertion;
9
- declare const assertPasskeyInParent: ({ transport, passkey, publishableKey, requireFreshAssertion, validateCredentialInAllowList, }: {
8
+ declare const assertPasskeyInParent: ({ transport, passkey, publishableKey, validateCredentialInAllowList, }: {
10
9
  transport: Transport;
11
10
  passkey: PasskeyAssertor;
12
11
  publishableKey: string;
13
- requireFreshAssertion?: boolean;
14
12
  validateCredentialInAllowList?: boolean;
15
13
  }) => Promise<AssertPasskeyInParentResult>;
16
14
 
@@ -25,10 +23,31 @@ declare const getPresenceToken: ({ transport, passkey, publishableKey, relyingPa
25
23
  relyingPartyOrigin: string;
26
24
  }) => Promise<GetPresenceTokenResult>;
27
25
 
28
- declare const getHeadlessEthereumMethods: ({ transport, passkey, publishableKey, }: {
26
+ interface ScopedPresenceToken {
27
+ token: string;
28
+ expiresAt: number;
29
+ }
30
+ interface GetInternalPresenceTokensResult {
31
+ tokens: Record<string, ScopedPresenceToken>;
32
+ tokenBatches: Record<string, ScopedPresenceToken[]>;
33
+ userHandleB64url: string;
34
+ credentialIdB64url: string;
35
+ }
36
+ declare const getInternalPresenceTokens: ({ transport, passkey, publishableKey, relyingPartyOrigin, scopes, scopeCounts, }: {
37
+ transport: Transport;
38
+ passkey: PasskeyAssertor;
39
+ publishableKey: string;
40
+ relyingPartyOrigin: string;
41
+ scopes?: string[];
42
+ scopeCounts?: Record<string, number>;
43
+ }) => Promise<GetInternalPresenceTokensResult>;
44
+ declare const flattenPresenceTokens: (result: Pick<GetInternalPresenceTokensResult, "tokens"> & Partial<GetInternalPresenceTokensResult>) => Record<string, string>;
45
+
46
+ declare const getHeadlessEthereumMethods: ({ transport, passkey, publishableKey, relyingPartyOrigin, }: {
29
47
  transport: Transport;
30
48
  passkey: PasskeyAssertor;
31
49
  publishableKey: string;
50
+ relyingPartyOrigin: string;
32
51
  }) => {
33
52
  signEthereumMessageHeadless: (params: EthereumSignMessageParams) => Promise<EthereumSignMessageResult>;
34
53
  signEthereumTransactionHeadless: (params: EthereumSignTransactionParams) => Promise<EthereumSignTransactionResult>;
@@ -46,10 +65,11 @@ declare const getHeadlessEthereumMethods: ({ transport, passkey, publishableKey,
46
65
  }) => Promise<unknown>;
47
66
  };
48
67
 
49
- declare const getHeadlessSolanaMethods: ({ transport, passkey, publishableKey, }: {
68
+ declare const getHeadlessSolanaMethods: ({ transport, passkey, publishableKey, relyingPartyOrigin, }: {
50
69
  transport: Transport;
51
70
  passkey: PasskeyAssertor;
52
71
  publishableKey: string;
72
+ relyingPartyOrigin: string;
53
73
  }) => {
54
74
  signSolanaMessageHeadless: (params: SolanaSignMessageParams) => Promise<SolanaSignMessageResult>;
55
75
  signSolanaTransactionHeadless: (params: SolanaSignTransactionParams) => Promise<SolanaSignTransactionResult>;
@@ -98,11 +118,12 @@ declare const getHeadlessAuthenticationMethods: ({ transport, publishableKey, se
98
118
  verifyOAuth: (params: VerifyOAuthParams) => Promise<unknown>;
99
119
  };
100
120
 
101
- declare const getHeadlessGeneralMethods: ({ transport, passkey, storage, publishableKey, setIsAuthenticated, setUser, }: {
121
+ declare const getHeadlessGeneralMethods: ({ transport, passkey, storage, publishableKey, relyingPartyOrigin, setIsAuthenticated, setUser, }: {
102
122
  transport: Transport;
103
123
  passkey: PasskeyAssertor;
104
124
  storage: KvStorage;
105
125
  publishableKey: string;
126
+ relyingPartyOrigin: string;
106
127
  setIsAuthenticated?: (isAuth: boolean) => void;
107
128
  setUser?: (user: unknown | null) => void;
108
129
  }) => {
@@ -111,15 +132,15 @@ declare const getHeadlessGeneralMethods: ({ transport, passkey, storage, publish
111
132
  createWallet: (walletType: "solana" | "ethereum", options?: {
112
133
  createAdditional?: boolean;
113
134
  walletIndex?: number;
114
- requireFreshAssertion?: boolean;
115
135
  }) => Promise<{
116
136
  wallet: PublicWallet;
117
137
  }>;
118
- importKey: (walletType: "solana" | "ethereum", key: string, options?: {
119
- requireFreshAssertion?: boolean;
120
- }) => Promise<{
138
+ importKey: (walletType: "solana" | "ethereum", key: string) => Promise<{
121
139
  wallet: PublicWallet;
122
140
  }>;
141
+ provisionEphemeralSigner: (params: ProvisionEphemeralSignerParams) => Promise<ProvisionEphemeralSignerResult>;
142
+ listEphemeralSigners: () => Promise<ListEphemeralSignersResult>;
143
+ revokeEphemeralSigner: (params: RevokeEphemeralSignerParams) => Promise<void>;
123
144
  getWallets: (walletType: "solana" | "ethereum") => Promise<{
124
145
  wallets: unknown[];
125
146
  walletType: string;
@@ -137,4 +158,54 @@ declare const getHeadlessGeneralMethods: ({ transport, passkey, storage, publish
137
158
  getUser: () => Promise<unknown>;
138
159
  };
139
160
 
140
- export { type AssertPasskeyInParentResult, type GetPresenceTokenResult, KvStorage, type LoginWithCodeParams, PasskeyAssertor, type SendCodeParams, Transport, type VerifyOAuthParams, assertPasskeyInParent, getHeadlessAuthenticationMethods, getHeadlessEthereumMethods, getHeadlessGeneralMethods, getHeadlessSolanaMethods, getPresenceToken };
161
+ interface EphemeralSignerSignInput {
162
+ /** Lowercase-hex 32-byte Ed25519 agent public key (no 0x prefix). */
163
+ apiPubHex: string;
164
+ /** Lowercase-hex 32-byte Ed25519 agent private key (no 0x prefix). */
165
+ apiPrivHex: string;
166
+ /**
167
+ * Wallet UUID (from `user.wallets[i].id`) the agent should sign on
168
+ * behalf of. Must be one of the wallets the agent was provisioned
169
+ * for. The SDK resolves this internally to the wallet's MPC `key_id`
170
+ * + stored `derivation_path` — integrators never see those values.
171
+ */
172
+ walletId: string;
173
+ /**
174
+ * Lowercase-hex digest to sign — keccak256 of the message/tx for
175
+ * ECDSA, raw bytes for Ed25519. No 0x prefix.
176
+ */
177
+ rawSigningPayloadHex: string;
178
+ /** Defaults to now. SES rejects timestamps further than ±5 min from its clock. */
179
+ issuedAt?: Date;
180
+ /** Wallets backend base URL (no trailing slash). */
181
+ baseUrl: string;
182
+ /**
183
+ * MoonX publishable key (`moon_pk_…`). The wallets backend's
184
+ * /ephemeral-signers/* router group is gated by RequirePublicToken — every
185
+ * call needs an `Authorization: PublicToken <publishableKey>` header.
186
+ */
187
+ publishableKey: string;
188
+ /** Optional fetch override — e.g. for Next.js route handlers or test stubs. */
189
+ fetchImpl?: typeof fetch;
190
+ }
191
+ interface EphemeralSignerSignResult {
192
+ scheme: "ecdsa_secp256k1" | "eddsa_ed25519";
193
+ signature: {
194
+ /** ECDSA only. Lowercase-hex 32-byte r. */
195
+ r?: string;
196
+ /** ECDSA only. Lowercase-hex 32-byte s. */
197
+ s?: string;
198
+ /** ECDSA only. 0..3. */
199
+ recovery_id?: number;
200
+ /** Ed25519 only. Lowercase-hex 64-byte signature. */
201
+ signature?: string;
202
+ };
203
+ }
204
+ declare class EphemeralSignerSignError extends Error {
205
+ readonly status?: number | undefined;
206
+ readonly body?: string | undefined;
207
+ constructor(message: string, status?: number | undefined, body?: string | undefined);
208
+ }
209
+ declare function signWithEphemeralSigner(input: EphemeralSignerSignInput): Promise<EphemeralSignerSignResult>;
210
+
211
+ export { type AssertPasskeyInParentResult, EphemeralSignerSignError, type EphemeralSignerSignInput, type EphemeralSignerSignResult, type GetInternalPresenceTokensResult, type GetPresenceTokenResult, KvStorage, type LoginWithCodeParams, PasskeyAssertor, type ScopedPresenceToken, type SendCodeParams, Transport, type VerifyOAuthParams, assertPasskeyInParent, flattenPresenceTokens, getHeadlessAuthenticationMethods, getHeadlessEthereumMethods, getHeadlessGeneralMethods, getHeadlessSolanaMethods, getInternalPresenceTokens, getPresenceToken, signWithEphemeralSigner };
@@ -1,16 +1,14 @@
1
- import { T as Transport, P as PasskeyAssertor, K as KvStorage } from '../interfaces-Bm7fGOAI.js';
2
- export { O as OAuthOpener, a as PlatformImpls, W as WebAuthnAssertionResponse, b as WebAuthnRequestOptions } from '../interfaces-Bm7fGOAI.js';
3
- import { C as CachedAssertion } from '../passkey-cache-B9PT3AWX.js';
4
- import { EthereumSignMessageParams, EthereumSignMessageResult, EthereumSignTransactionParams, EthereumSignTransactionResult, EthereumSignTypedDataParams, EthereumSignTypedDataResult, EthereumSignHashParams, EthereumSignHashResult, EthereumSign7702AuthorizationParams, EthereumSign7702AuthorizationResult, EthereumSendTransactionParams, EthereumSendTransactionResult, EthereumGetBalanceParams, EthereumGetBalanceResult, EthereumGetTokenAccountsByOwnerParams, EthereumGetTokenAccountsByOwnerResult, SolanaSignMessageParams, SolanaSignMessageResult, SolanaSignTransactionParams, SolanaSignTransactionResult, SolanaSendTransactionParams, SolanaSendTransactionResult, SolanaGetBalanceParams, SolanaGetBalanceResult, SolanaGetTokenAccountsByOwnerParams, SolanaGetTokenAccountsByOwnerResult, SendEmailOtpResponse, PublicWallet } from '../types/index.js';
5
- import '../post-message-CmgAfkOS.js';
6
- import '../chain-C9dvKXUY.js';
1
+ import { T as Transport, P as PasskeyAssertor, K as KvStorage } from '../interfaces-1vfik3Ef.js';
2
+ export { O as OAuthOpener, a as PlatformImpls, W as WebAuthnAssertionResponse, b as WebAuthnRequestOptions } from '../interfaces-1vfik3Ef.js';
3
+ import { C as CachedAssertion } from '../passkey-cache-WnDFQ-v4.js';
4
+ import { EthereumSignMessageParams, EthereumSignMessageResult, EthereumSignTransactionParams, EthereumSignTransactionResult, EthereumSignTypedDataParams, EthereumSignTypedDataResult, EthereumSignHashParams, EthereumSignHashResult, EthereumSign7702AuthorizationParams, EthereumSign7702AuthorizationResult, EthereumSendTransactionParams, EthereumSendTransactionResult, EthereumGetBalanceParams, EthereumGetBalanceResult, EthereumGetTokenAccountsByOwnerParams, EthereumGetTokenAccountsByOwnerResult, SolanaSignMessageParams, SolanaSignMessageResult, SolanaSignTransactionParams, SolanaSignTransactionResult, SolanaSendTransactionParams, SolanaSendTransactionResult, SolanaGetBalanceParams, SolanaGetBalanceResult, SolanaGetTokenAccountsByOwnerParams, SolanaGetTokenAccountsByOwnerResult, SendEmailOtpResponse, PublicWallet, ProvisionEphemeralSignerParams, ProvisionEphemeralSignerResult, ListEphemeralSignersResult, RevokeEphemeralSignerParams } from '../types/index.js';
5
+ import '../post-message-Z6cLf0mS.js';
7
6
 
8
7
  type AssertPasskeyInParentResult = CachedAssertion;
9
- declare const assertPasskeyInParent: ({ transport, passkey, publishableKey, requireFreshAssertion, validateCredentialInAllowList, }: {
8
+ declare const assertPasskeyInParent: ({ transport, passkey, publishableKey, validateCredentialInAllowList, }: {
10
9
  transport: Transport;
11
10
  passkey: PasskeyAssertor;
12
11
  publishableKey: string;
13
- requireFreshAssertion?: boolean;
14
12
  validateCredentialInAllowList?: boolean;
15
13
  }) => Promise<AssertPasskeyInParentResult>;
16
14
 
@@ -25,10 +23,31 @@ declare const getPresenceToken: ({ transport, passkey, publishableKey, relyingPa
25
23
  relyingPartyOrigin: string;
26
24
  }) => Promise<GetPresenceTokenResult>;
27
25
 
28
- declare const getHeadlessEthereumMethods: ({ transport, passkey, publishableKey, }: {
26
+ interface ScopedPresenceToken {
27
+ token: string;
28
+ expiresAt: number;
29
+ }
30
+ interface GetInternalPresenceTokensResult {
31
+ tokens: Record<string, ScopedPresenceToken>;
32
+ tokenBatches: Record<string, ScopedPresenceToken[]>;
33
+ userHandleB64url: string;
34
+ credentialIdB64url: string;
35
+ }
36
+ declare const getInternalPresenceTokens: ({ transport, passkey, publishableKey, relyingPartyOrigin, scopes, scopeCounts, }: {
37
+ transport: Transport;
38
+ passkey: PasskeyAssertor;
39
+ publishableKey: string;
40
+ relyingPartyOrigin: string;
41
+ scopes?: string[];
42
+ scopeCounts?: Record<string, number>;
43
+ }) => Promise<GetInternalPresenceTokensResult>;
44
+ declare const flattenPresenceTokens: (result: Pick<GetInternalPresenceTokensResult, "tokens"> & Partial<GetInternalPresenceTokensResult>) => Record<string, string>;
45
+
46
+ declare const getHeadlessEthereumMethods: ({ transport, passkey, publishableKey, relyingPartyOrigin, }: {
29
47
  transport: Transport;
30
48
  passkey: PasskeyAssertor;
31
49
  publishableKey: string;
50
+ relyingPartyOrigin: string;
32
51
  }) => {
33
52
  signEthereumMessageHeadless: (params: EthereumSignMessageParams) => Promise<EthereumSignMessageResult>;
34
53
  signEthereumTransactionHeadless: (params: EthereumSignTransactionParams) => Promise<EthereumSignTransactionResult>;
@@ -46,10 +65,11 @@ declare const getHeadlessEthereumMethods: ({ transport, passkey, publishableKey,
46
65
  }) => Promise<unknown>;
47
66
  };
48
67
 
49
- declare const getHeadlessSolanaMethods: ({ transport, passkey, publishableKey, }: {
68
+ declare const getHeadlessSolanaMethods: ({ transport, passkey, publishableKey, relyingPartyOrigin, }: {
50
69
  transport: Transport;
51
70
  passkey: PasskeyAssertor;
52
71
  publishableKey: string;
72
+ relyingPartyOrigin: string;
53
73
  }) => {
54
74
  signSolanaMessageHeadless: (params: SolanaSignMessageParams) => Promise<SolanaSignMessageResult>;
55
75
  signSolanaTransactionHeadless: (params: SolanaSignTransactionParams) => Promise<SolanaSignTransactionResult>;
@@ -98,11 +118,12 @@ declare const getHeadlessAuthenticationMethods: ({ transport, publishableKey, se
98
118
  verifyOAuth: (params: VerifyOAuthParams) => Promise<unknown>;
99
119
  };
100
120
 
101
- declare const getHeadlessGeneralMethods: ({ transport, passkey, storage, publishableKey, setIsAuthenticated, setUser, }: {
121
+ declare const getHeadlessGeneralMethods: ({ transport, passkey, storage, publishableKey, relyingPartyOrigin, setIsAuthenticated, setUser, }: {
102
122
  transport: Transport;
103
123
  passkey: PasskeyAssertor;
104
124
  storage: KvStorage;
105
125
  publishableKey: string;
126
+ relyingPartyOrigin: string;
106
127
  setIsAuthenticated?: (isAuth: boolean) => void;
107
128
  setUser?: (user: unknown | null) => void;
108
129
  }) => {
@@ -111,15 +132,15 @@ declare const getHeadlessGeneralMethods: ({ transport, passkey, storage, publish
111
132
  createWallet: (walletType: "solana" | "ethereum", options?: {
112
133
  createAdditional?: boolean;
113
134
  walletIndex?: number;
114
- requireFreshAssertion?: boolean;
115
135
  }) => Promise<{
116
136
  wallet: PublicWallet;
117
137
  }>;
118
- importKey: (walletType: "solana" | "ethereum", key: string, options?: {
119
- requireFreshAssertion?: boolean;
120
- }) => Promise<{
138
+ importKey: (walletType: "solana" | "ethereum", key: string) => Promise<{
121
139
  wallet: PublicWallet;
122
140
  }>;
141
+ provisionEphemeralSigner: (params: ProvisionEphemeralSignerParams) => Promise<ProvisionEphemeralSignerResult>;
142
+ listEphemeralSigners: () => Promise<ListEphemeralSignersResult>;
143
+ revokeEphemeralSigner: (params: RevokeEphemeralSignerParams) => Promise<void>;
123
144
  getWallets: (walletType: "solana" | "ethereum") => Promise<{
124
145
  wallets: unknown[];
125
146
  walletType: string;
@@ -137,4 +158,54 @@ declare const getHeadlessGeneralMethods: ({ transport, passkey, storage, publish
137
158
  getUser: () => Promise<unknown>;
138
159
  };
139
160
 
140
- export { type AssertPasskeyInParentResult, type GetPresenceTokenResult, KvStorage, type LoginWithCodeParams, PasskeyAssertor, type SendCodeParams, Transport, type VerifyOAuthParams, assertPasskeyInParent, getHeadlessAuthenticationMethods, getHeadlessEthereumMethods, getHeadlessGeneralMethods, getHeadlessSolanaMethods, getPresenceToken };
161
+ interface EphemeralSignerSignInput {
162
+ /** Lowercase-hex 32-byte Ed25519 agent public key (no 0x prefix). */
163
+ apiPubHex: string;
164
+ /** Lowercase-hex 32-byte Ed25519 agent private key (no 0x prefix). */
165
+ apiPrivHex: string;
166
+ /**
167
+ * Wallet UUID (from `user.wallets[i].id`) the agent should sign on
168
+ * behalf of. Must be one of the wallets the agent was provisioned
169
+ * for. The SDK resolves this internally to the wallet's MPC `key_id`
170
+ * + stored `derivation_path` — integrators never see those values.
171
+ */
172
+ walletId: string;
173
+ /**
174
+ * Lowercase-hex digest to sign — keccak256 of the message/tx for
175
+ * ECDSA, raw bytes for Ed25519. No 0x prefix.
176
+ */
177
+ rawSigningPayloadHex: string;
178
+ /** Defaults to now. SES rejects timestamps further than ±5 min from its clock. */
179
+ issuedAt?: Date;
180
+ /** Wallets backend base URL (no trailing slash). */
181
+ baseUrl: string;
182
+ /**
183
+ * MoonX publishable key (`moon_pk_…`). The wallets backend's
184
+ * /ephemeral-signers/* router group is gated by RequirePublicToken — every
185
+ * call needs an `Authorization: PublicToken <publishableKey>` header.
186
+ */
187
+ publishableKey: string;
188
+ /** Optional fetch override — e.g. for Next.js route handlers or test stubs. */
189
+ fetchImpl?: typeof fetch;
190
+ }
191
+ interface EphemeralSignerSignResult {
192
+ scheme: "ecdsa_secp256k1" | "eddsa_ed25519";
193
+ signature: {
194
+ /** ECDSA only. Lowercase-hex 32-byte r. */
195
+ r?: string;
196
+ /** ECDSA only. Lowercase-hex 32-byte s. */
197
+ s?: string;
198
+ /** ECDSA only. 0..3. */
199
+ recovery_id?: number;
200
+ /** Ed25519 only. Lowercase-hex 64-byte signature. */
201
+ signature?: string;
202
+ };
203
+ }
204
+ declare class EphemeralSignerSignError extends Error {
205
+ readonly status?: number | undefined;
206
+ readonly body?: string | undefined;
207
+ constructor(message: string, status?: number | undefined, body?: string | undefined);
208
+ }
209
+ declare function signWithEphemeralSigner(input: EphemeralSignerSignInput): Promise<EphemeralSignerSignResult>;
210
+
211
+ export { type AssertPasskeyInParentResult, EphemeralSignerSignError, type EphemeralSignerSignInput, type EphemeralSignerSignResult, type GetInternalPresenceTokensResult, type GetPresenceTokenResult, KvStorage, type LoginWithCodeParams, PasskeyAssertor, type ScopedPresenceToken, type SendCodeParams, Transport, type VerifyOAuthParams, assertPasskeyInParent, flattenPresenceTokens, getHeadlessAuthenticationMethods, getHeadlessEthereumMethods, getHeadlessGeneralMethods, getHeadlessSolanaMethods, getInternalPresenceTokens, getPresenceToken, signWithEphemeralSigner };