mirror of
https://github.com/orionprotocol/sdk.git
synced 2026-03-14 06:02:36 +03:00
fix: remove unused code
This commit is contained in:
@@ -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`);
|
||||
|
||||
|
||||
@@ -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`);
|
||||
|
||||
|
||||
@@ -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`);
|
||||
|
||||
|
||||
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user