Create a new Blockchain wallet from this API endpoint. Offical documentation here.
Make calls on the Create member object within the Blockchain object. Please note than an api_code is required with Create Wallet permissions. You may request an API code here.
In order to use Wallet and CreateWallet functionality, you must provide an URL to an instance of service-my-wallet-v3.
$Blockchain = new \Blockchain\Blockchain($api_code);
$Blockchain->setServiceUrl("http://localhost:3000");
$Blockchain->Create->function(...)
There are two ways to create wallets: provide an existing private key or let Blockchain generate a private key for you. Both methods allow you to specify an email address to be associated with the wallet and a label for the first address in the wallet. You must provide a password for the new wallet.
Please read the offical documentation for important details.
Create a new wallet with a known private key. Returns a WalletResponse object.
$wallet = $Blockchain->Create->createWithKey($password, $privKey, $email=null, $label=null);
Create a new wallet, letting Blockchain generate a new private key. Returns a WalletResponse object.
$wallet = $Blockchain->Create->create($password, $email=null, $label=null);
The WalletResponse object contains fields for the wallet identifier (guid), the address for receiving Bitcoin, and a label for the first account of the wallet.
class WalletResponse {
public $guid; // string
public $address; // string
public $label; // string
}