Code Duplication    Length = 9-9 lines in 5 locations

src/BlocktrailSDK.php 5 locations

@@ 407-415 (lines=9) @@
404
     * @param  integer $confirmations   the amount of confirmations to send.
405
     * @return array                    associative array containing the response
406
     */
407
    public function subscribeTransaction($identifier, $transaction, $confirmations = 6) {
408
        $postData = [
409
            'event_type'    => 'transaction',
410
            'transaction'   => $transaction,
411
            'confirmations' => $confirmations,
412
        ];
413
        $response = $this->client->post("webhook/{$identifier}/events", null, $postData, RestClient::AUTH_HTTP_SIG);
414
        return self::jsonDecode($response->body(), true);
415
    }
416
417
    /**
418
     * subscribes a webhook to transaction events on a particular address
@@ 424-432 (lines=9) @@
421
     * @param  integer $confirmations   the amount of confirmations to send.
422
     * @return array                    associative array containing the response
423
     */
424
    public function subscribeAddressTransactions($identifier, $address, $confirmations = 6) {
425
        $postData = [
426
            'event_type'    => 'address-transactions',
427
            'address'       => $address,
428
            'confirmations' => $confirmations,
429
        ];
430
        $response = $this->client->post("webhook/{$identifier}/events", null, $postData, RestClient::AUTH_HTTP_SIG);
431
        return self::jsonDecode($response->body(), true);
432
    }
433
434
    /**
435
     * batch subscribes a webhook to multiple transaction events
@@ 1530-1538 (lines=9) @@
1527
     * @param  string  $sortDir     pagination: sort direction (asc|desc)
1528
     * @return array                associative array containing the response
1529
     */
1530
    public function walletTransactions($identifier, $page = 1, $limit = 20, $sortDir = 'asc') {
1531
        $queryString = [
1532
            'page' => $page,
1533
            'limit' => $limit,
1534
            'sort_dir' => $sortDir
1535
        ];
1536
        $response = $this->client->get("wallet/{$identifier}/transactions", $queryString, RestClient::AUTH_HTTP_SIG);
1537
        return self::jsonDecode($response->body(), true);
1538
    }
1539
1540
    /**
1541
     * get all addresses for wallet (paginated)
@@ 1549-1557 (lines=9) @@
1546
     * @param  string  $sortDir     pagination: sort direction (asc|desc)
1547
     * @return array                associative array containing the response
1548
     */
1549
    public function walletAddresses($identifier, $page = 1, $limit = 20, $sortDir = 'asc') {
1550
        $queryString = [
1551
            'page' => $page,
1552
            'limit' => $limit,
1553
            'sort_dir' => $sortDir
1554
        ];
1555
        $response = $this->client->get("wallet/{$identifier}/addresses", $queryString, RestClient::AUTH_HTTP_SIG);
1556
        return self::jsonDecode($response->body(), true);
1557
    }
1558
1559
    /**
1560
     * get all UTXOs for wallet (paginated)
@@ 1568-1576 (lines=9) @@
1565
     * @param  string  $sortDir     pagination: sort direction (asc|desc)
1566
     * @return array                associative array containing the response
1567
     */
1568
    public function walletUTXOs($identifier, $page = 1, $limit = 20, $sortDir = 'asc') {
1569
        $queryString = [
1570
            'page' => $page,
1571
            'limit' => $limit,
1572
            'sort_dir' => $sortDir
1573
        ];
1574
        $response = $this->client->get("wallet/{$identifier}/utxos", $queryString, RestClient::AUTH_HTTP_SIG);
1575
        return self::jsonDecode($response->body(), true);
1576
    }
1577
1578
    /**
1579
     * get a paginated list of all wallets associated with the api user