From 787588f20b146c83a64b66f634d648baf7b6e121 Mon Sep 17 00:00:00 2001 From: Bogdan Fazakas Date: Thu, 28 Apr 2022 10:59:54 +0300 Subject: [PATCH] fix fixed rate --- package-lock.json | 2 -- src/@utils/fixedRateExchange.ts | 6 +++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8408248a2..b9d8c3ad8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21590,7 +21590,6 @@ "cross-fetch": "^3.1.5", "crypto-js": "^4.1.1", "decimal.js": "^10.3.1", - "web3": "^1.7.3", "web3-core": "^1.7.1", "web3-eth-contract": "^1.7.1" } @@ -21693,7 +21692,6 @@ "integrity": "sha512-5vwpq6kbvwkQwKqAoOU3L72GZ3Ta8RRrewKj9OJRolx28KLJJ8Dg9Rf7obRwt5jQA9bkYd8gqzMTrI7H3xLfaw==", "dev": true, "requires": { - "@oclif/config": "^1.15.1", "@oclif/errors": "^1.3.3", "@oclif/parser": "^3.8.3", "@oclif/plugin-help": "^3", diff --git a/src/@utils/fixedRateExchange.ts b/src/@utils/fixedRateExchange.ts index 9b3b068ed..30abb2f2d 100644 --- a/src/@utils/fixedRateExchange.ts +++ b/src/@utils/fixedRateExchange.ts @@ -2,7 +2,8 @@ import { FixedRateExchange, PriceAndFees } from '@oceanprotocol/lib' import { AccessDetails } from 'src/@types/Price' import Web3 from 'web3' import { getOceanConfig } from './ocean' -import { getSiteMetadata } from './siteConfig' +import { consumeMarketPoolSwapFee } from '../../app.config' + import { getDummyWeb3 } from './web3' /** @@ -25,13 +26,12 @@ export async function getFixedBuyPrice( } const config = getOceanConfig(chainId) - const { appConfig } = getSiteMetadata() const fixed = new FixedRateExchange(web3, config.fixedRateExchangeAddress) const estimatedPrice = await fixed.calcBaseInGivenOutDT( accessDetails.addressOrId, '1', - appConfig.consumeMarketPoolSwapFee + consumeMarketPoolSwapFee ) return estimatedPrice }