@xyo-network/wallet-xl1-cli 0.1.21 → 0.1.22
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 +53 -1
- package/dist/bin/wallet.mjs +5994 -4230
- package/dist/node/signing-types.d.ts +76 -0
- package/dist/node/signing.d.ts +9 -0
- package/dist/node/signing.mjs +169134 -0
- package/package.json +26 -5
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import type { SignedHydratedTransactionWithHashMeta, UnsignedHydratedTransaction } from '@xyo-network/xl1-sdk';
|
|
2
|
+
export interface SigningWalletSummary {
|
|
3
|
+
readonly algorithm: 'secp256k1' | 'ml-dsa-65';
|
|
4
|
+
readonly createdAt: number;
|
|
5
|
+
readonly id: string;
|
|
6
|
+
readonly isActive: boolean;
|
|
7
|
+
readonly label: string;
|
|
8
|
+
readonly walletKind: 'user' | 'os';
|
|
9
|
+
}
|
|
10
|
+
export interface OpenWalletSigningSessionOptions {
|
|
11
|
+
readonly chainId: string;
|
|
12
|
+
readonly expectedAccount: string;
|
|
13
|
+
readonly genesisBlockHash: string;
|
|
14
|
+
readonly offset: string;
|
|
15
|
+
readonly requesterId: string;
|
|
16
|
+
readonly ttlSeconds?: number;
|
|
17
|
+
readonly walletId: string;
|
|
18
|
+
}
|
|
19
|
+
export interface WalletSigningBinding {
|
|
20
|
+
readonly chainId: string;
|
|
21
|
+
readonly expectedAccount: string;
|
|
22
|
+
readonly generation: string;
|
|
23
|
+
readonly genesisBlockHash: string;
|
|
24
|
+
readonly offset: string;
|
|
25
|
+
readonly requesterId: string;
|
|
26
|
+
readonly walletId: string;
|
|
27
|
+
}
|
|
28
|
+
export interface WalletSigningSnapshot {
|
|
29
|
+
readonly binding: WalletSigningBinding;
|
|
30
|
+
readonly expiresAt: number;
|
|
31
|
+
readonly revision: number;
|
|
32
|
+
readonly scope: 'wallet:transactions:sign';
|
|
33
|
+
readonly state: 'active' | 'expired' | 'revoked' | 'locked';
|
|
34
|
+
}
|
|
35
|
+
export interface WalletSigningRequest {
|
|
36
|
+
readonly requestId: string;
|
|
37
|
+
readonly transaction: UnsignedHydratedTransaction;
|
|
38
|
+
}
|
|
39
|
+
export type WalletSigningOutcome = {
|
|
40
|
+
readonly requestId: string;
|
|
41
|
+
readonly state: 'unknown';
|
|
42
|
+
} | {
|
|
43
|
+
readonly requestId: string;
|
|
44
|
+
readonly state: 'signed';
|
|
45
|
+
readonly transaction: SignedHydratedTransactionWithHashMeta;
|
|
46
|
+
};
|
|
47
|
+
export interface WalletSigningSession {
|
|
48
|
+
readonly binding: WalletSigningBinding;
|
|
49
|
+
close(): Promise<void>;
|
|
50
|
+
signTransaction(request: WalletSigningRequest): Promise<SignedHydratedTransactionWithHashMeta>;
|
|
51
|
+
signingOutcome(requestId: string): Promise<WalletSigningOutcome | undefined>;
|
|
52
|
+
snapshot(): Promise<WalletSigningSnapshot>;
|
|
53
|
+
}
|
|
54
|
+
export type WalletSigningErrorCode = 'invalid-request' | 'unauthorized' | 'expired' | 'revoked' | 'locked' | 'continuity-unqualified' | 'request-conflict' | 'signing-outcome-unknown' | 'capacity' | 'storage-unavailable';
|
|
55
|
+
export declare class WalletSigningError extends Error {
|
|
56
|
+
readonly code: WalletSigningErrorCode;
|
|
57
|
+
readonly signingOutcome: 'not-attempted' | 'unknown';
|
|
58
|
+
constructor(code: WalletSigningErrorCode, outcome?: 'not-attempted' | 'unknown');
|
|
59
|
+
}
|
|
60
|
+
export interface WalletSigningContinuityMigration {
|
|
61
|
+
readonly assertion: 'exclusive-wallet-owner-cutover';
|
|
62
|
+
readonly checkpoint: {
|
|
63
|
+
readonly kind: 'unused';
|
|
64
|
+
} | {
|
|
65
|
+
readonly kind: 'signed';
|
|
66
|
+
readonly signed: unknown;
|
|
67
|
+
};
|
|
68
|
+
readonly expectedAccount: string;
|
|
69
|
+
readonly offset: string;
|
|
70
|
+
readonly walletId: string;
|
|
71
|
+
}
|
|
72
|
+
export interface WalletSigningContinuityCheckpoint {
|
|
73
|
+
readonly account: string;
|
|
74
|
+
readonly head: string | null;
|
|
75
|
+
readonly source: 'owner-cutover';
|
|
76
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { OpenWalletSigningSessionOptions, SigningWalletSummary, WalletSigningContinuityCheckpoint, WalletSigningContinuityMigration, WalletSigningSession } from './signing-types.js';
|
|
2
|
+
export type { OpenWalletSigningSessionOptions, SigningWalletSummary, WalletSigningBinding, WalletSigningErrorCode, WalletSigningOutcome, WalletSigningRequest, WalletSigningSession, WalletSigningSnapshot, } from './signing-types.js';
|
|
3
|
+
export { WalletSigningError } from './signing-types.js';
|
|
4
|
+
export declare function listSigningWallets(): readonly SigningWalletSummary[];
|
|
5
|
+
/** The wallet owner performs trusted approval and unlock; no key material crosses this API. */
|
|
6
|
+
export declare function openWalletSigningSession(options: OpenWalletSigningSessionOptions): Promise<WalletSigningSession>;
|
|
7
|
+
export type { WalletSigningContinuityCheckpoint, WalletSigningContinuityMigration } from './signing-types.js';
|
|
8
|
+
/** Fresh wallet-owner cutover approval is separate from every requester grant. */
|
|
9
|
+
export declare function migrateWalletSigningContinuity(options: WalletSigningContinuityMigration): Promise<WalletSigningContinuityCheckpoint>;
|