Code Duplication    Length = 16-18 lines in 2 locations

src/BlocktrailSDK.php 2 locations

@@ 1015-1030 (lines=16) @@
1012
     * @return mixed
1013
     * @throws \Exception
1014
     */
1015
    public function storeNewWalletV2($identifier, $primaryPublicKey, $backupPublicKey, $encryptedPrimarySeed, $encryptedSecret, $recoverySecret, $checksum, $keyIndex) {
1016
        $data = [
1017
            'identifier' => $identifier,
1018
            'wallet_version' => Wallet::WALLET_VERSION_V2,
1019
            'primary_public_key' => $primaryPublicKey,
1020
            'backup_public_key' => $backupPublicKey,
1021
            'encrypted_primary_seed' => $encryptedPrimarySeed,
1022
            'encrypted_secret' => $encryptedSecret,
1023
            'recovery_secret' => $recoverySecret,
1024
            'checksum' => $checksum,
1025
            'key_index' => $keyIndex
1026
        ];
1027
        $this->verifyPublicOnly($data);
1028
        $response = $this->client->post("wallet", null, $data, RestClient::AUTH_HTTP_SIG);
1029
        return self::jsonDecode($response->body(), true);
1030
    }
1031
1032
    /**
1033
     * create wallet using the API
@@ 1046-1063 (lines=18) @@
1043
     * @return mixed
1044
     * @throws \Exception
1045
     */
1046
    public function storeNewWalletV3($identifier, $primaryPublicKey, $backupPublicKey, $encryptedPrimarySeed, $encryptedSecret, $recoverySecret, $checksum, $keyIndex) {
1047
1048
        $data = [
1049
            'identifier' => $identifier,
1050
            'wallet_version' => Wallet::WALLET_VERSION_V3,
1051
            'primary_public_key' => $primaryPublicKey,
1052
            'backup_public_key' => $backupPublicKey,
1053
            'encrypted_primary_seed' => $encryptedPrimarySeed,
1054
            'encrypted_secret' => $encryptedSecret,
1055
            'recovery_secret' => $recoverySecret,
1056
            'checksum' => $checksum,
1057
            'key_index' => $keyIndex
1058
        ];
1059
1060
        $this->verifyPublicOnly($data);
1061
        $response = $this->client->post("wallet", null, $data, RestClient::AUTH_HTTP_SIG);
1062
        return self::jsonDecode($response->body(), true);
1063
    }
1064
1065
    /**
1066
     * upgrade wallet to use a new account number