Updating to use decimals from publishMarketFeeToken

This commit is contained in:
Jamie Hewitt 2023-06-30 17:01:58 +03:00
parent 32cfbcfe6d
commit 71be6ce9ff

View File

@ -259,10 +259,14 @@ export function handlePublishMarketFeeChanged(
const fixedRateExchange = getFixedRateExchange(fixedRateId)
if (fixedRateExchange) {
const dataToken = getToken(
Address.fromString(fixedRateExchange.datatoken),
true
)
let feeDecimals = BigInt.fromI32(18).toI32()
if (fixedRateExchange.publishMarketFeeAddress) {
if (dataToken) {
const feeToken = getToken(
Address.fromString(fixedRateExchange!.publishMarketFeeAddress!),
Address.fromString(dataToken.publishMarketFeeToken!),
false
)
feeDecimals = BigInt.fromI32(feeToken.decimals).toI32()