@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.
- package/README.md +1 -1
- package/dist/{chunk-CDT4MC7S.mjs → chunk-I56GRKAG.mjs} +19 -39
- package/dist/{chunk-VVL65GIB.mjs → chunk-JU5MWLXH.mjs} +14 -0
- package/dist/index.d.mts +2 -3
- package/dist/index.d.ts +2 -3
- package/dist/index.js +14 -0
- package/dist/index.mjs +1 -1
- package/dist/{interfaces-Bm7fGOAI.d.ts → interfaces-1vfik3Ef.d.ts} +24 -1
- package/dist/{interfaces-CYtJHALV.d.mts → interfaces-BdIeMGGD.d.mts} +24 -1
- package/dist/lib/index.d.mts +33 -3
- package/dist/lib/index.d.ts +33 -3
- package/dist/lib/index.js +23 -47
- package/dist/lib/index.mjs +7 -15
- package/dist/passkey-cache-WnDFQ-v4.d.mts +26 -0
- package/dist/passkey-cache-WnDFQ-v4.d.ts +26 -0
- package/dist/{post-message-CmgAfkOS.d.mts → post-message-Z6cLf0mS.d.mts} +3 -0
- package/dist/{post-message-CmgAfkOS.d.ts → post-message-Z6cLf0mS.d.ts} +3 -0
- package/dist/react/ethereum.d.mts +0 -1
- package/dist/react/ethereum.d.ts +0 -1
- package/dist/react/index.d.mts +41 -3
- package/dist/react/index.d.ts +41 -3
- package/dist/react/index.js +138 -12
- package/dist/react/index.mjs +137 -12
- package/dist/react/solana.d.mts +0 -1
- package/dist/react/solana.d.ts +0 -1
- package/dist/sdk/index.d.mts +87 -16
- package/dist/sdk/index.d.ts +87 -16
- package/dist/sdk/index.js +456 -102
- package/dist/sdk/index.mjs +440 -80
- package/dist/types/index.d.mts +135 -12
- package/dist/types/index.d.ts +135 -12
- package/dist/utils/index.d.mts +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.js +14 -0
- package/dist/utils/index.mjs +1 -1
- package/dist/web/index.d.mts +2 -2
- package/dist/web/index.d.ts +2 -2
- package/dist/web/index.js +29 -0
- package/dist/web/index.mjs +30 -1
- package/package.json +3 -1
- package/dist/chain-C9dvKXUY.d.mts +0 -48
- package/dist/chain-C9dvKXUY.d.ts +0 -48
- package/dist/passkey-cache-B9PT3AWX.d.mts +0 -47
- package/dist/passkey-cache-B9PT3AWX.d.ts +0 -47
package/dist/chain-C9dvKXUY.d.ts
DELETED
|
@@ -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 };
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
interface CachedAssertion {
|
|
2
|
-
userHandleB64url: string;
|
|
3
|
-
credentialIdB64url: string;
|
|
4
|
-
}
|
|
5
|
-
declare const setAssertCacheTtlMs: (ms: number) => void;
|
|
6
|
-
declare const getAssertCacheTtlMs: () => number;
|
|
7
|
-
declare const clearParentAssertCache: () => void;
|
|
8
|
-
declare const readParentAssertCache: () => CachedAssertion | null;
|
|
9
|
-
declare const writeParentAssertCache: (entry: CachedAssertion) => void;
|
|
10
|
-
/**
|
|
11
|
-
* Run `fn` inside a try/catch that clears the parent-side assertion
|
|
12
|
-
* cache on failure. Used by every wallet-interaction SDK method
|
|
13
|
-
* (sign / send / etc.) so that if the operation fails for any reason
|
|
14
|
-
* — backend rejection, network error, MPC ceremony failure — the
|
|
15
|
-
* next user attempt re-prompts biometric instead of silently reusing
|
|
16
|
-
* a possibly-bad cached assertion.
|
|
17
|
-
*
|
|
18
|
-
* The cache is set inside the platform-specific `assertPasskeyInParent`
|
|
19
|
-
* only on a successful ceremony, so cancellations / activation
|
|
20
|
-
* failures don't pollute it. This wrapper specifically handles the
|
|
21
|
-
* "assertion succeeded but downstream work failed" case where the
|
|
22
|
-
* cache is set but the user is stuck — without the clear, the user
|
|
23
|
-
* would have to refresh to escape.
|
|
24
|
-
*/
|
|
25
|
-
declare const withClearOnFailure: <T>(fn: () => Promise<T>) => Promise<T>;
|
|
26
|
-
/**
|
|
27
|
-
* Generate fresh user.id bytes for a new WebAuthn credential. The
|
|
28
|
-
* caller overrides `options.user.id` with these bytes before
|
|
29
|
-
* navigator.credentials.create so the authenticator persists them as
|
|
30
|
-
* the credential's user.id; on every subsequent assertion they come
|
|
31
|
-
* back as response.userHandle and serve as the AES-GCM key for that
|
|
32
|
-
* credential's DEK wrap.
|
|
33
|
-
*
|
|
34
|
-
* Returns the bytes both as base64url (what the WebAuthn options
|
|
35
|
-
* accept and what we ship over postMessage) and as raw bytes (for
|
|
36
|
-
* any caller that prefers direct binary).
|
|
37
|
-
*
|
|
38
|
-
* Requires a working `crypto.getRandomValues`. On RN this is provided
|
|
39
|
-
* by the `react-native-get-random-values` polyfill that the SDK's
|
|
40
|
-
* docs ask consumers to import at app entry.
|
|
41
|
-
*/
|
|
42
|
-
declare const generatePasskeyUserId: () => {
|
|
43
|
-
userIdB64url: string;
|
|
44
|
-
userIdBytes: Uint8Array;
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
export { type CachedAssertion as C, getAssertCacheTtlMs as a, writeParentAssertCache as b, clearParentAssertCache as c, generatePasskeyUserId as g, readParentAssertCache as r, setAssertCacheTtlMs as s, withClearOnFailure as w };
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
interface CachedAssertion {
|
|
2
|
-
userHandleB64url: string;
|
|
3
|
-
credentialIdB64url: string;
|
|
4
|
-
}
|
|
5
|
-
declare const setAssertCacheTtlMs: (ms: number) => void;
|
|
6
|
-
declare const getAssertCacheTtlMs: () => number;
|
|
7
|
-
declare const clearParentAssertCache: () => void;
|
|
8
|
-
declare const readParentAssertCache: () => CachedAssertion | null;
|
|
9
|
-
declare const writeParentAssertCache: (entry: CachedAssertion) => void;
|
|
10
|
-
/**
|
|
11
|
-
* Run `fn` inside a try/catch that clears the parent-side assertion
|
|
12
|
-
* cache on failure. Used by every wallet-interaction SDK method
|
|
13
|
-
* (sign / send / etc.) so that if the operation fails for any reason
|
|
14
|
-
* — backend rejection, network error, MPC ceremony failure — the
|
|
15
|
-
* next user attempt re-prompts biometric instead of silently reusing
|
|
16
|
-
* a possibly-bad cached assertion.
|
|
17
|
-
*
|
|
18
|
-
* The cache is set inside the platform-specific `assertPasskeyInParent`
|
|
19
|
-
* only on a successful ceremony, so cancellations / activation
|
|
20
|
-
* failures don't pollute it. This wrapper specifically handles the
|
|
21
|
-
* "assertion succeeded but downstream work failed" case where the
|
|
22
|
-
* cache is set but the user is stuck — without the clear, the user
|
|
23
|
-
* would have to refresh to escape.
|
|
24
|
-
*/
|
|
25
|
-
declare const withClearOnFailure: <T>(fn: () => Promise<T>) => Promise<T>;
|
|
26
|
-
/**
|
|
27
|
-
* Generate fresh user.id bytes for a new WebAuthn credential. The
|
|
28
|
-
* caller overrides `options.user.id` with these bytes before
|
|
29
|
-
* navigator.credentials.create so the authenticator persists them as
|
|
30
|
-
* the credential's user.id; on every subsequent assertion they come
|
|
31
|
-
* back as response.userHandle and serve as the AES-GCM key for that
|
|
32
|
-
* credential's DEK wrap.
|
|
33
|
-
*
|
|
34
|
-
* Returns the bytes both as base64url (what the WebAuthn options
|
|
35
|
-
* accept and what we ship over postMessage) and as raw bytes (for
|
|
36
|
-
* any caller that prefers direct binary).
|
|
37
|
-
*
|
|
38
|
-
* Requires a working `crypto.getRandomValues`. On RN this is provided
|
|
39
|
-
* by the `react-native-get-random-values` polyfill that the SDK's
|
|
40
|
-
* docs ask consumers to import at app entry.
|
|
41
|
-
*/
|
|
42
|
-
declare const generatePasskeyUserId: () => {
|
|
43
|
-
userIdB64url: string;
|
|
44
|
-
userIdBytes: Uint8Array;
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
export { type CachedAssertion as C, getAssertCacheTtlMs as a, writeParentAssertCache as b, clearParentAssertCache as c, generatePasskeyUserId as g, readParentAssertCache as r, setAssertCacheTtlMs as s, withClearOnFailure as w };
|