首页 > 解决方案 > 我们如何生成 Uniswap 子图构建文件夹?

问题描述

当我尝试生成构建文件夹时出现这些错误。

ERROR TS2305: Module '~lib/@graphprotocol/graph-ts' has no exported member 'EthereumEvent'.

 import { log, BigInt, BigDecimal, Address, EthereumEvent } from '@graphprotocol/graph-ts'
                                            ~~~~~~~~~~~~~
 in src/mappings/helpers.ts(2,44)

WARNING AS226: Expression resolves to unusual type 'usize'.

   let totalSupplyValue = null
                          ~~~~
 in src/mappings/helpers.ts(108,26)

ERROR TS2322: Type '~lib/@graphprotocol/graph-ts/chain/ethereum/ethereum.CallResult<~lib/@graphprotocol/graph-ts/common/numbers/BigInt>' is not assignable to type 'i32'.

   totalSupplyValue = totalSupplyResult as i32
                        ~~~~~~~~~~~~~~~~~
 in src/mappings/helpers.ts(111,24)

WARNING AS226: Expression resolves to unusual type 'usize'.

   let decimalValue = null
                      ~~~~
 in src/mappings/helpers.ts(119,22)

× Failed to compile subgraph: Failed to compile data source mapping: 2 compile error(s)

标签: typescriptblockchainsubgraph

解决方案


推荐阅读