Code Duplication    Length = 7-8 lines in 4 locations

src/BlocktrailSDK.php 4 locations

@@ 351-358 (lines=8) @@
348
     * @param  string  $identifier a unique identifier to associate with this webhook
349
     * @return array               associative array containing the response
350
     */
351
    public function setupWebhook($url, $identifier = null) {
352
        $postData = [
353
            'url'        => $url,
354
            'identifier' => $identifier
355
        ];
356
        $response = $this->client->post("webhook", null, $postData, RestClient::AUTH_HTTP_SIG);
357
        return self::jsonDecode($response->body(), true);
358
    }
359
360
    /**
361
     * update an existing webhook
@@ 464-470 (lines=7) @@
461
     * @param  string  $identifier  the unique identifier of the webhook to be triggered
462
     * @return array                associative array containing the response
463
     */
464
    public function subscribeNewBlocks($identifier) {
465
        $postData = [
466
            'event_type'    => 'block',
467
        ];
468
        $response = $this->client->post("webhook/{$identifier}/events", null, $postData, RestClient::AUTH_HTTP_SIG);
469
        return self::jsonDecode($response->body(), true);
470
    }
471
472
    /**
473
     * removes an transaction event subscription from a webhook
@@ 1613-1620 (lines=8) @@
1610
     * @param  integer          $limit   pagination: records per page
1611
     * @return array                     associative array containing the response
1612
     */
1613
    public function allWallets($page = 1, $limit = 20) {
1614
        $queryString = [
1615
            'page' => $page,
1616
            'limit' => $limit
1617
        ];
1618
        $response = $this->client->get("wallets", $queryString, RestClient::AUTH_HTTP_SIG);
1619
        return self::jsonDecode($response->body(), true);
1620
    }
1621
1622
    /**
1623
     * send raw transaction
@@ 1641-1647 (lines=7) @@
1638
     * @return mixed
1639
     * @throws \Exception
1640
     */
1641
    public function faucetWithdrawl($address, $amount = 10000) {
1642
        $response = $this->client->post("faucet/withdrawl", null, [
1643
            'address' => $address,
1644
            'amount' => $amount,
1645
        ], RestClient::AUTH_HTTP_SIG);
1646
        return self::jsonDecode($response->body(), true);
1647
    }
1648
1649
    /**
1650
     * verify a message signed bitcoin-core style