@deadvault/sdk 0.1.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/LICENSE +21 -0
- package/README.md +197 -0
- package/dist/index.cjs +520 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +210 -0
- package/dist/index.d.ts +210 -0
- package/dist/index.js +507 -0
- package/dist/index.js.map +1 -0
- package/package.json +69 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @deadvault/sdk — Type definitions.
|
|
3
|
+
* @module
|
|
4
|
+
*/
|
|
5
|
+
/** A single vault entry (password, API key, TOTP secret, etc.) */
|
|
6
|
+
interface VaultEntry {
|
|
7
|
+
/** Unique identifier (UUID v4) */
|
|
8
|
+
id: string;
|
|
9
|
+
/** Human‑readable label (e.g. "GitHub", "OpenAI API") */
|
|
10
|
+
label: string;
|
|
11
|
+
/** The secret value (password, API key, or Base32 TOTP seed) */
|
|
12
|
+
secret: string;
|
|
13
|
+
/** Optional URL for autofill matching */
|
|
14
|
+
url?: string;
|
|
15
|
+
/** Category tag (e.g. "API Keys", "Passwords") */
|
|
16
|
+
category?: string;
|
|
17
|
+
/** Unix timestamp in milliseconds when created */
|
|
18
|
+
createdAt: number;
|
|
19
|
+
/** Unix timestamp in milliseconds when last modified */
|
|
20
|
+
updatedAt: number;
|
|
21
|
+
/** Entry type — defaults to `"password"` for backward compatibility */
|
|
22
|
+
type?: "password" | "totp";
|
|
23
|
+
/** TOTP‑specific configuration (only relevant when `type === "totp"`) */
|
|
24
|
+
totpConfig?: {
|
|
25
|
+
/** HMAC algorithm — defaults to `"SHA1"` (standard) */
|
|
26
|
+
algorithm?: "SHA1" | "SHA256";
|
|
27
|
+
/** Code length — defaults to `6` */
|
|
28
|
+
digits?: 6 | 8;
|
|
29
|
+
/** Time step in seconds — defaults to `30` */
|
|
30
|
+
period?: number;
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
/** Decrypted vault payload */
|
|
34
|
+
interface VaultData {
|
|
35
|
+
/** Data format version (currently `1`) */
|
|
36
|
+
version: number;
|
|
37
|
+
/** All vault entries */
|
|
38
|
+
entries: VaultEntry[];
|
|
39
|
+
}
|
|
40
|
+
/** Supported chain name shorthands */
|
|
41
|
+
type ChainName = "base" | "ethereum" | "arbitrum" | "optimism";
|
|
42
|
+
/** Constructor options for {@link DeadVault} */
|
|
43
|
+
interface DeadVaultConfig {
|
|
44
|
+
/** Chain name shorthand (default: `"base"`) */
|
|
45
|
+
chain?: ChainName;
|
|
46
|
+
/** Numeric chain ID — takes precedence over `chain` */
|
|
47
|
+
chainId?: number;
|
|
48
|
+
/** Custom JSON‑RPC endpoint (overrides built‑in defaults) */
|
|
49
|
+
rpcUrl?: string;
|
|
50
|
+
}
|
|
51
|
+
/** Options for {@link DeadVault.read} */
|
|
52
|
+
interface ReadOptions {
|
|
53
|
+
/** Wallet address that owns the vault (`0x…`) */
|
|
54
|
+
address: string;
|
|
55
|
+
/** Master password used during encryption */
|
|
56
|
+
password: string;
|
|
57
|
+
/** Wallet signature needed for v2‑encrypted vaults */
|
|
58
|
+
walletSignature?: string;
|
|
59
|
+
}
|
|
60
|
+
/** Options for {@link DeadVault.write} */
|
|
61
|
+
interface WriteOptions {
|
|
62
|
+
/** Vault data to encrypt and store on‑chain */
|
|
63
|
+
data: VaultData;
|
|
64
|
+
/** Master password for encryption */
|
|
65
|
+
password: string;
|
|
66
|
+
/** Hex‑encoded private key for signing the transaction (`0x…`) */
|
|
67
|
+
privateKey: string;
|
|
68
|
+
/** Wallet signature for v2 encryption (created via {@link DeadVault.signKdfMessage}) */
|
|
69
|
+
walletSignature: string;
|
|
70
|
+
}
|
|
71
|
+
/** Result returned by {@link DeadVault.write} */
|
|
72
|
+
interface WriteResult {
|
|
73
|
+
/** Transaction hash (`0x…`) */
|
|
74
|
+
hash: string;
|
|
75
|
+
/** Block number the transaction was mined in */
|
|
76
|
+
blockNumber: bigint;
|
|
77
|
+
}
|
|
78
|
+
/** Fee information returned by {@link DeadVault.getWriteFee} */
|
|
79
|
+
interface FeeInfo {
|
|
80
|
+
/** Fee amount in wei */
|
|
81
|
+
wei: bigint;
|
|
82
|
+
/** Fee formatted as a decimal ETH string */
|
|
83
|
+
eth: string;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* DeadVault SDK — Main client class.
|
|
88
|
+
*
|
|
89
|
+
* Usage:
|
|
90
|
+
* const vault = new DeadVault({ chain: "base" });
|
|
91
|
+
* const data = await vault.read({ address, password, walletSignature });
|
|
92
|
+
* const entry = vault.findEntry(data, { label: "OpenAI" });
|
|
93
|
+
* const code = await vault.generateTOTP(entry);
|
|
94
|
+
*/
|
|
95
|
+
|
|
96
|
+
declare class DeadVault {
|
|
97
|
+
private readonly chainId;
|
|
98
|
+
private readonly rpcUrl?;
|
|
99
|
+
private readonly vaultAddress;
|
|
100
|
+
private client;
|
|
101
|
+
constructor(config?: DeadVaultConfig);
|
|
102
|
+
/**
|
|
103
|
+
* Read and decrypt a vault from the chain.
|
|
104
|
+
* Returns the decrypted VaultData with all entries.
|
|
105
|
+
*/
|
|
106
|
+
read(options: ReadOptions): Promise<VaultData>;
|
|
107
|
+
/**
|
|
108
|
+
* Encrypt and write vault data on-chain.
|
|
109
|
+
* Requires a private key for the transaction + wallet signature for v2 encryption.
|
|
110
|
+
*/
|
|
111
|
+
write(options: WriteOptions): Promise<WriteResult>;
|
|
112
|
+
/**
|
|
113
|
+
* Find an entry in vault data by label, category, URL, or custom predicate.
|
|
114
|
+
*/
|
|
115
|
+
findEntry(data: VaultData, match: {
|
|
116
|
+
label?: string;
|
|
117
|
+
category?: string;
|
|
118
|
+
url?: string;
|
|
119
|
+
} | ((entry: VaultEntry) => boolean)): VaultEntry | undefined;
|
|
120
|
+
/**
|
|
121
|
+
* Find all matching entries.
|
|
122
|
+
*/
|
|
123
|
+
findEntries(data: VaultData, match: {
|
|
124
|
+
label?: string;
|
|
125
|
+
category?: string;
|
|
126
|
+
url?: string;
|
|
127
|
+
type?: "password" | "totp";
|
|
128
|
+
} | ((entry: VaultEntry) => boolean)): VaultEntry[];
|
|
129
|
+
/**
|
|
130
|
+
* Generate a TOTP code from a vault entry.
|
|
131
|
+
* The entry must have type "totp" and contain a base32 secret.
|
|
132
|
+
*/
|
|
133
|
+
generateTOTP(entry: VaultEntry): Promise<string>;
|
|
134
|
+
/**
|
|
135
|
+
* Get the remaining seconds in the current TOTP window.
|
|
136
|
+
*/
|
|
137
|
+
getTOTPTimeRemaining(period?: number): number;
|
|
138
|
+
/**
|
|
139
|
+
* Get the write fee for this chain.
|
|
140
|
+
*/
|
|
141
|
+
getWriteFee(): Promise<FeeInfo>;
|
|
142
|
+
/**
|
|
143
|
+
* Check if an address has an unlimited pass (no fee required).
|
|
144
|
+
*/
|
|
145
|
+
hasPass(address: string): Promise<boolean>;
|
|
146
|
+
/**
|
|
147
|
+
* Check if an address has a vault on-chain.
|
|
148
|
+
*/
|
|
149
|
+
hasVault(address: string): Promise<boolean>;
|
|
150
|
+
/**
|
|
151
|
+
* Sign the KDF message with a private key.
|
|
152
|
+
* Returns the wallet signature needed for v2 read/write operations.
|
|
153
|
+
*/
|
|
154
|
+
signKdfMessage(privateKey: string): Promise<string>;
|
|
155
|
+
/** Get the chain ID this client is configured for */
|
|
156
|
+
getChainId(): number;
|
|
157
|
+
/** Get the vault contract address */
|
|
158
|
+
getVaultAddress(): `0x${string}`;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* TOTP (Time-Based One-Time Password) Generator — RFC 6238
|
|
163
|
+
* Uses Web Crypto API for HMAC. No external dependencies.
|
|
164
|
+
*/
|
|
165
|
+
/** Decode a Base32-encoded string */
|
|
166
|
+
declare function base32Decode(input: string): Uint8Array;
|
|
167
|
+
type TOTPAlgorithm = "SHA1" | "SHA256";
|
|
168
|
+
interface TOTPParams {
|
|
169
|
+
secret: string;
|
|
170
|
+
algorithm?: TOTPAlgorithm;
|
|
171
|
+
digits?: 6 | 8;
|
|
172
|
+
period?: number;
|
|
173
|
+
}
|
|
174
|
+
/** Generate the current TOTP code */
|
|
175
|
+
declare function generateTOTP(params: TOTPParams): Promise<string>;
|
|
176
|
+
/** Get remaining seconds in the current TOTP window */
|
|
177
|
+
declare function getTOTPTimeRemaining(period?: number): number;
|
|
178
|
+
/** Validate a base32 TOTP secret — checks it decodes to >= 10 bytes */
|
|
179
|
+
declare function isValidTOTPSecret(secret: string): boolean;
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* Chain configuration — contract addresses, RPCs, chain objects, and ABI.
|
|
183
|
+
* @module
|
|
184
|
+
*/
|
|
185
|
+
|
|
186
|
+
/** DeadVault proxy addresses per chain ID */
|
|
187
|
+
declare const VAULT_ADDRESSES: Record<number, `0x${string}`>;
|
|
188
|
+
/** Human‑friendly chain name → chain ID lookup */
|
|
189
|
+
declare const CHAIN_NAME_TO_ID: Record<string, number>;
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* AES-256-GCM encryption/decryption using Web Crypto API.
|
|
193
|
+
* Compatible with Node.js 18+, Deno, Bun, and Cloudflare Workers.
|
|
194
|
+
*
|
|
195
|
+
* v1: PBKDF2(password, salt, 600k, SHA-256) → AES-256-GCM
|
|
196
|
+
* Format: salt(16) || iv(12) || ciphertext
|
|
197
|
+
*
|
|
198
|
+
* v2: PBKDF2(password + walletSignature, salt, 600k, SHA-256) → AES-256-GCM
|
|
199
|
+
* Format: 0xDEAD00 || 0x02 || salt(16) || iv(12) || ciphertext
|
|
200
|
+
*/
|
|
201
|
+
declare const KDF_SIGN_MESSAGE: string;
|
|
202
|
+
declare function detectVersionFromHex(hexCiphertext: string): number;
|
|
203
|
+
/** Encrypt plaintext with password only (v1 format) */
|
|
204
|
+
declare function encrypt(plaintext: string, password: string): Promise<string>;
|
|
205
|
+
/** Encrypt plaintext with password + wallet signature (v2 format) */
|
|
206
|
+
declare function encryptV2(plaintext: string, password: string, walletSignature: string): Promise<string>;
|
|
207
|
+
/** Decrypt a hex ciphertext. Auto-detects v1/v2 format. */
|
|
208
|
+
declare function decrypt(hexCiphertext: string, password: string, walletSignature?: string): Promise<string>;
|
|
209
|
+
|
|
210
|
+
export { CHAIN_NAME_TO_ID, DeadVault, type DeadVaultConfig, type FeeInfo, KDF_SIGN_MESSAGE, type ReadOptions, type TOTPAlgorithm, type TOTPParams, VAULT_ADDRESSES, type VaultData, type VaultEntry, type WriteOptions, type WriteResult, base32Decode, decrypt, detectVersionFromHex, encrypt, encryptV2, generateTOTP, getTOTPTimeRemaining, isValidTOTPSecret };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @deadvault/sdk — Type definitions.
|
|
3
|
+
* @module
|
|
4
|
+
*/
|
|
5
|
+
/** A single vault entry (password, API key, TOTP secret, etc.) */
|
|
6
|
+
interface VaultEntry {
|
|
7
|
+
/** Unique identifier (UUID v4) */
|
|
8
|
+
id: string;
|
|
9
|
+
/** Human‑readable label (e.g. "GitHub", "OpenAI API") */
|
|
10
|
+
label: string;
|
|
11
|
+
/** The secret value (password, API key, or Base32 TOTP seed) */
|
|
12
|
+
secret: string;
|
|
13
|
+
/** Optional URL for autofill matching */
|
|
14
|
+
url?: string;
|
|
15
|
+
/** Category tag (e.g. "API Keys", "Passwords") */
|
|
16
|
+
category?: string;
|
|
17
|
+
/** Unix timestamp in milliseconds when created */
|
|
18
|
+
createdAt: number;
|
|
19
|
+
/** Unix timestamp in milliseconds when last modified */
|
|
20
|
+
updatedAt: number;
|
|
21
|
+
/** Entry type — defaults to `"password"` for backward compatibility */
|
|
22
|
+
type?: "password" | "totp";
|
|
23
|
+
/** TOTP‑specific configuration (only relevant when `type === "totp"`) */
|
|
24
|
+
totpConfig?: {
|
|
25
|
+
/** HMAC algorithm — defaults to `"SHA1"` (standard) */
|
|
26
|
+
algorithm?: "SHA1" | "SHA256";
|
|
27
|
+
/** Code length — defaults to `6` */
|
|
28
|
+
digits?: 6 | 8;
|
|
29
|
+
/** Time step in seconds — defaults to `30` */
|
|
30
|
+
period?: number;
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
/** Decrypted vault payload */
|
|
34
|
+
interface VaultData {
|
|
35
|
+
/** Data format version (currently `1`) */
|
|
36
|
+
version: number;
|
|
37
|
+
/** All vault entries */
|
|
38
|
+
entries: VaultEntry[];
|
|
39
|
+
}
|
|
40
|
+
/** Supported chain name shorthands */
|
|
41
|
+
type ChainName = "base" | "ethereum" | "arbitrum" | "optimism";
|
|
42
|
+
/** Constructor options for {@link DeadVault} */
|
|
43
|
+
interface DeadVaultConfig {
|
|
44
|
+
/** Chain name shorthand (default: `"base"`) */
|
|
45
|
+
chain?: ChainName;
|
|
46
|
+
/** Numeric chain ID — takes precedence over `chain` */
|
|
47
|
+
chainId?: number;
|
|
48
|
+
/** Custom JSON‑RPC endpoint (overrides built‑in defaults) */
|
|
49
|
+
rpcUrl?: string;
|
|
50
|
+
}
|
|
51
|
+
/** Options for {@link DeadVault.read} */
|
|
52
|
+
interface ReadOptions {
|
|
53
|
+
/** Wallet address that owns the vault (`0x…`) */
|
|
54
|
+
address: string;
|
|
55
|
+
/** Master password used during encryption */
|
|
56
|
+
password: string;
|
|
57
|
+
/** Wallet signature needed for v2‑encrypted vaults */
|
|
58
|
+
walletSignature?: string;
|
|
59
|
+
}
|
|
60
|
+
/** Options for {@link DeadVault.write} */
|
|
61
|
+
interface WriteOptions {
|
|
62
|
+
/** Vault data to encrypt and store on‑chain */
|
|
63
|
+
data: VaultData;
|
|
64
|
+
/** Master password for encryption */
|
|
65
|
+
password: string;
|
|
66
|
+
/** Hex‑encoded private key for signing the transaction (`0x…`) */
|
|
67
|
+
privateKey: string;
|
|
68
|
+
/** Wallet signature for v2 encryption (created via {@link DeadVault.signKdfMessage}) */
|
|
69
|
+
walletSignature: string;
|
|
70
|
+
}
|
|
71
|
+
/** Result returned by {@link DeadVault.write} */
|
|
72
|
+
interface WriteResult {
|
|
73
|
+
/** Transaction hash (`0x…`) */
|
|
74
|
+
hash: string;
|
|
75
|
+
/** Block number the transaction was mined in */
|
|
76
|
+
blockNumber: bigint;
|
|
77
|
+
}
|
|
78
|
+
/** Fee information returned by {@link DeadVault.getWriteFee} */
|
|
79
|
+
interface FeeInfo {
|
|
80
|
+
/** Fee amount in wei */
|
|
81
|
+
wei: bigint;
|
|
82
|
+
/** Fee formatted as a decimal ETH string */
|
|
83
|
+
eth: string;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* DeadVault SDK — Main client class.
|
|
88
|
+
*
|
|
89
|
+
* Usage:
|
|
90
|
+
* const vault = new DeadVault({ chain: "base" });
|
|
91
|
+
* const data = await vault.read({ address, password, walletSignature });
|
|
92
|
+
* const entry = vault.findEntry(data, { label: "OpenAI" });
|
|
93
|
+
* const code = await vault.generateTOTP(entry);
|
|
94
|
+
*/
|
|
95
|
+
|
|
96
|
+
declare class DeadVault {
|
|
97
|
+
private readonly chainId;
|
|
98
|
+
private readonly rpcUrl?;
|
|
99
|
+
private readonly vaultAddress;
|
|
100
|
+
private client;
|
|
101
|
+
constructor(config?: DeadVaultConfig);
|
|
102
|
+
/**
|
|
103
|
+
* Read and decrypt a vault from the chain.
|
|
104
|
+
* Returns the decrypted VaultData with all entries.
|
|
105
|
+
*/
|
|
106
|
+
read(options: ReadOptions): Promise<VaultData>;
|
|
107
|
+
/**
|
|
108
|
+
* Encrypt and write vault data on-chain.
|
|
109
|
+
* Requires a private key for the transaction + wallet signature for v2 encryption.
|
|
110
|
+
*/
|
|
111
|
+
write(options: WriteOptions): Promise<WriteResult>;
|
|
112
|
+
/**
|
|
113
|
+
* Find an entry in vault data by label, category, URL, or custom predicate.
|
|
114
|
+
*/
|
|
115
|
+
findEntry(data: VaultData, match: {
|
|
116
|
+
label?: string;
|
|
117
|
+
category?: string;
|
|
118
|
+
url?: string;
|
|
119
|
+
} | ((entry: VaultEntry) => boolean)): VaultEntry | undefined;
|
|
120
|
+
/**
|
|
121
|
+
* Find all matching entries.
|
|
122
|
+
*/
|
|
123
|
+
findEntries(data: VaultData, match: {
|
|
124
|
+
label?: string;
|
|
125
|
+
category?: string;
|
|
126
|
+
url?: string;
|
|
127
|
+
type?: "password" | "totp";
|
|
128
|
+
} | ((entry: VaultEntry) => boolean)): VaultEntry[];
|
|
129
|
+
/**
|
|
130
|
+
* Generate a TOTP code from a vault entry.
|
|
131
|
+
* The entry must have type "totp" and contain a base32 secret.
|
|
132
|
+
*/
|
|
133
|
+
generateTOTP(entry: VaultEntry): Promise<string>;
|
|
134
|
+
/**
|
|
135
|
+
* Get the remaining seconds in the current TOTP window.
|
|
136
|
+
*/
|
|
137
|
+
getTOTPTimeRemaining(period?: number): number;
|
|
138
|
+
/**
|
|
139
|
+
* Get the write fee for this chain.
|
|
140
|
+
*/
|
|
141
|
+
getWriteFee(): Promise<FeeInfo>;
|
|
142
|
+
/**
|
|
143
|
+
* Check if an address has an unlimited pass (no fee required).
|
|
144
|
+
*/
|
|
145
|
+
hasPass(address: string): Promise<boolean>;
|
|
146
|
+
/**
|
|
147
|
+
* Check if an address has a vault on-chain.
|
|
148
|
+
*/
|
|
149
|
+
hasVault(address: string): Promise<boolean>;
|
|
150
|
+
/**
|
|
151
|
+
* Sign the KDF message with a private key.
|
|
152
|
+
* Returns the wallet signature needed for v2 read/write operations.
|
|
153
|
+
*/
|
|
154
|
+
signKdfMessage(privateKey: string): Promise<string>;
|
|
155
|
+
/** Get the chain ID this client is configured for */
|
|
156
|
+
getChainId(): number;
|
|
157
|
+
/** Get the vault contract address */
|
|
158
|
+
getVaultAddress(): `0x${string}`;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* TOTP (Time-Based One-Time Password) Generator — RFC 6238
|
|
163
|
+
* Uses Web Crypto API for HMAC. No external dependencies.
|
|
164
|
+
*/
|
|
165
|
+
/** Decode a Base32-encoded string */
|
|
166
|
+
declare function base32Decode(input: string): Uint8Array;
|
|
167
|
+
type TOTPAlgorithm = "SHA1" | "SHA256";
|
|
168
|
+
interface TOTPParams {
|
|
169
|
+
secret: string;
|
|
170
|
+
algorithm?: TOTPAlgorithm;
|
|
171
|
+
digits?: 6 | 8;
|
|
172
|
+
period?: number;
|
|
173
|
+
}
|
|
174
|
+
/** Generate the current TOTP code */
|
|
175
|
+
declare function generateTOTP(params: TOTPParams): Promise<string>;
|
|
176
|
+
/** Get remaining seconds in the current TOTP window */
|
|
177
|
+
declare function getTOTPTimeRemaining(period?: number): number;
|
|
178
|
+
/** Validate a base32 TOTP secret — checks it decodes to >= 10 bytes */
|
|
179
|
+
declare function isValidTOTPSecret(secret: string): boolean;
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* Chain configuration — contract addresses, RPCs, chain objects, and ABI.
|
|
183
|
+
* @module
|
|
184
|
+
*/
|
|
185
|
+
|
|
186
|
+
/** DeadVault proxy addresses per chain ID */
|
|
187
|
+
declare const VAULT_ADDRESSES: Record<number, `0x${string}`>;
|
|
188
|
+
/** Human‑friendly chain name → chain ID lookup */
|
|
189
|
+
declare const CHAIN_NAME_TO_ID: Record<string, number>;
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* AES-256-GCM encryption/decryption using Web Crypto API.
|
|
193
|
+
* Compatible with Node.js 18+, Deno, Bun, and Cloudflare Workers.
|
|
194
|
+
*
|
|
195
|
+
* v1: PBKDF2(password, salt, 600k, SHA-256) → AES-256-GCM
|
|
196
|
+
* Format: salt(16) || iv(12) || ciphertext
|
|
197
|
+
*
|
|
198
|
+
* v2: PBKDF2(password + walletSignature, salt, 600k, SHA-256) → AES-256-GCM
|
|
199
|
+
* Format: 0xDEAD00 || 0x02 || salt(16) || iv(12) || ciphertext
|
|
200
|
+
*/
|
|
201
|
+
declare const KDF_SIGN_MESSAGE: string;
|
|
202
|
+
declare function detectVersionFromHex(hexCiphertext: string): number;
|
|
203
|
+
/** Encrypt plaintext with password only (v1 format) */
|
|
204
|
+
declare function encrypt(plaintext: string, password: string): Promise<string>;
|
|
205
|
+
/** Encrypt plaintext with password + wallet signature (v2 format) */
|
|
206
|
+
declare function encryptV2(plaintext: string, password: string, walletSignature: string): Promise<string>;
|
|
207
|
+
/** Decrypt a hex ciphertext. Auto-detects v1/v2 format. */
|
|
208
|
+
declare function decrypt(hexCiphertext: string, password: string, walletSignature?: string): Promise<string>;
|
|
209
|
+
|
|
210
|
+
export { CHAIN_NAME_TO_ID, DeadVault, type DeadVaultConfig, type FeeInfo, KDF_SIGN_MESSAGE, type ReadOptions, type TOTPAlgorithm, type TOTPParams, VAULT_ADDRESSES, type VaultData, type VaultEntry, type WriteOptions, type WriteResult, base32Decode, decrypt, detectVersionFromHex, encrypt, encryptV2, generateTOTP, getTOTPTimeRemaining, isValidTOTPSecret };
|