Module: MoneroRPC::Transfer

Included in:
Client
Defined in:
lib/monero_rpc/transfer.rb

Instance Method Summary collapse

Instance Method Details

#create_transfer(address, amount, args = {}) ⇒ Object



26
27
28
# File 'lib/monero_rpc/transfer.rb', line 26

def create_transfer(address, amount, args={})
  send_bulk_transfer([address: address, amount: amount], args)
end

#send_bulk_transfer(destinations, args = {}) ⇒ Object



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/monero_rpc/transfer.rb', line 30

def send_bulk_transfer(destinations, args={})

  mixin = args.fetch(:mixin, 7)
  fee = args.fetch(:fee, 1) # ignored anyways
  unlock_time = args.fetch(:unlock_time, 0)
  payment_id = args.fetch(:payment_id, nil)
  get_tx_key = args.fetch(:get_tx_key, true)
  priority = args.fetch(:priority, 0)
  do_not_relay = args.fetch(:do_not_relay, false)
  get_tx_hex = args.fetch(:get_tx_hex, false)


  options = {
    destinations: destinations, fee: fee, mixin: mixin, unlock_time: unlock_time,
    payment_id: payment_id, get_tx_key: get_tx_key, priority: priority, do_not_relay: do_not_relay, get_tx_hex: get_tx_hex
  }

  request("transfer", options)
end