graph-tooling icon indicating copy to clipboard operation
graph-tooling copied to clipboard

Access ETH value attached to call handler

Open dorothy-zbornak opened this issue 4 years ago • 3 comments

Is there a way to access the ETH attached to a call inside a call handler? Seems to be missing from the Call object.

https://github.com/graphprotocol/graph-ts/blob/master/chain/ethereum.ts#L381-L388

dorothy-zbornak avatar May 27 '21 07:05 dorothy-zbornak

From looking at the types, the Value is accessible in the 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
    ) {}
  }

So


export function handleFnCall(event: FnCall_Call): void {
...
event.transaction.value
...
}

Benjythebee avatar Sep 26 '21 02:09 Benjythebee

Yeah but I need the value attached to the call itself.

dorothy-zbornak avatar Sep 26 '21 08:09 dorothy-zbornak

Hey @dorothy-zbornak thanks this makes sense, we are currently validating a new mechanism for ingesting data (Firehose), which will make it easier to provide this information to handlers, will keep this thread up to date!

azf20 avatar Oct 29 '21 11:10 azf20