/** * @param string $type * @param string $url * @param string $blockChain */ public function __construct($type, $url, $blockChain = Chain::BLOCK_CHAIN_BITCOIN) { if (!Notification::validateType($type)) { throw new \Nette\InvalidArgumentException("Unknown type {$type}."); } if (!Chain::validateBlockChain($blockChain)) { throw new \Nette\InvalidArgumentException("Unknown block chain {$blockChain}."); } $this->parameters['type'] = $type; $this->parameters['url'] = $url; $this->parameters['block_chain'] = $blockChain; }
/** * @param array $notification */ protected function __construct(array $notification) { parent::__construct($notification); $this->transaction = new Transaction($notification['payload']['transaction']); }
/** * @param array $notification */ protected function __construct(array $notification) { parent::__construct($notification); $this->block = new Block($notification['payload']['block']); }