Sha256: 767ed1d591eb6b6d51415e9bd7cdad1c7066862fad3e7860f31612b75c69ed95

Contents?: true

Size: 843 Bytes

Versions: 28

Compression:

Stored size: 843 Bytes

Contents

module OpenAssets
  module Transaction

    # A transaction output with information about the asset ID and asset quantity associated to it.
    class SpendableOutput

      # An object that can be used to locate the output.
      attr_accessor :out_point
      # The actual output object.
      attr_accessor :output

      attr_accessor :confirmations

      # @param [OpenAssets::Transaction::OutPoint] out_point
      # @param [OpenAssets::Protocol::TransactionOutput] output
      def initialize(out_point, output)
        @out_point = out_point
        @output = output
        @confirmations = nil
      end

      # convert to hash.
      def to_hash
        return {} if @output.nil?
        {'txid' => @out_point.hash, 'vout' => @out_point.index, 'confirmations' => @confirmations}.merge(@output.to_hash)
      end

    end

  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
openassets-ruby-0.5.3 lib/openassets/transaction/spendable_output.rb
openassets-ruby-0.5.2 lib/openassets/transaction/spendable_output.rb
openassets-ruby-0.5.1 lib/openassets/transaction/spendable_output.rb
openassets-ruby-0.5.0 lib/openassets/transaction/spendable_output.rb
openassets-ruby-0.4.9 lib/openassets/transaction/spendable_output.rb
openassets-ruby-0.4.8 lib/openassets/transaction/spendable_output.rb
openassets-ruby-0.4.7 lib/openassets/transaction/spendable_output.rb
openassets-ruby-0.4.6 lib/openassets/transaction/spendable_output.rb
openassets-ruby-0.4.5 lib/openassets/transaction/spendable_output.rb
openassets-ruby-0.4.4 lib/openassets/transaction/spendable_output.rb
openassets-ruby-0.4.3 lib/openassets/transaction/spendable_output.rb
openassets-ruby-0.4.2 lib/openassets/transaction/spendable_output.rb
openassets-ruby-0.4.1 lib/openassets/transaction/spendable_output.rb
openassets-ruby-0.4.0 lib/openassets/transaction/spendable_output.rb
openassets-ruby-0.3.9 lib/openassets/transaction/spendable_output.rb
openassets-ruby-0.3.8 lib/openassets/transaction/spendable_output.rb
openassets-ruby-0.3.7 lib/openassets/transaction/spendable_output.rb
openassets-ruby-0.3.6 lib/openassets/transaction/spendable_output.rb
openassets-ruby-0.3.5 lib/openassets/transaction/spendable_output.rb
openassets-ruby-0.3.4 lib/openassets/transaction/spendable_output.rb