lib/nanook/wallet.rb in nanook-1.0.0 vs lib/nanook/wallet.rb in nanook-1.0.1
- old
+ new
@@ -111,20 +111,20 @@
#
# wallet.balance(account_break_down: true)
#
# Example response:
#
- {
- "xrb_3e3j5tkog48pnny9dmfzj1r16pg8t1e76dz5tmac6iq689wyjfpi00000000"=>{
- "balance"=>2500000000000000,
- "pending"=>10000000000000
- },
- "xrb_1e5aqegc1jb7qe964u4adzmcezyo6o146zb8hm6dft8tkp79za3sxwjym5rx"=>{
- "balance"=>2500000000000000,
- "pending"=>0
- },
- }
+ # {
+ # "xrb_3e3j5tkog48pnny9dmfzj1r16pg8t1e76dz5tmac6iq689wyjfpi00000000"=>{
+ # "balance"=>2.5,
+ # "pending"=>1
+ # },
+ # "xrb_1e5aqegc1jb7qe964u4adzmcezyo6o146zb8hm6dft8tkp79za3sxwjym5rx"=>{
+ # "balance"=>51.4,
+ # "pending"=>0
+ # },
+ # }
def balance(account_break_down: false, unit: Nanook::WalletAccount::DEFAULT_UNIT)
wallet_required!
unless Nanook::WalletAccount::UNITS.include?(unit)
raise ArgumentError.new("Unsupported unit: #{unit}")
@@ -133,10 +133,10 @@
if account_break_down
return Nanook::Util.coerce_empty_string_to_type(rpc(:wallet_balances)[:balances], Hash).tap do |r|
if unit == :nano
r.each do |account, balances|
r[account][:balance] = Nanook::Util.raw_to_NANO(r[account][:balance])
- r[account][:pending] = Nanook::Util.raw_to_NANO(r[account][:balapendingnce])
+ r[account][:pending] = Nanook::Util.raw_to_NANO(r[account][:pending])
end
end
end
end