Module: Raiblocks::AccountProxyHelper

Included in:
Account
Defined in:
lib/raiblocks/helpers/account_proxy_helper.rb

Instance Method Summary collapse

Instance Method Details

#balanceObject



3
4
5
# File 'lib/raiblocks/helpers/account_proxy_helper.rb', line 3

def balance
  .balance
end

#block_countObject



7
8
9
# File 'lib/raiblocks/helpers/account_proxy_helper.rb', line 7

def block_count
  .block_count
end

#create(wallet:, work:) ⇒ Object



11
12
13
# File 'lib/raiblocks/helpers/account_proxy_helper.rb', line 11

def create(wallet:, work:)
  (wallet: wallet, work: work).
end

#history(count:) ⇒ Object



15
16
17
# File 'lib/raiblocks/helpers/account_proxy_helper.rb', line 15

def history(count:)
  (count: count).history
end

#infoObject



19
20
21
# File 'lib/raiblocks/helpers/account_proxy_helper.rb', line 19

def info
  
end

#keyObject



23
24
25
# File 'lib/raiblocks/helpers/account_proxy_helper.rb', line 23

def key
  .key
end

#listObject



27
28
29
# File 'lib/raiblocks/helpers/account_proxy_helper.rb', line 27

def list
  .accounts
end

#move(wallet:, source:, accounts:) ⇒ Object



31
32
33
# File 'lib/raiblocks/helpers/account_proxy_helper.rb', line 31

def move(wallet:, source:, accounts:)
  (wallet: wallet, source: source, accounts: accounts).moved == 1
end

#pending_balanceObject Also known as: balance_pending



43
44
45
# File 'lib/raiblocks/helpers/account_proxy_helper.rb', line 43

def pending_balance
  .pending
end

#pending_blocks(count:, threshold: nil, exists: nil) ⇒ Object Also known as: blocks_pending



48
49
50
# File 'lib/raiblocks/helpers/account_proxy_helper.rb', line 48

def pending_blocks(count:, threshold: nil, exists: nil)
  pending(count: count, threshold: threshold, exists: exists).locks
end

#remove(wallet:) ⇒ Object



53
54
55
# File 'lib/raiblocks/helpers/account_proxy_helper.rb', line 53

def remove(wallet:)
  (wallet: wallet).removed == 1
end

#representativeObject



57
58
59
# File 'lib/raiblocks/helpers/account_proxy_helper.rb', line 57

def representative
  .representative
end

#representative_set(wallet:, representative:) ⇒ Object



61
62
63
64
65
# File 'lib/raiblocks/helpers/account_proxy_helper.rb', line 61

def representative_set(wallet:, representative:)
  (
    wallet: wallet, representative: representative
  ).set == 1
end

#wallet_work(wallet:) ⇒ Object



35
36
37
# File 'lib/raiblocks/helpers/account_proxy_helper.rb', line 35

def wallet_work(wallet:)
  work_get(wallet: wallet).work
end

#wallet_work_set(wallet:, work:) ⇒ Object



39
40
41
# File 'lib/raiblocks/helpers/account_proxy_helper.rb', line 39

def wallet_work_set(wallet:, work:)
  work_set(wallet: wallet, work: work).work[:success] == ''
end

#weightObject



67
68
69
# File 'lib/raiblocks/helpers/account_proxy_helper.rb', line 67

def weight
  .weight
end