mirror of
https://github.com/nbd-wtf/go-nostr.git
synced 2025-12-03 17:37:05 +01:00
nip46: revamp dynamic signer, require a ctx on HandleRequest().
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package nip46
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"regexp"
|
||||
@@ -26,10 +27,11 @@ type Response struct {
|
||||
|
||||
type Signer interface {
|
||||
GetSession(clientPubkey string) (Session, bool)
|
||||
HandleRequest(event *nostr.Event) (req Request, resp Response, eventResponse nostr.Event, err error)
|
||||
HandleRequest(context.Context, *nostr.Event) (req Request, resp Response, eventResponse nostr.Event, err error)
|
||||
}
|
||||
|
||||
type Session struct {
|
||||
PublicKey string
|
||||
SharedKey []byte // nip04
|
||||
ConversationKey [32]byte // nip44
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user