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:
@@ -106,10 +106,7 @@ class MobileHandler extends NostrSigner {
|
|||||||
if (!this.event) throw new Error('No origin event');
|
if (!this.event) throw new Error('No origin event');
|
||||||
|
|
||||||
// emit event to the UI to show a modal
|
// emit event to the UI to show a modal
|
||||||
this.events.emit('sign_event_request', {
|
this.events.emit('sign_event_request', event);
|
||||||
sender: this.event.pubkey,
|
|
||||||
event,
|
|
||||||
});
|
|
||||||
|
|
||||||
// wait for the user to approve or reject the request
|
// wait for the user to approve or reject the request
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
@@ -132,6 +129,8 @@ class MobileHandler extends NostrSigner {
|
|||||||
|
|
||||||
Generate a key to identify the remote signer, it is used to be reached by the apps.
|
Generate a key to identify the remote signer, it is used to be reached by the apps.
|
||||||
|
|
||||||
|
An instance that extends `NostrSigner` has access to `isConnected(pubkey:string): boolean` method that tells you if the current request is from an app that has been granted the connection by the current signer app.
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
// random key
|
// random key
|
||||||
const secretKey = secp.utils.bytesToHex(secp.utils.randomPrivateKey());
|
const secretKey = secp.utils.bytesToHex(secp.utils.randomPrivateKey());
|
||||||
|
|||||||
Reference in New Issue
Block a user