mirror of
https://github.com/nostr-connect/connect.git
synced 2025-12-17 05:04:20 +01:00
bump nostr-tools
This commit is contained in:
@@ -92,7 +92,7 @@ It's best to ask approval from the user before signing an event. To do so, you c
|
|||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { NostrSigner } from '@nostr-connect/connect';
|
import { NostrSigner } from '@nostr-connect/connect';
|
||||||
import { getPublicKey, signEvent, nip06 } from 'nostr-tools';
|
import { getPublicKey, getSignature, nip06 } from 'nostr-tools';
|
||||||
|
|
||||||
const sk = nip06.privateKeyFromSeedWords(myWords);
|
const sk = nip06.privateKeyFromSeedWords(myWords);
|
||||||
|
|
||||||
@@ -113,7 +113,7 @@ class MobileHandler extends NostrSigner {
|
|||||||
|
|
||||||
// listen for user accept
|
// listen for user accept
|
||||||
this.events.on('sign_event_approve', () => {
|
this.events.on('sign_event_approve', () => {
|
||||||
resolve(signEvent(event, this.self.secret));
|
resolve(getSignature(event, this.self.secret));
|
||||||
});
|
});
|
||||||
|
|
||||||
// or reject
|
// or reject
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import EventEmitter from 'events';
|
import EventEmitter from 'events';
|
||||||
import { Event, getPublicKey, nip04, Kind } from 'nostr-tools';
|
import { getPublicKey, Event, nip04 } from 'nostr-tools';
|
||||||
import { nip26 } from 'nostr-tools';
|
import { nip26 } from 'nostr-tools';
|
||||||
|
|
||||||
import { isValidRequest, NostrRPC } from './rpc';
|
import { isValidRequest, NostrRPC } from './rpc';
|
||||||
|
|||||||
@@ -296,13 +296,7 @@ export async function broadcastToRelay(
|
|||||||
relay.on('error', () => {
|
relay.on('error', () => {
|
||||||
reject(new Error(`failed to connect to ${relay.url}`));
|
reject(new Error(`failed to connect to ${relay.url}`));
|
||||||
});
|
});
|
||||||
const pub = relay.publish(event);
|
relay.publish(event);
|
||||||
if (skipSeen) resolve();
|
|
||||||
pub.on('failed', (reason: any) => {
|
|
||||||
reject(reason);
|
|
||||||
});
|
|
||||||
pub.on('ok', () => {
|
|
||||||
resolve();
|
resolve();
|
||||||
});
|
});
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user