* Retrieves an account from a wallet using its child key derivation function.\r
* Defaults to the first account at index 0.\r
*\r
+ * The returned object will have keys corresponding with the requested range\r
+ * of account indexes. The value of each key will be the Account derived for\r
+ * that index in the wallet.\r
+ *\r
* ```\r
- * console.log(await wallet.account(5))\r
- * // outputs sixth account of the wallet\r
- * // {\r
- * // privateKey: <...>,\r
- * // index: 5\r
- * // }\r
+ * const account = await wallet.account(1)\r
+ * // outputs the second account of the wallet\r
+ * console.log(account)\r
+ * // { address: <...>, publicKey: <...>, index: 1, <etc...> }\r
* ```\r
*\r
- * @param {number} index - Wallet index of secret key. Default: 0\r
- * @returns {Account} Account derived at the specified wallet index\r
+ * @param {number} index - Wallet index of account. Default: 0\r
+ * @returns Promise for the Account at the specified index\r
*/\r
async account (index: number = 0): Promise<Account> {\r
return (await this.accounts(index))[index]\r
* that index in the wallet.\r
*\r
* ```\r
- * console.log(await wallet.accounts(5))\r
- * // outputs sixth account of the wallet\r
+ * const accounts = await wallet.accounts(0, 1))\r
+ * // outputs the first and second account of the wallet\r
+ * console.log(accounts)\r
* // {\r
- * // 5: {\r
- * // privateKey: <...>,\r
- * // index: 5\r
- * // }\r
+ * // 0: {\r
+ * // address: <...>,\r
+ * // publicKey: <...>,\r
+ * // index: 0,\r
+ * // <etc...>\r
+ * // },\r
+ * // 1: {\r
+ * // address: <...>,\r
+ * // publicKey: <...>,\r
+ * // index: 1,\r
+ * // <etc...>\r
+ * // }\r
* // }\r
+ * // individual accounts can be referenced using array index notation\r
+ * console.log(accounts[1])\r
+ * // { address: <...>, publicKey: <...>, index: 1, <etc...> }\r
* ```\r
*\r
- * @param {number} from - Start index of secret keys. Default: 0\r
- * @param {number} to - End index of secret keys. Default: `from`\r
- * @returns {AccountList} Object with keys of account indexes and values of the corresponding Accounts\r
+ * If `from` is greater than `to`, their values will be swapped.\r
+ * @param {number} from - Start index of accounts. Default: 0\r
+ * @param {number} to - End index of accounts. Default: `from`\r
+ * @returns {AccountList} Promise for a list of Accounts at the specified indexes\r
*/\r
async accounts (from: number = 0, to: number = from): Promise<AccountList> {\r
if (from > to) [from, to] = [to, from]\r
get status (): DeviceStatus { return this.#status }\r
\r
/**\r
- * Gets the public key for an account from the Ledger device.\r
+ * Gets the index and public key for an account from the Ledger device.\r
*\r
- * @param {number[]} indexes - Indexes of the accounts\r
- * @returns {Promise<Account>}\r
+ * @param {number} index - Wallet index of the account\r
+ * @returns Promise for the Account at the index specified\r
*/\r
async account (index: number): Promise<Account> {\r
const { status, publicKey } = await Ledger.#account(index)\r
}\r
\r
/**\r
- * Retrieves accounts from a wallet using its child key derivation function.\r
+ * Retrieves accounts from a Ledger wallet using its internal secure software.\r
* Defaults to the first account at index 0.\r
*\r
* The returned object will have keys corresponding with the requested range\r
*\r
* ```\r
* const accounts = await wallet.accounts(0, 1))\r
- *\r
* // outputs the first and second account of the wallet\r
* console.log(accounts)\r
- * // { 0: { privateKey: <...>, index: 0 }, 1: { privateKey: <...>, index: 1 } }\r
- *\r
+ * // {\r
+ * // 0: {\r
+ * // address: <...>,\r
+ * // publicKey: <...>,\r
+ * // index: 0,\r
+ * // <etc...>\r
+ * // },\r
+ * // 1: {\r
+ * // address: <...>,\r
+ * // publicKey: <...>,\r
+ * // index: 1,\r
+ * // <etc...>\r
+ * // }\r
+ * // }\r
* // individual accounts can be referenced using array index notation\r
* console.log(accounts[1])\r
- * // { privateKey: <...>, index: 1 }\r
+ * // { address: <...>, publicKey: <...>, index: 1, <etc...> }\r
* ```\r
*\r
* If `from` is greater than `to`, their values will be swapped.\r
- * @param {number} from - Start index of secret keys. Default: 0\r
- * @param {number} to - End index of secret keys. Default: `from`\r
- * @returns {AccountList} Object with keys of account indexes and values of the corresponding Accounts\r
+ * @param {number} from - Start index of accounts. Default: 0\r
+ * @param {number} to - End index of accounts. Default: `from`\r
+ * @returns {AccountList} Promise for a list of Accounts at the specified indexes\r
*/\r
async accounts (from: number = 0, to: number = from): Promise<AccountList> {\r
if (from > to) [from, to] = [to, from]\r