Class: TxDecoder

tx_decoder~ TxDecoder


new TxDecoder(tx, options)

A TxDecoder object parses a transaction, and unserializes the data that is encoded on that transaction into it's primitive components. Principally, this includes the sender, the receiver, and the binary data inside. This component was ported from counterparty_ruby, and principally follows the Counterparty message encoding format.

Parameters:
Name Type Description
tx Transaction

bitcore transaction to decode

options Object
Properties
Name Type Description
prefix String

The ASCII prefix of this encoding. Defaults to 'CNTRPRTY'

network Network

The bitcore network to use for decoding public sender/receiver addresses. Defaults to bitcore.Network.livenet

Members


data :Buffer

Returns the binary data that represents the content of this message

Type:
  • Buffer

decryptKey :String

Returns the decrypton key used for obfuscation in this transaction

Type:
  • String

network :Buffer

Returns the Bitcoin network that was passed in the constructor (or livenet if none was provided)

Type:
  • Buffer

prefix :String

Returns the expected encoding prefix of this decoding's data

Type:
  • String

receiverAddr :String

Returns the public key corresponding to the 'receiver' of this transaction

Type:
  • String

senderAddr :String

Returns the public key corresponding to the 'sender' of this transaction

Type:
  • String

tx :Transaction

Returns the Transaction that was supplied in the constructor

Type:
  • Transaction