module NanoRpc::AccountHelper

Public Instance Methods

balance() click to toggle source
# File lib/nano_rpc/helpers/account_helper.rb, line 5
def balance
  account_balance.balance
end
balance_pending()
Alias for: pending_balance
block_count() click to toggle source
# File lib/nano_rpc/helpers/account_helper.rb, line 9
def block_count
  account_block_count.block_count
end
blocks_pending(count: 100, threshold: nil, source: nil)
Alias for: pending_blocks
history(count:) click to toggle source
# File lib/nano_rpc/helpers/account_helper.rb, line 13
def history(count:)
  account_history(count: count).history
end
info() click to toggle source
# File lib/nano_rpc/helpers/account_helper.rb, line 17
def info
  account_info
end
key() click to toggle source
# File lib/nano_rpc/helpers/account_helper.rb, line 21
def key
  account_key['key']
end
move(from:, to:) click to toggle source
# File lib/nano_rpc/helpers/account_helper.rb, line 25
def move(from:, to:)
  account_move(
    source: from,
    wallet: to,
    accounts: [address]
  ).moved == 1
end
pending_balance() click to toggle source
# File lib/nano_rpc/helpers/account_helper.rb, line 37
def pending_balance
  account_balance.pending
end
Also aliased as: balance_pending
pending_blocks(count: 100, threshold: nil, source: nil) click to toggle source
# File lib/nano_rpc/helpers/account_helper.rb, line 42
def pending_blocks(count: 100, threshold: nil, source: nil)
  pending(
    count: count,
    threshold: threshold,
    source: source
  ).blocks
end
Also aliased as: blocks_pending
remove(wallet:) click to toggle source
# File lib/nano_rpc/helpers/account_helper.rb, line 51
def remove(wallet:)
  account_remove(wallet: wallet).removed == 1
end
representative() click to toggle source
# File lib/nano_rpc/helpers/account_helper.rb, line 55
def representative
  account_representative.representative
end
representative_set(wallet:, representative:) click to toggle source
# File lib/nano_rpc/helpers/account_helper.rb, line 59
def representative_set(wallet:, representative:)
  account_representative_set(
    wallet: wallet,
    representative: representative
  ).set == 1
end
valid?() click to toggle source
# File lib/nano_rpc/helpers/account_helper.rb, line 66
def valid?
  validate_account_number.valid == 1
end
wallet_work_set(wallet:, work:) click to toggle source
# File lib/nano_rpc/helpers/account_helper.rb, line 33
def wallet_work_set(wallet:, work:)
  work_set(wallet: wallet, work: work).success == ''
end
weight() click to toggle source
# File lib/nano_rpc/helpers/account_helper.rb, line 70
def weight
  account_weight.weight
end