fix(wallet): Fix fees missing on community owner token minting

This commit is contained in:
Ivan Belyakov 2024-05-03 15:22:09 +02:00 committed by Jonathan Rainville
parent 3ecb533adb
commit f557b82c1d
1 changed files with 5 additions and 2 deletions

View File

@ -196,18 +196,21 @@ proc decodeSuggestedFeesDto*(jsonObj: JsonNode): SuggestedFeesDto =
result.maxFeePerGasL = jsonObj{"maxFeePerGasL"}.getFloat
result.maxFeePerGasM = jsonObj{"maxFeePerGasM"}.getFloat
result.maxFeePerGasH = jsonObj{"maxFeePerGasH"}.getFloat
result.l1GasFee = jsonObj{"l1GasFee"}.getFloat
if jsonObj.hasKey("l1GasFee"):
result.l1GasFee = jsonObj{"l1GasFee"}.getFloat
result.eip1559Enabled = jsonObj{"eip1559Enabled"}.getbool
proc toSuggestedFeesDto*(jsonObj: JsonNode): SuggestedFeesDto =
result = SuggestedFeesDto()
var stringValue: string
result.gasPrice = parseFloat(jsonObj["gasPrice"].getStr)
result.baseFee = parseFloat(jsonObj["baseFee"].getStr)
result.maxPriorityFeePerGas = parseFloat(jsonObj{"maxPriorityFeePerGas"}.getStr)
result.maxFeePerGasL = parseFloat(jsonObj{"maxFeePerGasLow"}.getStr)
result.maxFeePerGasM = parseFloat(jsonObj{"maxFeePerGasMedium"}.getStr)
result.maxFeePerGasH = parseFloat(jsonObj{"maxFeePerGasHigh"}.getStr)
result.l1GasFee = parseFloat(jsonObj{"l1GasFee"}.getStr)
if jsonObj.getProp("l1GasFee", stringValue) and stringValue.len > 0:
result.l1GasFee = parseFloat(stringValue)
result.eip1559Enabled = jsonObj{"eip1559Enabled"}.getbool
proc `$`*(self: SuggestedFeesDto): string =