'use strict';

var index = require('./index-1627eb9c.cjs.dev.js');
var ethers = require('ethers');
var fetchCurrencyValue = require('./fetchCurrencyValue-fd470bc3.cjs.dev.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;
