Method: Hive::Broadcast.transfer_to_savings

Defined in:
lib/hive/broadcast.rb

.transfer_to_savings(options, &block) ⇒ Object

For time locked savings accounts.

Parameters:

  • options (Hash)

    options

Options Hash (options):

  • :wif (String)

    Active wif

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

    • :to (String)

    • :amount (String)

    • :memo (String) (optional)

  • :pretend (Boolean)

    Just validate, do not broadcast.

See Also:



1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
# File 'lib/hive/broadcast.rb', line 1087

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

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