abstract class Wallet {\r
#accounts: Account[]\r
#id: Entropy\r
+ #locked: boolean = true\r
#mnemonic: Bip39Mnemonic | null\r
#safe: Safe\r
#seed: string | null\r
- get id () {\r
- return this.#id.hex\r
- }\r
+ get id () { return this.#id.hex }\r
+ get isLocked () { return this.#locked }\r
+ get isUnlocked () { return !this.#locked }\r
get mnemonic () {\r
if (this.#mnemonic instanceof Bip39Mnemonic) {\r
return this.#mnemonic.phrase\r
} catch (err) {\r
throw new Error('Failed to lock wallet')\r
}\r
+ this.#locked = true\r
this.#mnemonic = null\r
this.#seed = null\r
return true\r
if (seed != null) {\r
this.#seed = seed\r
}\r
+ this.#locked = false\r
} catch (err) {\r
throw new Error('Failed to unlock wallet')\r
}\r