This repository has been archived by the owner on Feb 21, 2024. It is now read-only.
/
getAccountsCount.php
74 lines (58 loc) · 1.73 KB
/
getAccountsCount.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<?php
/**
* Copyright (c) 2022-2023 tatum.io
*
* @link https://tatumio.github.io/tatum-php/Api/AccountApi/#getaccountscount
* @license MIT
* @author Mark Jivko
*
* SECURITY WARNING
* Execute this file in CLI mode only!
*/
"cli" !== php_sapi_name() && exit();
// Use any PSR-4 autoloader
require_once dirname(__DIR__, 3) . "/autoload.php";
// Set your API Keys 👇 here
$sdk = new \Tatum\Sdk();
// 🐛 Enable debugging on the MainNet
$sdk->mainnet()->config()->setDebug(true);
// Max number of items per page is 50.
$arg_page_size = 20;
// Page number
$arg_page = 0;
// Direction of sorting. Can be asc or desc
$arg_sort = 'sort_example';
// Sort by
$arg_sort_by = "_id";
// Filter only active or non active accounts
$arg_active = true;
// Filter only accounts with non zero balances
$arg_only_non_zero_balance = true;
// Filter only frozen or non frozen accounts
$arg_frozen = true;
// Filter by currency
$arg_currency = "BTC";
// Filter by account number
$arg_account_number = "AC_1011_B";
try {
/**
* GET /v3/ledger/account/count
*
* @var \Tatum\Model\EntitiesCount $response
*/
$response = $sdk->mainnet()
->api()
->account()
->getAccountsCount($arg_page_size, $arg_page, $arg_sort, $arg_sort_by, $arg_active, $arg_only_non_zero_balance, $arg_frozen, $arg_currency, $arg_account_number);
var_dump($response);
} catch (\Tatum\Sdk\ApiException $apiExc) {
echo sprintf(
"API Exception when calling api()->account()->getAccountsCount(): %s\n",
var_export($apiExc->getResponseObject(), true)
);
} catch (\Exception $exc) {
echo sprintf(
"Exception when calling api()->account()->getAccountsCount(): %s\n",
$exc->getMessage()
);
}