export function loadTransaction(event: ethereum.Event): Transaction {
let transaction = Transaction.load(event.transaction.hash.toHexString())
if (transaction === null) {
transaction = new Transaction(event.transaction.hash.toHexString())
}
transaction.blockNumber = event.block.number
transaction.timestamp = event.block.timestamp
transaction.gasUsed = event.transaction.gasUsed
transaction.gasPrice = event.transaction.gasPrice
transaction.save()
return transaction as Transaction
}
the problem is transaction.gasUsed = event.transaction.gasUsed
but in ethereum Transaction
/**
* An Ethereum transaction.
*/
export class Transaction {
constructor(
public hash: Bytes,
public index: BigInt,
public from: Address,
public to: Address | null,
public value: BigInt,
public gasLimit: BigInt,
public gasPrice: BigInt,
public input: Bytes,
public nonce: BigInt,
) {}
}
there is no gasUsed.
so I got this error.
TS2339: Property 'gasUsed' does not exist on type '~lib/@graphprotocol/graph-ts/chain/ethereum/ethereum.Transaction'.
transaction.gasUsed = event.transaction.gasUsed
~~~~~~~
in src/utils/index.ts(90,43)
this is src > utils > index.ts
the problem is
transaction.gasUsed = event.transaction.gasUsed
but in ethereum Transactionthere is no gasUsed.
so I got this error.
anyone solve this?