From c9af47b1a6d8bf5664c9417971bfca6f9d5905e4 Mon Sep 17 00:00:00 2001 From: Chris Duncan Date: Wed, 3 Sep 2025 09:41:53 -0700 Subject: [PATCH] Update type definitions. --- src/types.d.ts | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/src/types.d.ts b/src/types.d.ts index be64a93..995d0af 100644 --- a/src/types.d.ts +++ b/src/types.d.ts @@ -231,6 +231,28 @@ export declare class Bip39 { export declare class Blake2b { #private /** + * Derives account private keys from a wallet seed using the BLAKE2b hashing + * algorithm. + * + * Separately, account public keys are derived from the private key using the + * Ed25519 key algorithm, and account addresses are derived from the public key + * as described in the Nano documentation. + * https://docs.nano.org/integration-guides/the-basics/ + * + * @param {ArrayBuffer} seed - 32-byte secret seed of the wallet + * @param {number} index - 4-byte index of account to derive + * @returns {ArrayBuffer} Private key for the account + */ + static ckd (seed: ArrayBuffer, index: number): Promise + static get OUTBYTES_MIN (): 1 + static get OUTBYTES_MAX (): 64 + static get KEYBYTES_MIN (): 1 + static get KEYBYTES_MAX (): 64 + static get SALTBYTES (): 16 + static get PERSONALBYTES (): 16 + static get IV (): bigint[] + static get SIGMA (): number[][] + /** * Creates a BLAKE2b hashing context. * * @param {number} length - Output length between 1-64 bytes @@ -241,8 +263,6 @@ export declare class Blake2b { constructor (length: number, key?: Uint8Array, salt?: Uint8Array, personal?: Uint8Array) update (input: ArrayBuffer | Uint8Array): Blake2b digest (): Uint8Array - digest (out: 'hex'): string - digest (out: 'binary' | Uint8Array): Uint8Array } /** @@ -550,9 +570,10 @@ export declare class Wallet { #private static get DB_NAME (): 'Wallet' /** - * Retrieves all encrypted wallets from the database. + * Retrieves all wallets with encrypted secrets and unencrypted metadata from + * the database. * - * @returns Array of wallets with encrypted secrets and unencrypted metadata + * @returns id, type, iv, salt, encrypted */ static backup (): Promise /** -- 2.47.3