|
@@ 419-427 (lines=9) @@
|
| 416 |
|
* @param integer $confirmations the amount of confirmations to send. |
| 417 |
|
* @return array associative array containing the response |
| 418 |
|
*/ |
| 419 |
|
public function subscribeTransaction($identifier, $transaction, $confirmations = 6) { |
| 420 |
|
$postData = [ |
| 421 |
|
'event_type' => 'transaction', |
| 422 |
|
'transaction' => $transaction, |
| 423 |
|
'confirmations' => $confirmations, |
| 424 |
|
]; |
| 425 |
|
$response = $this->client->post("webhook/{$identifier}/events", null, $postData, RestClient::AUTH_HTTP_SIG); |
| 426 |
|
return self::jsonDecode($response->body(), true); |
| 427 |
|
} |
| 428 |
|
|
| 429 |
|
/** |
| 430 |
|
* subscribes a webhook to transaction events on a particular address |
|
@@ 436-444 (lines=9) @@
|
| 433 |
|
* @param integer $confirmations the amount of confirmations to send. |
| 434 |
|
* @return array associative array containing the response |
| 435 |
|
*/ |
| 436 |
|
public function subscribeAddressTransactions($identifier, $address, $confirmations = 6) { |
| 437 |
|
$postData = [ |
| 438 |
|
'event_type' => 'address-transactions', |
| 439 |
|
'address' => $address, |
| 440 |
|
'confirmations' => $confirmations, |
| 441 |
|
]; |
| 442 |
|
$response = $this->client->post("webhook/{$identifier}/events", null, $postData, RestClient::AUTH_HTTP_SIG); |
| 443 |
|
return self::jsonDecode($response->body(), true); |
| 444 |
|
} |
| 445 |
|
|
| 446 |
|
/** |
| 447 |
|
* batch subscribes a webhook to multiple transaction events |
|
@@ 1568-1576 (lines=9) @@
|
| 1565 |
|
* @param string $sortDir pagination: sort direction (asc|desc) |
| 1566 |
|
* @return array associative array containing the response |
| 1567 |
|
*/ |
| 1568 |
|
public function walletTransactions($identifier, $page = 1, $limit = 20, $sortDir = 'asc') { |
| 1569 |
|
$queryString = [ |
| 1570 |
|
'page' => $page, |
| 1571 |
|
'limit' => $limit, |
| 1572 |
|
'sort_dir' => $sortDir |
| 1573 |
|
]; |
| 1574 |
|
$response = $this->client->get("wallet/{$identifier}/transactions", $queryString, RestClient::AUTH_HTTP_SIG); |
| 1575 |
|
return self::jsonDecode($response->body(), true); |
| 1576 |
|
} |
| 1577 |
|
|
| 1578 |
|
/** |
| 1579 |
|
* get all addresses for wallet (paginated) |
|
@@ 1587-1595 (lines=9) @@
|
| 1584 |
|
* @param string $sortDir pagination: sort direction (asc|desc) |
| 1585 |
|
* @return array associative array containing the response |
| 1586 |
|
*/ |
| 1587 |
|
public function walletAddresses($identifier, $page = 1, $limit = 20, $sortDir = 'asc') { |
| 1588 |
|
$queryString = [ |
| 1589 |
|
'page' => $page, |
| 1590 |
|
'limit' => $limit, |
| 1591 |
|
'sort_dir' => $sortDir |
| 1592 |
|
]; |
| 1593 |
|
$response = $this->client->get("wallet/{$identifier}/addresses", $queryString, RestClient::AUTH_HTTP_SIG); |
| 1594 |
|
return self::jsonDecode($response->body(), true); |
| 1595 |
|
} |
| 1596 |
|
|
| 1597 |
|
/** |
| 1598 |
|
* get all UTXOs for wallet (paginated) |
|
@@ 1606-1614 (lines=9) @@
|
| 1603 |
|
* @param string $sortDir pagination: sort direction (asc|desc) |
| 1604 |
|
* @return array associative array containing the response |
| 1605 |
|
*/ |
| 1606 |
|
public function walletUTXOs($identifier, $page = 1, $limit = 20, $sortDir = 'asc') { |
| 1607 |
|
$queryString = [ |
| 1608 |
|
'page' => $page, |
| 1609 |
|
'limit' => $limit, |
| 1610 |
|
'sort_dir' => $sortDir |
| 1611 |
|
]; |
| 1612 |
|
$response = $this->client->get("wallet/{$identifier}/utxos", $queryString, RestClient::AUTH_HTTP_SIG); |
| 1613 |
|
return self::jsonDecode($response->body(), true); |
| 1614 |
|
} |
| 1615 |
|
|
| 1616 |
|
/** |
| 1617 |
|
* get a paginated list of all wallets associated with the api user |