@moon-x/core 0.2.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 (55) hide show
  1. package/README.md +39 -0
  2. package/dist/chain-C9dvKXUY.d.mts +48 -0
  3. package/dist/chain-C9dvKXUY.d.ts +48 -0
  4. package/dist/chunk-264CEGDS.mjs +46 -0
  5. package/dist/chunk-CDT4MC7S.mjs +1532 -0
  6. package/dist/chunk-CMYR6AOY.mjs +0 -0
  7. package/dist/chunk-GQKIA37O.mjs +20 -0
  8. package/dist/chunk-IMLBIIJ4.mjs +36 -0
  9. package/dist/chunk-MOREUKOG.mjs +18 -0
  10. package/dist/chunk-SOKLPX7V.mjs +270 -0
  11. package/dist/index.d.mts +4 -0
  12. package/dist/index.d.ts +4 -0
  13. package/dist/index.js +402 -0
  14. package/dist/index.mjs +33 -0
  15. package/dist/interfaces-9k0eKCc4.d.ts +120 -0
  16. package/dist/interfaces-fNhwnCeY.d.mts +120 -0
  17. package/dist/lib/index.d.mts +410 -0
  18. package/dist/lib/index.d.ts +410 -0
  19. package/dist/lib/index.js +1622 -0
  20. package/dist/lib/index.mjs +89 -0
  21. package/dist/passkey-cache-B9PT3AWX.d.mts +47 -0
  22. package/dist/passkey-cache-B9PT3AWX.d.ts +47 -0
  23. package/dist/passkey-metadata-QqFF2SWQ.d.mts +25 -0
  24. package/dist/passkey-metadata-QqFF2SWQ.d.ts +25 -0
  25. package/dist/post-message-C_99BCBh.d.mts +70 -0
  26. package/dist/post-message-C_99BCBh.d.ts +70 -0
  27. package/dist/react/ethereum.d.mts +26 -0
  28. package/dist/react/ethereum.d.ts +26 -0
  29. package/dist/react/ethereum.js +99 -0
  30. package/dist/react/ethereum.mjs +56 -0
  31. package/dist/react/index.d.mts +182 -0
  32. package/dist/react/index.d.ts +182 -0
  33. package/dist/react/index.js +586 -0
  34. package/dist/react/index.mjs +328 -0
  35. package/dist/react/solana.d.mts +17 -0
  36. package/dist/react/solana.d.ts +17 -0
  37. package/dist/react/solana.js +75 -0
  38. package/dist/react/solana.mjs +35 -0
  39. package/dist/sdk/index.d.mts +126 -0
  40. package/dist/sdk/index.d.ts +126 -0
  41. package/dist/sdk/index.js +864 -0
  42. package/dist/sdk/index.mjs +579 -0
  43. package/dist/types/index.d.mts +1190 -0
  44. package/dist/types/index.d.ts +1190 -0
  45. package/dist/types/index.js +64 -0
  46. package/dist/types/index.mjs +10 -0
  47. package/dist/utils/index.d.mts +11 -0
  48. package/dist/utils/index.d.ts +11 -0
  49. package/dist/utils/index.js +365 -0
  50. package/dist/utils/index.mjs +25 -0
  51. package/dist/web/index.d.mts +20 -0
  52. package/dist/web/index.d.ts +20 -0
  53. package/dist/web/index.js +470 -0
  54. package/dist/web/index.mjs +155 -0
  55. package/package.json +111 -0
