Code Duplication    Length = 16-18 lines in 2 locations

src/BlocktrailSDK.php 2 locations

@@ 1005-1020 (lines=16) @@
1002
     * @return mixed
1003
     * @throws \Exception
1004
     */
1005
    public function storeNewWalletV2($identifier, $primaryPublicKey, $backupPublicKey, $encryptedPrimarySeed, $encryptedSecret, $recoverySecret, $checksum, $keyIndex) {
1006
        $data = [
1007
            'identifier' => $identifier,
1008
            'wallet_version' => Wallet::WALLET_VERSION_V2,
1009
            'primary_public_key' => $primaryPublicKey,
1010
            'backup_public_key' => $backupPublicKey,
1011
            'encrypted_primary_seed' => $encryptedPrimarySeed,
1012
            'encrypted_secret' => $encryptedSecret,
1013
            'recovery_secret' => $recoverySecret,
1014
            'checksum' => $checksum,
1015
            'key_index' => $keyIndex
1016
        ];
1017
        $this->verifyPublicOnly($data);
1018
        $response = $this->client->post("wallet", null, $data, RestClient::AUTH_HTTP_SIG);
1019
        return self::jsonDecode($response->body(), true);
1020
    }
1021
1022
    /**
1023
     * create wallet using the API
@@ 1036-1053 (lines=18) @@
1033
     * @return mixed
1034
     * @throws \Exception
1035
     */
1036
    public function storeNewWalletV3($identifier, $primaryPublicKey, $backupPublicKey, $encryptedPrimarySeed, $encryptedSecret, $recoverySecret, $checksum, $keyIndex) {
1037
1038
        $data = [
1039
            'identifier' => $identifier,
1040
            'wallet_version' => Wallet::WALLET_VERSION_V3,
1041
            'primary_public_key' => $primaryPublicKey,
1042
            'backup_public_key' => $backupPublicKey,
1043
            'encrypted_primary_seed' => $encryptedPrimarySeed,
1044
            'encrypted_secret' => $encryptedSecret,
1045
            'recovery_secret' => $recoverySecret,
1046
            'checksum' => $checksum,
1047
            'key_index' => $keyIndex
1048
        ];
1049
1050
        $this->verifyPublicOnly($data);
1051
        $response = $this->client->post("wallet", null, $data, RestClient::AUTH_HTTP_SIG);
1052
        return self::jsonDecode($response->body(), true);
1053
    }
1054
1055
    /**
1056
     * upgrade wallet to use a new account number