Skip to content

Commit

Permalink
Merge pull request #81 from cryptohopper/development
Browse files Browse the repository at this point in the history
CopyBot + GetHopper Update
  • Loading branch information
canerten authored May 25, 2023
2 parents 7c00fe4 + f6f9ea7 commit 7cf1e37
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import cryptohopper.android.sdk.SharedModels.ConfigModels.HopperAPIHttpMethod

class HopperAPIGetSingleHopperRequest: HopperAPIRequest<HopperAPIGetSingleHopperResponse> {

constructor(hopperId : String) {
constructor(hopperId : Int) {
this.httpMethod = HopperAPIHttpMethod.GET
this.needsAuthentication = true
this.changeUrlPath("/hopper/$hopperId")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import cryptohopper.android.sdk.SharedModels.ConfigModels.HopperAPIHttpMethod

class HopperAPICopyBotCreateHopperRequest : HopperAPIRequest<HopperAPIPurchaseResponse> {

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")
Expand All @@ -17,6 +17,9 @@ class HopperAPICopyBotCreateHopperRequest : HopperAPIRequest<HopperAPIPurchaseRe
addBodyItem( "walletscrubber", "1")
addBodyItem( "autosync", "1")

if((hopperId?: "") != ""){
addBodyItem("load_into_bot",hopperId!!)
}
if(autoSync){
addBodyItem("autosync","1")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class CryptohopperHopper {
/// Gets one hopper by id
///
/// - Parameter (required) Hopper's id
fun getHopper(hopperId: String, callback: (Hopper?, HopperAPIError?) -> Unit) {
fun getHopper(hopperId: Int, callback: (Hopper?, HopperAPIError?) -> Unit) {
HopperAPIGetSingleHopperRequest(hopperId).request<HopperAPIGetSingleHopperResponse>({ hopper ->
callback(hopper.data?.hopper, null)
}, { error ->
Expand Down Expand Up @@ -1804,6 +1804,7 @@ class CryptohopperHopper {
}

fun createCopyBot(
hopperId: String?,
copyBotMarketplaceId : String,
paperTrading: Boolean ,
apiKey : String? ,
Expand All @@ -1816,6 +1817,7 @@ class CryptohopperHopper {
callback: (String?, HopperAPIError?) -> Unit
) {
HopperAPICopyBotCreateHopperRequest(
hopperId = hopperId,
copyBotMarketplaceId = copyBotMarketplaceId,
paperTrading = paperTrading,
apiKey = apiKey,
Expand Down

0 comments on commit 7cf1e37

Please sign in to comment.