Sha256: 1705c236212ba82ea840e3e21206d5a70c34de03fc910fce67d19a81df48e20e
Contents?: true
Size: 892 Bytes
Versions: 6
Compression:
Stored size: 892 Bytes
Contents
module BTC # Represents a distinct issuance of any given asset. # Hash160(tx hash || txout index || amount) class IssuanceID < BTC::Hash160Address register_class self def self.mainnet_version 63 # 'S' prefix ('single', 'issuance') end def self.testnet_version 125 # 's' prefix end def initialize(string: nil, hash: nil, network: nil, outpoint: nil, amount: nil, _raw_data: nil) if outpoint || amount raise ArgumentError, "Outpoint is missing" if !outpoint raise ArgumentError, "Amount is missing" if !amount || amount < 0 data = outpoint.transaction_hash + WireFormat.encode_uint32be(outpoint.index) + WireFormat.encode_uint64le(amount) super(hash: BTC.hash160(data), network: network) else super(string: string, hash: hash, network: network, _raw_data: _raw_data) end end end end
Version data entries
6 entries across 6 versions & 1 rubygems