Skip to content
This repository has been archived by the owner on Dec 16, 2023. It is now read-only.

Latest commit

 

History

History
55 lines (38 loc) · 1016 Bytes

README.md

File metadata and controls

55 lines (38 loc) · 1016 Bytes

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