This repository provides the methods of Bitaps Wallet API (https://developer.bitaps.com/wallet) with PHP. This package works with all available currencies of API (BTC, LTC, BHC, ETH) and supports all endpoints (Mainnet, Testner, TOR Mainnet)
- PHP 7.4 or higher
- cURL
composer require eldarqa/bitaps-wallet-api
Don't forget to set your endpoint :) https://developer.bitaps.com/wallet#API_endpoint
// use Bitaps\WalletAPI\WalletAPI;
$endpoint = "https://api.bitaps.com/btc/testnet/v1";
$api = new WalletAPI($endpoint);
$create = $api->createWallet();
// it's recommended to set the password, just use: $api->createWallet($callbackLink, $password);
// $create->getWalletId();
// use Bitaps\WalletAPI\WalletAPI;
$endpoint = "https://api.bitaps.com/btc/testnet/v1";
$walletId = "your wallet ID";
$password = "your password (if requires)";
$api = new WalletAPI($endpoint, $walletId, $password);
$address = $api->addAddress();
//$address->getAddress();
// use Bitaps\WalletAPI\WalletAPI;
$endpoint = "https://api.bitaps.com/btc/testnet/v1";
$walletId = "your wallet ID";
$password = "your password (if requires)";
$api = new WalletAPI($endpoint, $walletId, $password);
$receiverAddress = "abcdefg123456xxxx";
$receiverAmount = 30000; // In Satoshi
$payment = $api->addPayment($receiverAddress, $receiverAmount)->pay();
//$receivers = $payment->getTxList();
//
//foreach ($receivers as $receiver) {
// var_dump($receiver->getTxHash());
//}
You cann add more receivers:
$receiverAddress = "abcdefg123456xxxx";
$receiverAmount = 30000; // In Satoshi
$secondReceiverAddress = "qwerty25525woo";
$secondReceiverAmount = 40000; // In Satoshi
$thirdReceiverAddress = "zyxwe135679zzz";
$thirdReceiverAmount = 50000; // In Satoshi
$payment = $api->addPayment($receiverAddress, $receiverAmount)
->addPayment($secondReceiverAddress, $secondReceiverAmount)
->addPayment($thirdReceiverAddress, $thirdReceiverAmount)
->pay();
// use Bitaps\WalletAPI\WalletAPI;
$endpoint = "https://api.bitaps.com/btc/testnet/v1";
$walletId = "your wallet ID";
$password = "your password (if requires)";
$api = new WalletAPI($endpoint, $walletId, $password);
$state = $api->getWalletState();
//$state->getBalanceAmount();
// use Bitaps\WalletAPI\WalletAPI;
$endpoint = "https://api.bitaps.com/btc/testnet/v1";
$walletId = "your wallet ID";
$password = "your password (if requires)";
$api = new WalletAPI($endpoint, $walletId, $password);
$transactions = $api->getTransactions();
//$transactions->getTransactions();
//$transactions->getPendingTransactions();
// use Bitaps\WalletAPI\WalletAPI;
$endpoint = "https://api.bitaps.com/btc/testnet/v1";
$walletId = "your wallet ID";
$password = "your password (if requires)";
$api = new WalletAPI($endpoint, $walletId, $password);
$addresses = $api->getAddresses();
//foreach ($addresses->getTxList() as $address)
//{
// $address->getReceivedAmount();
//}
// use Bitaps\WalletAPI\WalletAPI;
$endpoint = "https://api.bitaps.com/btc/testnet/v1";
$walletId = "your wallet ID";
$password = "your password (if requires)";
$api = new WalletAPI($endpoint, $walletId, $password);
$address = "abcde123456789fghijkl";
$transactions = $api->getAddressTransactions($address);
//$transactions->getTransactions();
//$transactions->getPendingTransactions();
// use Bitaps\WalletAPI\WalletAPI;
$endpoint = "https://api.bitaps.com/btc/testnet/v1";
$walletId = "your wallet ID";
$password = "your password (if requires)";
$api = new WalletAPI($endpoint, $walletId, $password);
$statistics = $api->getDailyStatistics();
//foreach ($statistics->getDayList() as $data)
//{
// $data->getBalanceAmount();
//}