Method: Hive::Broadcast.transfer_from_savings

Defined in:
lib/hive/broadcast.rb

.transfer_from_savings(options, &block) ⇒ Object

Parameters:

  • options (Hash)

    options

Options Hash (options):

  • :wif (String)

    Active wif

  • :params (Hash)
    • :from (String)

    • :request_id (String)

    • :to (String)

    • :amount (String)

    • :memo (String) (optional)

  • :pretend (Boolean)

    Just validate, do not broadcast.

See Also:



1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
# File 'lib/hive/broadcast.rb', line 1110

def self.transfer_from_savings(options, &block)
  required_fields = %i(from request_id to amount)
  params = options[:params]
  check_required_fields(params, *required_fields)
  
  params[:memo] ||= ''
  params[:amount] = normalize_amount(options.merge amount: params[:amount])

  ops = [[:transfer_from_savings, params]]
  
  process(options.merge(ops: ops), &block)
end