(network: string, token: string, amount?: string, mnemonic?: string)
| 4 | const { toWei, fromWei } = Web3.utils; |
| 5 | |
| 6 | export async function usdPrice(network: string, token: string, amount?: string, mnemonic?: string): Promise<void> { |
| 7 | amount = amount ?? '1'; |
| 8 | let web3 = await getWeb3(network, mnemonic); |
| 9 | let amountInWei = toWei(amount); |
| 10 | let exchangeRate = await getSDK('ExchangeRate', web3); |
| 11 | let usdPrice = await exchangeRate.getUSDPrice(token, amountInWei); |
| 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); |
no test coverage detected