$output = new \BlockCypher\Api\TXOutput();
$output->addAddress("n3D2YXwvpoPg8FhcWpzJiS3SvKKGD8AXZ4");
$output->setValue(1000);
$tx->addInput($input);
$tx->addOutput($output);
$request = clone $tx;
$txClient = new \BlockCypher\Client\TXClient($apiContexts['BTC.test3']);
try {
$txSkeleton = $txClient->create($tx);
} catch (Exception $ex) {
ResultPrinter::printError("Created Multisig TX (spend multisig fund)", "TXSkeleton", null, $request, $ex);
exit(1);
}
ResultPrinter::printResult("Created Multisig TX (spend multisig fund)", "TXSkeleton", $txSkeleton->getTx()->getHash(), $request, $txSkeleton);
return $txSkeleton;
Create TX Sample (without sending it)
This sample code demonstrate how you can create a new transaction, as documented at docs. Source address is a multisig address.
API used: POST /v1/btc/main/txs/new