@@ -0,0 +1,126 @@
1
+ import { T as Transport, P as PasskeyAssertor, K as KvStorage } from '../interfaces-9k0eKCc4.js';
2
+ export { O as OAuthOpener, a as PlatformImpls } from '../interfaces-9k0eKCc4.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, PublicWallet } from '../types/index.js';
5
+ import '../post-message-C_99BCBh.js';
6
+ import '../chain-C9dvKXUY.js';
7
+
8
+ type AssertPasskeyInParentResult = CachedAssertion;
9
+ declare const assertPasskeyInParent: ({ transport, passkey, publishableKey, requireFreshAssertion, }: {
10
+ transport: Transport;
11
+ passkey: PasskeyAssertor;
12
+ publishableKey: string;
13
+ requireFreshAssertion?: boolean;
14
+ }) => Promise<AssertPasskeyInParentResult>;
15
+
16
+ declare const getHeadlessEthereumMethods: ({ transport, passkey, publishableKey, }: {
17
+ transport: Transport;
18
+ passkey: PasskeyAssertor;
19
+ publishableKey: string;
20
+ }) => {
21
+ signEthereumMessageHeadless: (params: EthereumSignMessageParams) => Promise<EthereumSignMessageResult>;
22
+ signEthereumTransactionHeadless: (params: EthereumSignTransactionParams) => Promise<EthereumSignTransactionResult>;
23
+ signEthereumTypedDataHeadless: (params: EthereumSignTypedDataParams) => Promise<EthereumSignTypedDataResult>;
24
+ signEthereumHashHeadless: (params: EthereumSignHashParams) => Promise<EthereumSignHashResult>;
25
+ signEthereum7702AuthorizationHeadless: (params: EthereumSign7702AuthorizationParams) => Promise<EthereumSign7702AuthorizationResult>;
26
+ sendEthereumTransactionHeadless: (params: EthereumSendTransactionParams) => Promise<EthereumSendTransactionResult>;
27
+ getEthereumBalance: (params: EthereumGetBalanceParams) => Promise<EthereumGetBalanceResult>;
28
+ getEthereumTokenAccountsByOwner: (params: EthereumGetTokenAccountsByOwnerParams) => Promise<EthereumGetTokenAccountsByOwnerResult>;
29
+ getEthereumConfirmTransaction: (params: {
30
+ transaction: string | object;
31
+ walletAddress: string;
32
+ rpcUrl: string;
33
+ network?: string;
34
+ }) => Promise<unknown>;
35
+ };
36
+
37
+ declare const getHeadlessSolanaMethods: ({ transport, passkey, publishableKey, }: {
38
+ transport: Transport;
39
+ passkey: PasskeyAssertor;
40
+ publishableKey: string;
41
+ }) => {
42
+ signSolanaMessageHeadless: (params: SolanaSignMessageParams) => Promise<SolanaSignMessageResult>;
43
+ signSolanaTransactionHeadless: (params: SolanaSignTransactionParams) => Promise<SolanaSignTransactionResult>;
44
+ sendSolanaTransactionHeadless: (params: SolanaSendTransactionParams) => Promise<SolanaSendTransactionResult>;
45
+ getSolanaBalance: (params: SolanaGetBalanceParams) => Promise<SolanaGetBalanceResult>;
46
+ getSolanaTokenAccountsByOwner: (params: SolanaGetTokenAccountsByOwnerParams) => Promise<SolanaGetTokenAccountsByOwnerResult>;
47
+ };
48
+
49
+ interface SendCodeParams {
50
+ email: string;
51
+ disableSignup?: boolean;
52
+ }
53
+ interface LoginWithCodeParams {
54
+ code: string;
55
+ }
56
+ interface VerifyOAuthParams {
57
+ provider: "google" | "apple";
58
+ code?: string;
59
+ token?: string;
60
+ state?: string;
61
+ }
62
+ declare const getHeadlessAuthenticationMethods: ({ transport, publishableKey, emailConfig, setIsAuthenticated, setUser, }: {
63
+ transport: Transport;
64
+ publishableKey: string;
65
+ emailConfig?: {
66
+ expiresIn?: number;
67
+ };
68
+ setIsAuthenticated?: (isAuth: boolean) => void;
69
+ setUser?: (user: unknown | null) => void;
70
+ }) => {
71
+ /** Send a one-time passcode to the user's email address. */
72
+ sendCode: (params: SendCodeParams) => Promise<void>;
73
+ /**
74
+ * Verify the OTP and complete the login. The iframe-app handles
75
+ * session persistence; on success the SDK flips isAuthenticated and
76
+ * fetches the real user object to populate provider state.
77
+ */
78
+ loginWithCode: (params: LoginWithCodeParams) => Promise<unknown>;
79
+ /**
80
+ * Commit an OAuth code/token for a session. The deep-link / popup
81
+ * round-trip lives in the platform-specific OAuth hook; this method
82
+ * is the tail-end commit step the hook calls.
83
+ */
84
+ verifyOAuth: (params: VerifyOAuthParams) => Promise<unknown>;
85
+ };
86
+
87
+ declare const getHeadlessGeneralMethods: ({ transport, passkey, storage, publishableKey, setIsAuthenticated, setUser, }: {
88
+ transport: Transport;
89
+ passkey: PasskeyAssertor;
90
+ storage: KvStorage;
91
+ publishableKey: string;
92
+ setIsAuthenticated?: (isAuth: boolean) => void;
93
+ setUser?: (user: unknown | null) => void;
94
+ }) => {
95
+ getPasskeyStatus: () => Promise<unknown>;
96
+ removePasskey: (credentialIdB64url: string) => Promise<void>;
97
+ createWallet: (walletType: "solana" | "ethereum", options?: {
98
+ createAdditional?: boolean;
99
+ walletIndex?: number;
100
+ requireFreshAssertion?: boolean;
101
+ }) => Promise<{
102
+ wallet: PublicWallet;
103
+ }>;
104
+ importKey: (walletType: "solana" | "ethereum", key: string, options?: {
105
+ requireFreshAssertion?: boolean;
106
+ }) => Promise<{
107
+ wallet: PublicWallet;
108
+ }>;
109
+ getWallets: (walletType: "solana" | "ethereum") => Promise<{
110
+ wallets: unknown[];
111
+ walletType: string;
112
+ }>;
113
+ getSessionTokens: () => Promise<{
114
+ accessToken: string;
115
+ identityToken: string;
116
+ expiresAt: number;
117
+ } | null>;
118
+ logout: () => Promise<{
119
+ success: boolean;
120
+ message: string;
121
+ }>;
122
+ getCurrentSession: () => Promise<unknown>;
123
+ getUser: () => Promise<unknown>;
124
+ };
125
+
126
+ export { type AssertPasskeyInParentResult, KvStorage, type LoginWithCodeParams, PasskeyAssertor, type SendCodeParams, Transport, type VerifyOAuthParams, assertPasskeyInParent, getHeadlessAuthenticationMethods, getHeadlessEthereumMethods, getHeadlessGeneralMethods, getHeadlessSolanaMethods };