From: Chris Duncan Date: Tue, 19 Nov 2024 07:03:21 +0000 (-0800) Subject: In Wallet class, greatly expand on accounts method documentation. X-Git-Tag: v0.0.20~7 X-Git-Url: https://zoso.dev/?a=commitdiff_plain;h=dc928a353511a5de7e29f687fe49dded5f0d86e3;p=libnemo.git In Wallet class, greatly expand on accounts method documentation. --- diff --git a/src/lib/wallet.ts b/src/lib/wallet.ts index ae3bea2..4379496 100644 --- a/src/lib/wallet.ts +++ b/src/lib/wallet.ts @@ -59,6 +59,17 @@ abstract class Wallet { /** * Retrieves accounts from a wallet using its child key derivation function. + * Defaults to the first account at index 0. + * + * Note: The wallet index of a given requested account might not correlate with + * its index in the returned array. + * + * For example, calling `await wallet.accounts(5)` will return the sixth + * account of the wallet in the first array element position at index 0. + * + * A shorthand way of getting one specific account could be + * `const account = (await wallet.accounts(N))[0]` where N is the wallet index + * of the desired account. * * @param {number} from - Start index of secret keys. Default: 0 * @param {number} to - End index of secret keys. Default: `from`