TS2363: правая часть арифметической операции должна иметь тип «любой», «число», «большой» или тип перечисления.

Я использую typeScript в GraphQl (в проекте TheQraph), это моя сущность:

      type UserBorrow @entity{
id: ID!
userCollateral: UserCollateral!
market: Market!
balance: BigDecimal!
accumulatedInterest: BigDecimal!
lastBorrowIndexTime: BigInt!
timeStamp: BigInt!
}

и это мое отображение:

          userBorrow.balance = userBorrow.balance - event.params.balance.toBigDecimal()

и когда приходит событие ethereum, я вычисляю «userBorrow.balance», я получаю эту ошибку:

      TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type

Как я могу решить эту проблему?

0 ответов

Другие вопросы по тегам