@guveno/wallet-sdk 1.0.0 → 1.0.1
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 +2 -1
- package/dist/api/client.d.ts +3 -17
- package/dist/api/client.d.ts.map +1 -1
- package/dist/api/client.js +15 -76
- package/dist/api/client.js.map +1 -1
- package/dist/api/types.d.ts +9 -31
- package/dist/api/types.d.ts.map +1 -1
- package/dist/api/types.js.map +1 -1
- package/dist/config/file-store.d.ts +40 -0
- package/dist/config/file-store.d.ts.map +1 -0
- package/dist/config/file-store.js +118 -0
- package/dist/config/file-store.js.map +1 -0
- package/dist/constants.d.ts +8 -1
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +17 -1
- package/dist/constants.js.map +1 -1
- package/dist/crypto/sealed-box.d.ts +7 -0
- package/dist/crypto/sealed-box.d.ts.map +1 -1
- package/dist/crypto/sealed-box.js +36 -1
- package/dist/crypto/sealed-box.js.map +1 -1
- package/dist/crypto/user-keys.d.ts +31 -0
- package/dist/crypto/user-keys.d.ts.map +1 -0
- package/dist/crypto/user-keys.js +36 -0
- package/dist/crypto/user-keys.js.map +1 -0
- package/dist/encryption-session.d.ts +33 -0
- package/dist/encryption-session.d.ts.map +1 -0
- package/dist/encryption-session.js +59 -0
- package/dist/encryption-session.js.map +1 -0
- package/dist/hot-wallet.d.ts +19 -2
- package/dist/hot-wallet.d.ts.map +1 -1
- package/dist/hot-wallet.js +26 -3
- package/dist/hot-wallet.js.map +1 -1
- package/dist/index.d.ts +12 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -6
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +1 -177
- package/dist/types.d.ts.map +1 -1
- package/dist/wallet-service.d.ts +75 -0
- package/dist/wallet-service.d.ts.map +1 -0
- package/dist/wallet-service.js +113 -0
- package/dist/wallet-service.js.map +1 -0
- package/package.json +5 -4
- package/dist/manager.d.ts +0 -28
- package/dist/manager.d.ts.map +0 -1
- package/dist/manager.js +0 -499
- package/dist/manager.js.map +0 -1
- package/dist/session/file-store.d.ts +0 -10
- package/dist/session/file-store.d.ts.map +0 -1
- package/dist/session/file-store.js +0 -88
- package/dist/session/file-store.js.map +0 -1
- package/dist/storage/crypto.d.ts +0 -7
- package/dist/storage/crypto.d.ts.map +0 -1
- package/dist/storage/crypto.js +0 -80
- package/dist/storage/crypto.js.map +0 -1
- package/dist/storage/file-store.d.ts +0 -21
- package/dist/storage/file-store.d.ts.map +0 -1
- package/dist/storage/file-store.js +0 -219
- package/dist/storage/file-store.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sealed-box.d.ts","sourceRoot":"","sources":["../../src/crypto/sealed-box.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sealed-box.d.ts","sourceRoot":"","sources":["../../src/crypto/sealed-box.ts"],"names":[],"mappings":"AAgBA,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,mBAAmB,CAAC;IAC1B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,UAAU,EAAE,MAAM,CAAC;CACpB;AA6ED,wBAAgB,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,wBAAwB,EAAE,MAAM,GAAG,gBAAgB,CAmB/F;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,UAAU,GAAG,MAAM,CAe9F"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import { createCipheriv, createPublicKey, diffieHellman, generateKeyPairSync, hkdfSync, randomBytes } from 'node:crypto';
|
|
1
|
+
import { createCipheriv, createDecipheriv, createPrivateKey, createPublicKey, diffieHellman, generateKeyPairSync, hkdfSync, randomBytes } from 'node:crypto';
|
|
2
|
+
// PKCS#8 DER prefix for an X25519 private key (OID 1.3.101.110), followed by the
|
|
3
|
+
// raw 32-byte scalar. Lets us build a KeyObject from raw key bytes.
|
|
4
|
+
const X25519_PKCS8_PREFIX = Buffer.from('302e020100300506032b656e04220420', 'hex');
|
|
2
5
|
function toBase64Url(raw) {
|
|
3
6
|
return raw.toString('base64url');
|
|
4
7
|
}
|
|
@@ -21,6 +24,16 @@ function createRawPublicKey(rawPublicKey) {
|
|
|
21
24
|
}
|
|
22
25
|
});
|
|
23
26
|
}
|
|
27
|
+
function createRawPrivateKey(rawPrivateKey) {
|
|
28
|
+
if (rawPrivateKey.length !== 32) {
|
|
29
|
+
throw new Error('An X25519 private key must be exactly 32 bytes.');
|
|
30
|
+
}
|
|
31
|
+
return createPrivateKey({
|
|
32
|
+
format: 'der',
|
|
33
|
+
type: 'pkcs8',
|
|
34
|
+
key: Buffer.concat([X25519_PKCS8_PREFIX, rawPrivateKey])
|
|
35
|
+
});
|
|
36
|
+
}
|
|
24
37
|
function exportRawPublicKey(publicKey) {
|
|
25
38
|
const jwk = publicKey.export({ format: 'jwk' });
|
|
26
39
|
if (typeof jwk.x !== 'string') {
|
|
@@ -63,4 +76,26 @@ export function sealSecret(mnemonic, recipientPublicKeyBase64) {
|
|
|
63
76
|
aesKey.fill(0);
|
|
64
77
|
}
|
|
65
78
|
}
|
|
79
|
+
/**
|
|
80
|
+
* Reverse of {@link sealSecret}: recover the mnemonic from a sealed box using the
|
|
81
|
+
* recipient's raw 32-byte X25519 private key (decrypted from the user's
|
|
82
|
+
* `encryptedPrivateKeyJson` with their encryption password). Throws if the box
|
|
83
|
+
* was sealed to a different key or has been tampered with (GCM auth failure).
|
|
84
|
+
*/
|
|
85
|
+
export function unsealSecret(sealed, recipientPrivateKey) {
|
|
86
|
+
const payload = JSON.parse(fromBase64(sealed.ciphertext).toString('utf8'));
|
|
87
|
+
const privateKey = createRawPrivateKey(Buffer.from(recipientPrivateKey));
|
|
88
|
+
const ephemeralPublicKey = createRawPublicKey(fromBase64(payload.ephemeralPublicKey));
|
|
89
|
+
const aesKey = deriveSharedAesKey(privateKey, ephemeralPublicKey);
|
|
90
|
+
try {
|
|
91
|
+
const decipher = createDecipheriv('aes-256-gcm', aesKey, fromBase64(payload.iv));
|
|
92
|
+
decipher.setAuthTag(fromBase64(payload.tag));
|
|
93
|
+
const decrypted = Buffer.concat([decipher.update(fromBase64(payload.ciphertext)), decipher.final()]);
|
|
94
|
+
const parsed = JSON.parse(decrypted.toString('utf8'));
|
|
95
|
+
return parsed.mnemonic;
|
|
96
|
+
}
|
|
97
|
+
finally {
|
|
98
|
+
aesKey.fill(0);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
66
101
|
//# sourceMappingURL=sealed-box.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sealed-box.js","sourceRoot":"","sources":["../../src/crypto/sealed-box.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,eAAe,EACf,aAAa,EACb,mBAAmB,EACnB,QAAQ,EACR,WAAW,EAEZ,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"sealed-box.js","sourceRoot":"","sources":["../../src/crypto/sealed-box.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,mBAAmB,EACnB,QAAQ,EACR,WAAW,EAEZ,MAAM,aAAa,CAAC;AAErB,iFAAiF;AACjF,oEAAoE;AACpE,MAAM,mBAAmB,GAAG,MAAM,CAAC,IAAI,CAAC,kCAAkC,EAAE,KAAK,CAAC,CAAC;AAgBnF,SAAS,WAAW,CAAC,GAAW;IAC9B,OAAO,GAAG,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;AACnC,CAAC;AAED,SAAS,aAAa,CAAC,KAAa;IAClC,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;AACzC,CAAC;AAED,SAAS,QAAQ,CAAC,GAAwB;IACxC,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,Q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C,QAAQ,CAAC,MAAM,CAAC,CAAyB,CAAC;QAC9E,OAAO,MAAM,CAAC,QAAQ,CAAC;IACzB,CAAC;YAAS,CAAC;QACT,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACjB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Password-encrypted X25519 private key as produced by the web client during
|
|
3
|
+
* encryption-key setup (`PUT /me/encryption-key`) and returned by `GET /me`. The
|
|
4
|
+
* server only ever stores this encrypted blob; the password never leaves the
|
|
5
|
+
* client, so the server cannot decrypt it.
|
|
6
|
+
*/
|
|
7
|
+
export interface EncryptedPrivateKeyJson {
|
|
8
|
+
version: number;
|
|
9
|
+
type: 'password-encrypted-x25519-private-key';
|
|
10
|
+
algorithm: string;
|
|
11
|
+
kdf: string;
|
|
12
|
+
salt: string;
|
|
13
|
+
iv: string;
|
|
14
|
+
tag: string;
|
|
15
|
+
ciphertext: string;
|
|
16
|
+
kdfParams: {
|
|
17
|
+
cost: number;
|
|
18
|
+
blockSize: number;
|
|
19
|
+
parallelization: number;
|
|
20
|
+
keyLength: number;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Decrypt the user's raw X25519 private key (32 bytes) from the
|
|
25
|
+
* `encryptedPrivateKeyJson` blob using their encryption password. Wire-compatible
|
|
26
|
+
* with the web client's scrypt + AES-256-GCM envelope (the plaintext is the
|
|
27
|
+
* base64-encoded private key). Throws {@link WrongPasswordError} on a bad
|
|
28
|
+
* password (GCM auth failure).
|
|
29
|
+
*/
|
|
30
|
+
export declare function decryptUserPrivateKey(encrypted: EncryptedPrivateKeyJson, password: string): Uint8Array;
|
|
31
|
+
//# sourceMappingURL=user-keys.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-keys.d.ts","sourceRoot":"","sources":["../../src/crypto/user-keys.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,uCAAuC,CAAC;IAC9C,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE;QACT,IAAI,EAAE,MAAM,CAAC;QACb,SAAS,EAAE,MAAM,CAAC;QAClB,eAAe,EAAE,MAAM,CAAC;QACxB,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;CACH;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,uBAAuB,EAAE,QAAQ,EAAE,MAAM,GAAG,UAAU,CA4BtG"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { createDecipheriv, scryptSync } from 'node:crypto';
|
|
2
|
+
import { WrongPasswordError } from '../errors.js';
|
|
3
|
+
/**
|
|
4
|
+
* Decrypt the user's raw X25519 private key (32 bytes) from the
|
|
5
|
+
* `encryptedPrivateKeyJson` blob using their encryption password. Wire-compatible
|
|
6
|
+
* with the web client's scrypt + AES-256-GCM envelope (the plaintext is the
|
|
7
|
+
* base64-encoded private key). Throws {@link WrongPasswordError} on a bad
|
|
8
|
+
* password (GCM auth failure).
|
|
9
|
+
*/
|
|
10
|
+
export function decryptUserPrivateKey(encrypted, password) {
|
|
11
|
+
if (!password || password.trim().length === 0) {
|
|
12
|
+
throw new WrongPasswordError('An encryption password is required to unlock your key.');
|
|
13
|
+
}
|
|
14
|
+
const salt = Buffer.from(encrypted.salt, 'base64');
|
|
15
|
+
const iv = Buffer.from(encrypted.iv, 'base64');
|
|
16
|
+
const tag = Buffer.from(encrypted.tag, 'base64');
|
|
17
|
+
const ciphertext = Buffer.from(encrypted.ciphertext, 'base64');
|
|
18
|
+
const key = scryptSync(password, salt, encrypted.kdfParams.keyLength, {
|
|
19
|
+
N: encrypted.kdfParams.cost,
|
|
20
|
+
r: encrypted.kdfParams.blockSize,
|
|
21
|
+
p: encrypted.kdfParams.parallelization
|
|
22
|
+
});
|
|
23
|
+
try {
|
|
24
|
+
const decipher = createDecipheriv('aes-256-gcm', key, iv);
|
|
25
|
+
decipher.setAuthTag(tag);
|
|
26
|
+
const plaintextBase64 = Buffer.concat([decipher.update(ciphertext), decipher.final()]).toString('utf8');
|
|
27
|
+
return new Uint8Array(Buffer.from(plaintextBase64, 'base64'));
|
|
28
|
+
}
|
|
29
|
+
catch (error) {
|
|
30
|
+
throw new WrongPasswordError('Incorrect encryption password. Use the password that unlocks your key (set during setup), not your account login password.', { cause: error });
|
|
31
|
+
}
|
|
32
|
+
finally {
|
|
33
|
+
key.fill(0);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=user-keys.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-keys.js","sourceRoot":"","sources":["../../src/crypto/user-keys.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAyBlD;;;;;;GAMG;AACH,MAAM,UAAU,qBAAqB,CAAC,SAAkC,EAAE,QAAgB;IACxF,IAAI,CAAC,QAAQ,IAAI,QAAQ,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC9C,MAAM,IAAI,kBAAkB,CAAC,wDAAwD,CAAC,CAAC;IACzF,CAAC;IAED,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IACnD,MAAM,EAAE,GAAG,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC;IAC/C,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;IACjD,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;IAC/D,MAAM,GAAG,GAAG,UAAU,CAAC,QAAQ,EAAE,IAAI,EAAE,SAAS,CAAC,SAAS,CAAC,SAAS,EAAE;QACpE,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,IAAI;QAC3B,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,SAAS;QAChC,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,eAAe;KACvC,CAAC,CAAC;IAEH,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,gBAAgB,CAAC,aAAa,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC;QAC1D,QAAQ,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;QACzB,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;QACxG,OAAO,IAAI,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,eAAe,EAAE,QAAQ,CAAC,CAAC,CAAC;IAChE,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,kBAAkB,CAC1B,4HAA4H,EAC5H,EAAE,KAAK,EAAE,KAAK,EAAE,CACjB,CAAC;IACJ,CAAC;YAAS,CAAC;QACT,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACd,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { GuvenoApiClient } from './api/client.js';
|
|
2
|
+
import { type SealedSecretJson } from './crypto/sealed-box.js';
|
|
3
|
+
/**
|
|
4
|
+
* In-memory unlock of the user's X25519 encryption key — the SDK equivalent of
|
|
5
|
+
* the web client's EncryptionSession. The server is the source of truth: the
|
|
6
|
+
* mnemonic lives there sealed to this key. To create or read a wallet secret the
|
|
7
|
+
* SDK fetches the user's key blob from `GET /me`, decrypts the private key with
|
|
8
|
+
* the encryption password (held only in memory), and seals/unseals locally.
|
|
9
|
+
*
|
|
10
|
+
* The password and decrypted private key never leave the process and never reach
|
|
11
|
+
* the server. Call {@link lock} when done to wipe the key from memory.
|
|
12
|
+
*/
|
|
13
|
+
export declare class EncryptionSession {
|
|
14
|
+
/** The user's X25519 public key (base64), used to seal new wallet secrets. */
|
|
15
|
+
readonly publicKey: string;
|
|
16
|
+
private privateKey;
|
|
17
|
+
private constructor();
|
|
18
|
+
/**
|
|
19
|
+
* Fetch the caller's encryption key via `GET /me` and decrypt its private key
|
|
20
|
+
* with the encryption password. Throws {@link EncryptionRequiredError} if the
|
|
21
|
+
* account has no encryption key yet (set one up in the Guveno dashboard first),
|
|
22
|
+
* or {@link WrongPasswordError} on a bad password.
|
|
23
|
+
*/
|
|
24
|
+
static unlock(api: GuvenoApiClient, encryptionPassword: string): Promise<EncryptionSession>;
|
|
25
|
+
/** Seal a mnemonic to the user's public key, ready to push to the server. */
|
|
26
|
+
seal(mnemonic: string): SealedSecretJson;
|
|
27
|
+
/** Unseal a wallet's `encryptedSecretJson` (from `GET /wallets/:id/secret`). */
|
|
28
|
+
unsealRecord(encryptedSecretJson: Record<string, unknown>): string;
|
|
29
|
+
/** Wipe the private key from memory. The session cannot be used afterwards. */
|
|
30
|
+
lock(): void;
|
|
31
|
+
private assertUnlocked;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=encryption-session.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"encryption-session.d.ts","sourceRoot":"","sources":["../src/encryption-session.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAA4B,KAAK,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAIzF;;;;;;;;;GASG;AACH,qBAAa,iBAAiB;IAC5B,8EAA8E;IAC9E,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,OAAO,CAAC,UAAU,CAAoB;IAEtC,OAAO;IAKP;;;;;OAKG;WACU,MAAM,CAAC,GAAG,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAiBjG,6EAA6E;IAC7E,IAAI,CAAC,QAAQ,EAAE,MAAM,GAAG,gBAAgB;IAKxC,gFAAgF;IAChF,YAAY,CAAC,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM;IAIlE,+EAA+E;IAC/E,IAAI,IAAI,IAAI;IAOZ,OAAO,CAAC,cAAc;CAMvB"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { sealSecret, unsealSecret } from './crypto/sealed-box.js';
|
|
2
|
+
import { decryptUserPrivateKey } from './crypto/user-keys.js';
|
|
3
|
+
import { EncryptionRequiredError, WalletSdkError } from './errors.js';
|
|
4
|
+
/**
|
|
5
|
+
* In-memory unlock of the user's X25519 encryption key — the SDK equivalent of
|
|
6
|
+
* the web client's EncryptionSession. The server is the source of truth: the
|
|
7
|
+
* mnemonic lives there sealed to this key. To create or read a wallet secret the
|
|
8
|
+
* SDK fetches the user's key blob from `GET /me`, decrypts the private key with
|
|
9
|
+
* the encryption password (held only in memory), and seals/unseals locally.
|
|
10
|
+
*
|
|
11
|
+
* The password and decrypted private key never leave the process and never reach
|
|
12
|
+
* the server. Call {@link lock} when done to wipe the key from memory.
|
|
13
|
+
*/
|
|
14
|
+
export class EncryptionSession {
|
|
15
|
+
/** The user's X25519 public key (base64), used to seal new wallet secrets. */
|
|
16
|
+
publicKey;
|
|
17
|
+
privateKey;
|
|
18
|
+
constructor(publicKey, privateKey) {
|
|
19
|
+
this.publicKey = publicKey;
|
|
20
|
+
this.privateKey = privateKey;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Fetch the caller's encryption key via `GET /me` and decrypt its private key
|
|
24
|
+
* with the encryption password. Throws {@link EncryptionRequiredError} if the
|
|
25
|
+
* account has no encryption key yet (set one up in the Guveno dashboard first),
|
|
26
|
+
* or {@link WrongPasswordError} on a bad password.
|
|
27
|
+
*/
|
|
28
|
+
static async unlock(api, encryptionPassword) {
|
|
29
|
+
const user = await api.getCurrentUser();
|
|
30
|
+
if (user.encryptionKey == null) {
|
|
31
|
+
throw new EncryptionRequiredError('This account has no encryption key. Set one up in the Guveno dashboard before using the SDK.');
|
|
32
|
+
}
|
|
33
|
+
const privateKey = decryptUserPrivateKey(user.encryptionKey.encryptedPrivateKeyJson, encryptionPassword);
|
|
34
|
+
return new EncryptionSession(user.encryptionKey.publicKey, privateKey);
|
|
35
|
+
}
|
|
36
|
+
/** Seal a mnemonic to the user's public key, ready to push to the server. */
|
|
37
|
+
seal(mnemonic) {
|
|
38
|
+
this.assertUnlocked();
|
|
39
|
+
return sealSecret(mnemonic, this.publicKey);
|
|
40
|
+
}
|
|
41
|
+
/** Unseal a wallet's `encryptedSecretJson` (from `GET /wallets/:id/secret`). */
|
|
42
|
+
unsealRecord(encryptedSecretJson) {
|
|
43
|
+
return unsealSecret(encryptedSecretJson, this.assertUnlocked());
|
|
44
|
+
}
|
|
45
|
+
/** Wipe the private key from memory. The session cannot be used afterwards. */
|
|
46
|
+
lock() {
|
|
47
|
+
if (this.privateKey != null) {
|
|
48
|
+
this.privateKey.fill(0);
|
|
49
|
+
this.privateKey = null;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
assertUnlocked() {
|
|
53
|
+
if (this.privateKey == null) {
|
|
54
|
+
throw new WalletSdkError('ENCRYPTION_REQUIRED', 'This encryption session has been locked.');
|
|
55
|
+
}
|
|
56
|
+
return this.privateKey;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=encryption-session.js.map
|
|
@@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AC;IACjG,CAAC;IAED,+EAA+E;IAC/E,IAAI;QACF,IAAI,IAAI,CAAC,UAAU,IAAI,IAAI,EAAE,CAAC;YAC5B,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YACxB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;QACzB,CAAC;IACH,CAAC;IAEO,cAAc;QACpB,IAAI,IAAI,CAAC,UAAU,IAAI,IAAI,EAAE,CAAC;YAC5B,MAAM,IAAI,cAAc,CAAC,qBAAqB,EAAE,0CAA0C,CAAC,CAAC;QAC9F,CAAC;QACD,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;CACF"}
|
package/dist/hot-wallet.d.ts
CHANGED
|
@@ -1,13 +1,23 @@
|
|
|
1
1
|
import type { GuvenoApiClient } from './api/client.js';
|
|
2
2
|
import type { ApiWithdrawal } from './api/types.js';
|
|
3
|
+
import type { EncryptionSession } from './encryption-session.js';
|
|
3
4
|
import type { KeyProvider } from './keyprovider/index.js';
|
|
4
5
|
import type { EthereumGasOverrides } from './signing/sign-ethereum.js';
|
|
5
6
|
import type { BitcoinOutput } from './signing/types.js';
|
|
6
7
|
export interface HotWalletOptions {
|
|
7
8
|
/** API client authenticated with an API key whose role is in WITHDRAWAL_ROLES (owner/admin/manager/signer). */
|
|
8
9
|
api: GuvenoApiClient;
|
|
9
|
-
/**
|
|
10
|
-
|
|
10
|
+
/**
|
|
11
|
+
* Source the recovery phrase from the server (sealed) and unseal it locally —
|
|
12
|
+
* the server-source-of-truth path. Mutually usable with `keys`; provide one.
|
|
13
|
+
*/
|
|
14
|
+
session?: EncryptionSession;
|
|
15
|
+
/**
|
|
16
|
+
* Alternative key source: resolve the mnemonic from a KMS/HSM-wrapped blob or a
|
|
17
|
+
* local file ({@link KeyProvider}) instead of the server. Use for headless
|
|
18
|
+
* signers that manage their own key material.
|
|
19
|
+
*/
|
|
20
|
+
keys?: KeyProvider;
|
|
11
21
|
}
|
|
12
22
|
export interface WithdrawInput {
|
|
13
23
|
addressId: number;
|
|
@@ -39,6 +49,7 @@ export interface WithdrawInput {
|
|
|
39
49
|
export declare class HotWallet {
|
|
40
50
|
private readonly api;
|
|
41
51
|
private readonly keys;
|
|
52
|
+
private readonly session;
|
|
42
53
|
private readonly addressContexts;
|
|
43
54
|
private readonly queues;
|
|
44
55
|
private fullyIndexed;
|
|
@@ -48,6 +59,12 @@ export declare class HotWallet {
|
|
|
48
59
|
/** Fetch the current state of a withdrawal (e.g. to poll for confirmation). */
|
|
49
60
|
getWithdrawal(withdrawalId: number): Promise<ApiWithdrawal>;
|
|
50
61
|
private runWithdraw;
|
|
62
|
+
/**
|
|
63
|
+
* Resolve the recovery phrase for a withdrawal: from the server (sealed, then
|
|
64
|
+
* unsealed via the encryption session) when in session mode, else from the
|
|
65
|
+
* configured key provider. Session mode needs the address's wallet id.
|
|
66
|
+
*/
|
|
67
|
+
private resolveMnemonic;
|
|
51
68
|
private resolveAddress;
|
|
52
69
|
private indexWallet;
|
|
53
70
|
private indexAllWallets;
|
package/dist/hot-wallet.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hot-wallet.d.ts","sourceRoot":"","sources":["../src/hot-wallet.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"hot-wallet.d.ts","sourceRoot":"","sources":["../src/hot-wallet.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAEjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAE1D,OAAO,KAAK,EAAE,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AAa,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;YAInD,WAAW;IAgDzB;;;;OAIG;YACW,eAAe;YAef,cAAc;YA6Bd,WAAW;YAsBX,eAAe;IAY7B,yFAAyF;IACzF,OAAO,CAAC,SAAS;CAYlB"}
|
package/dist/hot-wallet.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { randomUUID } from 'node:crypto';
|
|
2
|
-
import { NotFoundError, SigningError } from './errors.js';
|
|
2
|
+
import { NotFoundError, SigningError, ValidationError } from './errors.js';
|
|
3
3
|
import { fingerprintMnemonic } from './mnemonic.js';
|
|
4
4
|
import { canSignChain, signWithdrawal } from './signing/sign-withdrawal.js';
|
|
5
5
|
/**
|
|
@@ -12,12 +12,17 @@ import { canSignChain, signWithdrawal } from './signing/sign-withdrawal.js';
|
|
|
12
12
|
export class HotWallet {
|
|
13
13
|
api;
|
|
14
14
|
keys;
|
|
15
|
+
session;
|
|
15
16
|
addressContexts = new Map();
|
|
16
17
|
queues = new Map();
|
|
17
18
|
fullyIndexed = false;
|
|
18
19
|
constructor(options) {
|
|
20
|
+
if (options.keys == null && options.session == null) {
|
|
21
|
+
throw new ValidationError('A HotWallet needs either a `session` or a `keys` provider to source signing keys.');
|
|
22
|
+
}
|
|
19
23
|
this.api = options.api;
|
|
20
24
|
this.keys = options.keys;
|
|
25
|
+
this.session = options.session;
|
|
21
26
|
}
|
|
22
27
|
/** Prepare, sign, and broadcast a withdrawal. Resolves to the broadcast withdrawal record. */
|
|
23
28
|
async withdraw(input) {
|
|
@@ -44,7 +49,7 @@ export class HotWallet {
|
|
|
44
49
|
if (!canSignChain(signingPayload.chain)) {
|
|
45
50
|
throw new SigningError(`The hot wallet cannot sign ${signingPayload.chain} withdrawals.`);
|
|
46
51
|
}
|
|
47
|
-
let mnemonic = (await this.
|
|
52
|
+
let mnemonic = (await this.resolveMnemonic(context, input)).trim();
|
|
48
53
|
try {
|
|
49
54
|
const actual = fingerprintMnemonic(mnemonic);
|
|
50
55
|
if (actual !== context.keyFingerprint) {
|
|
@@ -67,11 +72,28 @@ export class HotWallet {
|
|
|
67
72
|
mnemonic = '';
|
|
68
73
|
}
|
|
69
74
|
}
|
|
75
|
+
/**
|
|
76
|
+
* Resolve the recovery phrase for a withdrawal: from the server (sealed, then
|
|
77
|
+
* unsealed via the encryption session) when in session mode, else from the
|
|
78
|
+
* configured key provider. Session mode needs the address's wallet id.
|
|
79
|
+
*/
|
|
80
|
+
async resolveMnemonic(context, input) {
|
|
81
|
+
if (this.keys != null) {
|
|
82
|
+
return this.keys.getMnemonic(context.keyFingerprint);
|
|
83
|
+
}
|
|
84
|
+
const walletId = context.walletId ?? input.walletId;
|
|
85
|
+
if (walletId == null) {
|
|
86
|
+
throw new SigningError('Session-mode withdrawals need the source address’s wallet id; pass `walletId` to withdraw().');
|
|
87
|
+
}
|
|
88
|
+
const secret = await this.api.getWalletKeySecret(walletId);
|
|
89
|
+
return this.session.unsealRecord(secret.encryptedSecretJson);
|
|
90
|
+
}
|
|
70
91
|
async resolveAddress(input) {
|
|
71
92
|
if (input.derivationPath != null && input.keyFingerprint != null) {
|
|
72
93
|
const context = {
|
|
73
94
|
derivationPath: input.derivationPath,
|
|
74
|
-
keyFingerprint: input.keyFingerprint
|
|
95
|
+
keyFingerprint: input.keyFingerprint,
|
|
96
|
+
...(input.walletId != null ? { walletId: input.walletId } : {})
|
|
75
97
|
};
|
|
76
98
|
this.addressContexts.set(input.addressId, context);
|
|
77
99
|
return context;
|
|
@@ -105,6 +127,7 @@ export class HotWallet {
|
|
|
105
127
|
this.addressContexts.set(address.id, {
|
|
106
128
|
derivationPath: address.derivationPath,
|
|
107
129
|
keyFingerprint,
|
|
130
|
+
walletId,
|
|
108
131
|
chain: address.chain
|
|
109
132
|
});
|
|
110
133
|
}
|
package/dist/hot-wallet.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hot-wallet.js","sourceRoot":"","sources":["../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AC,CAAC,CAAC;QACH,OAAO,GAAG,CAAC;IACb,CAAC;CACF"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
export { GuvenoApiClient } from './api/client.js';
|
|
2
2
|
export { WEBHOOK_EVENT_TYPES } from './api/types.js';
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
3
|
+
export { FileSystemConfigStore, init, loadConfig, createClientFromConfig } from './config/file-store.js';
|
|
4
|
+
export type { GuvenoConfig } from './config/file-store.js';
|
|
5
|
+
export { WalletService } from './wallet-service.js';
|
|
6
|
+
export type { CreateWalletOptions, CreateWalletResult, DeriveAddressOptions, DeriveAddressResult, ImportWalletOptions, WalletServiceOptions } from './wallet-service.js';
|
|
7
|
+
export { EncryptionSession } from './encryption-session.js';
|
|
8
|
+
export { sealSecret, unsealSecret } from './crypto/sealed-box.js';
|
|
9
|
+
export type { SealedSecretJson } from './crypto/sealed-box.js';
|
|
10
|
+
export { decryptUserPrivateKey } from './crypto/user-keys.js';
|
|
11
|
+
export type { EncryptedPrivateKeyJson } from './crypto/user-keys.js';
|
|
8
12
|
export { DEFAULT_CHAIN, CHAIN_DEFINITIONS, POLKADOT_SS58_FORMAT, SUPPORTED_CHAINS, SUPPORTED_NETWORKS } from './chains.js';
|
|
9
|
-
export { DEFAULT_API_BASE_URL, DEFAULT_API_BASE_URL_ENV_VAR } from './constants.js';
|
|
13
|
+
export { DEFAULT_API_BASE_URL, DEFAULT_API_BASE_URL_ENV_VAR, DEFAULT_API_KEY_ENV_VAR, resolveStorageDir } from './constants.js';
|
|
10
14
|
export { buildDerivationPath, deriveAddress, deriveBitcoinAddress, deriveEthereumAddress, derivePolkadotAddress, deriveXrpAddress } from './derivation.js';
|
|
11
15
|
export { assertValidMnemonic, fingerprintMnemonic, generateRandomMnemonic, getMnemonicWordCount, normalizeMnemonic } from './mnemonic.js';
|
|
12
16
|
export { HotWallet } from './hot-wallet.js';
|
|
@@ -24,6 +28,6 @@ export type { MnemonicMap } from './keyprovider/file-provider.js';
|
|
|
24
28
|
export type { SignWithdrawalInput } from './signing/sign-withdrawal.js';
|
|
25
29
|
export type { EthereumGasOverrides } from './signing/sign-ethereum.js';
|
|
26
30
|
export type { BitcoinChainState, BitcoinOutput, ChainState, EthereumChainState, PolkadotChainState, SigningAsset, SigningPayload, XrpChainState } from './signing/types.js';
|
|
27
|
-
export type {
|
|
28
|
-
export type {
|
|
31
|
+
export type { MnemonicWordCount, SupportedChain, SupportedNetwork, WalletRecordAddressExport } from './types.js';
|
|
32
|
+
export type { ApiChain, ApiClientOptions, ApiCompanyMembership, ApiCompanyRole, ApiKeyAccess, ApiKeySummary, ApiNetwork, ApiPageInfo, ApiRecordStatus, ApiUser, ApiUserEncryptionKey, ApiWalletAddress, ApiWalletDetail, ApiWalletKeySecret, ApiWalletSummary, ApiWalletType, ApiWebhook, ApiWebhookDelivery, ApiWebhookDeliveryStatus, ApiWebhookEventType, ApiWebhookType, ApiWebhookWithSecret, ApiWithdrawal, ApiWithdrawalStatus, BroadcastWithdrawalInput, CreateApiWalletInput, CreateApiWebhookInput, ListApiAddressOptions, ListApiWalletOptions, ListApiWebhookDeliveryOptions, ListApiWithdrawalOptions, PrepareWithdrawalInput, PrepareWithdrawalResult, UpdateApiWalletInput, ApiClientOptions as ApiClientConfig, ApiUser as AuthenticatedApiUser, ApiWalletDetail as RemoteWalletDetail, ApiWalletSummary as RemoteWalletSummary, CreateApiWalletInput as CreateRemoteWalletInput, UpdateApiWalletInput as UpdateRemoteWalletInput } from './api/types.js';
|
|
29
33
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,mBAAm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EACR,gBAAgB,EAChB,oBAAoB,EACpB,cAAc,EACd,YAAY,EACZ,aAAa,EACb,UAAU,EACV,WAAW,EACX,eAAe,EACf,OAAO,EACP,oBAAoB,EACpB,gBAAgB,EAChB,eAAe,EACf,kBAAkB,EAClB,gBAAgB,EAChB,aAAa,EACb,UAAU,EACV,kBAAkB,EAClB,wBAAwB,EACxB,mBAAmB,EACnB,cAAc,EACd,oBAAoB,EACpB,aAAa,EACb,mBAAmB,EACnB,wBAAwB,EACxB,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,EACrB,oBAAoB,EACpB,6BAA6B,EAC7B,wBAAwB,EACxB,sBAAsB,EACtB,uBAAuB,EACvB,oBAAoB,EACpB,gBAAgB,IAAI,eAAe,EACnC,OAAO,IAAI,oBAAoB,EAC/B,eAAe,IAAI,kBAAkB,EACrC,gBAAgB,IAAI,mBAAmB,EACvC,oBAAoB,IAAI,uBAAuB,EAC/C,oBAAoB,IAAI,uBAAuB,EAChD,MAAM,gBAAgB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export { GuvenoApiClient } from './api/client.js';
|
|
2
2
|
export { WEBHOOK_EVENT_TYPES } from './api/types.js';
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
3
|
+
export { FileSystemConfigStore, init, loadConfig, createClientFromConfig } from './config/file-store.js';
|
|
4
|
+
export { WalletService } from './wallet-service.js';
|
|
5
|
+
export { EncryptionSession } from './encryption-session.js';
|
|
6
|
+
export { sealSecret, unsealSecret } from './crypto/sealed-box.js';
|
|
7
|
+
export { decryptUserPrivateKey } from './crypto/user-keys.js';
|
|
8
8
|
export { DEFAULT_CHAIN, CHAIN_DEFINITIONS, POLKADOT_SS58_FORMAT, SUPPORTED_CHAINS, SUPPORTED_NETWORKS } from './chains.js';
|
|
9
|
-
export { DEFAULT_API_BASE_URL, DEFAULT_API_BASE_URL_ENV_VAR } from './constants.js';
|
|
9
|
+
export { DEFAULT_API_BASE_URL, DEFAULT_API_BASE_URL_ENV_VAR, DEFAULT_API_KEY_ENV_VAR, resolveStorageDir } from './constants.js';
|
|
10
10
|
export { buildDerivationPath, deriveAddress, deriveBitcoinAddress, deriveEthereumAddress, derivePolkadotAddress, deriveXrpAddress } from './derivation.js';
|
|
11
11
|
export { assertValidMnemonic, fingerprintMnemonic, generateRandomMnemonic, getMnemonicWordCount, normalizeMnemonic } from './mnemonic.js';
|
|
12
12
|
export { HotWallet } from './hot-wallet.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EACL,qBAAqB,EACrB,IAAI,EACJ,UAAU,EACV,sBAAsB,EACvB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AASpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAElE,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,oBAAoB,EACpB,gBAAgB,EAChB,kBAAkB,EACnB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,oBAAoB,EACpB,4BAA4B,EAC5B,uBAAuB,EACvB,iBAA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