New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@santiment-network/sanr-api-js

Package Overview
Dependencies
Maintainers
3
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@santiment-network/sanr-api-js

Sanr API JS Wrapper

latest
Source
npmnpm
Version
0.1.1
Version published
Maintainers
3
Created
Source

Sanr API JS Wrapper | wip

Documentation

  • Installation
  • Usage

Installation

You can either use npm or yarn to install it:

npm i --save @santiment-network/sanr-api-js
yarn add @santiment-network/sanr-api-js

Usage

In Sanr Participant, but in API - Issuer In Sanr Signal, but in API - Forecast

// ES Modules syntax
import Sanr from 'sanr-api-js';

// require syntax
const Sanr = require("sanr-api-js").default;

const sanr = new Sanr({
  token: "YOUR_TOKEN",
  refreshToken: "YOUR_REFRESH_TOKEN"
});

// Use api here

;(async () => {
  await api.refreshAccessToken()
  // Get stats about amount of sanr competitions
  // or sanr participants
  const worldstate: Worldstate = await api.getWorldstate()
  console.log(worldstate)
  // Get all competitions
  const competitions = await api.getCompetitions()
  const latestCompetition = competitions.data[competitions.total - 1].id
  console.log(latestCompetition);
  const issuers: SanrResponse<Issuer> = await api.getCompetition(latestCompetition)
  console.log("Participants in latest competition: " + issuers.total)
  // Show all latest forecasts
  const signals = await api.getSignals()
  console.log(signals)
})()

Keywords

nodejs

FAQs

Package last updated on 10 Apr 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