lib/BlockCypher/Client/TXClient.php
public function create(TX $tx, $apiContext = null, $restCall = null)
    {
        // TODO: change signature. Add $params = array() after TX $tx
        //ArgumentGetParamsValidator::validate($params, 'params');
        //$allowedParams = array(
        //    'includeToSignTx' => 1,
        //);
        //$params = ArgumentGetParamsValidator::sanitize($params, $allowedParams);

        $payLoad = $tx->toJSON();

        $chainUrlPrefix = $this->getChainUrlPrefix($apiContext);

        $json = $this->executeCall(
            "$chainUrlPrefix/txs/new",
            "POST",
            $payLoad,
            null,
            $apiContext,
            $restCall
        );

        $txSkeleton = new TXSkeleton();
        $txSkeleton->fromJson($json);
        return $txSkeleton;
    }
public function create(TX $tx, $apiContext = null, $restCall = null)
    {
        // TODO: change signature. Add $params = array() after TX $tx
        //ArgumentGetParamsValidator::validate($params, 'params');
        //$allowedParams = array(
        //    'includeToSignTx' => 1,
        //);
        //$params = ArgumentGetParamsValidator::sanitize($params, $allowedParams);

        $payLoad = $tx->toJSON();

        $chainUrlPrefix = $this->getChainUrlPrefix($apiContext);

        $json = $this->executeCall(
            "$chainUrlPrefix/txs/new",
            "POST",
            $payLoad,
            null,
            $apiContext,
            $restCall
        );

        $txSkeleton = new TXSkeleton();
        $txSkeleton->fromJson($json);
        return $txSkeleton;
    }
public function create ( TX $ tx , $ apiContext = null , $ restCall = null ) { // TODO: change signature. Add $params = array() after TX $tx //ArgumentGetParamsValidator::validate($params, 'params'); //$allowedParams = array( //    'includeToSignTx' => 1, //); //$params = ArgumentGetParamsValidator::sanitize($params, $allowedParams); $ payLoad = $ tx -> toJSON ( ) ; $ chainUrlPrefix = $ this -> getChainUrlPrefix ( $ apiContext ) ; $ json = $ this -> executeCall ( "$chainUrlPrefix/txs/new" , "POST" , $ payLoad , null , $ apiContext , $ restCall ) ; $ txSkeleton = new TXSkeleton ( ) ; $ txSkeleton -> fromJson ( $ json ) ; return $ txSkeleton ; }
Create a new TX.

@param TX $tx
@param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
@param BlockCypherRestCall $restCall is the Rest Call Service that is used to make rest calls
@return TXSkeleton
Create a new TX .