Releases: nbd-wtf/nostr-tools
v2.0.0
The "core" API has been modified to be simpler, but it didn't really change much since there wasn't much to change. Most names were changed though. Deprecated methods were removed. The <number>
type parameter on Event
was removed (sorry @alexgleason) and kinds are not enums anymore, they are just constants in the nostr-tools/kinds
module.
Ability to import individual modules has been introduced (thanks to @fr4nzap) (technically I think it was already released but doesn't matter), which will lead to much less bloated bundles when you just want a small piece of functionality.
The relay.ts
and pool.ts
modules were rewritten from scratch with no regards for backwards compatibility, but most of the actual functionality was kept (a notable exception were the batched requests from @sepehr-safari). Their code is more solid and simpler to read and understand now now and makes less compromises.
Ability to use this module optionally with nostr-wasm
was introduced.
Some other NIP helpers were introduced, like NIP-11 and some other I forgot. But more will come soon now.
Upgrade guide
keys.ts
andevent.ts
files were merged into a singlepure.ts
module -- which is equivalent towasm.ts
generatePrivateKey()
was renamed togenerateSecretKey()
and now returns aUint8Array
instead of a hex string;getPublicKey()
now takes aUint8Array
instead of a hex string, it still returns a public as a hex string though;finishEvent()
was renamed tofinalizeEvent()
and now takes aUint8Array
secret key instead of a hex string;nip19.nsecEncode()
also expects aUint8Array
now andnip19.decode()
returns aUint8Array
when it finds annsec
;- There are too many changes in
nostr-tools/relay
andnostr-tools/pool
, so I won't write them here.
Thank you for your patience.