Module: BSV::Wallet::Postgres::DisplayTxid
Overview
Convenience method for models with a wtxid column. Converts wire-order binary wtxid to display-order hex — the human-readable format used by block explorers and external APIs.
Include on any Sequel::Model whose table has a wtxid bytea column.
Instance Method Summary collapse
-
#dtxid ⇒ String?
(also: #dtxid_hex)
Display-order hex transaction ID (reversed from wire-order wtxid).
Instance Method Details
#dtxid ⇒ String? Also known as: dtxid_hex
Display-order hex transaction ID (reversed from wire-order wtxid).
15 16 17 18 19 20 |
# File 'lib/bsv/wallet/postgres/display_txid.rb', line 15 def dtxid return unless wtxid BSV::Primitives::Hex.validate_wtxid!(wtxid, name: "#{self.class.name}#dtxid") wtxid.reverse.unpack1('H*') end |