|
@@ 349-356 (lines=8) @@
|
| 346 |
|
* @param string $identifier a unique identifier to associate with this webhook |
| 347 |
|
* @return array associative array containing the response |
| 348 |
|
*/ |
| 349 |
|
public function setupWebhook($url, $identifier = null) { |
| 350 |
|
$postData = [ |
| 351 |
|
'url' => $url, |
| 352 |
|
'identifier' => $identifier |
| 353 |
|
]; |
| 354 |
|
$response = $this->client->post("webhook", null, $postData, RestClient::AUTH_HTTP_SIG); |
| 355 |
|
return self::jsonDecode($response->body(), true); |
| 356 |
|
} |
| 357 |
|
|
| 358 |
|
/** |
| 359 |
|
* update an existing webhook |
|
@@ 462-468 (lines=7) @@
|
| 459 |
|
* @param string $identifier the unique identifier of the webhook to be triggered |
| 460 |
|
* @return array associative array containing the response |
| 461 |
|
*/ |
| 462 |
|
public function subscribeNewBlocks($identifier) { |
| 463 |
|
$postData = [ |
| 464 |
|
'event_type' => 'block', |
| 465 |
|
]; |
| 466 |
|
$response = $this->client->post("webhook/{$identifier}/events", null, $postData, RestClient::AUTH_HTTP_SIG); |
| 467 |
|
return self::jsonDecode($response->body(), true); |
| 468 |
|
} |
| 469 |
|
|
| 470 |
|
/** |
| 471 |
|
* removes an transaction event subscription from a webhook |
|
@@ 1585-1592 (lines=8) @@
|
| 1582 |
|
* @param integer $limit pagination: records per page |
| 1583 |
|
* @return array associative array containing the response |
| 1584 |
|
*/ |
| 1585 |
|
public function allWallets($page = 1, $limit = 20) { |
| 1586 |
|
$queryString = [ |
| 1587 |
|
'page' => $page, |
| 1588 |
|
'limit' => $limit |
| 1589 |
|
]; |
| 1590 |
|
$response = $this->client->get("wallets", $queryString, RestClient::AUTH_HTTP_SIG); |
| 1591 |
|
return self::jsonDecode($response->body(), true); |
| 1592 |
|
} |
| 1593 |
|
|
| 1594 |
|
/** |
| 1595 |
|
* send raw transaction |
|
@@ 1613-1619 (lines=7) @@
|
| 1610 |
|
* @return mixed |
| 1611 |
|
* @throws \Exception |
| 1612 |
|
*/ |
| 1613 |
|
public function faucetWithdrawl($address, $amount = 10000) { |
| 1614 |
|
$response = $this->client->post("faucet/withdrawl", null, [ |
| 1615 |
|
'address' => $address, |
| 1616 |
|
'amount' => $amount, |
| 1617 |
|
], RestClient::AUTH_HTTP_SIG); |
| 1618 |
|
return self::jsonDecode($response->body(), true); |
| 1619 |
|
} |
| 1620 |
|
|
| 1621 |
|
/** |
| 1622 |
|
* verify a message signed bitcoin-core style |