Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rss3

Package Overview
Dependencies
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rss3

JavaScript SDK for [RSS3-Hub](https://github.com/NaturalSelectionLabs/RSS3-Hub)

  • 0.3.5
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
77
increased by1183.33%
Maintainers
1
Weekly downloads
 
Created
Source

RSS3 SDK JavaScript

JavaScript SDK for RSS3-Hub

Install

npm install rss3 --save

or

yarn add rss3

API

Initialization

new RSS3(options: {
    endpoint: string; // RSS3 Hub Address
    privateKey?: string; // Persona's private key, a new persona will be created if it is empty
})

Example:

const rss3 = new RSS3({
    endpoint: 'https://rss3-hub-playground-6raed.ondigitalocean.app',
    privateKey: '0x47e18d6c386898b424025cd9db446f779ef24ad33a26c499c87bb3d9372540ba',
});

Persona

persona.privateKey

persona.privateKey: string

Example:

const privateKey = rss3.persona.privateKey;

persona.id

persona.id: string

Example:

const id = rss3.persona.id;

persona.sync()

Please note that changes will only be synced to the node after persona.sync() is successfully executed

persona.sync(): string[]

Example:

const changedFiles = rss3.persona.sync();

persona.raw()

persona.raw(fileID: string = persona.id): Promise<RSS3IContent>x

Example:

const file = await rss3.persona.raw();

Profile

profile.get()

profile.get(personaID: string = persona.id): Promise<RSS3Profile>

Example:

const profile = rss3.profile.get();

profile.patch()

profile.patch(profile: RSS3Profile): Promise<RSS3Profile>

Example:

const newProfile = await rss3.profile.patch({
    name: 'RSS3',
    avatar: 'https://cloudflare-ipfs.com/ipfs/QmZWWSspbyFtWpLZtoAK35AjEYK75woNawqLgKC4DRpqxu',
    bio: 'RSS3 is an open protocol designed for content and social networks in the Web 3.0 era.',
});

Items

items.get()

items.get(fileID: string = persona.id): Promise<{
    items: RSS3Item[],
    items_next?: string,
}>

Example:

const list1 = await rss3.items.get();
const items1 = list1.items;
const list2 = await rss3.items.get(list1.items_next);
const items2 = list2.items;

Item

item.get

item.get(itemID: string): Promise<RSS3Item>

Example:

const item = await rss3.item.get('0x47e18d6c386898b424025cd9db446f779ef24ad33a26c499c87bb3d9372540ba-item-0');

item.post

item.post(item: RSS3ItemInput): Promise<RSS3ItemInput>

Example:

const item = await rss3.item.post({
    title: 'Hello RSS3',
    summary: 'RSS3 is an open protocol designed for content and social networks in the Web 3.0 era.',
});

item.patch

item.patch(item: RSS3ItemInput): Promise<RSS3ItemInput>

Example:

const newItem = await rss3.item.patch({
    title: 'Hi RSS3',
});

Keywords

FAQs

Package last updated on 15 Jun 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc