Code Duplication    Length = 16-18 lines in 2 locations

src/BlocktrailSDK.php 2 locations

@@ 1029-1044 (lines=16) @@
1026
     * @return mixed
1027
     * @throws \Exception
1028
     */
1029
    public function storeNewWalletV2($identifier, $primaryPublicKey, $backupPublicKey, $encryptedPrimarySeed, $encryptedSecret, $recoverySecret, $checksum, $keyIndex) {
1030
        $data = [
1031
            'identifier' => $identifier,
1032
            'wallet_version' => Wallet::WALLET_VERSION_V2,
1033
            'primary_public_key' => $primaryPublicKey,
1034
            'backup_public_key' => $backupPublicKey,
1035
            'encrypted_primary_seed' => $encryptedPrimarySeed,
1036
            'encrypted_secret' => $encryptedSecret,
1037
            'recovery_secret' => $recoverySecret,
1038
            'checksum' => $checksum,
1039
            'key_index' => $keyIndex
1040
        ];
1041
        $this->verifyPublicOnly($data);
1042
        $response = $this->client->post("wallet", null, $data, RestClient::AUTH_HTTP_SIG);
1043
        return self::jsonDecode($response->body(), true);
1044
    }
1045
1046
    /**
1047
     * create wallet using the API
@@ 1060-1077 (lines=18) @@
1057
     * @return mixed
1058
     * @throws \Exception
1059
     */
1060
    public function storeNewWalletV3($identifier, $primaryPublicKey, $backupPublicKey, $encryptedPrimarySeed, $encryptedSecret, $recoverySecret, $checksum, $keyIndex) {
1061
1062
        $data = [
1063
            'identifier' => $identifier,
1064
            'wallet_version' => Wallet::WALLET_VERSION_V3,
1065
            'primary_public_key' => $primaryPublicKey,
1066
            'backup_public_key' => $backupPublicKey,
1067
            'encrypted_primary_seed' => $encryptedPrimarySeed,
1068
            'encrypted_secret' => $encryptedSecret,
1069
            'recovery_secret' => $recoverySecret,
1070
            'checksum' => $checksum,
1071
            'key_index' => $keyIndex
1072
        ];
1073
1074
        $this->verifyPublicOnly($data);
1075
        $response = $this->client->post("wallet", null, $data, RestClient::AUTH_HTTP_SIG);
1076
        return self::jsonDecode($response->body(), true);
1077
    }
1078
1079
    /**
1080
     * upgrade wallet to use a new account number