Code Duplication    Length = 7-8 lines in 4 locations

src/BlocktrailSDK.php 4 locations

@@ 348-355 (lines=8) @@
345
     * @param  string  $identifier a unique identifier to associate with this webhook
346
     * @return array               associative array containing the response
347
     */
348
    public function setupWebhook($url, $identifier = null) {
349
        $postData = [
350
            'url'        => $url,
351
            'identifier' => $identifier
352
        ];
353
        $response = $this->client->post("webhook", null, $postData, RestClient::AUTH_HTTP_SIG);
354
        return self::jsonDecode($response->body(), true);
355
    }
356
357
    /**
358
     * update an existing webhook
@@ 461-467 (lines=7) @@
458
     * @param  string  $identifier  the unique identifier of the webhook to be triggered
459
     * @return array                associative array containing the response
460
     */
461
    public function subscribeNewBlocks($identifier) {
462
        $postData = [
463
            'event_type'    => 'block',
464
        ];
465
        $response = $this->client->post("webhook/{$identifier}/events", null, $postData, RestClient::AUTH_HTTP_SIG);
466
        return self::jsonDecode($response->body(), true);
467
    }
468
469
    /**
470
     * removes an transaction event subscription from a webhook
@@ 1378-1385 (lines=8) @@
1375
     * @param  integer          $limit   pagination: records per page
1376
     * @return array                     associative array containing the response
1377
     */
1378
    public function allWallets($page = 1, $limit = 20) {
1379
        $queryString = [
1380
            'page' => $page,
1381
            'limit' => $limit
1382
        ];
1383
        $response = $this->client->get("wallets", $queryString, RestClient::AUTH_HTTP_SIG);
1384
        return self::jsonDecode($response->body(), true);
1385
    }
1386
1387
    /**
1388
     * send raw transaction
@@ 1406-1412 (lines=7) @@
1403
     * @return mixed
1404
     * @throws \Exception
1405
     */
1406
    public function faucetWithdrawl($address, $amount = 10000) {
1407
        $response = $this->client->post("faucet/withdrawl", null, [
1408
            'address' => $address,
1409
            'amount' => $amount,
1410
        ], RestClient::AUTH_HTTP_SIG);
1411
        return self::jsonDecode($response->body(), true);
1412
    }
1413
1414
    /**
1415
     * verify a message signed bitcoin-core style