Sha256: 0606e78158012d14ab831464b7716073ed2d1b2aff303ffdbc5354ea587ff85c

Contents?: true

Size: 818 Bytes

Versions: 1

Compression:

Stored size: 818 Bytes

Contents

module OmiseGO
  class Transaction < Base
    attributes :id, :idempotency_token, :amount, :from, :to, :exchange,
               :metadata, :status, :created_at, :updated_at

    class << self
      def all(params: {}, client: nil)
        request(client).send('transaction.all', {}, params: params).data
      end

      def all_for_user(provider_user_id:, address: nil, params: {}, client: nil)
        body = {
          provider_user_id: provider_user_id,
          address:          address
        }

        request(client).send('user.list_transactions', body, params: params).data
      end
    end

    def from
      @_from ||= TransactionSource.new(@from)
    end

    def to
      @_to ||= TransactionSource.new(@to)
    end

    def exchange
      @_exchange ||= Exchange.new(@exchange)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
omisego-0.9.5 lib/omisego/transaction.rb