Sha256: 363a4feef1f0aedfd2b3dcae6222eec49dd6d7f1bbb36fc64313365429cfb720

Contents?: true

Size: 737 Bytes

Versions: 4

Compression:

Stored size: 737 Bytes

Contents

module BTC
  # Represents an Asset ID.
  class AssetID < BTC::Hash160Address
    
    def self.mainnet_version
      23 # "A" prefix
    end

    def self.testnet_version
      115
    end

    # Instantiates AssetID with output, output script or raw hash.
    # To compute an Asset ID for the Asset Definition file, use `trim_script_prefix: true`.
    def initialize(string: nil, hash: nil, network: nil, _raw_data: nil, script: nil, trim_script_prefix: false)
      if script
        script = script.without_dropped_prefix_data if trim_script_prefix
        super(hash: BTC.hash160(script.data), network: network)
      else
        super(string: string, hash: hash, network: network, _raw_data: _raw_data)
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
btcruby-1.0.3 lib/btcruby/open_assets/asset_id.rb
btcruby-1.0.2 lib/btcruby/open_assets/asset_id.rb
btcruby-1.0.1 lib/btcruby/open_assets/asset_id.rb
btcruby-1.0.0 lib/btcruby/open_assets/asset_id.rb