Class: ItBitSDK::Trading::Wallet

Inherits:
Base
  • Object
show all
Defined in:
lib/it_bit_sdk/trading/wallet.rb

Constant Summary

Constants inherited from Base

Base::BASE_URL

Instance Method Summary collapse

Methods inherited from Base

#next_nonce, #send_request, #timestamp

Instance Method Details

#balance(wallet_id, currency_code) ⇒ Object



20
21
22
# File 'lib/it_bit_sdk/trading/wallet.rb', line 20

def balance(wallet_id, currency_code)
  ::ItBitSDK::Wallet::Balance.new(params: send_request(:get, "/wallets/#{wallet_id}/balances/#{currency_code}"))
end

#create!(name) ⇒ Object



12
13
14
# File 'lib/it_bit_sdk/trading/wallet.rb', line 12

def create!(name)
  ::ItBitSDK::Wallet.new(params: send_request(:post, "/wallets", name: name, user_id: ::ItBitSDK.user_id))
end

#wallet(wallet_id) ⇒ Object



16
17
18
# File 'lib/it_bit_sdk/trading/wallet.rb', line 16

def wallet(wallet_id)
  ::ItBitSDK::Wallet.new(params: send_request(:get, "/wallets/#{wallet_id}"))
end

#wallets(page: 1, per_page: 50) ⇒ Object



7
8
9
10
# File 'lib/it_bit_sdk/trading/wallet.rb', line 7

def wallets(page: 1, per_page: 50)
  send_request(:get, "/wallets", userId: ::ItBitSDK.user_id)
    .collect { |wallet| ::ItBitSDK::Wallet.new(params: wallet)  }
end