From dc928a353511a5de7e29f687fe49dded5f0d86e3 Mon Sep 17 00:00:00 2001 From: Chris Duncan Date: Mon, 18 Nov 2024 23:03:21 -0800 Subject: [PATCH] In Wallet class, greatly expand on accounts method documentation. --- src/lib/wallet.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) 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` -- 2.34.1