Skip to content

Commit

Permalink
Add doc comment for setHdPath
Browse files Browse the repository at this point in the history
  • Loading branch information
danjm committed Nov 9, 2021
1 parent a1fa38f commit 34c087e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,17 @@ class TrezorKeyring extends EventEmitter {
this.paths = {};
}

/**
* Sets the hdPath property to the passed param, if it is an explicitly supported hdPath.
* If the passed param is equal to the current hdPath, then this method has no effect. If it
* is different, the hdPath is updated, and the hdk, accounts, page and perPage properties are
* reset.
*
* If the passed hdPath is not explicitly supported, an error is thrown.
*
* @param {string} hdPath
* @returns undefined
*/
setHdPath(hdPath) {
if (!ALLOWED_HD_PATHS[hdPath]) {
throw new Error(
Expand Down

0 comments on commit 34c087e

Please sign in to comment.