From f6f9ea7c7028852e7ffc802d39cc26f398ac0df7 Mon Sep 17 00:00:00 2001 From: Can Erten Date: Thu, 25 May 2023 15:14:57 +0200 Subject: [PATCH] CopyBot + GetHopper Update --- .../GetSingleHopper/HopperAPIGetSingleHopperRequest.kt | 2 +- .../HopperAPICopyBotCreateHopperRequest.kt | 5 ++++- .../main/java/cryptohopper/android/sdk/CryptohopperHopper.kt | 4 +++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/sdk/src/main/java/cryptohopper/android/sdk/API/Hopper/General/GetSingleHopper/HopperAPIGetSingleHopperRequest.kt b/sdk/src/main/java/cryptohopper/android/sdk/API/Hopper/General/GetSingleHopper/HopperAPIGetSingleHopperRequest.kt index c7d2e33..dff9e46 100644 --- a/sdk/src/main/java/cryptohopper/android/sdk/API/Hopper/General/GetSingleHopper/HopperAPIGetSingleHopperRequest.kt +++ b/sdk/src/main/java/cryptohopper/android/sdk/API/Hopper/General/GetSingleHopper/HopperAPIGetSingleHopperRequest.kt @@ -9,7 +9,7 @@ import cryptohopper.android.sdk.SharedModels.ConfigModels.HopperAPIHttpMethod class HopperAPIGetSingleHopperRequest: HopperAPIRequest { - constructor(hopperId : String) { + constructor(hopperId : Int) { this.httpMethod = HopperAPIHttpMethod.GET this.needsAuthentication = true this.changeUrlPath("/hopper/$hopperId") diff --git a/sdk/src/main/java/cryptohopper/android/sdk/API/Marketplace/Copybot/CopyBotCreateHopper/HopperAPICopyBotCreateHopperRequest.kt b/sdk/src/main/java/cryptohopper/android/sdk/API/Marketplace/Copybot/CopyBotCreateHopper/HopperAPICopyBotCreateHopperRequest.kt index dcafcde..ecd89b9 100644 --- a/sdk/src/main/java/cryptohopper/android/sdk/API/Marketplace/Copybot/CopyBotCreateHopper/HopperAPICopyBotCreateHopperRequest.kt +++ b/sdk/src/main/java/cryptohopper/android/sdk/API/Marketplace/Copybot/CopyBotCreateHopper/HopperAPICopyBotCreateHopperRequest.kt @@ -6,7 +6,7 @@ import cryptohopper.android.sdk.SharedModels.ConfigModels.HopperAPIHttpMethod class HopperAPICopyBotCreateHopperRequest : HopperAPIRequest { - constructor(copyBotMarketplaceId : String, paperTrading: Boolean, apiKey : String? , apiSecret : String? , apiPassphrase : String? , extraApiKey : String? , extraApiSecret : String?,autoSync : Boolean = true, isSandbox : Boolean = false ) { + constructor(hopperId : String?, copyBotMarketplaceId : String, paperTrading: Boolean, apiKey : String? , apiSecret : String? , apiPassphrase : String? , extraApiKey : String? , extraApiSecret : String?,autoSync : Boolean = true, isSandbox : Boolean = false ) { this.httpMethod = HopperAPIHttpMethod.POST this.needsAuthentication = true this.changeUrlPath("/app/mobile/iap") @@ -17,6 +17,9 @@ class HopperAPICopyBotCreateHopperRequest : HopperAPIRequest Unit) { + fun getHopper(hopperId: Int, callback: (Hopper?, HopperAPIError?) -> Unit) { HopperAPIGetSingleHopperRequest(hopperId).request({ hopper -> callback(hopper.data?.hopper, null) }, { error -> @@ -1832,6 +1832,7 @@ class CryptohopperHopper { } fun createCopyBot( + hopperId: String?, copyBotMarketplaceId : String, paperTrading: Boolean , apiKey : String? , @@ -1844,6 +1845,7 @@ class CryptohopperHopper { callback: (String?, HopperAPIError?) -> Unit ) { HopperAPICopyBotCreateHopperRequest( + hopperId = hopperId, copyBotMarketplaceId = copyBotMarketplaceId, paperTrading = paperTrading, apiKey = apiKey,