require __DIR__ . '/../bootstrap.php';
if (isset($_GET['wallet_name'])) {
$walletName = filter_input(INPUT_GET, 'wallet_name', FILTER_SANITIZE_SPECIAL_CHARS);
} else {
$walletName = 'alice';
}
$walletClient = new \BlockCypher\Client\WalletClient($apiContexts['BTC.main']);
try {
$output = $walletClient->get($walletName);
} catch (Exception $ex) {
ResultPrinter::printError("Get a Wallet", "Wallet", null, $walletName, $ex);
exit(1);
}
ResultPrinter::printResult("Get a Wallet", "Wallet", $output->getName(), null, $output);
return $output;
Get Wallet
This sample code demonstrate how you can get a wallet, as documented here at: http://dev.blockcypher.com/#wallets
API used: GET /v1/btc/main/wallets/Wallet-Name