module Bitcoin::PSBT

Constants

PSBT_GLOBAL_TYPES
PSBT_IN_TYPES
PSBT_MAGIC_BYTES

constants for PSBT

PSBT_OUT_TYPES
PSBT_SEPARATOR
SUPPORT_VERSION

Public Class Methods

serialize_to_vector(key_type, key: nil, value: nil) click to toggle source
# File lib/bitcoin/psbt.rb, line 26
def self.serialize_to_vector(key_type, key: nil, value: nil)
  key_len = key_type.itb.bytesize
  key_len += key.bytesize if key
  s = Bitcoin.pack_var_int(key_len) << Bitcoin.pack_var_int(key_type)
  s << key if key
  s << Bitcoin.pack_var_int(value.bytesize) << value
  s
end