Generate a new Addresses and associated to Wallet Sample
This sample code demonstrate how you can generate a new addresses and associated it to a wallet, as documented here at:
http://dev.blockcypher.com/#wallet_api
API used: GET /v1/btc/main/wallets/Wallet-Name/addresses/generate
Get Wallet Name.
In samples we are using CreateWallet.php sample to get the created instance of wallet.
You have to run that sample before running this one or there will be no wallets
require__DIR__ . '/../bootstrap.php';
Wallet must be created previously
if (isset($_GET['wallet_name'])) {
$walletName = filter_input(INPUT_GET, 'wallet_name', FILTER_SANITIZE_SPECIAL_CHARS);
} else {
$walletName = 'alice'; // Default wallet name for samples
}
Generate new address and associated it to the Wallet
Generate a new Addresses and associated to Wallet Sample
This sample code demonstrate how you can generate a new addresses and associated it to a wallet, as documented here at: http://dev.blockcypher.com/#wallet_api API used: GET /v1/btc/main/wallets/Wallet-Name/addresses/generate