mirror of
https://github.com/nostr-connect/connect.git
synced 2025-12-17 05:04:20 +01:00
Update README.md
This commit is contained in:
@@ -91,12 +91,12 @@ The NostrRPC class provides access to the Nostr public key via `this.self.pubkey
|
||||
It's best to ask approval from the user before signing an event. To do so, you can emit an event to the UI and wait for the user to approve or reject the request.
|
||||
|
||||
```typescript
|
||||
import { NostrRPC } from '@nostr-connect/connect';
|
||||
import { NostrSigner } from '@nostr-connect/connect';
|
||||
import { getPublicKey, signEvent, nip06 } from 'nostr-tools';
|
||||
|
||||
const sk = nip06.privateKeyFromSeedWords(myWords);
|
||||
|
||||
class MobileHandler extends NostrRPC {
|
||||
class MobileHandler extends NostrSigner {
|
||||
|
||||
async get_public_key(): Promise<string> {
|
||||
return getPublicKey(sk);
|
||||
@@ -169,4 +169,4 @@ const { target, relay, metadata } = ConnectURI.fromURI(text);
|
||||
await connectURI.approve(key);
|
||||
// if rejects could be polite to notify the app of the rejection
|
||||
await connectURI.reject(key);
|
||||
```
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user