@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,5 +1,49 @@
1
- import { a as ChainLikeWithId, C as Chain } from '../chain-C9dvKXUY.mjs';
2
- export { B as BlockExplorer, E as EthereumChainConfig, N as NativeCurrency, R as RpcConfig, b as RpcUrls } from '../chain-C9dvKXUY.mjs';
1
+ type RpcUrls = {
2
+ http: readonly string[];
3
+ webSocket?: readonly string[];
4
+ };
5
+ type NativeCurrency = {
6
+ name: string;
7
+ symbol: string;
8
+ decimals: number;
9
+ };
10
+ type BlockExplorer = {
11
+ name: string;
12
+ url: string;
13
+ };
14
+ type Chain = {
15
+ id: number;
16
+ name: string;
17
+ network?: string;
18
+ nativeCurrency: NativeCurrency;
19
+ blockExplorers?: {
20
+ [key: string]: BlockExplorer;
21
+ default: BlockExplorer;
22
+ };
23
+ rpcUrls: {
24
+ [key: string]: RpcUrls;
25
+ default: RpcUrls;
26
+ };
27
+ testnet?: boolean;
28
+ };
29
+ type ChainLikeWithId = {
30
+ id: number;
31
+ };
32
+ type RpcConfig = {
33
+ rpcUrls?: {
34
+ [chainId: number]: string;
35
+ };
36
+ rpcTimeout?: number;
37
+ };
38
+ interface EthereumChainConfig {
39
+ defaultChain?: any;
40
+ supportedChains?: any[];
41
+ rpcs?: {
42
+ 'ethereum:mainnet': {
43
+ rpc: string;
44
+ };
45
+ };
46
+ }
3
47
 
