fix: remove unused code

This commit is contained in:
Kirill Litvinov
2023-08-02 15:05:44 +03:00
parent cd3eb34b11
commit cccf239f27
4 changed files with 1 additions and 19 deletions

View File

@@ -121,12 +121,6 @@ export default async function getSwapInfo({
if (baseAssetAddress === undefined) throw new Error(`No asset address for ${baseAssetName}`);
// Fee calculation
const baseAssetPriceInQuoteAsset = allPrices.prices[baseAssetAddress];
if (baseAssetPriceInQuoteAsset === undefined) throw new Error(`Base asset price ${baseAssetName} in ${allPrices.quoteAsset} not found`);
const baseCurrencyPriceInQuoteAsset = allPrices.prices[ethers.constants.AddressZero];
if (baseCurrencyPriceInQuoteAsset === undefined) throw new Error(`Base currency price in ${allPrices.quoteAsset} not found`);
const feeAssetPriceInQuoteAsset = allPrices.prices[feeAssetAddress];
if (feeAssetPriceInQuoteAsset === undefined) throw new Error(`Fee asset price ${feeAsset} in ${allPrices.quoteAsset} not found`);
const feePercent = feeAssets[feeAsset];
if (feePercent === undefined) throw new Error(`Fee asset ${feeAsset} not available`);

View File

@@ -372,12 +372,6 @@ export default async function swapLimit({
});
// Fee calculation
const baseAssetPriceInQuoteAsset = allPrices.prices[baseAssetAddress];
if (baseAssetPriceInQuoteAsset === undefined) throw new Error(`Base asset price ${baseAssetName} in ${allPrices.quoteAsset} not found`);
const baseCurrencyPriceInQuoteAsset = allPrices.prices[ethers.constants.AddressZero];
if (baseCurrencyPriceInQuoteAsset === undefined) throw new Error(`Base currency price in ${allPrices.quoteAsset} not found`);
const feeAssetPriceInQuoteAsset = allPrices.prices[feeAssetAddress];
if (feeAssetPriceInQuoteAsset === undefined) throw new Error(`Fee asset price ${feeAsset} in ${allPrices.quoteAsset} not found`);
const feePercent = feeAssets[feeAsset];
if (feePercent === undefined) throw new Error(`Fee asset ${feeAsset} not available`);

View File

@@ -330,12 +330,6 @@ export default async function swapMarket({
});
// Fee calculation
const baseAssetPriceInQuoteAsset = allPrices.prices[baseAssetAddress];
if (baseAssetPriceInQuoteAsset === undefined) throw new Error(`Base asset price ${baseAssetName} in ${allPrices.quoteAsset}not found`);
const baseCurrencyPriceInQuoteAsset = allPrices.prices[ethers.constants.AddressZero];
if (baseCurrencyPriceInQuoteAsset === undefined) throw new Error(`Base currency price in ${allPrices.quoteAsset} not found`);
const feeAssetPriceInQuoteAsset = allPrices.prices[feeAssetAddress];
if (feeAssetPriceInQuoteAsset === undefined) throw new Error(`Fee asset price ${feeAsset} in ${allPrices.quoteAsset} not found`);
const feePercent = feeAssets[feeAsset];
if (feePercent === undefined) throw new Error(`Fee asset ${feeAsset} not available`);

View File

@@ -39,7 +39,7 @@ const swapInfoBase = z.object({
orderInfo: orderInfoSchema,
isThroughPoolOrCurve: z.boolean(),
}).array(),
anm: z.record(z.string()).optional(), // address to ERC20 names
assetNameMapping: z.record(z.string()).optional(), // address to ERC20 names
});
const swapInfoByAmountIn = swapInfoBase.extend({