* allow garbage collection.\r
*/\r
async destroy (): Promise<void> {\r
- await SafeWorker.request({\r
- method: 'destroy',\r
- store: 'Account',\r
- [this.publicKey]: this.publicKey\r
- })\r
this.#frontier = undefined\r
this.#balance = undefined\r
this.#receivable = undefined\r
this.#representative = undefined\r
this.#weight = undefined\r
+ try {\r
+ await SafeWorker.request<boolean>({\r
+ method: 'destroy',\r
+ store: 'Account',\r
+ [this.publicKey]: this.publicKey\r
+ })\r
+ } catch (err) {\r
+ console.error(err)\r
+ throw new Error('failed to destroy account', { cause: err })\r
+ }\r
}\r
\r
/**\r
*/\r
async destroy (): Promise<void> {\r
try {\r
- for (const a in this.#accounts) {\r
- await this.#accounts[a].destroy()\r
- delete this.#accounts[a]\r
- }\r
this.#m?.destroy()\r
bytes.erase(this.#s)\r
this.#m = undefined\r
this.#s = undefined\r
+ for (const a in this.#accounts) {\r
+ this.#accounts[a].destroy()\r
+ delete this.#accounts[a]\r
+ }\r
await SafeWorker.request<boolean>({\r
store: 'Wallet',\r
method: 'destroy',\r