}\r
\r
/**\r
- * Unlocks the account using the same password as used prior to lock it.\r
+ * Retrieves and decryptes the private key of the Account. The same password\r
+ * used to lock it must be used to unlock it.\r
*\r
- * @param {(string|Uint8Array)} password Used previously to lock the account\r
- * @returns True if successfully unlocked\r
+ * @param {(string|Uint8Array)} password Used previously to lock the Account\r
+ * @returns Private key bytes as a Uint8Array\r
*/\r
async exportPrivateKey (password: string | Uint8Array<ArrayBuffer>): Promise<Uint8Array<ArrayBuffer>>\r
+ /**\r
+ * Retrieves and decryptes the private key of the Account. The same password\r
+ * used to lock it must be used to unlock it.\r
+ *\r
+ * @param {(string|Uint8Array)} password Used previously to lock the Account\r
+ * @returns Private key bytes as a hexadecimal string\r
+ */\r
async exportPrivateKey (password: string | Uint8Array<ArrayBuffer>, format: 'hex'): Promise<string>\r
async exportPrivateKey (password: string | Uint8Array<ArrayBuffer>, format?: 'hex'): Promise<string | Uint8Array<ArrayBuffer>> {\r
if (typeof password === 'string') password = utf8.toBytes(password)\r
}\r
try {\r
const headers = {\r
- store: 'Account',\r
method: 'get',\r
+ store: 'Account',\r
name: this.publicKey,\r
password: password.buffer\r
}\r