chainlink-asset-converter
v0.0.6
Published
Asset conversion utils powered by Chainlink price feeds
Downloads
11
Readme
chainlink-asset-converter
Super easy conversion between any of the assets currently supported by Chainlink's price feeds network
Installation
npm i chainlink-asset-converter
Basic Usage
import { convert } from 'chainlink-asset-converter';
await convert({
amount: 5,
from: 'ETH',
to: 'BTC',
// Your Ethereum JSON-RPC endpoint*
endpoint: 'https://mainnet.infura.io/v3/ab01ab01ab01ab01ab01ab01',
});
// => '0.2'
*you could get your own one of these with a free-tier account at Infura for example