]> git.codecow.com Git - libnemo.git/commitdiff
Update type definitions.
authorChris Duncan <chris@zoso.dev>
Wed, 3 Sep 2025 16:41:53 +0000 (09:41 -0700)
committerChris Duncan <chris@zoso.dev>
Wed, 3 Sep 2025 16:41:53 +0000 (09:41 -0700)
src/types.d.ts

index be64a935cfca3e7f7dc12cb7576fdbd83218f631..995d0afd244897518b5a9dabd85b348bf17e35ff 100644 (file)
@@ -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<ArrayBuffer>
+       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<ArrayBuffer>, salt?: Uint8Array<ArrayBuffer>, personal?: Uint8Array<ArrayBuffer>)
        update (input: ArrayBuffer | Uint8Array): Blake2b
        digest (): Uint8Array<ArrayBuffer>
-       digest (out: 'hex'): string
-       digest (out: 'binary' | Uint8Array<ArrayBuffer>): Uint8Array<ArrayBuffer>
 }
 
 /**
@@ -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<NamedData[]>
        /**