0.13.1 • Published 17 days ago

@rust-nostr/nostr v0.13.1

Weekly downloads
-
License
MIT
Repository
github
Last release
17 days ago

Nostr

Description

JavaScript bindings of nostr library.

If you're writing a typical Nostr client or bot, you may be interested in nostr-sdk.

This library should work on every JavaScript environment (nodejs, web, react native, ...).

Getting started

npm i @rust-nostr/nostr
const { Keys, loadWasmAsync } = require("@rust-nostr/nostr");

async function main() {
    // Load WASM 
    // if you are in a non async context, use loadWasmSync()
    await loadWasmAsync();

    // Generate random keys
    let keys = Keys.generate();

    // Hex keys
    console.log("Public key (hex): ", keys.publicKey.toHex());
    console.log("Secret key (hex): ", keys.secretKey.toHex());

    // Bech32 keys
    console.log("Public key (bech32): ", keys.publicKey.toBech32());
    console.log("Secret key (bech32): ", keys.secretKey.toBech32());
}

main();

More examples can be found in the examples directory.

Supported NIPs

Look at https://github.com/rust-nostr/nostr/tree/master/crates/nostr#supported-nips (the Js library could be out of sync with the supported NIPs in the nostr rust crate)

State

This library is in an ALPHA state, things that are implemented generally work but the API will change in breaking ways.

Donations

rust-nostr is free and open-source. This means we do not earn any revenue by selling it. Instead, we rely on your financial support. If you actively use any of the rust-nostr libs/software/services, then please donate.

License

This project is distributed under the MIT software license - see the LICENSE file for details

0.13.1

17 days ago

0.13.0

27 days ago

0.12.0

2 months ago

0.11.0

3 months ago

0.10.0

3 months ago

0.9.0

4 months ago

0.8.0

4 months ago

0.7.0

4 months ago

0.6.1

4 months ago

0.6.0

4 months ago

0.5.0

4 months ago

0.4.2

5 months ago

0.3.0

1 year ago

0.4.1

5 months ago

0.4.0

5 months ago

0.3.1

1 year ago

0.2.0

1 year ago

0.1.0

1 year ago