public function fetchByInput(TransactionInputInterface $input) { return $this->fetch($input->getTransactionId(), $input->getVout()); }
/** * @param TransactionInputInterface $input * @return array */ public function convertTxinToArray(TransactionInputInterface $input) { return ['outpoint' => $this->convertOutpointToArray($input->getOutPoint()), 'scriptSig' => $input->getScript()->getHex(), 'sequence' => $input->getSequence()]; }
/** * @param TransactionInputInterface $input * @return Buffer */ public function serialize(TransactionInputInterface $input) { return $this->getTemplate()->write([Buffer::hex($input->getTransactionId()), $input->getVout(), $input->getScript()->getBuffer(), $input->getSequence()]); }
/** * @param array $array * @return $this */ private function replace(array $array = []) { $this->input = new TransactionInput(array_key_exists('outpoint', $array) ? $array['outpoint'] : $this->input->getOutPoint(), array_key_exists('script', $array) ? $array['script'] : $this->input->getScript(), array_key_exists('nSequence', $array) ? $array['nSequence'] : $this->input->getSequence()); return $this; }
/** * @param TransactionInputInterface $input * @return Buffer */ public function serialize(TransactionInputInterface $input) { return Buffertools::concat($this->outpointSerializer->serialize($input->getOutPoint()), $this->getInputTemplate()->write([$input->getScript()->getBuffer(), $input->getSequence()])); }
/** * @param TransactionInputInterface $input * @return Utxo */ public function fetchByInput(TransactionInputInterface $input) { return $this->fetch($input->getOutPoint()); }