|
@@ 433-441 (lines=9) @@
|
| 430 |
|
* @param integer $confirmations the amount of confirmations to send. |
| 431 |
|
* @return array associative array containing the response |
| 432 |
|
*/ |
| 433 |
|
public function subscribeTransaction($identifier, $transaction, $confirmations = 6) { |
| 434 |
|
$postData = [ |
| 435 |
|
'event_type' => 'transaction', |
| 436 |
|
'transaction' => $transaction, |
| 437 |
|
'confirmations' => $confirmations, |
| 438 |
|
]; |
| 439 |
|
$response = $this->client->post("webhook/{$identifier}/events", null, $postData, RestClient::AUTH_HTTP_SIG); |
| 440 |
|
return self::jsonDecode($response->body(), true); |
| 441 |
|
} |
| 442 |
|
|
| 443 |
|
/** |
| 444 |
|
* subscribes a webhook to transaction events on a particular address |
|
@@ 450-458 (lines=9) @@
|
| 447 |
|
* @param integer $confirmations the amount of confirmations to send. |
| 448 |
|
* @return array associative array containing the response |
| 449 |
|
*/ |
| 450 |
|
public function subscribeAddressTransactions($identifier, $address, $confirmations = 6) { |
| 451 |
|
$postData = [ |
| 452 |
|
'event_type' => 'address-transactions', |
| 453 |
|
'address' => $address, |
| 454 |
|
'confirmations' => $confirmations, |
| 455 |
|
]; |
| 456 |
|
$response = $this->client->post("webhook/{$identifier}/events", null, $postData, RestClient::AUTH_HTTP_SIG); |
| 457 |
|
return self::jsonDecode($response->body(), true); |
| 458 |
|
} |
| 459 |
|
|
| 460 |
|
/** |
| 461 |
|
* batch subscribes a webhook to multiple transaction events |
|
@@ 1582-1590 (lines=9) @@
|
| 1579 |
|
* @param string $sortDir pagination: sort direction (asc|desc) |
| 1580 |
|
* @return array associative array containing the response |
| 1581 |
|
*/ |
| 1582 |
|
public function walletTransactions($identifier, $page = 1, $limit = 20, $sortDir = 'asc') { |
| 1583 |
|
$queryString = [ |
| 1584 |
|
'page' => $page, |
| 1585 |
|
'limit' => $limit, |
| 1586 |
|
'sort_dir' => $sortDir |
| 1587 |
|
]; |
| 1588 |
|
$response = $this->client->get("wallet/{$identifier}/transactions", $queryString, RestClient::AUTH_HTTP_SIG); |
| 1589 |
|
return self::jsonDecode($response->body(), true); |
| 1590 |
|
} |
| 1591 |
|
|
| 1592 |
|
/** |
| 1593 |
|
* get all addresses for wallet (paginated) |
|
@@ 1601-1609 (lines=9) @@
|
| 1598 |
|
* @param string $sortDir pagination: sort direction (asc|desc) |
| 1599 |
|
* @return array associative array containing the response |
| 1600 |
|
*/ |
| 1601 |
|
public function walletAddresses($identifier, $page = 1, $limit = 20, $sortDir = 'asc') { |
| 1602 |
|
$queryString = [ |
| 1603 |
|
'page' => $page, |
| 1604 |
|
'limit' => $limit, |
| 1605 |
|
'sort_dir' => $sortDir |
| 1606 |
|
]; |
| 1607 |
|
$response = $this->client->get("wallet/{$identifier}/addresses", $queryString, RestClient::AUTH_HTTP_SIG); |
| 1608 |
|
return self::jsonDecode($response->body(), true); |
| 1609 |
|
} |
| 1610 |
|
|
| 1611 |
|
/** |
| 1612 |
|
* get all UTXOs for wallet (paginated) |