import {LitElement, html} from './lit-all.min.js';
import * as tfrpc from '/static/tfrpc.js';
class TfIdentityManagerElement extends LitElement {
static get properties() {
return {
ids: {type: Array},
};
}
constructor() {
super();
this.ids = [];
this.load();
}
async load() {
this.ids = await tfrpc.rpc.getIdentities();
}
async exportIdentity(id) {
alert('Your private key is:\n' + (await tfrpc.rpc.getPrivateKey(id)));
}
render() {
return html`
Create a new identity
Import an SSB Identity from 12 BIP39 English Words
Warning !
Anybody that has access to your private key can gain total access over your account.
Tilde Friends' contributors will never ask you for your private key !
${this.ids.map(
(id) =>
html`
-
${id}
`
)}
`;
}
}
customElements.define('tf-identity-manager', TfIdentityManagerElement);