Module: Rubybear::Mixins::ActsAsWallet
- Included in:
- Chain
- Defined in:
- lib/rubybear/mixins/acts_as_wallet.rb
Instance Method Summary collapse
-
#claim_reward_balance(options) ⇒ Object
Create a claim_reward_balance operation.
-
#claim_reward_balance!(permlink) ⇒ Object
Create a claim_reward_balance operation and broadcasts it right away.
-
#transfer(options = {}) ⇒ Object
Create a transfer operation.
-
#transfer!(options = {}) ⇒ Object
Create a transfer operation and broadcasts it right away.
Instance Method Details
#claim_reward_balance(options) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/rubybear/mixins/acts_as_wallet.rb', line 16 def claim_reward_balance() reward_bears = [:reward_bears] || '0.000 BEARS' reward_bsd = [:reward_bsd] || '0.000 BSD' reward_coins = [:reward_coins] || '0.000000 COINS' @operations << { type: :claim_reward_balance, account: account_name, reward_bears: reward_bears, reward_bsd: reward_bsd, reward_coins: reward_coins } self end |
#claim_reward_balance!(permlink) ⇒ Object
40 |
# File 'lib/rubybear/mixins/acts_as_wallet.rb', line 40 def claim_reward_balance!(permlink); claim_reward_balance(permlink).broadcast!(true); end |
#transfer(options = {}) ⇒ Object
52 53 54 55 56 |
# File 'lib/rubybear/mixins/acts_as_wallet.rb', line 52 def transfer( = {}) @operations << .merge(type: :transfer, from: account_name) self end |
#transfer!(options = {}) ⇒ Object
64 |
# File 'lib/rubybear/mixins/acts_as_wallet.rb', line 64 def transfer!( = {}); transfer().broadcast!(true); end |