Skip to content
This repository has been archived by the owner on Dec 16, 2023. It is now read-only.
/ go-nostr-event Public archive

A Go library that helps generating Event of go-nostr

License

Notifications You must be signed in to change notification settings

foxytanuki/go-nostr-event

Repository files navigation

go-nostr-event

A Go library that helps generating Event of go-nostr

GoDoc

Overview

You can create and sign nostr events with less code

with go-nostr-event (nostrevent)

sk := nostr.GeneratePrivateKey()
cev := nostrevent.NewNote("Hello World!")
cev.SignPk(sk)

original

sk := nostr.GeneratePrivateKey()
pub, _ := nostr.GetPublicKey(sk)

ev := nostr.Event{
	PubKey:    pub,
	CreatedAt: time.Now(),
	Kind:      1,
	Tags:      nil,
	Content:   "Hello World!",
}

ev.Sign(sk)

Getting started

import nostrevent "github.com/foxytanuki/go-nostr-event"

or

go get -u github.com/foxytanuki/go-nostr-event

Example script

example/post_note.go

go run example/post_note.go

About

A Go library that helps generating Event of go-nostr

Topics

Resources

License

Stars

Watchers

Forks

Languages