class OmiseGO::Transaction

Public Class Methods

all(params: {}, client: nil) click to toggle source
# File lib/omisego/transaction.rb, line 14
def all(params: {}, client: nil)
  if params[:provider_user_id]
    all_for_user(
      provider_user_id: params[:provider_user_id],
      address: params[:address],
      params: params,
      client: client
    )
  else
    request(client).send('transaction.all', {}, params: params).data
  end
end
all_for_user(provider_user_id:, address: nil, params: {}, client: nil) click to toggle source
# File lib/omisego/transaction.rb, line 27
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.get_transactions', body, params: params).data
end
create(from_account_id: nil, from_provider_user_id: nil, from_address: nil, to_account_id: nil, to_provider_user_id: nil, to_address: nil, from_token_id: nil, to_token_id: nil, token_id: nil, from_amount: nil, to_amount: nil, amount: nil, exchange_account_id: nil, exchange_wallet_address: nil, metadata: {}, encrypted_metadata: {}, idempotency_token:, client: nil) click to toggle source
# File lib/omisego/transaction.rb, line 36
def create(from_account_id: nil,
           from_provider_user_id: nil,
           from_address: nil,
           to_account_id: nil,
           to_provider_user_id: nil,
           to_address: nil,
           from_token_id: nil,
           to_token_id: nil,
           token_id: nil,
           from_amount: nil,
           to_amount: nil,
           amount: nil,
           exchange_account_id: nil,
           exchange_wallet_address: nil,
           metadata: {},
           encrypted_metadata: {},
           idempotency_token:,
           client: nil)
  request(client).send('transaction.create', from_account_id: from_account_id,
                                             from_provider_user_id: from_provider_user_id,
                                             from_address: from_address,
                                             to_account_id: to_account_id,
                                             to_provider_user_id: to_provider_user_id,
                                             to_address: to_address,
                                             from_token_id: from_token_id,
                                             to_token_id: to_token_id,
                                             token_id: token_id,
                                             from_amount: from_amount,
                                             to_amount: to_amount,
                                             amount: amount,
                                             exchange_account_id: exchange_account_id,
                                             exchange_wallet_address: exchange_wallet_address,
                                             metadata: metadata,
                                             encrypted_metadata: encrypted_metadata,
                                             idempotency_token: idempotency_token).data
end

Public Instance Methods

exchange() click to toggle source
# File lib/omisego/transaction.rb, line 82
def exchange
  @_exchange ||= Exchange.new(@exchange)
end
from() click to toggle source
# File lib/omisego/transaction.rb, line 74
def from
  @_from ||= TransactionSource.new(@from)
end
to() click to toggle source
# File lib/omisego/transaction.rb, line 78
def to
  @_to ||= TransactionSource.new(@to)
end