Skip to content

Commit

Permalink
nip46: implement fmt.Stringer for request and response.
Browse files Browse the repository at this point in the history
  • Loading branch information
fiatjaf committed Oct 14, 2024
1 parent e05dbb5 commit 022d4ce
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions nip46/nip46.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,22 @@ type Request struct {
Params []string `json:"params"`
}

func (r Request) String() string {
j, _ := json.Marshal(r)
return string(j)
}

type Response struct {
ID string `json:"id"`
Error string `json:"error,omitempty"`
Result string `json:"result,omitempty"`
}

func (r Response) String() string {
j, _ := json.Marshal(r)
return string(j)
}

type Signer interface {
GetSession(clientPubkey string) (Session, bool)
HandleRequest(context.Context, *nostr.Event) (req Request, resp Response, eventResponse nostr.Event, err error)
Expand Down

0 comments on commit 022d4ce

Please sign in to comment.