From: Chris Duncan Date: Wed, 4 Dec 2024 07:08:04 +0000 (-0800) Subject: Update JSDoc. X-Git-Url: https://zoso.dev/?a=commitdiff_plain;h=8da659fcf5eba9bb8bc41f055f8ff4a4c4e97008;p=libnemo.git Update JSDoc. --- diff --git a/src/lib/bip32-key-derivation.ts b/src/lib/bip32-key-derivation.ts index 3bff28a..f9014f9 100644 --- a/src/lib/bip32-key-derivation.ts +++ b/src/lib/bip32-key-derivation.ts @@ -15,7 +15,7 @@ type ExtendedKey = { * * @param {string} seed - Hexadecimal seed derived from mnemonic phrase * @param {number} index - Account number between 0 and 2^31-1 -* @returns Private child key for the account +* @returns {Promise} Private child key for the account */ export async function nanoCKD (seed: string, index: number): Promise { if (!Number.isSafeInteger(index) || index < 0 || index > 0x7fffffff) { diff --git a/src/lib/bip39-mnemonic.ts b/src/lib/bip39-mnemonic.ts index 4ae0b6d..cae009d 100644 --- a/src/lib/bip39-mnemonic.ts +++ b/src/lib/bip39-mnemonic.ts @@ -75,7 +75,7 @@ export class Bip39Mnemonic { * used to generate the mnemonic phrase. * * @param {Entropy} entropy - Cryptographically strong pseudorandom data of length N bits - * @returns First N/32 bits of the hash as a hexadecimal string + * @returns {Promise} First N/32 bits of the hash as a hexadecimal string */ static async checksum (entropy: Entropy): Promise { const hashBuffer = await subtle.digest('SHA-256', entropy.bytes) diff --git a/src/lib/block.ts b/src/lib/block.ts index 691ec1f..36dda5a 100644 --- a/src/lib/block.ts +++ b/src/lib/block.ts @@ -42,7 +42,7 @@ abstract class Block { /** * Converts the block to JSON format as expected by the `process` RPC. * - * @returns JSON representation of the block + * @returns {string} JSON representation of the block */ json (): { [key: string]: string } { return { diff --git a/src/lib/rolodex.ts b/src/lib/rolodex.ts index b32fc1b..0587dd6 100644 --- a/src/lib/rolodex.ts +++ b/src/lib/rolodex.ts @@ -91,7 +91,7 @@ export class Rolodex { * @param {string} name - Alias to look up * @param {string} signature - Signature to use for verification * @param {...string} data - Signed data to verify - * @returns {boolean} True if the signature was used to sign the data, else false + * @returns {Promise} True if the signature was used to sign the data, else false */ async verify (name: string, signature: string, ...data: string[]): Promise { const Tools = await import('./tools.js') diff --git a/src/lib/rpc.ts b/src/lib/rpc.ts index cf88263..0e28d59 100644 --- a/src/lib/rpc.ts +++ b/src/lib/rpc.ts @@ -22,7 +22,7 @@ export class Rpc { * * @param {string} action - Nano protocol RPC call to execute * @param {object} [data] - JSON to send to the node as defined by the action - * @returns JSON-formatted RPC results from the node + * @returns {Promise} JSON-formatted RPC results from the node */ async call (action: string, data?: { [key: string]: any }): Promise { this.#validate(action) diff --git a/src/lib/tools.ts b/src/lib/tools.ts index 48cd6e6..cff52bf 100644 --- a/src/lib/tools.ts +++ b/src/lib/tools.ts @@ -149,7 +149,7 @@ export async function sweep (rpc: Rpc | string | URL, wallet: Blake2bWallet | Bi * @param {string} key - Hexadecimal-formatted public key to use for verification * @param {string} signature - Hexadcimal-formatted signature * @param {...string} input - Data to be verified -* @returns {boolean} True if the data was signed by the public key's matching private key +* @returns {Promise} True if the data was signed by the public key's matching private key */ export async function verify (key: string, signature: string, ...input: string[]): Promise { const data = hash(input)