Class: BSV::Transaction::Beef::TxidOnlyEntry

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

Overview

A BEEF entry containing only a transaction ID (no raw data).

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from BeefTx

#dtxid

Constructor Details

#initialize(known_wtxid:) ⇒ TxidOnlyEntry

Returns a new instance of TxidOnlyEntry.

Parameters:

  • known_wtxid (String)

    32-byte wire-order wtxid

Raises:

  • (ArgumentError)

    if known_wtxid is invalid



138
139
140
141
142
# File 'lib/bsv/transaction/beef.rb', line 138

def initialize(known_wtxid:)
  BSV::Primitives::Hex.validate_wtxid!(known_wtxid, name: 'known_wtxid')
  super()
  @known_wtxid = known_wtxid
end

Instance Attribute Details

#known_wtxidString (readonly)

Returns 32-byte wire-order wtxid.

Returns:

  • (String)

    32-byte wire-order wtxid



134
135
136
# File 'lib/bsv/transaction/beef.rb', line 134

def known_wtxid
  @known_wtxid
end

Instance Method Details

#format_flagInteger

Returns FORMAT_TXID_ONLY wire-protocol flag.

Returns:

  • (Integer)

    FORMAT_TXID_ONLY wire-protocol flag



150
151
152
# File 'lib/bsv/transaction/beef.rb', line 150

def format_flag
  FORMAT_TXID_ONLY
end

#wtxidString

Returns the stored wire-order wtxid.

Returns:

  • (String)

    the stored wire-order wtxid



145
146
147
# File 'lib/bsv/transaction/beef.rb', line 145

def wtxid
  @known_wtxid
end