Version: 2.1.1
Platform: x86_64
First, install or update to the latest system software.
sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev
async getCasperRatio(usd_amount: number): Promise<number> { | |
const js = await (await fetch("https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd&ids=casper-network&order=market_cap_desc&per_page=4&page=1&sparkline=false")).json(); | |
const price = js[0].current_price; | |
console.log(price); | |
const integer = Math.round((usd_amount * 1000000000 / price)); | |
return integer; // this is not going to work with big numbers | |
} | |
async customerPayment1(sender_publicKey: string, reciver_publicKey: string, amount_in_usd: number) { | |
const amount_of_motes = await this.getCasperRatio(amount_in_usd); |