11 protected $data = null;
12 protected $transaction = null;
30 self::validate($filterChange, $tx);
33 if (is_a($eventOrAbi,
'\Ethereum\Event')) {
35 $abi = $eventOrAbi->getAbi();
37 parent::__construct(
$abi);
39 $this->data = $this->decode($filterChange);
40 $this->transaction = $tx;
41 $this->emitterAddress = $tx->from->hexVal();
42 $this->contractAddress = $filterChange->address->hexVal();
49 $txHash = $this->transaction->getProperty(
'hash', TRUE);
50 return "Transaction: $txHash \n Contract: $this->contractAddress\n Event Emiter: $this->emitterAddress\n Data " . print_r($this->toArray(), TRUE);
57 return $this->contractAddress;
65 $this->response = $response;
72 return $this->response;
79 return $this->emitterAddress;
87 return is_array($this->data);
106 foreach ($this->getData() as $val) {
107 $return[] = $val->hexVal();
117 return $this->transaction;
126 foreach ($this->data as $k => $v) {
127 $data[$k] = $v->hexVal();
138 if ($filterChange->transactionHash->hexVal() !== $tx->hash->hexVal()) {
139 throw new \Exception(
'FilterChange and Transaction hash must correspond to create a EmittedEvent.');
141 if (!isset($tx->from) || is_null($tx->from)) {
142 throw new \Exception(
'Could not determine Event emitter EmittedEvent.');
__construct($eventOrAbi, FilterChange $filterChange, Transaction $tx)