Class: BSV::Transaction::Beef::BeefTx Abstract

Inherits:
Object
  • Object
show all
Defined in:
lib/bsv/transaction/beef.rb

Overview

This class is abstract.

Subclass and implement #wtxid and #format_flag.

Abstract base class for a single entry in a BEEF bundle.

Subclasses represent the three wire formats:

Direct Known Subclasses

ProvenTxEntry, RawTxEntry, TxidOnlyEntry

Instance Method Summary collapse

Constructor Details

#initializeBeefTx

Returns a new instance of BeefTx.



48
# File 'lib/bsv/transaction/beef.rb', line 48

def initialize; end

Instance Method Details

#dtxidString?

Display-order transaction ID as a hex string.

dtxid always returns a 64-char hex string suitable for JSON and UI boundaries.

Returns:

  • (String, nil)

    hex-encoded transaction ID (display order)



63
64
65
# File 'lib/bsv/transaction/beef.rb', line 63

def dtxid
  wtxid&.reverse&.unpack1('H*')
end

#format_flagInteger

This method is abstract.

Wire-protocol format integer for serialisation.

Returns:

  • (Integer)

Raises:

  • (NotImplementedError)


70
71
72
# File 'lib/bsv/transaction/beef.rb', line 70

def format_flag
  raise NotImplementedError, "#{self.class}#format_flag is not implemented"
end

#wtxidString?

This method is abstract.

Wire-order transaction ID.

Returns:

  • (String, nil)

    32-byte wtxid

Raises:

  • (NotImplementedError)


53
54
55
# File 'lib/bsv/transaction/beef.rb', line 53

def wtxid
  raise NotImplementedError, "#{self.class}#wtxid is not implemented"
end