New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More

@rsksmart/roc-stablecoin-price

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rsksmart/roc-stablecoin-price

A small library to get the ROC (RIF On Chain) stablecoin price from its price feeder contract


Version published
Weekly downloads
0
decreased by-100%
Maintainers
0
Weekly downloads
 
Created

ROC stablecoin price

A small library to get the ROC (RIF On Chain) stablecoin price from its price feeder contract

USAGE

Make sure to include in the .env file the NODE_URL and CONTRACT_ADDRESS (as specified in the env.placeholders example) with the corresponding RSK node url and the price feeder contract address.
When using the library as standalone, the .env file must be at this directory's root. If it's being imported from another project, use the .env file of the project.

Example:

const { getPrice } = require('@rsksmart/roc-stablecoin-price');

async function test() {
  console.log(await getPrice())
}

test()

// testnet output: "0.999999999999999999"

The async function getPrice() will return a string containing the price of the token.

FAQs

Package last updated on 07 Aug 2023

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