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.



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

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)



61
62
63
# File 'lib/bsv/transaction/beef.rb', line 61

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

#format_flagInteger

This method is abstract.

Wire-protocol format integer for serialisation.

Returns:

  • (Integer)

Raises:

  • (NotImplementedError)


68
69
70
# File 'lib/bsv/transaction/beef.rb', line 68

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)


51
52
53
# File 'lib/bsv/transaction/beef.rb', line 51

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