Skip to content

Commit

Permalink
js(nostr-sdk): fix example and REAMDE.md
Browse files Browse the repository at this point in the history
  • Loading branch information
yukibtc committed Dec 16, 2023
1 parent 7ac8a5b commit 246af41
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions bindings/nostr-sdk-js/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ JavaScript bindings of the [`nostr-sdk`](https://crates.io/crates/nostr-sdk) cra
## Getting started

```sh
npm i @rust-nostr/nostr-sdk-js
npm i @rust-nostr/nostr-sdk
```

```javascript
const { Keys, Client, Metadata, EventId, PublicKey, EventBuilder } = require("@rust-nostr/nostr-sdk-js");
const { Keys, Client, Metadata, EventId, PublicKey, EventBuilder } = require("@rust-nostr/nostr-sdk");

async function main() {
let keys = Keys.generate();
Expand Down Expand Up @@ -51,7 +51,7 @@ async function main() {
let event = EventBuilder.newReaction(event_id, public_key, "🧡").toEvent(keys);

// Send custom event to all relays
await client.send_event(event);
await client.sendEvent(event);

// Send custom event to a specific previously added relay
// await client.sendEventTo("wss://relay.damus.io", event);
Expand Down
2 changes: 1 addition & 1 deletion bindings/nostr-sdk-js/examples/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ async function main() {
let event = EventBuilder.newReaction(event_id, public_key, "🧡").toEvent(keys);

// Send custom event to all relays
await client.send_event(event);
await client.sendEvent(event);

// Send custom event to a specific previously added relay
// await client.sendEventTo("wss://relay.damus.io", event);
Expand Down

0 comments on commit 246af41

Please sign in to comment.