@getsafle/token-rates-controller

1.0.6 • Public • Published

Safle Token Rates Controller

Token rates controller returns the rates of tokens for multiple currencies across multiple tokens on multiple chains.

Installation

To install this SDK,

npm install --save @getsafle/token-rates-controller

Initialization

Initialize the constructor,

const safleTokenRatesController = require('@getsafle/token-rates-controller');

const tokenRatesController = new safleTokenRatesController.TokenRatesController();

Get token conversion rates


This function takes in an array of token contract addresses and an array of currencies and returns the rates accordingly.

const tokenRates= await tokenRatesController.getTokenRates({ contractAddresses, currencies, chain })
  • contractAddresses - contract address of tokens - type : array
  • currencies - Base currencies selected by user - type : array
  • chain - name of blockchain - type : string [ethereum, polygon supported for now]

Supported Chains

  • ethereum
  • polygon
  • bsc
  • avalanche
  • harmony

Readme

Keywords

none

Package Sidebar

Install

npm i @getsafle/token-rates-controller

Weekly Downloads

1

Version

1.0.6

License

ISC

Unpacked Size

7.66 kB

Total Files

10

Last publish

Collaborators

  • subhanshugupta
  • apoorv31
  • shubham.3008
  • sidth