/**\r
* Derives BIP-44 Nano account private keys.\r
*\r
- * @param {number} from - Start index of private keys. Default: 0\r
- * @param {number} to - End index of private keys. Default: `from`\r
- * @returns {Promise<Account[]>}\r
+ * @param {number} index - Index of the account\r
+ * @returns {Promise<Account>}\r
*/\r
async ckd (index: number): Promise<Account> {\r
const key = await nanoCKD(this.seed, index)\r
/**\r
* Derives BLAKE2b account private keys.\r
*\r
- * @param {number} from - Start index of private keys. Default: 0\r
- * @param {number} to - End index of private keys. Default: `from`\r
+ * @param {number} index - Index of the account\r
+ * @returns {Promise<Account>}\r
*/\r
async ckd (index: number): Promise<Account> {\r
const hash = await Tools.blake2b([this.seed, dec.toHex(index, 4)])\r
return new this(l)\r
}\r
\r
+ /**\r
+ * Gets the public key for an account from the Ledger device.\r
+ *\r
+ * @param {number} index - Index of the account\r
+ * @returns {Promise<Account>}\r
+ */\r
async ckd (index: number): Promise<Account | null> {\r
const { status, publicKey } = await this.ledger.account(index)\r
if (status === 'OK' && publicKey != null) {\r
return null\r
}\r
\r
+ /**\r
+ * Attempts to close the current process on the Ledger device.\r
+ *\r
+ * Overrides the default wallet `lock()` method since as a hardware wallet it\r
+ * does not need to be encrypted by software.\r
+ *\r
+ * @returns True if successfully locked\r
+ */\r
async lock (): Promise<boolean> {\r
if (this.#ledger == null) {\r
return false\r
return result === 'OK'\r
}\r
\r
+ /**\r
+ * Attempts to connect to the Ledger device.\r
+ *\r
+ * Overrides the default wallet `unlock()` method since as a hardware wallet it\r
+ * does not need to be encrypted by software.\r
+ *\r
+ * @returns True if successfully unlocked\r
+ */\r
async unlock (): Promise<boolean> {\r
if (this.#ledger == null) {\r
return false\r