Meta and refactor

This commit is contained in:
2026-08-20 11:06:35 +02:00
parent 8bdae4ceb8
commit 9c448049bc
6 changed files with 50 additions and 37 deletions
+17 -8
View File
@@ -44,6 +44,14 @@ export default class Enclave<P = Page> {
return this.accounts?.accounts[this.accounts.activeAccount] || null;
}
public getClientSecretKey() {
if (!this.accounts) return null;
const account = this.getAccount();
return account ? base58.decode(account.privateKey) : null;
}
public sendMessage(content: string, channelId: string) {
const clientSecretKey = this.getClientSecretKey();
@@ -104,6 +112,15 @@ export default class Enclave<P = Page> {
return;
}
const account = this.getAccount();
if (!account) {
console.error("Failed to get account");
return;
}
this.server.websocket?.send({ method: "Meta", ...account.meta });
const metaResponse = await axios.get(
getHTTPUrl(hostname, isSecure, "/meta"),
);
@@ -118,12 +135,4 @@ export default class Enclave<P = Page> {
this.forceRender();
}
public getClientSecretKey() {
if (!this.accounts) return null;
const account = this.getAccount();
return account ? base58.decode(account.privateKey) : null;
}
}