1

I user typeScript in GraphQl (in TheQraph project) , this is my entity:

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

and this is my mapping:

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

and when ethereum event come,I calculate "userBorrow.balance", I get this error :

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

how can I solve this problem?

  • Most likely, the RHS contains an invalid value. check the `balance` operands if it contains a valid value. – Joseph D. Jan 17 '22 at 15:20

0 Answers0