Code Duplication    Length = 9-9 lines in 5 locations

src/BlocktrailSDK.php 5 locations

@@ 409-417 (lines=9) @@
406
     * @param  integer $confirmations   the amount of confirmations to send.
407
     * @return array                    associative array containing the response
408
     */
409
    public function subscribeTransaction($identifier, $transaction, $confirmations = 6) {
410
        $postData = [
411
            'event_type'    => 'transaction',
412
            'transaction'   => $transaction,
413
            'confirmations' => $confirmations,
414
        ];
415
        $response = $this->client->post("webhook/{$identifier}/events", null, $postData, RestClient::AUTH_HTTP_SIG);
416
        return self::jsonDecode($response->body(), true);
417
    }
418
419
    /**
420
     * subscribes a webhook to transaction events on a particular address
@@ 426-434 (lines=9) @@
423
     * @param  integer $confirmations   the amount of confirmations to send.
424
     * @return array                    associative array containing the response
425
     */
426
    public function subscribeAddressTransactions($identifier, $address, $confirmations = 6) {
427
        $postData = [
428
            'event_type'    => 'address-transactions',
429
            'address'       => $address,
430
            'confirmations' => $confirmations,
431
        ];
432
        $response = $this->client->post("webhook/{$identifier}/events", null, $postData, RestClient::AUTH_HTTP_SIG);
433
        return self::jsonDecode($response->body(), true);
434
    }
435
436
    /**
437
     * batch subscribes a webhook to multiple transaction events
@@ 1558-1566 (lines=9) @@
1555
     * @param  string  $sortDir     pagination: sort direction (asc|desc)
1556
     * @return array                associative array containing the response
1557
     */
1558
    public function walletTransactions($identifier, $page = 1, $limit = 20, $sortDir = 'asc') {
1559
        $queryString = [
1560
            'page' => $page,
1561
            'limit' => $limit,
1562
            'sort_dir' => $sortDir
1563
        ];
1564
        $response = $this->client->get("wallet/{$identifier}/transactions", $queryString, RestClient::AUTH_HTTP_SIG);
1565
        return self::jsonDecode($response->body(), true);
1566
    }
1567
1568
    /**
1569
     * get all addresses for wallet (paginated)
@@ 1577-1585 (lines=9) @@
1574
     * @param  string  $sortDir     pagination: sort direction (asc|desc)
1575
     * @return array                associative array containing the response
1576
     */
1577
    public function walletAddresses($identifier, $page = 1, $limit = 20, $sortDir = 'asc') {
1578
        $queryString = [
1579
            'page' => $page,
1580
            'limit' => $limit,
1581
            'sort_dir' => $sortDir
1582
        ];
1583
        $response = $this->client->get("wallet/{$identifier}/addresses", $queryString, RestClient::AUTH_HTTP_SIG);
1584
        return self::jsonDecode($response->body(), true);
1585
    }
1586
1587
    /**
1588
     * get all UTXOs for wallet (paginated)
@@ 1596-1604 (lines=9) @@
1593
     * @param  string  $sortDir     pagination: sort direction (asc|desc)
1594
     * @return array                associative array containing the response
1595
     */
1596
    public function walletUTXOs($identifier, $page = 1, $limit = 20, $sortDir = 'asc') {
1597
        $queryString = [
1598
            'page' => $page,
1599
            'limit' => $limit,
1600
            'sort_dir' => $sortDir
1601
        ];
1602
        $response = $this->client->get("wallet/{$identifier}/utxos", $queryString, RestClient::AUTH_HTTP_SIG);
1603
        return self::jsonDecode($response->body(), true);
1604
    }
1605
1606
    /**
1607
     * get a paginated list of all wallets associated with the api user