PHP code example of eldarqa / bitaps-wallet-api

1. Go to this page and download the library: Download eldarqa/bitaps-wallet-api library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

eldarqa / bitaps-wallet-api example snippets


// 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 

// use Bitaps\WalletAPI\WalletAPI;

$endpoint = "https://api.bitaps.com/btc/testnet/v1";
$walletId = "your wallet ID";
$password = "your password (if api->addPayment($receiverAddress, $receiverAmount)->pay();

//$receivers = $payment->getTxList();
//
//foreach ($receivers as $receiver) {
//    var_dump($receiver->getTxHash());
//}

$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 

// use Bitaps\WalletAPI\WalletAPI;

$endpoint = "https://api.bitaps.com/btc/testnet/v1";
$walletId = "your wallet ID";
$password = "your password (if s->getPendingTransactions();

// use Bitaps\WalletAPI\WalletAPI;

$endpoint = "https://api.bitaps.com/btc/testnet/v1";
$walletId = "your wallet ID";
$password = "your password (if   $address->getReceivedAmount();
//}

// use Bitaps\WalletAPI\WalletAPI;

$endpoint = "https://api.bitaps.com/btc/testnet/v1";
$walletId = "your wallet ID";
$password = "your password (if 
//$transactions->getTransactions();
//$transactions->getPendingTransactions();

// use Bitaps\WalletAPI\WalletAPI;

$endpoint = "https://api.bitaps.com/btc/testnet/v1";
$walletId = "your wallet ID";
$password = "your password (if {
//    $data->getBalanceAmount();
//}