Skip to content

Commit

Permalink
implement ping method in nip46 signers
Browse files Browse the repository at this point in the history
  • Loading branch information
jiftechnify authored and fiatjaf committed Oct 1, 2024
1 parent 03ae381 commit 1b6ac1f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions nip46/dynamic-signer.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,8 @@ func (p *DynamicSigner) HandleRequest(event *nostr.Event) (
break
}
result = plaintext
case "ping":
result = "pong"
default:
return req, resp, eventResponse,
fmt.Errorf("unknown method '%s'", req.Method)
Expand Down
2 changes: 2 additions & 0 deletions nip46/static-key-signer.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,8 @@ func (p *StaticKeySigner) HandleRequest(event *nostr.Event) (
break
}
result = plaintext
case "ping":
result = "pong"
default:
return req, resp, eventResponse,
fmt.Errorf("unknown method '%s'", req.Method)
Expand Down

0 comments on commit 1b6ac1f

Please sign in to comment.