1.0.12 • Published 3 years ago

plugin-pricing-index-pair v1.0.12

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

Plugin Pricing Index Pair Npm Package

Package which brings pricing index pair using Plugin Decentralized Oracle

1 Installation

Install plugin-pricing-index-pair with npm

  npm install plugin-pricing-index-pair

2 PRE-REQUISITE

  • Go to https://feeds.goplugin.co explore the data feeds, you want to access
  • Deposit 1 PLI for the specific data feed, you want to access
  • copy the contract-address to override below in Step 3
  • create .env file and add PRIVATE_KEY (from which you deposited PLI)

3 Implementation Example

var { custom_pair,default_pair,show } = require("plugin-pricing-index-pair");

var ProviderOptions={
    CONTRACT_ADDR:"0xB5B54e202ae923381DBc3859196d88004d85f361",
    RPC_URL:"https://erpc.xinfin.network",
    FSymbol:"PLI",
    TSymbol:"USDT"
}

async function main() {
    //to Apply custom index-pairs
    <!-- const returnCodeA = await custom_pair(ProviderOptions);
    if(returnCodeA){
        const result = await show(ProviderOptions);
        console.log("log::::result::::",result/10000)
    } -->
    // //to get default index-pair for the provided contract_address
    const returncodeB = await default_pair(ProviderOptions);

    if(returncodeB){
         const result = await show(ProviderOptions);
         console.log("log::::result::::",result/10000)
    }
}
main()

Function & Parameters

FunctionsDescriptions
custom_pairit enables you to override index-pairs and retrieve price pair
default_pairIt gets you the default index-pair that contract is configured for
showwill get you the latestAnswer for the given index-pair
CONTRACT_ADDR0xB5B54e202ae923381DBc3859196d88004d85f361 (Default contract address if you want to override custom symbols)
RPC_URLhttps://erpc.xinfin.network
FSymbolPLI
TSymbolUSDT
1.0.12

3 years ago

1.0.11

3 years ago

1.0.10

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago