我在 GraphQl 中使用 typeScript(在 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()
当以太坊事件发生时,我计算“userBorrow.balance”,我得到这个错误:
TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type
我怎么解决这个问题?