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



136
137
138
139
140
# File 'lib/bsv/transaction/beef.rb', line 136

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



132
133
134
# File 'lib/bsv/transaction/beef.rb', line 132

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



148
149
150
# File 'lib/bsv/transaction/beef.rb', line 148

def format_flag
  FORMAT_TXID_ONLY
end

#wtxidString

Returns the stored wire-order wtxid.

Returns:

  • (String)

    the stored wire-order wtxid



143
144
145
# File 'lib/bsv/transaction/beef.rb', line 143

def wtxid
  @known_wtxid
end