*\r
* @param {string} seed - Hexadecimal seed derived from mnemonic phrase\r
* @param {number} index - Account number between 0 and 2^31-1\r
-* @returns Private child key for the account\r
+* @returns {Promise<string>} Private child key for the account\r
*/\r
export async function nanoCKD (seed: string, index: number): Promise<string> {\r
if (!Number.isSafeInteger(index) || index < 0 || index > 0x7fffffff) {\r
* used to generate the mnemonic phrase.\r
*\r
* @param {Entropy} entropy - Cryptographically strong pseudorandom data of length N bits\r
- * @returns First N/32 bits of the hash as a hexadecimal string\r
+ * @returns {Promise<string>} First N/32 bits of the hash as a hexadecimal string\r
*/\r
static async checksum (entropy: Entropy): Promise<string> {\r
const hashBuffer = await subtle.digest('SHA-256', entropy.bytes)\r
/**
* 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 {
* @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<boolean>} True if the signature was used to sign the data, else false
*/
async verify (name: string, signature: string, ...data: string[]): Promise<boolean> {
const Tools = await import('./tools.js')
*
* @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<any>} JSON-formatted RPC results from the node
*/
async call (action: string, data?: { [key: string]: any }): Promise<any> {
this.#validate(action)
* @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<boolean>} 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<boolean> {
const data = hash(input)