Class: WavesRubyClient::Wallet
- Inherits:
-
Object
- Object
- WavesRubyClient::Wallet
- Defined in:
- lib/waves_ruby_client/wallet.rb
Overview
get waves and btc balance
Class Method Summary collapse
Class Method Details
.balance ⇒ Object
6 7 8 9 10 11 12 13 14 15 |
# File 'lib/waves_ruby_client/wallet.rb', line 6 def self.balance WavesRubyClient.try_many_times do url = ['/orderbook', WavesRubyClient::AMOUNT_ASSET.url_id, WavesRubyClient::PRICE_ASSET.url_id, 'tradableBalance', WavesRubyClient::WAVES_ADDRESS].join('/') res = WavesRubyClient::Api.instance.call_matcher(url) { waves: res['WAVES'].to_f / WavesRubyClient::NUMBER_MULTIPLIKATOR, btc: res[WavesRubyClient::Asset.btc.url_id].to_f / WavesRubyClient::NUMBER_MULTIPLIKATOR } end end |