class OmiseGO::Wallet

Public Class Methods

all(provider_user_id:, client: nil) click to toggle source
# File lib/omisego/wallet.rb, line 8
def all(provider_user_id:, client: nil)
  request(client).send('user.get_wallets', provider_user_id: provider_user_id).data
end
all_for_account(account_id:, client: nil) click to toggle source
# File lib/omisego/wallet.rb, line 12
def all_for_account(account_id:, client: nil)
  request(client).send('account.get_wallets', id: account_id).data
end
credit(provider_user_id:, token_id:, amount:, metadata: {}, user_address: nil, encrypted_metadata: {}, idempotency_token:, account_id:, account_address: nil, client: nil) click to toggle source
# File lib/omisego/wallet.rb, line 16
def credit(provider_user_id:, token_id:, amount:, metadata: {}, user_address: nil,
           encrypted_metadata: {}, idempotency_token:, account_id:, account_address: nil,
           client: nil)
  params = { to_provider_user_id: provider_user_id,
             to_address: user_address,
             from_account_id: account_id,
             from_address: account_address,
             token_id: token_id,
             amount: amount,
             metadata: metadata,
             encrypted_metadata: encrypted_metadata,
             account_address: account_address,
             idempotency_token: idempotency_token }
  request(client).send('transaction.create', params).data
end
debit(provider_user_id:, user_address: nil, token_id:, amount:, metadata: {}, encrypted_metadata: {}, idempotency_token:, account_id:, account_address: nil, client: nil) click to toggle source
# File lib/omisego/wallet.rb, line 32
def debit(provider_user_id:, user_address: nil, token_id:, amount:, metadata: {},
          encrypted_metadata: {}, idempotency_token:, account_id:, account_address: nil,
          client: nil)
  params = { from_provider_user_id: provider_user_id,
             from_address: user_address,
             to_account_id: account_id,
             to_address: account_address,
             token_id: token_id,
             amount: amount,
             metadata: metadata,
             encrypted_metadata: encrypted_metadata,
             account_address: account_address,
             idempotency_token: idempotency_token }
  request(client).send('transaction.create', params).data
end

Public Instance Methods

account() click to toggle source
# File lib/omisego/wallet.rb, line 53
def account
  @_account ||= Account.new(@account)
end
balances() click to toggle source
# File lib/omisego/wallet.rb, line 57
def balances
  @_balances ||= @balances.map do |balance|
    Balance.new(balance)
  end
end
user() click to toggle source
# File lib/omisego/wallet.rb, line 49
def user
  @_user ||= User.new(@user)
end