|
@@ 369-377 (lines=9) @@
|
| 366 |
|
* @param integer $confirmations the amount of confirmations to send. |
| 367 |
|
* @return array associative array containing the response |
| 368 |
|
*/ |
| 369 |
|
public function subscribeTransaction($identifier, $transaction, $confirmations = 6) { |
| 370 |
|
$postData = [ |
| 371 |
|
'event_type' => 'transaction', |
| 372 |
|
'transaction' => $transaction, |
| 373 |
|
'confirmations' => $confirmations, |
| 374 |
|
]; |
| 375 |
|
$response = $this->client->post("webhook/{$identifier}/events", null, $postData, RestClient::AUTH_HTTP_SIG); |
| 376 |
|
return self::jsonDecode($response->body(), true); |
| 377 |
|
} |
| 378 |
|
|
| 379 |
|
/** |
| 380 |
|
* subscribes a webhook to transaction events on a particular address |
|
@@ 386-394 (lines=9) @@
|
| 383 |
|
* @param integer $confirmations the amount of confirmations to send. |
| 384 |
|
* @return array associative array containing the response |
| 385 |
|
*/ |
| 386 |
|
public function subscribeAddressTransactions($identifier, $address, $confirmations = 6) { |
| 387 |
|
$postData = [ |
| 388 |
|
'event_type' => 'address-transactions', |
| 389 |
|
'address' => $address, |
| 390 |
|
'confirmations' => $confirmations, |
| 391 |
|
]; |
| 392 |
|
$response = $this->client->post("webhook/{$identifier}/events", null, $postData, RestClient::AUTH_HTTP_SIG); |
| 393 |
|
return self::jsonDecode($response->body(), true); |
| 394 |
|
} |
| 395 |
|
|
| 396 |
|
/** |
| 397 |
|
* batch subscribes a webhook to multiple transaction events |
|
@@ 1036-1044 (lines=9) @@
|
| 1033 |
|
* @param string $sortDir pagination: sort direction (asc|desc) |
| 1034 |
|
* @return array associative array containing the response |
| 1035 |
|
*/ |
| 1036 |
|
public function walletTransactions($identifier, $page = 1, $limit = 20, $sortDir = 'asc') { |
| 1037 |
|
$queryString = [ |
| 1038 |
|
'page' => $page, |
| 1039 |
|
'limit' => $limit, |
| 1040 |
|
'sort_dir' => $sortDir |
| 1041 |
|
]; |
| 1042 |
|
$response = $this->client->get("wallet/{$identifier}/transactions", $queryString, RestClient::AUTH_HTTP_SIG); |
| 1043 |
|
return self::jsonDecode($response->body(), true); |
| 1044 |
|
} |
| 1045 |
|
|
| 1046 |
|
/** |
| 1047 |
|
* get all addresses for wallet (paginated) |
|
@@ 1055-1063 (lines=9) @@
|
| 1052 |
|
* @param string $sortDir pagination: sort direction (asc|desc) |
| 1053 |
|
* @return array associative array containing the response |
| 1054 |
|
*/ |
| 1055 |
|
public function walletAddresses($identifier, $page = 1, $limit = 20, $sortDir = 'asc') { |
| 1056 |
|
$queryString = [ |
| 1057 |
|
'page' => $page, |
| 1058 |
|
'limit' => $limit, |
| 1059 |
|
'sort_dir' => $sortDir |
| 1060 |
|
]; |
| 1061 |
|
$response = $this->client->get("wallet/{$identifier}/addresses", $queryString, RestClient::AUTH_HTTP_SIG); |
| 1062 |
|
return self::jsonDecode($response->body(), true); |
| 1063 |
|
} |
| 1064 |
|
|
| 1065 |
|
/** |
| 1066 |
|
* get all UTXOs for wallet (paginated) |
|
@@ 1074-1082 (lines=9) @@
|
| 1071 |
|
* @param string $sortDir pagination: sort direction (asc|desc) |
| 1072 |
|
* @return array associative array containing the response |
| 1073 |
|
*/ |
| 1074 |
|
public function walletUTXOs($identifier, $page = 1, $limit = 20, $sortDir = 'asc') { |
| 1075 |
|
$queryString = [ |
| 1076 |
|
'page' => $page, |
| 1077 |
|
'limit' => $limit, |
| 1078 |
|
'sort_dir' => $sortDir |
| 1079 |
|
]; |
| 1080 |
|
$response = $this->client->get("wallet/{$identifier}/utxos", $queryString, RestClient::AUTH_HTTP_SIG); |
| 1081 |
|
return self::jsonDecode($response->body(), true); |
| 1082 |
|
} |
| 1083 |
|
|
| 1084 |
|
/** |
| 1085 |
|
* get a paginated list of all wallets associated with the api user |