public function sendTransaction(
        int $anonymity,
        array $transfers,
        int $fee,
        array $addresses = null,
        int $unlockTime = null,
        string $extra = null,
        string $paymentId = null,
        string $changeAddress = null
    ):JsonResponse {
        $params = [
            'anonymity' => $anonymity,
            'transfers' => $transfers,
            'fee'       => $fee,
        ];

        if (!is_null($addresses)) $params['addresses'] = $addresses;
        if (!is_null($unlockTime)) $params['unlockTime'] = $unlockTime;
        if (!is_null($extra)) $params['extra'] = $extra;
        if (!is_null($paymentId)) $params['paymentId'] = $paymentId;
        if (!is_null($changeAddress)) $params['changeAddress'] = $changeAddress;

        return $this->rpcPost('sendTransaction', $params);
    }
public function sendTransaction(
        int $anonymity,
        array $transfers,
        int $fee,
        array $addresses = null,
        int $unlockTime = null,
        string $extra = null,
        string $paymentId = null,
        string $changeAddress = null
    ):JsonResponse {
        $params = [
            'anonymity' => $anonymity,
            'transfers' => $transfers,
            'fee'       => $fee,
        ];

        if (!is_null($addresses)) $params['addresses'] = $addresses;
        if (!is_null($unlockTime)) $params['unlockTime'] = $unlockTime;
        if (!is_null($extra)) $params['extra'] = $extra;
        if (!is_null($paymentId)) $params['paymentId'] = $paymentId;
        if (!is_null($changeAddress)) $params['changeAddress'] = $changeAddress;

        return $this->rpcPost('sendTransaction', $params);
    }
public function sendTransaction ( int $ anonymity , array $ transfers , int $ fee , array $ addresses = null , int $ unlockTime = null , string $ extra = null , string $ paymentId = null , string $ changeAddress = null ) : JsonResponse { $ params = [ 'anonymity' => $ anonymity , 'transfers' => $ transfers , 'fee' => $ fee , ] ; if ( ! is_null ( $ addresses ) ) $ params [ 'addresses' ] = $ addresses ; if ( ! is_null ( $ unlockTime ) ) $ params [ 'unlockTime' ] = $ unlockTime ; if ( ! is_null ( $ extra ) ) $ params [ 'extra' ] = $ extra ; if ( ! is_null ( $ paymentId ) ) $ params [ 'paymentId' ] = $ paymentId ; if ( ! is_null ( $ changeAddress ) ) $ params [ 'changeAddress' ] = $ changeAddress ; return $ this -> rpcPost ( 'sendTransaction' , $ params ) ; }
Allows you to send transaction to one or several addresses. Also, it allows you to use a payment_id for a
transaction to a single address.

@param int         $anonymity      Privacy level (a discrete number from 1 to infinity).
6+ recommended. Required.
@param array       $transfers      Array that contains: address as string, amount as integer. Required.
@param int         $fee            Transaction fee. Required.
@param array|null  $addresses      Array of strings, where each string is an address to take the funds
from. Optional.
@param int|null    $unlockTime     Height of the block until which transaction is going to be locked for
spending. Optional.
@param string|null $extra          String of variable length. Can contain A-Z, 0-9 characters. Optional.
@param string|null $paymentId      Optional.
@param string|null $changeAddress  Valid and existing in this container address. If container contains only
1 address, $changeAddress field can be left empty and the change is going to
be sent to this address. If $addresses field contains only 1 address,
$changeAddress can be left empty and the change is going to be sent to this
address. In the rest of the cases, $changeAddress field is mandatory and
must contain an address.
@return JsonResponse
Allows you to send transaction to one or several addresses . Also it allows you to use a payment_id for a transaction to a single address .