4
48
  interface PublicWallet {
5
49
  id: string;
@@ -280,7 +324,6 @@ type Sign7702AuthorizationResponse = Sign7702AuthorizationResult | Sign7702Autho
280
324
  interface EthereumSignMessageParams {
281
325
  message: string;
282
326
  wallet: PublicWallet;
283
- requireFreshAssertion?: boolean;
284
327
  options?: {
285
328
  uiOptions?: {
286
329
  title?: string;
@@ -298,7 +341,6 @@ interface EthereumSignMessageResult {
298
341
  interface EthereumSignTransactionParams {
299
342
  transaction: string;
300
343
  wallet: PublicWallet;
301
- requireFreshAssertion?: boolean;
302
344
  options?: {
303
345
  preflightCommitment?: "finalized" | "confirmed" | "processed";
304
346
  minContextSlot?: number;
@@ -324,7 +366,6 @@ interface EthereumSignTypedDataParams {
324
366
  primaryType: SignTypedDataParams["primaryType"];
325
367
  message: SignTypedDataParams["message"];
326
368
  wallet: PublicWallet;
327
- requireFreshAssertion?: boolean;
328
369
  options?: {
329
370
  uiOptions?: any;
330
371
  };
@@ -335,7 +376,6 @@ interface EthereumSignTypedDataResult {
335
376
  interface EthereumSignHashParams {
336
377
  hash: `0x${string}` | string;
337
378
  wallet: PublicWallet;
338
- requireFreshAssertion?: boolean;
339
379
  options?: {
340
380
  uiOptions?: any;
341
381
  };
@@ -349,7 +389,6 @@ interface EthereumSign7702AuthorizationParams {
349
389
  nonce?: number;
350
390
  executor?: "self" | `0x${string}`;
351
391
  wallet: PublicWallet;
352
- requireFreshAssertion?: boolean;
353
392
  options?: {
354
393
  uiOptions?: any;
355
394
  };
@@ -378,7 +417,6 @@ interface EthereumSendTransactionParams {
378
417
  };
379
418
  wallet: PublicWallet;
380
419
  rpcUrl: string;
381
- requireFreshAssertion?: boolean;
382
420
  options?: {
383
421
  commitment?: TransactionCommitment;
384
422
  skipPreflight?: boolean;
@@ -522,7 +560,6 @@ interface UseFundWalletInterface {
522
560
  interface SolanaSignMessageParams {
523
561
  message: string;
524
562
  wallet: PublicWallet;
525
- requireFreshAssertion?: boolean;
526
563
  options?: {
527
564
  uiOptions?: {
528
565
  title?: string;
@@ -541,7 +578,6 @@ interface SolanaSignMessageResult {
541
578
  interface SolanaSignTransactionParams {
542
579
  transaction: string;
543
580
  wallet: PublicWallet;
544
- requireFreshAssertion?: boolean;
545
581
  options?: {
546
582
  preflightCommitment?: "finalized" | "confirmed" | "processed";
547
583
  minContextSlot?: number;
@@ -564,7 +600,6 @@ interface SolanaSendTransactionParams {
564
600
  transaction: string;
565
601
  wallet: PublicWallet;
566
602
  rpcUrl: string;
567
- requireFreshAssertion?: boolean;
568
603
  options?: {
569
604
  commitment?: TransactionCommitment;
570
605
  skipPreflight?: boolean;
@@ -628,6 +663,94 @@ interface SolanaGetTokenAccountsByOwnerResult {
628
663
  tokenAccounts: any[];
629
664
  }
630
665
 
666
+ type EphemeralSignerScheme = "ecdsa_secp256k1" | "eddsa_ed25519";
667
+ type EphemeralSignerChain = "ethereum" | "solana";
668
+ interface ProvisionEphemeralSignerParams {
669
+ /**
670
+ * Wallet IDs (from `user.wallets[i].id`) the agent will be authorized
671
+ * over. The iframe resolves each ID to its `key_id`, chain → MPC
672
+ * scheme, and stored `derivation_path` — integrator code doesn't need
673
+ * to know about MPC internals or BIP-32 path formatting.
674
+ */
675
+ walletIds: string[];
676
+ /**
677
+ * Optional expiration. If set, the SES enclave refuses sign requests
678
+ * issued after this timestamp. Omit for an open-ended provisioning
679
+ * the user can revoke later.
680
+ */
681
+ expiresAt?: Date;
682
+ /**
683
+ * Optional user-facing name ("DCA bot"). Stored on the wallets
684
+ * backend for the manage view — not sealed into the SES AAD, so
685
+ * renaming later is a DB-only edit and doesn't invalidate the
686
+ * provisioned signer.
687
+ */
688
+ label?: string;
689
+ }
690
+ /**
691
+ * Per-wallet display entry inside an EphemeralSigner. The list
692
+ * response is deliberately slim — schemes / derivation paths stay
693
+ * server-side (SES enforces them) and are exposed via a per-signer
694
+ * detail endpoint if ever needed.
695
+ */
696
+ interface EphemeralSignerWallet {
697
+ /** Wallet's public address/key, as stored in `platform.wallets.public_key`. */
698
+ address: string;
699
+ /** "ethereum", "solana", etc. */
700
+ chain: string;
701
+ }
702
+ /**
703
+ * One previously-provisioned ephemeral signer as returned by the list
704
+ * endpoint. Lighter than ProvisionEphemeralSignerResult — no enclave
705
+ * attestation metadata, no priv key. Drives the manage view.
706
+ */
707
+ interface EphemeralSigner {
708
+ /** Lowercase-hex Ed25519 public key. Unique within the app. */
709
+ api_pub: string;
710
+ label?: string;
711
+ /** One entry per wallet the signer is authorized over, in provisioning order. */
712
+ wallets: EphemeralSignerWallet[];
713
+ /** RFC3339. Omitted if the signer has no expiration. */
714
+ expires_at?: string;
715
+ /** RFC3339. When the row was created. */
716
+ provisioned_at: string;
717
+ }
718
+ interface ListEphemeralSignersResult {
719
+ signers: EphemeralSigner[];
720
+ }
721
+ interface RevokeEphemeralSignerParams {
722
+ /** Lowercase-hex Ed25519 signer public key, no 0x. */
723
+ apiPubHex: string;
724
+ }
725
+ interface ProvisionEphemeralSignerResult {
726
+ /** 32-byte Ed25519 signer public key (lowercase hex, no 0x). Already provisioned in the SES enclave. */
727
+ apiPubHex: string;
728
+ /**
729
+ * 32-byte Ed25519 signer private key (lowercase hex, no 0x). MoonX
730
+ * does not persist this — the caller is responsible for surfacing it
731
+ * to the user exactly once and never storing it server-side.
732
+ */
733
+ apiPrivHex: string;
734
+ /** AWS Nitro module ID from the verified attestation (e.g. `i-…-enc…`). */
735
+ moduleId: string;
736
+ /** PCR indices that matched the operator-pinned allowlist (typically [0,1,2]). */
737
+ pcrsMatched: number[];
738
+ /**
739
+ * The exact ProvisionAad JSON the iframe sealed to the enclave —
740
+ * useful for rendering a confirmation summary in the parent UI
741
+ * without rebuilding it from `wallets`.
742
+ */
743
+ aad: {
744
+ api_pub: string;
745
+ shares: Array<{
746
+ key_id: string;
747
+ scheme: EphemeralSignerScheme;
748
+ allowed_derivation_paths: string[];
749
+ }>;
750
+ expires_at: string | null;
751
+ };
752
+ }
753
+
631
754
  type EmailOtpFlowState = {
632
755
  status: "start";
633
756
  } | {
@@ -1203,4 +1326,4 @@ interface WalletVerifyRequest {
1203
1326
  sessionExpiresIn: number;
1204
1327
  }
1205
1328
 
1206
- export { type AccessTokenClaims, type AppConfigRequest, type AppConfigResponse, type AttachOAuthTokenRequest, type AttachOAuthTokenResponse, type AuthAppearance, type AuthFlow, type AuthFlowComponent, type AuthLoginMethod, type AuthProviderConfig, type BaseGetBalanceParams, type BaseGetBalanceResult, type BaseGetTokenAccountsParams, type BaseSendTransactionParams, type BaseSendTransactionResult, type BaseSignMessageParams, type BaseSignMessageResult, type BaseSignTransactionParams, type BaseSignTransactionResult, type BaseTokenClaims, type BaseUIOptions, type BaseWalletHooks, Chain, ChainLikeWithId, type ContractUIOptions, type CreateWalletResponse, type DefaultFundingMethod, type DeleteSessionRequest, type DeleteSessionResponse, type DetachOAuthTokenRequest, type DeviceFingerprint, type DisplayMode, type EmailOtpConfig, type EmailOtpFlowState, type EthereumFundingConfig, type EthereumGetBalanceParams, type EthereumGetBalanceResult, type EthereumGetTokenAccountsByOwnerParams, type EthereumGetTokenAccountsByOwnerResult, type EthereumSendTransactionParams, type EthereumSendTransactionRequest, type EthereumSendTransactionResult, type EthereumSign7702AuthorizationParams, type EthereumSign7702AuthorizationResult, type EthereumSignHashParams, type EthereumSignHashResult, type EthereumSignMessageParams, type EthereumSignMessageResult, type EthereumSignTransactionParams, type EthereumSignTransactionResult, type EthereumSignTypedDataParams, type EthereumSignTypedDataResult, type EthereumSwitchChainParams, type ExportKeyConfig, type Factor, type FlexibleTheme, type FundWalletConfig, type FundingEvents, type FundingMethod, type FundingUIConfig, type GetCurrentSessionRequest, type GetCurrentSessionResponse, type Hex, type IdentityTokenClaims, type IdpProvider, type IsAuthenticatedRequest, type IsAuthenticatedResponse, type LoginTokenBundle, type LogoutRequest, type LogoutResponse, type MessageTypeProperty, type MessageTypes, type MoonKeyThemeConfig, type MoonPaySignRequest, type MoonPaySignResponse, type MpcKeyShares, Network, type OAuthRequest, type OAuthResponse, type OnrampFundingSettings, type PasskeyEnrollConfig, type PasskeySettings, type PreferredCardProvider, type PrefillConfig, type PresenceTokenClaims, type PublicEthereumWallet, type PublicSessionData, type PublicWallet, type RefreshSessionRequest, type RefreshSessionResponse, type RetrieveWalletKeyRequest, type RetrieveWalletKeyResponse, type SdkSettings, type SendEmailOtpRequest, type SendEmailOtpResponse, type SendTransactionConfig, type SendTransactionRequest, type SessionData, type SharesDeviceRequest, type SharesDeviceResponse, type Sign7702AuthorizationError, type Sign7702AuthorizationParams, type Sign7702AuthorizationResponse, type Sign7702AuthorizationResult, type SignMessageConfig, type SignTransactionConfig, type SignTypedDataError, type SignTypedDataParams, type SignTypedDataResponse, type SignTypedDataResult, type SmsSettings, type SolanaChain, type SolanaFundingConfig, type SolanaGetBalanceParams, type SolanaGetBalanceResult, type SolanaGetTokenAccountsByOwnerParams, type SolanaGetTokenAccountsByOwnerResult, type SolanaSendTransactionParams, type SolanaSendTransactionResult, type SolanaSignMessageParams, type SolanaSignMessageResult, type SolanaSignTransactionParams, type SolanaSignTransactionResult, type TransactionCommitment, type TransactionEncoding, type TransactionUIOptions, type TypedMessage, type UseFundWalletInterface, type UsersMePublicResponse, type UsersMeRequest, type UsersMeResponse, type VerifiedSession, type VerifyEmailOtpRequest, type VerifyEmailOtpResponse, type VerifyEmailOtpUser, type VerifyOAuthTokenRequest, type VerifyOAuthTokenResponse, type VerifySiweWalletRegistrationRequest, WALLET_ERROR_CODES, type Wallet, type WalletChain, type WalletChainType, type WalletConnectConfig, WalletCreationError, type WalletError, type WalletErrorCode, type WalletKeyRequest, type WalletListEntry, type WalletRegistrationNonceRequest, type WalletRegistrationNonceResponse, type WalletType, type WalletVerifyRequest };
1329
+ export { type AccessTokenClaims, type AppConfigRequest, type AppConfigResponse, type AttachOAuthTokenRequest, type AttachOAuthTokenResponse, type AuthAppearance, type AuthFlow, type AuthFlowComponent, type AuthLoginMethod, type AuthProviderConfig, type BaseGetBalanceParams, type BaseGetBalanceResult, type BaseGetTokenAccountsParams, type BaseSendTransactionParams, type BaseSendTransactionResult, type BaseSignMessageParams, type BaseSignMessageResult, type BaseSignTransactionParams, type BaseSignTransactionResult, type BaseTokenClaims, type BaseUIOptions, type BaseWalletHooks, type BlockExplorer, type Chain, type ChainLikeWithId, type ContractUIOptions, type CreateWalletResponse, type DefaultFundingMethod, type DeleteSessionRequest, type DeleteSessionResponse, type DetachOAuthTokenRequest, type DeviceFingerprint, type DisplayMode, type EmailOtpConfig, type EmailOtpFlowState, type EphemeralSigner, type EphemeralSignerChain, type EphemeralSignerScheme, type EphemeralSignerWallet, type EthereumChainConfig, type EthereumFundingConfig, type EthereumGetBalanceParams, type EthereumGetBalanceResult, type EthereumGetTokenAccountsByOwnerParams, type EthereumGetTokenAccountsByOwnerResult, type EthereumSendTransactionParams, type EthereumSendTransactionRequest, type EthereumSendTransactionResult, type EthereumSign7702AuthorizationParams, type EthereumSign7702AuthorizationResult, type EthereumSignHashParams, type EthereumSignHashResult, type EthereumSignMessageParams, type EthereumSignMessageResult, type EthereumSignTransactionParams, type EthereumSignTransactionResult, type EthereumSignTypedDataParams, type EthereumSignTypedDataResult, type EthereumSwitchChainParams, type ExportKeyConfig, type Factor, type FlexibleTheme, type FundWalletConfig, type FundingEvents, type FundingMethod, type FundingUIConfig, type GetCurrentSessionRequest, type GetCurrentSessionResponse, type Hex, type IdentityTokenClaims, type IdpProvider, type IsAuthenticatedRequest, type IsAuthenticatedResponse, type ListEphemeralSignersResult, type LoginTokenBundle, type LogoutRequest, type LogoutResponse, type MessageTypeProperty, type MessageTypes, type MoonKeyThemeConfig, type MoonPaySignRequest, type MoonPaySignResponse, type MpcKeyShares, type NativeCurrency, Network, type OAuthRequest, type OAuthResponse, type OnrampFundingSettings, type PasskeyEnrollConfig, type PasskeySettings, type PreferredCardProvider, type PrefillConfig, type PresenceTokenClaims, type ProvisionEphemeralSignerParams, type ProvisionEphemeralSignerResult, type PublicEthereumWallet, type PublicSessionData, type PublicWallet, type RefreshSessionRequest, type RefreshSessionResponse, type RetrieveWalletKeyRequest, type RetrieveWalletKeyResponse, type RevokeEphemeralSignerParams, type RpcConfig, type RpcUrls, type SdkSettings, type SendEmailOtpRequest, type SendEmailOtpResponse, type SendTransactionConfig, type SendTransactionRequest, type SessionData, type SharesDeviceRequest, type SharesDeviceResponse, type Sign7702AuthorizationError, type Sign7702AuthorizationParams, type Sign7702AuthorizationResponse, type Sign7702AuthorizationResult, type SignMessageConfig, type SignTransactionConfig, type SignTypedDataError, type SignTypedDataParams, type SignTypedDataResponse, type SignTypedDataResult, type SmsSettings, type SolanaChain, type SolanaFundingConfig, type SolanaGetBalanceParams, type SolanaGetBalanceResult, type SolanaGetTokenAccountsByOwnerParams, type SolanaGetTokenAccountsByOwnerResult, type SolanaSendTransactionParams, type SolanaSendTransactionResult, type SolanaSignMessageParams, type SolanaSignMessageResult, type SolanaSignTransactionParams, type SolanaSignTransactionResult, type TransactionCommitment, type TransactionEncoding, type TransactionUIOptions, type TypedMessage, type UseFundWalletInterface, type UsersMePublicResponse, type UsersMeRequest, type UsersMeResponse, type VerifiedSession, type VerifyEmailOtpRequest, type VerifyEmailOtpResponse, type VerifyEmailOtpUser, type VerifyOAuthTokenRequest, type VerifyOAuthTokenResponse, type VerifySiweWalletRegistrationRequest, WALLET_ERROR_CODES, type Wallet, type WalletChain, type WalletChainType, type WalletConnectConfig, WalletCreationError, type WalletError, type WalletErrorCode, type WalletKeyRequest, type WalletListEntry, type WalletRegistrationNonceRequest, type WalletRegistrationNonceResponse, type WalletType, type WalletVerifyRequest };
@@ -1,5 +1,49 @@
1
- import { a as ChainLikeWithId, C as Chain } from '../chain-C9dvKXUY.js';
2
- export { B as BlockExplorer, E as EthereumChainConfig, N as NativeCurrency, R as RpcConfig, b as RpcUrls } from '../chain-C9dvKXUY.js';
1
+ type RpcUrls = {
2
+ http: readonly string[];
3
+ webSocket?: readonly string[];
4
+ };
5
+ type NativeCurrency = {
6
+ name: string;
7
+ symbol: string;
8
+ decimals: number;
9
+ };
10
+ type BlockExplorer = {
11
+ name: string;
12
+ url: string;
13
+ };
14
+ type Chain = {
15
+ id: number;
16
+ name: string;
17
+ network?: string;
18
+ nativeCurrency: NativeCurrency;
19
+ blockExplorers?: {
20
+ [key: string]: BlockExplorer;
21
+ default: BlockExplorer;
22
+ };
23
+ rpcUrls: {
24
+ [key: string]: RpcUrls;
25
+ default: RpcUrls;
26
+ };
27
+ testnet?: boolean;
28
+ };
29
+ type ChainLikeWithId = {
30
+ id: number;
31
+ };
32
+ type RpcConfig = {
33
+ rpcUrls?: {
34
+ [chainId: number]: string;
35
+ };
36
+ rpcTimeout?: number;
37
+ };
38
+ interface EthereumChainConfig {
39
+ defaultChain?: any;
40
+ supportedChains?: any[];
41
+ rpcs?: {
42
+ 'ethereum:mainnet': {
43
+ rpc: string;
44
+ };
45
+ };
46
+ }
3
47
 
4
48
  interface PublicWallet {
5
49
  id: string;
@@ -280,7 +324,6 @@ type Sign7702AuthorizationResponse = Sign7702AuthorizationResult | Sign7702Autho
280
324
  interface EthereumSignMessageParams {
281
325
  message: string;
282
326
  wallet: PublicWallet;
283
- requireFreshAssertion?: boolean;
284
327
  options?: {
285
328
  uiOptions?: {
286
329
  title?: string;
@@ -298,7 +341,6 @@ interface EthereumSignMessageResult {
298
341
  interface EthereumSignTransactionParams {
299
342
  transaction: string;
300
343
  wallet: PublicWallet;
301
- requireFreshAssertion?: boolean;
302
344
  options?: {
303
345
  preflightCommitment?: "finalized" | "confirmed" | "processed";
304
346
  minContextSlot?: number;
@@ -324,7 +366,6 @@ interface EthereumSignTypedDataParams {
324
366
  primaryType: SignTypedDataParams["primaryType"];
325
367
  message: SignTypedDataParams["message"];
326
368
  wallet: PublicWallet;
327
- requireFreshAssertion?: boolean;
328
369
  options?: {
329
370
  uiOptions?: any;
330
371
  };
@@ -335,7 +376,6 @@ interface EthereumSignTypedDataResult {
335
376
  interface EthereumSignHashParams {
336
377
  hash: `0x${string}` | string;
337
378
  wallet: PublicWallet;
338
- requireFreshAssertion?: boolean;
339
379
  options?: {
340
380
  uiOptions?: any;
341
381
  };
@@ -349,7 +389,6 @@ interface EthereumSign7702AuthorizationParams {
349
389
  nonce?: number;
350
390
  executor?: "self" | `0x${string}`;
351
391
  wallet: PublicWallet;
352
- requireFreshAssertion?: boolean;
353
392
  options?: {
354
393
  uiOptions?: any;
355
394
  };
@@ -378,7 +417,6 @@ interface EthereumSendTransactionParams {
378
417
  };
379
418
  wallet: PublicWallet;
380
419
  rpcUrl: string;
381
- requireFreshAssertion?: boolean;
382
420
  options?: {
383
421
  commitment?: TransactionCommitment;
384
422
  skipPreflight?: boolean;
@@ -522,7 +560,6 @@ interface UseFundWalletInterface {
522
560
  interface SolanaSignMessageParams {
523
561
  message: string;
524
562
  wallet: PublicWallet;
525
- requireFreshAssertion?: boolean;
526
563
  options?: {
527
564
  uiOptions?: {
528
565
  title?: string;
@@ -541,7 +578,6 @@ interface SolanaSignMessageResult {
541
578
  interface SolanaSignTransactionParams {
542
579
  transaction: string;
543
580
  wallet: PublicWallet;
544
- requireFreshAssertion?: boolean;
545
581
  options?: {
546
582
  preflightCommitment?: "finalized" | "confirmed" | "processed";
547
583
  minContextSlot?: number;
@@ -564,7 +600,6 @@ interface SolanaSendTransactionParams {
564
600
  transaction: string;
565
601
  wallet: PublicWallet;
566
602
  rpcUrl: string;
567
- requireFreshAssertion?: boolean;
568
603
  options?: {
569
604
  commitment?: TransactionCommitment;
570
605
  skipPreflight?: boolean;
@@ -628,6 +663,94 @@ interface SolanaGetTokenAccountsByOwnerResult {
628
663
  tokenAccounts: any[];
629
664
  }
630
665
 
666
+ type EphemeralSignerScheme = "ecdsa_secp256k1" | "eddsa_ed25519";
667
+ type EphemeralSignerChain = "ethereum" | "solana";
668
+ interface ProvisionEphemeralSignerParams {
669
+ /**
670
+ * Wallet IDs (from `user.wallets[i].id`) the agent will be authorized
671
+ * over. The iframe resolves each ID to its `key_id`, chain → MPC
672
+ * scheme, and stored `derivation_path` — integrator code doesn't need
673
+ * to know about MPC internals or BIP-32 path formatting.
674
+ */
675
+ walletIds: string[];
676
+ /**
677
+ * Optional expiration. If set, the SES enclave refuses sign requests
678
+ * issued after this timestamp. Omit for an open-ended provisioning
679
+ * the user can revoke later.
680
+ */
681
+ expiresAt?: Date;
682
+ /**
683
+ * Optional user-facing name ("DCA bot"). Stored on the wallets
684
+ * backend for the manage view — not sealed into the SES AAD, so
685
+ * renaming later is a DB-only edit and doesn't invalidate the
686
+ * provisioned signer.
687
+ */
688
+ label?: string;
689
+ }
690
+ /**
691
+ * Per-wallet display entry inside an EphemeralSigner. The list
692
+ * response is deliberately slim — schemes / derivation paths stay
693
+ * server-side (SES enforces them) and are exposed via a per-signer
694
+ * detail endpoint if ever needed.
695
+ */
696
+ interface EphemeralSignerWallet {
697
+ /** Wallet's public address/key, as stored in `platform.wallets.public_key`. */
698
+ address: string;
699
+ /** "ethereum", "solana", etc. */
700
+ chain: string;
701
+ }
702
+ /**
703
+ * One previously-provisioned ephemeral signer as returned by the list
704
+ * endpoint. Lighter than ProvisionEphemeralSignerResult — no enclave
705
+ * attestation metadata, no priv key. Drives the manage view.
706
+ */
707
+ interface EphemeralSigner {
708
+ /** Lowercase-hex Ed25519 public key. Unique within the app. */
709
+ api_pub: string;
710
+ label?: string;
711
+ /** One entry per wallet the signer is authorized over, in provisioning order. */
712
+ wallets: EphemeralSignerWallet[];
713
+ /** RFC3339. Omitted if the signer has no expiration. */
714
+ expires_at?: string;
715
+ /** RFC3339. When the row was created. */
716
+ provisioned_at: string;
717
+ }
718
+ interface ListEphemeralSignersResult {
719
+ signers: EphemeralSigner[];
720
+ }
721
+ interface RevokeEphemeralSignerParams {
722
+ /** Lowercase-hex Ed25519 signer public key, no 0x. */
723
+ apiPubHex: string;
724
+ }
725
+ interface ProvisionEphemeralSignerResult {
726
+ /** 32-byte Ed25519 signer public key (lowercase hex, no 0x). Already provisioned in the SES enclave. */
727
+ apiPubHex: string;
728
+ /**
729
+ * 32-byte Ed25519 signer private key (lowercase hex, no 0x). MoonX
730
+ * does not persist this — the caller is responsible for surfacing it
731
+ * to the user exactly once and never storing it server-side.
732
+ */
733
+ apiPrivHex: string;
734
+ /** AWS Nitro module ID from the verified attestation (e.g. `i-…-enc…`). */
735
+ moduleId: string;
736
+ /** PCR indices that matched the operator-pinned allowlist (typically [0,1,2]). */
737
+ pcrsMatched: number[];
738
+ /**
739
+ * The exact ProvisionAad JSON the iframe sealed to the enclave —
740
+ * useful for rendering a confirmation summary in the parent UI
741
+ * without rebuilding it from `wallets`.
742
+ */
743
+ aad: {
744
+ api_pub: string;
745
+ shares: Array<{
746
+ key_id: string;
747
+ scheme: EphemeralSignerScheme;
748
+ allowed_derivation_paths: string[];
749
+ }>;
750
+ expires_at: string | null;
751
+ };
752
+ }
753
+
631
754
  type EmailOtpFlowState = {
632
755
  status: "start";
633
756
  } | {
@@ -1203,4 +1326,4 @@ interface WalletVerifyRequest {
1203
1326
  sessionExpiresIn: number;
1204
1327
  }
1205
1328
 
1206
- export { type AccessTokenClaims, type AppConfigRequest, type AppConfigResponse, type AttachOAuthTokenRequest, type AttachOAuthTokenResponse, type AuthAppearance, type AuthFlow, type AuthFlowComponent, type AuthLoginMethod, type AuthProviderConfig, type BaseGetBalanceParams, type BaseGetBalanceResult, type BaseGetTokenAccountsParams, type BaseSendTransactionParams, type BaseSendTransactionResult, type BaseSignMessageParams, type BaseSignMessageResult, type BaseSignTransactionParams, type BaseSignTransactionResult, type BaseTokenClaims, type BaseUIOptions, type BaseWalletHooks, Chain, ChainLikeWithId, type ContractUIOptions, type CreateWalletResponse, type DefaultFundingMethod, type DeleteSessionRequest, type DeleteSessionResponse, type DetachOAuthTokenRequest, type DeviceFingerprint, type DisplayMode, type EmailOtpConfig, type EmailOtpFlowState, type EthereumFundingConfig, type EthereumGetBalanceParams, type EthereumGetBalanceResult, type EthereumGetTokenAccountsByOwnerParams, type EthereumGetTokenAccountsByOwnerResult, type EthereumSendTransactionParams, type EthereumSendTransactionRequest, type EthereumSendTransactionResult, type EthereumSign7702AuthorizationParams, type EthereumSign7702AuthorizationResult, type EthereumSignHashParams, type EthereumSignHashResult, type EthereumSignMessageParams, type EthereumSignMessageResult, type EthereumSignTransactionParams, type EthereumSignTransactionResult, type EthereumSignTypedDataParams, type EthereumSignTypedDataResult, type EthereumSwitchChainParams, type ExportKeyConfig, type Factor, type FlexibleTheme, type FundWalletConfig, type FundingEvents, type FundingMethod, type FundingUIConfig, type GetCurrentSessionRequest, type GetCurrentSessionResponse, type Hex, type IdentityTokenClaims, type IdpProvider, type IsAuthenticatedRequest, type IsAuthenticatedResponse, type LoginTokenBundle, type LogoutRequest, type LogoutResponse, type MessageTypeProperty, type MessageTypes, type MoonKeyThemeConfig, type MoonPaySignRequest, type MoonPaySignResponse, type MpcKeyShares, Network, type OAuthRequest, type OAuthResponse, type OnrampFundingSettings, type PasskeyEnrollConfig, type PasskeySettings, type PreferredCardProvider, type PrefillConfig, type PresenceTokenClaims, type PublicEthereumWallet, type PublicSessionData, type PublicWallet, type RefreshSessionRequest, type RefreshSessionResponse, type RetrieveWalletKeyRequest, type RetrieveWalletKeyResponse, type SdkSettings, type SendEmailOtpRequest, type SendEmailOtpResponse, type SendTransactionConfig, type SendTransactionRequest, type SessionData, type SharesDeviceRequest, type SharesDeviceResponse, type Sign7702AuthorizationError, type Sign7702AuthorizationParams, type Sign7702AuthorizationResponse, type Sign7702AuthorizationResult, type SignMessageConfig, type SignTransactionConfig, type SignTypedDataError, type SignTypedDataParams, type SignTypedDataResponse, type SignTypedDataResult, type SmsSettings, type SolanaChain, type SolanaFundingConfig, type SolanaGetBalanceParams, type SolanaGetBalanceResult, type SolanaGetTokenAccountsByOwnerParams, type SolanaGetTokenAccountsByOwnerResult, type SolanaSendTransactionParams, type SolanaSendTransactionResult, type SolanaSignMessageParams, type SolanaSignMessageResult, type SolanaSignTransactionParams, type SolanaSignTransactionResult, type TransactionCommitment, type TransactionEncoding, type TransactionUIOptions, type TypedMessage, type UseFundWalletInterface, type UsersMePublicResponse, type UsersMeRequest, type UsersMeResponse, type VerifiedSession, type VerifyEmailOtpRequest, type VerifyEmailOtpResponse, type VerifyEmailOtpUser, type VerifyOAuthTokenRequest, type VerifyOAuthTokenResponse, type VerifySiweWalletRegistrationRequest, WALLET_ERROR_CODES, type Wallet, type WalletChain, type WalletChainType, type WalletConnectConfig, WalletCreationError, type WalletError, type WalletErrorCode, type WalletKeyRequest, type WalletListEntry, type WalletRegistrationNonceRequest, type WalletRegistrationNonceResponse, type WalletType, type WalletVerifyRequest };
1329
+ export { type AccessTokenClaims, type AppConfigRequest, type AppConfigResponse, type AttachOAuthTokenRequest, type AttachOAuthTokenResponse, type AuthAppearance, type AuthFlow, type AuthFlowComponent, type AuthLoginMethod, type AuthProviderConfig, type BaseGetBalanceParams, type BaseGetBalanceResult, type BaseGetTokenAccountsParams, type BaseSendTransactionParams, type BaseSendTransactionResult, type BaseSignMessageParams, type BaseSignMessageResult, type BaseSignTransactionParams, type BaseSignTransactionResult, type BaseTokenClaims, type BaseUIOptions, type BaseWalletHooks, type BlockExplorer, type Chain, type ChainLikeWithId, type ContractUIOptions, type CreateWalletResponse, type DefaultFundingMethod, type DeleteSessionRequest, type DeleteSessionResponse, type DetachOAuthTokenRequest, type DeviceFingerprint, type DisplayMode, type EmailOtpConfig, type EmailOtpFlowState, type EphemeralSigner, type EphemeralSignerChain, type EphemeralSignerScheme, type EphemeralSignerWallet, type EthereumChainConfig, type EthereumFundingConfig, type EthereumGetBalanceParams, type EthereumGetBalanceResult, type EthereumGetTokenAccountsByOwnerParams, type EthereumGetTokenAccountsByOwnerResult, type EthereumSendTransactionParams, type EthereumSendTransactionRequest, type EthereumSendTransactionResult, type EthereumSign7702AuthorizationParams, type EthereumSign7702AuthorizationResult, type EthereumSignHashParams, type EthereumSignHashResult, type EthereumSignMessageParams, type EthereumSignMessageResult, type EthereumSignTransactionParams, type EthereumSignTransactionResult, type EthereumSignTypedDataParams, type EthereumSignTypedDataResult, type EthereumSwitchChainParams, type ExportKeyConfig, type Factor, type FlexibleTheme, type FundWalletConfig, type FundingEvents, type FundingMethod, type FundingUIConfig, type GetCurrentSessionRequest, type GetCurrentSessionResponse, type Hex, type IdentityTokenClaims, type IdpProvider, type IsAuthenticatedRequest, type IsAuthenticatedResponse, type ListEphemeralSignersResult, type LoginTokenBundle, type LogoutRequest, type LogoutResponse, type MessageTypeProperty, type MessageTypes, type MoonKeyThemeConfig, type MoonPaySignRequest, type MoonPaySignResponse, type MpcKeyShares, type NativeCurrency, Network, type OAuthRequest, type OAuthResponse, type OnrampFundingSettings, type PasskeyEnrollConfig, type PasskeySettings, type PreferredCardProvider, type PrefillConfig, type PresenceTokenClaims, type ProvisionEphemeralSignerParams, type ProvisionEphemeralSignerResult, type PublicEthereumWallet, type PublicSessionData, type PublicWallet, type RefreshSessionRequest, type RefreshSessionResponse, type RetrieveWalletKeyRequest, type RetrieveWalletKeyResponse, type RevokeEphemeralSignerParams, type RpcConfig, type RpcUrls, type SdkSettings, type SendEmailOtpRequest, type SendEmailOtpResponse, type SendTransactionConfig, type SendTransactionRequest, type SessionData, type SharesDeviceRequest, type SharesDeviceResponse, type Sign7702AuthorizationError, type Sign7702AuthorizationParams, type Sign7702AuthorizationResponse, type Sign7702AuthorizationResult, type SignMessageConfig, type SignTransactionConfig, type SignTypedDataError, type SignTypedDataParams, type SignTypedDataResponse, type SignTypedDataResult, type SmsSettings, type SolanaChain, type SolanaFundingConfig, type SolanaGetBalanceParams, type SolanaGetBalanceResult, type SolanaGetTokenAccountsByOwnerParams, type SolanaGetTokenAccountsByOwnerResult, type SolanaSendTransactionParams, type SolanaSendTransactionResult, type SolanaSignMessageParams, type SolanaSignMessageResult, type SolanaSignTransactionParams, type SolanaSignTransactionResult, type TransactionCommitment, type TransactionEncoding, type TransactionUIOptions, type TypedMessage, type UseFundWalletInterface, type UsersMePublicResponse, type UsersMeRequest, type UsersMeResponse, type VerifiedSession, type VerifyEmailOtpRequest, type VerifyEmailOtpResponse, type VerifyEmailOtpUser, type VerifyOAuthTokenRequest, type VerifyOAuthTokenResponse, type VerifySiweWalletRegistrationRequest, WALLET_ERROR_CODES, type Wallet, type WalletChain, type WalletChainType, type WalletConnectConfig, WalletCreationError, type WalletError, type WalletErrorCode, type WalletKeyRequest, type WalletListEntry, type WalletRegistrationNonceRequest, type WalletRegistrationNonceResponse, type WalletType, type WalletVerifyRequest };
@@ -1,4 +1,4 @@
1
- export { F as FORWARDED_ERROR_FIELDS, P as PostMessageClient, a as PostMessageMethod, b as PostMessageServer, c as PostMessageType } from '../post-message-CmgAfkOS.mjs';
1
+ export { F as FORWARDED_ERROR_FIELDS, P as PostMessageClient, a as PostMessageMethod, b as PostMessageServer, c as PostMessageType } from '../post-message-Z6cLf0mS.mjs';
2
2
 
3
3
  /**
4
4
  * Get the appropriate MoonKey API URL based on environment configuration
@@ -1,4 +1,4 @@
1
- export { F as FORWARDED_ERROR_FIELDS, P as PostMessageClient, a as PostMessageMethod, b as PostMessageServer, c as PostMessageType } from '../post-message-CmgAfkOS.js';
1
+ export { F as FORWARDED_ERROR_FIELDS, P as PostMessageClient, a as PostMessageMethod, b as PostMessageServer, c as PostMessageType } from '../post-message-Z6cLf0mS.js';
2
2
 
3
3
  /**
4
4
  * Get the appropriate MoonKey API URL based on environment configuration
@@ -143,6 +143,20 @@ var PostMessageMethod = {
143
143
  // dispatcher boring.
144
144
  SIGN_HASH: "SIGN_HASH",
145
145
  SIGN_7702_AUTHORIZATION: "SIGN_7702_AUTHORIZATION",
146
+ // Provision a SES (Secure Ephemeral Signer) over one or more of the
147
+ // user's MPC wallets. Iframe verifies the Nitro attestation, decrypts
148
+ // the selected keyshares, HPKE-seals them to the verified enclave
149
+ // pubkey, and returns a freshly-generated Ed25519 signer keypair.
150
+ // MoonX never persists the private key — the parent must hand it to
151
+ // the user immediately.
152
+ PROVISION_EPHEMERAL_SIGNER: "PROVISION_EPHEMERAL_SIGNER",
153
+ // List the user's active provisioned ephemeral signers from the
154
+ // wallets backend. Read-only; doesn't touch SES or the enclave.
155
+ LIST_EPHEMERAL_SIGNERS: "LIST_EPHEMERAL_SIGNERS",
156
+ // Soft-revoke a previously-provisioned ephemeral signer. The wallets
157
+ // backend updates revoked_at locally and forwards the revoke to SES
158
+ // so the enclave drops the policy.
159
+ REVOKE_EPHEMERAL_SIGNER: "REVOKE_EPHEMERAL_SIGNER",
146
160
  VERIFY_EMAIL_OTP: "VERIFY_EMAIL_OTP",
147
161
  VERIFY_OAUTH: "VERIFY_OAUTH",
148
162
  START_OAUTH: "START_OAUTH",
@@ -9,7 +9,7 @@ import {
9
9
  PostMessageMethod,
10
10
  PostMessageServer,
11
11
  PostMessageType
12
- } from "../chunk-VVL65GIB.mjs";
12
+ } from "../chunk-JU5MWLXH.mjs";
13
13
  import {
14
14
  getMoonKeyApiUrl
15
15
  } from "../chunk-GQKIA37O.mjs";
@@ -1,5 +1,5 @@
1
- import { P as PostMessageClient } from '../post-message-CmgAfkOS.mjs';
2
- import { T as Transport, P as PasskeyAssertor, K as KvStorage } from '../interfaces-CYtJHALV.mjs';
1
+ import { P as PostMessageClient } from '../post-message-Z6cLf0mS.mjs';
2
+ import { T as Transport, P as PasskeyAssertor, K as KvStorage } from '../interfaces-BdIeMGGD.mjs';
3
3
 
4
4
  declare const getCachedPostMessageClient: (contentWindow: Window) => PostMessageClient;
5
5
  /**
@@ -1,5 +1,5 @@
1
- import { P as PostMessageClient } from '../post-message-CmgAfkOS.js';
2
- import { T as Transport, P as PasskeyAssertor, K as KvStorage } from '../interfaces-Bm7fGOAI.js';
1
+ import { P as PostMessageClient } from '../post-message-Z6cLf0mS.js';
2
+ import { T as Transport, P as PasskeyAssertor, K as KvStorage } from '../interfaces-1vfik3Ef.js';
3
3
 
4
4
  declare const getCachedPostMessageClient: (contentWindow: Window) => PostMessageClient;
5
5
  /**
package/dist/web/index.js CHANGED
@@ -338,6 +338,35 @@ var createWebAuthnPasskey = () => ({
338
338
  authenticatorAttachment: result.authenticatorAttachment
339
339
  };
340
340
  return sanitized;
341
+ },
342
+ assertForInternalPresence: async ({ optionsJSON }) => {
343
+ const result = await (0, import_browser.startAuthentication)({
344
+ optionsJSON: {
345
+ ...optionsJSON,
346
+ allowCredentials: []
347
+ }
348
+ });
349
+ if (!result.response.userHandle) {
350
+ throw new Error("user_handle_missing");
351
+ }
352
+ const sanitized = {
353
+ id: result.id,
354
+ rawId: result.rawId,
355
+ type: result.type,
356
+ response: {
357
+ clientDataJSON: result.response.clientDataJSON,
358
+ authenticatorData: result.response.authenticatorData,
359
+ signature: result.response.signature,
360
+ userHandle: void 0
361
+ },
362
+ clientExtensionResults: result.clientExtensionResults,
363
+ authenticatorAttachment: result.authenticatorAttachment
364
+ };
365
+ return {
366
+ response: sanitized,
367
+ userHandleB64url: result.response.userHandle,
368
+ credentialIdB64url: result.rawId
369
+ };
341
370
  }
342
371
  });
343
372
 
@@ -5,7 +5,7 @@ import {
5
5
  import {
6
6
  PostMessageClient,
7
7
  PostMessageServer
8
- } from "../chunk-VVL65GIB.mjs";
8
+ } from "../chunk-JU5MWLXH.mjs";
9
9
 
10
10
  // src/web/iframe-transport.ts
11
11
  var clientCache = /* @__PURE__ */ new WeakMap();
@@ -81,6 +81,35 @@ var createWebAuthnPasskey = () => ({
81
81
  authenticatorAttachment: result.authenticatorAttachment
82
82
  };
83
83
  return sanitized;
84
+ },
85
+ assertForInternalPresence: async ({ optionsJSON }) => {
86
+ const result = await startAuthentication({
87
+ optionsJSON: {
88
+ ...optionsJSON,
89
+ allowCredentials: []
90
+ }
91
+ });
92
+ if (!result.response.userHandle) {
93
+ throw new Error("user_handle_missing");
94
+ }
95
+ const sanitized = {
96
+ id: result.id,
97
+ rawId: result.rawId,
98
+ type: result.type,
99
+ response: {
100
+ clientDataJSON: result.response.clientDataJSON,
101
+ authenticatorData: result.response.authenticatorData,
102
+ signature: result.response.signature,
103
+ userHandle: void 0
104
+ },
105
+ clientExtensionResults: result.clientExtensionResults,
106
+ authenticatorAttachment: result.authenticatorAttachment
107
+ };
108
+ return {
109
+ response: sanitized,
110
+ userHandleB64url: result.response.userHandle,
111
+ credentialIdB64url: result.rawId
112
+ };
84
113
  }
85
114
  });
86
115
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moon-x/core",
3
- "version": "0.3.0",
3
+ "version": "0.5.0",
4
4
  "license": "UNLICENSED",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -58,6 +58,8 @@
58
58
  "access": "public"
59
59
  },
60
60
  "dependencies": {
61
+ "@noble/curves": "1.8.0",
62
+ "@noble/hashes": "1.8.0",
61
63
  "@simplewebauthn/browser": "^13.2.2"
62
64
  },
63
65
  "devDependencies": {
@@ -1,48 +0,0 @@
1
- type RpcUrls = {
2
- http: readonly string[];
3
- webSocket?: readonly string[];
4
- };
5
- type NativeCurrency = {
6
- name: string;
7
- symbol: string;
8
- decimals: number;
9
- };
10
- type BlockExplorer = {
11
- name: string;
12
- url: string;
13
- };
14
- type Chain = {
15
- id: number;
16
- name: string;
17
- network?: string;
18
- nativeCurrency: NativeCurrency;
19
- blockExplorers?: {
20
- [key: string]: BlockExplorer;
21
- default: BlockExplorer;
22
- };
23
- rpcUrls: {
24
- [key: string]: RpcUrls;
25
- default: RpcUrls;
26
- };
27
- testnet?: boolean;
28
- };
29
- type ChainLikeWithId = {
30
- id: number;
31
- };
32
- type RpcConfig = {
33
- rpcUrls?: {
34
- [chainId: number]: string;
35
- };
36
- rpcTimeout?: number;
37
- };
38
- interface EthereumChainConfig {
39
- defaultChain?: any;
40
- supportedChains?: any[];
41
- rpcs?: {
42
- 'ethereum:mainnet': {
43
- rpc: string;
44
- };
45
- };
46
- }
47
-
48
- export type { BlockExplorer as B, Chain as C, EthereumChainConfig as E, NativeCurrency as N, RpcConfig as R, ChainLikeWithId as a, RpcUrls as b };