Module: Raiblocks::WalletProxyHelper
- Included in:
- Wallet
- Defined in:
- lib/raiblocks/helpers/wallet_proxy_helper.rb
Instance Method Summary collapse
- #account_work(account:) ⇒ Object
- #account_work_set(account:, work:) ⇒ Object (also: #set_account_work)
- #add(key:, work: nil) ⇒ Object
- #balance ⇒ Object
- #balances(threshold: nil) ⇒ Object
- #begin_payment ⇒ Object
- #change_password(new_password:) ⇒ Object
- #change_seed(new_seed:) ⇒ Object
- #contains?(account:) ⇒ Boolean
- #create ⇒ Object
- #destroy ⇒ Object
- #enter_password(password) ⇒ Object
- #export ⇒ Object
- #frontiers ⇒ Object
- #init_payment ⇒ Object
- #locked? ⇒ Boolean
- #password_valid?(password:) ⇒ Boolean
- #pending_balance ⇒ Object
- #pending_blocks(count:, threshold: nil, source: nil) ⇒ Object
- #receive_block(account:, block:) ⇒ Object
- #representative ⇒ Object
- #representative_set(representative:) ⇒ Object (also: #set_representative)
- #republish(count:) ⇒ Object
- #send_tx(source:, destination:, amount:) ⇒ Object (also: #send_transaction)
- #work ⇒ Object
Instance Method Details
#account_work(account:) ⇒ Object
3 4 5 |
# File 'lib/raiblocks/helpers/wallet_proxy_helper.rb', line 3 def account_work(account:) work_get.work(account: account).work end |
#account_work_set(account:, work:) ⇒ Object Also known as: set_account_work
87 88 89 |
# File 'lib/raiblocks/helpers/wallet_proxy_helper.rb', line 87 def account_work_set(account:, work:) work_set(account: account, work: work).work[:success] == '' end |
#add(key:, work: nil) ⇒ Object
7 8 9 |
# File 'lib/raiblocks/helpers/wallet_proxy_helper.rb', line 7 def add(key:, work: nil) wallet_add(key: key, work: work).account end |
#balance ⇒ Object
11 12 13 |
# File 'lib/raiblocks/helpers/wallet_proxy_helper.rb', line 11 def balance wallet_balance_total.balance end |
#balances(threshold: nil) ⇒ Object
15 16 17 |
# File 'lib/raiblocks/helpers/wallet_proxy_helper.rb', line 15 def balances(threshold: nil) wallet_balances(threshold: threshold).balances end |
#begin_payment ⇒ Object
19 20 21 |
# File 'lib/raiblocks/helpers/wallet_proxy_helper.rb', line 19 def begin_payment payment_begin.account end |
#change_password(new_password:) ⇒ Object
23 24 25 |
# File 'lib/raiblocks/helpers/wallet_proxy_helper.rb', line 23 def change_password(new_password:) password_change(password: new_password).changed == 1 end |
#change_seed(new_seed:) ⇒ Object
27 28 29 |
# File 'lib/raiblocks/helpers/wallet_proxy_helper.rb', line 27 def change_seed(new_seed:) wallet_change_seed(seed: new_seed)[:success] == '' end |
#contains?(account:) ⇒ Boolean
31 32 33 |
# File 'lib/raiblocks/helpers/wallet_proxy_helper.rb', line 31 def contains?(account:) wallet_contains(account: account).exists == 1 end |
#create ⇒ Object
35 36 37 |
# File 'lib/raiblocks/helpers/wallet_proxy_helper.rb', line 35 def create wallet_create.wallet end |
#destroy ⇒ Object
39 40 41 |
# File 'lib/raiblocks/helpers/wallet_proxy_helper.rb', line 39 def destroy wallet_destroy end |
#enter_password(password) ⇒ Object
43 44 45 |
# File 'lib/raiblocks/helpers/wallet_proxy_helper.rb', line 43 def enter_password(password) password_enter(password: password).valid == 1 end |
#export ⇒ Object
47 48 49 |
# File 'lib/raiblocks/helpers/wallet_proxy_helper.rb', line 47 def export JSON[wallet_export.json] end |
#frontiers ⇒ Object
51 52 53 |
# File 'lib/raiblocks/helpers/wallet_proxy_helper.rb', line 51 def frontiers wallet_frontiers.frontiers end |
#init_payment ⇒ Object
55 56 57 |
# File 'lib/raiblocks/helpers/wallet_proxy_helper.rb', line 55 def init_payment payment_init.status == 'Ready' end |
#locked? ⇒ Boolean
59 60 61 |
# File 'lib/raiblocks/helpers/wallet_proxy_helper.rb', line 59 def locked? wallet_locked.locked == 1 end |
#password_valid?(password:) ⇒ Boolean
63 64 65 |
# File 'lib/raiblocks/helpers/wallet_proxy_helper.rb', line 63 def password_valid?(password:) password_valid(password: password).valid == 1 end |
#pending_balance ⇒ Object
67 68 69 |
# File 'lib/raiblocks/helpers/wallet_proxy_helper.rb', line 67 def pending_balance wallet_balance_total.pending end |
#pending_blocks(count:, threshold: nil, source: nil) ⇒ Object
71 72 73 |
# File 'lib/raiblocks/helpers/wallet_proxy_helper.rb', line 71 def pending_blocks(count:, threshold: nil, source: nil) wallet_pending(count: count, threshold: threshold, source: source).blocks end |
#receive_block(account:, block:) ⇒ Object
75 76 77 |
# File 'lib/raiblocks/helpers/wallet_proxy_helper.rb', line 75 def receive_block(account:, block:) receive.block(account: account, block: block).block end |
#representative ⇒ Object
79 80 81 |
# File 'lib/raiblocks/helpers/wallet_proxy_helper.rb', line 79 def representative wallet_representative.representative end |
#representative_set(representative:) ⇒ Object Also known as: set_representative
92 93 94 |
# File 'lib/raiblocks/helpers/wallet_proxy_helper.rb', line 92 def representative_set(representative:) wallet_representative_set(representative: representative).set == 1 end |
#republish(count:) ⇒ Object
83 84 85 |
# File 'lib/raiblocks/helpers/wallet_proxy_helper.rb', line 83 def republish(count:) wallet_republish(count: count).blocks end |
#send_tx(source:, destination:, amount:) ⇒ Object Also known as: send_transaction
97 98 99 |
# File 'lib/raiblocks/helpers/wallet_proxy_helper.rb', line 97 def send_tx(source:, destination:, amount:) rai_send(source: source, destination: destination, amount: amount).block end |
#work ⇒ Object
102 103 104 |
# File 'lib/raiblocks/helpers/wallet_proxy_helper.rb', line 102 def work wallet_work_get.works end |