/** * Send the transaction to the network. * * @param TXSkeleton $txSkeleton * @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 */ public function send(TXSkeleton $txSkeleton, $apiContext = null, $restCall = null) { $payLoad = $txSkeleton->toJSON(); $chainUrlPrefix = $this->getChainUrlPrefix($apiContext); $json = $this->executeCall("{$chainUrlPrefix}/txs/send", "POST", $payLoad, null, $apiContext, $restCall); $returnedTXSkeleton = new TXSkeleton(); $returnedTXSkeleton->fromJson($json); return $returnedTXSkeleton; }
/** * Create a new TX. * * @deprecated since version 1.2. Use TXClient. * @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 */ public function create($apiContext = null, $restCall = null) { $payLoad = $this->toJSON(); $chainUrlPrefix = self::getChainUrlPrefix($apiContext); $json = self::executeCall("{$chainUrlPrefix}/txs/new", "POST", $payLoad, null, $apiContext, $restCall); $ret = new TXSkeleton(); $ret->fromJson($json); return $ret; }