/** * Transfer to multiple people at once (but with same payment id) * * @param array an array in following format: * array( * array( * 'amount' => 0.1, * 'address' => 'ADDRESS HERE' * ), * array( * 'amount' => '2.1', * 'address' => 'ADDRESS HERE' * ) * @param string payment id, 64-character long string (optional) * @param decimal fee amount in XMR * @param int mixin count * @param int unlock time * @return string|bool if transfer was successful (all of them) it will * return transaction id, if any error occured no * transfers will be made and the function will * return false. Use $this->get_errors() to get error */ public function bulk_transfer($destinations = array(), $payment_id = '', $mixin = 3, $fee = 0.01, $unlock_time = 0) { // Convert decimals to integer, but without casting to int. Due to limits of PHP 32/64-bit we must store as string. foreach ($destinations as &$destination) { $destination['amount'] = bc::strip_trailing_zeros(bc::mul($destination['amount'], $this->multiplier)); } $params = array('destinations' => $destinations, 'payment_id' => $payment_id, 'fee' => bc::strip_trailing_zeros(bc::mul($fee, $this->multiplier)), 'mixin' => $mixin, 'unlock_time' => $unlock_time); $result = $this->_execute('transfer', $params, array('destinations' => array('amount'), 'fee')); if (isset($result['tx_hash'])) { return trim($result['tx_hash'], '<>'); } return false; }