src/Parser.php
public function parseBitcoinTransaction(array $tx, $protocol_version=null) {
        if ($protocol_version === null) { $protocol_version = self::DEFAULT_PROTOCOL_VERSION; }

        switch ($protocol_version) {
            case 1:
                return $this->parseBitcoinTransactionVersion1($tx);
            case 2:
                return $this->parseBitcoinTransactionVersion2($tx);
            
            default:
                throw new Exception("Unknown protocol version", 1);
        }
    }
public function parseBitcoinTransaction(array $tx, $protocol_version=null) {
        if ($protocol_version === null) { $protocol_version = self::DEFAULT_PROTOCOL_VERSION; }

        switch ($protocol_version) {
            case 1:
                return $this->parseBitcoinTransactionVersion1($tx);
            case 2:
                return $this->parseBitcoinTransactionVersion2($tx);
            
            default:
                throw new Exception("Unknown protocol version", 1);
        }
    }
public function parseBitcoinTransaction ( array $ tx , $ protocol_version = null ) { if ( $ protocol_version === null ) { $ protocol_version = self :: DEFAULT_PROTOCOL_VERSION ; } switch ( $ protocol_version ) { case 1 : return $ this -> parseBitcoinTransactionVersion1 ( $ tx ) ; case 2 : return $ this -> parseBitcoinTransactionVersion2 ( $ tx ) ; default : throw new Exception ( "Unknown protocol version" , 1 ) ; } }
parses a transaction and returns the raw counterparty data
@param  array $tx Transaction data from bitcoind
@param  int|null  $protocol_version the procol version.  Leave blank for the latest protocol.
@return array transaction data including type, destination, asset and quantity
parses a transaction and returns the raw counterparty data