-
-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
book: add NIP65 & Relay Messages JavaScript examples #575
book: add NIP65 & Relay Messages JavaScript examples #575
Conversation
- Added NIP65 examples in line with python examples - Corrected minor typos - Replaced previous relay messages example with more comprehensive set - Added relevant book text throughout - Updated index
Just seen the fail, something about it not liking the lack of a Kind instance for an EventBuilder. Will test it again in the morning, I'm pretty confident the code ran prior to the PR but am still juggling machines given that my Linux machine still doesn't like compiling the WebAssembly.Module(). Anyway will review and report back. |
- Minor corrections
Curious, just re-tested this code and I have no issues running it locally (see image below, where the second JSON is the Tag build method) @yukibtc would you mind running the following on your side and let me know if you have some issues. The book deployment checks seem to be falling over at const { loadWasmSync, Keys, EventBuilder, Tag, RelayMetadata } = require("@rust-nostr/nostr");
function run(){
// Load WASM
loadWasmSync();
// Generate Keys
let keys = Keys.generate();
// Create relay metadata tags
let tag1 = Tag.relayMetadata("wss://relay.damus.io", RelayMetadata.READ);
let tag2 = Tag.relayMetadata("wss://relay.primal.net", RelayMetadata.WRITE);
let tag3 = Tag.relayMetadata("wss://relay.nostr.band", null);
// Build/sign event
let kind = 10002;
let content = "";
let tags = [tag1, tag2, tag3];
builder = new EventBuilder(kind, content, tags);
event = builder.toEvent(keys);
// Print event as json
console.log(` Event: ${event.asJson()}`);
}
run(); |
The kind should be constructed in this way: let kind = new Kind(10002); |
I can fix it during cherry-picking |
* Added NIP65 examples in line with python examples * Corrected minor typos * Replaced previous relay messages example with more comprehensive set * Added relevant book text throughout * Updated index Closes #575 Signed-off-by: Yuki Kishimoto <[email protected]>
thanks! Got it sorted, weirdly it wasn't upgrading my package using the normal command. I was rocking v0.33. Had to uninstall the package and re-install the latest. Fixed it though now. |
Description
Notes to the reviewers
Will keep chipping away for the time being. Let me know if there is anything specific I need to look at though.
Checklist
just precommit
orjust check
before committing