Code Duplication    Length = 7-8 lines in 4 locations

src/BlocktrailSDK.php 4 locations

@@ 375-382 (lines=8) @@
372
     * @param  string  $identifier a unique identifier to associate with this webhook
373
     * @return array               associative array containing the response
374
     */
375
    public function setupWebhook($url, $identifier = null) {
376
        $postData = [
377
            'url'        => $url,
378
            'identifier' => $identifier
379
        ];
380
        $response = $this->client->post("webhook", null, $postData, RestClient::AUTH_HTTP_SIG);
381
        return self::jsonDecode($response->body(), true);
382
    }
383
384
    /**
385
     * update an existing webhook
@@ 488-494 (lines=7) @@
485
     * @param  string  $identifier  the unique identifier of the webhook to be triggered
486
     * @return array                associative array containing the response
487
     */
488
    public function subscribeNewBlocks($identifier) {
489
        $postData = [
490
            'event_type'    => 'block',
491
        ];
492
        $response = $this->client->post("webhook/{$identifier}/events", null, $postData, RestClient::AUTH_HTTP_SIG);
493
        return self::jsonDecode($response->body(), true);
494
    }
495
496
    /**
497
     * removes an transaction event subscription from a webhook
@@ 1639-1646 (lines=8) @@
1636
     * @param  integer          $limit   pagination: records per page
1637
     * @return array                     associative array containing the response
1638
     */
1639
    public function allWallets($page = 1, $limit = 20) {
1640
        $queryString = [
1641
            'page' => $page,
1642
            'limit' => $limit
1643
        ];
1644
        $response = $this->client->get("wallets", $queryString, RestClient::AUTH_HTTP_SIG);
1645
        return self::jsonDecode($response->body(), true);
1646
    }
1647
1648
    /**
1649
     * send raw transaction
@@ 1667-1673 (lines=7) @@
1664
     * @return mixed
1665
     * @throws \Exception
1666
     */
1667
    public function faucetWithdrawal($address, $amount = 10000) {
1668
        $response = $this->client->post("faucet/withdrawl", null, [
1669
            'address' => $address,
1670
            'amount' => $amount,
1671
        ], RestClient::AUTH_HTTP_SIG);
1672
        return self::jsonDecode($response->body(), true);
1673
    }
1674
1675
    /**
1676
     * Exists for BC. Remove at major bump.