mirror of
https://github.com/fiatjaf/nak.git
synced 2025-12-08 16:48:51 +00:00
adapt to FetchSpecificEvent() changes.
This commit is contained in:
7
mcp.go
7
mcp.go
@@ -6,11 +6,12 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/urfave/cli/v3"
|
|
||||||
"github.com/mark3labs/mcp-go/mcp"
|
"github.com/mark3labs/mcp-go/mcp"
|
||||||
"github.com/mark3labs/mcp-go/server"
|
"github.com/mark3labs/mcp-go/server"
|
||||||
"github.com/nbd-wtf/go-nostr"
|
"github.com/nbd-wtf/go-nostr"
|
||||||
"github.com/nbd-wtf/go-nostr/nip19"
|
"github.com/nbd-wtf/go-nostr/nip19"
|
||||||
|
"github.com/nbd-wtf/go-nostr/sdk"
|
||||||
|
"github.com/urfave/cli/v3"
|
||||||
)
|
)
|
||||||
|
|
||||||
var mcpServer = &cli.Command{
|
var mcpServer = &cli.Command{
|
||||||
@@ -139,7 +140,9 @@ var mcpServer = &cli.Command{
|
|||||||
pm.ShortName(), pm.PubKey),
|
pm.ShortName(), pm.PubKey),
|
||||||
), nil
|
), nil
|
||||||
case "nevent":
|
case "nevent":
|
||||||
event, _, err := sys.FetchSpecificEventFromInput(ctx, uri, false)
|
event, _, err := sys.FetchSpecificEventFromInput(ctx, uri, sdk.FetchSpecificEventParameters{
|
||||||
|
WithRelays: false,
|
||||||
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return mcp.NewToolResultError("Couldn't find this event anywhere"), nil
|
return mcp.NewToolResultError("Couldn't find this event anywhere"), nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,10 +7,11 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/fatih/color"
|
"github.com/fatih/color"
|
||||||
"github.com/urfave/cli/v3"
|
|
||||||
"github.com/nbd-wtf/go-nostr"
|
"github.com/nbd-wtf/go-nostr"
|
||||||
"github.com/nbd-wtf/go-nostr/nip60"
|
"github.com/nbd-wtf/go-nostr/nip60"
|
||||||
"github.com/nbd-wtf/go-nostr/nip61"
|
"github.com/nbd-wtf/go-nostr/nip61"
|
||||||
|
"github.com/nbd-wtf/go-nostr/sdk"
|
||||||
|
"github.com/urfave/cli/v3"
|
||||||
)
|
)
|
||||||
|
|
||||||
func prepareWallet(ctx context.Context, c *cli.Command) (*nip60.Wallet, func(), error) {
|
func prepareWallet(ctx context.Context, c *cli.Command) (*nip60.Wallet, func(), error) {
|
||||||
@@ -332,7 +333,9 @@ var wallet = &cli.Command{
|
|||||||
var eventId string
|
var eventId string
|
||||||
|
|
||||||
if strings.HasPrefix(target, "nevent1") {
|
if strings.HasPrefix(target, "nevent1") {
|
||||||
evt, _, err = sys.FetchSpecificEventFromInput(ctx, target, false)
|
evt, _, err = sys.FetchSpecificEventFromInput(ctx, target, sdk.FetchSpecificEventParameters{
|
||||||
|
WithRelays: false,
|
||||||
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user