import * as tfrpc from '/tfrpc.js'; tfrpc.register(async function get_private_key(id) { return bip39Words(await ssb.getPrivateKey(id)); }); async function main() { /* let words = 'body hair useful camp warm into cause riot two bamboo kick educate dinosaur advice seed type crisp where guilt avocado output rely lunch goddess'; let bytes = base64Decode('GO0Lv5BvcuuJJdHrokHoo0PmCDC/XjO/SZ6H+ddq4UvWd/VPW1RJrjd1aCUIfPIojFXrWMb8R54vVerU2TwjdQ==').slice(0, 32); let data = { ids: ids, words: bip39Words(bytes), bytes: base64Encode(bip39Bytes(words)), round: bip39Words((await bip39Bytes(words)).slice(0, 32)), privates: (await Promise.all(ids.map(id => ssb.getPrivateKey(id)))).map(x => bip39Words(x)), };*/ let ids = await ssb.getIdentities(); await app.setDocument(` `+ ids.map(id => `
`).join('\n')+ ``); } main();