Sha256: 988d95dc32f0aded53e3691c4cb9a8b49b82a732533e45533df4b7c471157b8d
Contents?: true
Size: 726 Bytes
Versions: 21
Compression:
Stored size: 726 Bytes
Contents
module Bitcoin module PSBT class KeyOriginInfo include Bitcoin::KeyPath attr_reader :fingerprint # String hex format attr_reader :key_paths # Array[Integer] def initialize(fingerprint: nil, key_paths: []) @fingerprint = fingerprint @key_paths = key_paths end def self.parse_from_payload(payload) buf = StringIO.new(payload) self.new(fingerprint: buf.read(4).bth, key_paths: buf.read.unpack('I*')) end def to_payload fingerprint.htb + key_paths.pack('I*') end def to_h {fingerprint: fingerprint, key_paths: to_key_path(key_paths)} end def to_s to_h.to_s end end end end
Version data entries
21 entries across 21 versions & 1 rubygems