nostr-nsec-seedphrase
Version:
A comprehensive TypeScript library for Nostr key management with BIP39 seed phrases, supporting both ESM and CommonJS. Implements NIP-01, NIP-06, NIP-19, and NIP-26 with key generation, event signing, bech32 encoding/decoding, and secure cryptographic ope
64 lines (36 loc) • 979 B
Markdown
[**nostr-nsec-seedphrase v0.6.0**](../README.md)
***
[](../globals.md) / createEvent
> **createEvent**(`content`, `kind`, `privateKey`, `tags`?): `Promise`\<[`NostrEvent`](../interfaces/NostrEvent.md)\>
Creates a new signed Nostr event
`string`
The event content
`number`
The event kind (1 for text note, etc.)
### privateKey
`string`
The hex-encoded private key to sign with
### tags?
`string`[][] = `[]`
Optional event tags
`Promise`\<[`NostrEvent`](../interfaces/NostrEvent.md)\>
The signed event
If event creation or signing fails
```ts
const event = await createEvent(
"Hello Nostr!",
1,
privateKey,
[["t", "nostr"]]
);
console.log(event); // complete signed event
```
[](https://github.com/HumanjavaEnterprises/nostr-nsec-seedphrase/blob/885e04e5180059d4aa901af59d633038a53240cb/src/index.ts#L453)