Module: Raiblocks::AccountProxyHelper
- Included in:
- Account
- Defined in:
- lib/raiblocks/helpers/account_proxy_helper.rb
Instance Method Summary collapse
- #balance ⇒ Object
- #block_count ⇒ Object
- #create(wallet:, work:) ⇒ Object
- #history(count:) ⇒ Object
- #info ⇒ Object
- #key ⇒ Object
- #list ⇒ Object
- #move(wallet:, source:, accounts:) ⇒ Object
- #pending_balance ⇒ Object (also: #balance_pending)
- #pending_blocks(count:, threshold: nil, exists: nil) ⇒ Object (also: #blocks_pending)
- #remove(wallet:) ⇒ Object
- #representative ⇒ Object
- #representative_set(wallet:, representative:) ⇒ Object
- #wallet_work(wallet:) ⇒ Object
- #wallet_work_set(wallet:, work:) ⇒ Object
- #weight ⇒ Object
Instance Method Details
#balance ⇒ Object
3 4 5 |
# File 'lib/raiblocks/helpers/account_proxy_helper.rb', line 3 def balance account_balance.balance end |
#block_count ⇒ Object
7 8 9 |
# File 'lib/raiblocks/helpers/account_proxy_helper.rb', line 7 def block_count account_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:) account_create(wallet: wallet, work: work).account end |
#history(count:) ⇒ Object
15 16 17 |
# File 'lib/raiblocks/helpers/account_proxy_helper.rb', line 15 def history(count:) account_history(count: count).history end |
#info ⇒ Object
19 20 21 |
# File 'lib/raiblocks/helpers/account_proxy_helper.rb', line 19 def info account_info end |
#key ⇒ Object
23 24 25 |
# File 'lib/raiblocks/helpers/account_proxy_helper.rb', line 23 def key account_key.key end |
#list ⇒ Object
27 28 29 |
# File 'lib/raiblocks/helpers/account_proxy_helper.rb', line 27 def list account_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:) account_move(wallet: wallet, source: source, accounts: accounts).moved == 1 end |
#pending_balance ⇒ Object Also known as: balance_pending
43 44 45 |
# File 'lib/raiblocks/helpers/account_proxy_helper.rb', line 43 def pending_balance account_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:) account_remove(wallet: wallet).removed == 1 end |
#representative ⇒ Object
57 58 59 |
# File 'lib/raiblocks/helpers/account_proxy_helper.rb', line 57 def representative account_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:) account_representative_set( 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 |
#weight ⇒ Object
67 68 69 |
# File 'lib/raiblocks/helpers/account_proxy_helper.rb', line 67 def weight account_weight.weight end |