if (typeof password === 'string') {\r
password = utf8.toBytes(password)\r
}\r
+ if (password == null || password.constructor.name !== 'Uint8Array') {\r
+ throw new Error('Failed to unlock wallet')\r
+ }\r
try {\r
if (this.#prv != null) {\r
await Account.#poolSafe.assign({\r
if (typeof password === 'string') {\r
password = utf8.toBytes(password)\r
}\r
+ if (password == null || password.constructor.name !== 'Uint8Array') {\r
+ throw new Error('Failed to unlock wallet')\r
+ }\r
try {\r
this.#prv = await Account.#poolSafe.assign({\r
method: 'get',\r
if (typeof password === 'string') {\r
password = utf8.toBytes(password)\r
}\r
+ if (password == null || password.constructor.name !== 'Uint8Array') {\r
+ throw new Error('Failed to unlock wallet')\r
+ }\r
let success = true\r
try {\r
const data: { id: string, mnemonic: string | null, seed: string | null } = {\r
if (typeof password === 'string') {\r
password = utf8.toBytes(password)\r
}\r
+ if (password == null || password.constructor.name !== 'Uint8Array') {\r
+ throw new Error('Failed to unlock wallet')\r
+ }\r
try {\r
const data = await this.#poolSafe.assign({\r
method: 'get',\r