Replying to Avatar しゅうすい🐡

消したアカウントを復活させるスクリプト

```

const recover = async () => {

const event = {

kind: 0,

// deleteフラグを消す

content: '{"name":"name","about":"消したつもりではなか","display_name":"name"}',

tags: [],

created_at: Math.floor(new Date() / 1000),

pubkey: 'pubkey書いてね',

};

event.id = getEventHash(event);

// NIP-07使うyお

const signedEvent = await window.nostr.signEvent(event);

console.log(signedEvent);

for (const url of relays) {

console.log(url);

const relay = relayInit(url);

await relay.connect();

const pub = relay.publish(signedEvent);

pub.on('ok', () => {

console.log(`${url} has accepted our event`);

});

pub.on('seen', () => {

console.log(`we saw the event on ${url}`);

});

pub.on('failed', (reason) => {

console.log(`failed to publish to ${url}: ${reason}`);

});

}

console.log('done');

};

```

Avatar
あめ 2y ago

nostr:note1rxdafuv4ghw0h6umkhyqwupvrhrppk6aa695fqukrrg5awp433tq8p96g0

Reply to this note

Please Login to reply.

Discussion

No replies yet.