Class: Bitcoin::PSBT::GlobalXpub
Instance Attribute Summary collapse
-
#info ⇒ Object
readonly
Bitcoin::PSBT::KeyOriginInfo.
-
#xpub ⇒ Object
readonly
Bitcoin::ExtPubkey.
Instance Method Summary collapse
-
#initialize(xpub, info) ⇒ GlobalXpub
constructor
A new instance of GlobalXpub.
- #to_h ⇒ Object
- #to_payload ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(xpub, info) ⇒ GlobalXpub
Returns a new instance of GlobalXpub.
9 10 11 12 |
# File 'lib/bitcoin/psbt/tx.rb', line 9 def initialize(xpub, info) @xpub = xpub @info = info end |
Instance Attribute Details
#info ⇒ Object (readonly)
Bitcoin::PSBT::KeyOriginInfo
7 8 9 |
# File 'lib/bitcoin/psbt/tx.rb', line 7 def info @info end |
#xpub ⇒ Object (readonly)
Bitcoin::ExtPubkey
6 7 8 |
# File 'lib/bitcoin/psbt/tx.rb', line 6 def xpub @xpub end |
Instance Method Details
#to_h ⇒ Object
18 19 20 |
# File 'lib/bitcoin/psbt/tx.rb', line 18 def to_h {xpub: xpub.to_payload.bth}.merge(info.to_h) end |
#to_payload ⇒ Object
14 15 16 |
# File 'lib/bitcoin/psbt/tx.rb', line 14 def to_payload PSBT.serialize_to_vector(PSBT_GLOBAL_TYPES[:xpub], key: xpub.to_payload, value: info.to_payload) end |
#to_s ⇒ Object
22 23 24 |
# File 'lib/bitcoin/psbt/tx.rb', line 22 def to_s to_h.to_s end |