Sha256: 8007f30a9a137b489a9cb2c29268726957d1bf102ed5f1a757a06c561691de3a
Contents?: true
Size: 892 Bytes
Versions: 5
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_uint32le(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
5 entries across 5 versions & 1 rubygems