1
0
mirror of https://github.com/oceanprotocol/react.git synced 2025-02-14 21:10:38 +01:00

small fix

This commit is contained in:
mihaisc 2020-09-16 15:03:11 +03:00
parent 73a4662bd2
commit 1db0143c46
No known key found for this signature in database
GPG Key ID: BE522BB8C3A5E2E4

View File

@ -82,7 +82,7 @@ export async function getCheapestExchange(
dataTokenAddress: string dataTokenAddress: string
) { ) {
if (!ocean || !dataTokenAddress) return if (!ocean || !dataTokenAddress) return
try {
const tokenExchanges = await ocean.fixedRateExchange.searchforDT( const tokenExchanges = await ocean.fixedRateExchange.searchforDT(
dataTokenAddress, dataTokenAddress,
'1' '1'
@ -112,6 +112,13 @@ export async function getCheapestExchange(
address: cheapestExchangeAddress, address: cheapestExchangeAddress,
price: cheapestExchangePrice.toString() price: cheapestExchangePrice.toString()
} }
} catch (err) {
Logger.log(err)
return {
address: '',
price: ''
}
}
} }
export async function checkAndBuyDT( export async function checkAndBuyDT(