|
@@ 406-414 (lines=9) @@
|
| 403 |
|
* @param integer $confirmations the amount of confirmations to send. |
| 404 |
|
* @return array associative array containing the response |
| 405 |
|
*/ |
| 406 |
|
public function subscribeTransaction($identifier, $transaction, $confirmations = 6) { |
| 407 |
|
$postData = [ |
| 408 |
|
'event_type' => 'transaction', |
| 409 |
|
'transaction' => $transaction, |
| 410 |
|
'confirmations' => $confirmations, |
| 411 |
|
]; |
| 412 |
|
$response = $this->client->post("webhook/{$identifier}/events", null, $postData, RestClient::AUTH_HTTP_SIG); |
| 413 |
|
return self::jsonDecode($response->body(), true); |
| 414 |
|
} |
| 415 |
|
|
| 416 |
|
/** |
| 417 |
|
* subscribes a webhook to transaction events on a particular address |
|
@@ 423-431 (lines=9) @@
|
| 420 |
|
* @param integer $confirmations the amount of confirmations to send. |
| 421 |
|
* @return array associative array containing the response |
| 422 |
|
*/ |
| 423 |
|
public function subscribeAddressTransactions($identifier, $address, $confirmations = 6) { |
| 424 |
|
$postData = [ |
| 425 |
|
'event_type' => 'address-transactions', |
| 426 |
|
'address' => $address, |
| 427 |
|
'confirmations' => $confirmations, |
| 428 |
|
]; |
| 429 |
|
$response = $this->client->post("webhook/{$identifier}/events", null, $postData, RestClient::AUTH_HTTP_SIG); |
| 430 |
|
return self::jsonDecode($response->body(), true); |
| 431 |
|
} |
| 432 |
|
|
| 433 |
|
/** |
| 434 |
|
* batch subscribes a webhook to multiple transaction events |
|
@@ 1323-1331 (lines=9) @@
|
| 1320 |
|
* @param string $sortDir pagination: sort direction (asc|desc) |
| 1321 |
|
* @return array associative array containing the response |
| 1322 |
|
*/ |
| 1323 |
|
public function walletTransactions($identifier, $page = 1, $limit = 20, $sortDir = 'asc') { |
| 1324 |
|
$queryString = [ |
| 1325 |
|
'page' => $page, |
| 1326 |
|
'limit' => $limit, |
| 1327 |
|
'sort_dir' => $sortDir |
| 1328 |
|
]; |
| 1329 |
|
$response = $this->client->get("wallet/{$identifier}/transactions", $queryString, RestClient::AUTH_HTTP_SIG); |
| 1330 |
|
return self::jsonDecode($response->body(), true); |
| 1331 |
|
} |
| 1332 |
|
|
| 1333 |
|
/** |
| 1334 |
|
* get all addresses for wallet (paginated) |
|
@@ 1342-1350 (lines=9) @@
|
| 1339 |
|
* @param string $sortDir pagination: sort direction (asc|desc) |
| 1340 |
|
* @return array associative array containing the response |
| 1341 |
|
*/ |
| 1342 |
|
public function walletAddresses($identifier, $page = 1, $limit = 20, $sortDir = 'asc') { |
| 1343 |
|
$queryString = [ |
| 1344 |
|
'page' => $page, |
| 1345 |
|
'limit' => $limit, |
| 1346 |
|
'sort_dir' => $sortDir |
| 1347 |
|
]; |
| 1348 |
|
$response = $this->client->get("wallet/{$identifier}/addresses", $queryString, RestClient::AUTH_HTTP_SIG); |
| 1349 |
|
return self::jsonDecode($response->body(), true); |
| 1350 |
|
} |
| 1351 |
|
|
| 1352 |
|
/** |
| 1353 |
|
* get all UTXOs for wallet (paginated) |
|
@@ 1361-1369 (lines=9) @@
|
| 1358 |
|
* @param string $sortDir pagination: sort direction (asc|desc) |
| 1359 |
|
* @return array associative array containing the response |
| 1360 |
|
*/ |
| 1361 |
|
public function walletUTXOs($identifier, $page = 1, $limit = 20, $sortDir = 'asc') { |
| 1362 |
|
$queryString = [ |
| 1363 |
|
'page' => $page, |
| 1364 |
|
'limit' => $limit, |
| 1365 |
|
'sort_dir' => $sortDir |
| 1366 |
|
]; |
| 1367 |
|
$response = $this->client->get("wallet/{$identifier}/utxos", $queryString, RestClient::AUTH_HTTP_SIG); |
| 1368 |
|
return self::jsonDecode($response->body(), true); |
| 1369 |
|
} |
| 1370 |
|
|
| 1371 |
|
/** |
| 1372 |
|
* get a paginated list of all wallets associated with the api user |