| 12 | console.log(`USD value: $${usdPrice.toFixed(2)} USD`); |
| 13 | } |
| 14 | export async function ethPrice(network: string, token: string, amount?: string, mnemonic?: string): Promise<void> { |
| 15 | amount = amount ?? '1'; |
| 16 | let web3 = await getWeb3(network, mnemonic); |
| 17 | let amountInWei = toWei(amount); |
| 18 | let exchangeRate = await getSDK('ExchangeRate', web3); |
| 19 | let ethWeiPrice = await exchangeRate.getETHPrice(token, amountInWei); |
| 20 | console.log(`ETH value: ${fromWei(ethWeiPrice)} ETH`); |
| 21 | } |
| 22 | export async function priceOracleUpdatedAt(network: string, token: string, mnemonic?: string): Promise<void> { |
| 23 | let web3 = await getWeb3(network, mnemonic); |
| 24 | let exchangeRate = await getSDK('ExchangeRate', web3); |