Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Nostr protocol client library for deno runtime.

License

NotificationsYou must be signed in to change notification settings

KiPSOFT/nostr-deno

Repository files navigation

Nostr protocol client library for deno runtime.

Nostr -https://github.com/nostr-protocol/nostrDeno -https://deno.land/

Features


  • Multiple relay support
  • Profile information
  • Global feed
  • User's posts
  • Follows
  • Followers
  • Reply post.
  • Debug mode.
  • Promise-based simple and easy to use.
  • Encrypted send and receive direc messages.
  • npub and nsec prefix key support.
  • Async iterable filters.

Usage


import{Nostr,Relay}from'https://deno.land/x/nostr_deno_client/mod.ts';constnostr=newNostr();nostr.privateKey='';// A private key is optional. Only used for sending posts.nostr.relayList.push({name:'Nostrprotocol',url:'wss://relay.nostrprotocol.net'});nostr.relayList.push({name:'Wellorder',url:'wss://nostr-pub.wellorder.net'});nostr.on('relayConnected',(relay:Relay)=>console.log('Relay connected.',relay.name));nostr.on('relayError',(err:Error)=>console.log('Relay error;',err));nostr.on('relayNotice',(notice:string[])=>console.log('Notice',notice));nostr.debugMode=true;awaitnostr.connect();awaitnostr.sendTextPost('Hello nostr deno client library.');constposts=awaitnostr.getPosts();console.log('Posts',posts);constpost=posts[posts.length-1];awaitnostr.sendReplyPost('Test reply.',post);constprofile=awaitnostr.getMyProfile();console.log('Profile',profile);constfeeds=awaitnostr.globalFeed({limit:10});console.log('Feeds',feeds);//method 1: for awaitconsole.log('iterable return');forawait(constnoteofnostr.filter(filter)){console.log(note);}//method 2: collectconsole.log('promise return');constallNotes=awaitnostr.filter(filter).collect();console.log(allNotes);//method 3: callbackconsole.log('callback return');awaitnostr.filter(filter).each(note=>{console.log(note);});awaitnostr.disconnect();console.log('Finish');

Supported NIPs


NIP-01, NIP-02, NIP-04 NIP-05, NIP-08, NIP-10, NIP-19 NIP-20

Roadmap


  • NIP-05 DNS-based internet identifier checking.
  • Add user for follow.
  • Public chat (channels).
  • Hashtag list. NIP-12
  • Filter posts with hashtag.
  • CI for deno build.

About

Nostr protocol client library for deno runtime.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors2

  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp