'use strict';

var index = require('./index-a58e9bd5.cjs.prod.js');
var ethers = require('ethers');
var fetchCurrencyValue = require('./fetchCurrencyValue-04c2122d.cjs.prod.js');

/**
 *
 * @param provider - The provider to use
 * @param inputPrice - The input price to normalize
 * @param currencyAddress - The currency address to normalize the price for
 * @returns
 * @internal
 */
async function normalizePriceValue(provider, inputPrice, currencyAddress) {
  const metadata = await fetchCurrencyValue.fetchCurrencyMetadata(provider, currencyAddress);
  return ethers.utils.parseUnits(index.AmountSchema.parse(inputPrice), metadata.decimals);
}

exports.normalizePriceValue = normalizePriceValue;
