Module: Kucoin::Rest::Private::Balances

Included in:
Client
Defined in:
lib/kucoin/rest/private/balances.rb

Instance Method Summary collapse

Instance Method Details

#balance(options: {}) ⇒ Object



25
26
27
28
29
# File 'lib/kucoin/rest/private/balances.rb', line 25

def balance(options: {})
  options.merge!(authenticate: true)          
  response  =   get("/account/balance", options: options)&.fetch("data", {})
  ::Kucoin::Models::Balance.parse(response) if response
end

#coin_balance(coin, options: {}) ⇒ Object



18
19
20
21
22
23
# File 'lib/kucoin/rest/private/balances.rb', line 18

def coin_balance(coin, options: {})
  options.merge!(authenticate: true)          
  
  response  =   get("/account/#{coin}/balance", options: options)&.fetch("data", {})
  ::Kucoin::Models::Balance.new(response) if response
end

#wallet_records(coin, type: :deposit, status: :finished, limit: nil, page: nil, options: {}) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
# File 'lib/kucoin/rest/private/balances.rb', line 6

def wallet_records(coin, type: :deposit, status: :finished, limit: nil, page: nil, options: {})
  options.merge!(authenticate: true)
  
  type      =   type.to_s.upcase
  status    =   status.to_s.upcase
  
  params    =   {type: type, status: status, limit: limit, page: page}
  params.delete_if { |key, value| value.nil? }
  
  get("/account/#{coin}/wallet/records", params: params, options: options)&.fetch("data", {})
end