Skip to content

Commit

Permalink
Merge pull request #96 from cryptohopper/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
canerten authored Dec 12, 2023
2 parents c9218f4 + 22dafa0 commit fa9e5b6
Show file tree
Hide file tree
Showing 10 changed files with 109 additions and 2 deletions.
1 change: 0 additions & 1 deletion .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/kotlinc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package cryptohopper.android.sdk.API.Exchange.GetPortalExchangeKeyMaps

import HopperAPIGetPairOrderBookOfExchangeResponse
import HopperAPIRequest
import cryptohopper.android.sdk.SharedModels.ConfigModels.HopperAPIHttpMethod

class HopperAPIGetPortalExchangeKeyMapsRequest : HopperAPIRequest<HopperAPIGetPairOrderBookOfExchangeResponse> {

constructor(data: String) {
this.httpMethod = HopperAPIHttpMethod.GET
this.needsAuthentication = true
this.changeUrlPath("/exchange/portal")
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package cryptohopper.android.sdk.API.Exchange.GetPortalExchangeKeyMaps

import com.google.gson.annotations.SerializedName

class HopperAPIGetPortalExchangeKeyMapsResponse (

@SerializedName("maps") val maps: Map<String,String>?
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package cryptohopper.android.sdk.API.Exchange.GetPortalExchangePairMaps

import HopperAPIRequest
import cryptohopper.android.sdk.SharedModels.ConfigModels.HopperAPIHttpMethod

class HopperAPIGetPortalExchangePairMapsRequest : HopperAPIRequest<HopperAPIGetPortalExchangePairMapsResponse> {

constructor(exchangeKey : String) {
this.httpMethod = HopperAPIHttpMethod.GET
this.needsAuthentication = true
this.changeUrlPath("/exchange/$exchangeKey/portal/pairs")
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package cryptohopper.android.sdk.API.Exchange.GetPortalExchangePairMaps

import com.google.gson.annotations.SerializedName

class HopperAPIGetPortalExchangePairMapsResponse (

@SerializedName("maps") val maps: Map<String,String>?
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package cryptohopper.android.sdk.API.User.General.DeleteUser

import HopperAPIRequest
import HopperCommonMessageResponse
import cryptohopper.android.sdk.SharedModels.ConfigModels.HopperAPIHttpMethod

class HopperAPIDeleteUserRequest : HopperAPIRequest<HopperCommonMessageResponse>{

constructor(data : String) {
this.httpMethod = HopperAPIHttpMethod.DELETE
this.needsAuthentication = true
this.changeUrlPath("/user")
}
}
32 changes: 32 additions & 0 deletions sdk/src/main/java/cryptohopper/android/sdk/CryptohopperExchange.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import cryptohopper.android.sdk.API.Exchange.GetExchangeWhitelistIP.CHIPWhitelist
import cryptohopper.android.sdk.API.Exchange.GetExchangeWhitelistIP.HopperAPIGetExchangeWhitelistIPRequest
import cryptohopper.android.sdk.API.Exchange.GetExchangeWhitelistIP.HopperAPIGetExchangeWhitelistIPResponse
import cryptohopper.android.sdk.API.Exchange.GetPortalExchangeKeyMaps.HopperAPIGetPortalExchangeKeyMapsRequest
import cryptohopper.android.sdk.API.Exchange.GetPortalExchangeKeyMaps.HopperAPIGetPortalExchangeKeyMapsResponse
import cryptohopper.android.sdk.API.Exchange.GetPortalExchangePairMaps.HopperAPIGetPortalExchangePairMapsRequest
import cryptohopper.android.sdk.API.Exchange.GetPortalExchangePairMaps.HopperAPIGetPortalExchangePairMapsResponse
import cryptohopper.android.sdk.SharedModels.ConfigModels.HopperAPIError
import java.util.*

Expand Down Expand Up @@ -319,4 +323,32 @@ class CryptohopperExchange {
})
}
}

/// Get Portal Exchange Key Maps

fun getPortalExchangeKeyMaps(
callback: (Map<String, String>?, HopperAPIError?) -> Unit
) {
HopperAPIGetPortalExchangeKeyMapsRequest("").request<HopperAPIGetPortalExchangeKeyMapsResponse>(
{ data ->
callback(data.maps, null)
},
{ error ->
callback(null, error)
})
}

/// Get Portal Exchange Key Maps
fun getAllTickersOfExchange(
exchangeKey: String,
callback: (Map<String, String>?, HopperAPIError?) -> Unit
) {
HopperAPIGetPortalExchangePairMapsRequest(exchangeKey).request<HopperAPIGetPortalExchangePairMapsResponse>(
{ data ->
callback(data.maps, null)
},
{ error ->
callback(null, error)
})
}
}
12 changes: 12 additions & 0 deletions sdk/src/main/java/cryptohopper/android/sdk/CryptohopperUser.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import cryptohopper.android.sdk.API.Platform.Countries.HopperAPIGetPlatformCount
import cryptohopper.android.sdk.API.Platform.Countries.HopperAPIPlatformCountriesResponse
import cryptohopper.android.sdk.API.User.Check2FAReset.HopperAPICheck2FAResetRequest
import cryptohopper.android.sdk.API.User.CheckPasswordReset.HopperAPICheckPasswordResetRequest
import cryptohopper.android.sdk.API.User.General.DeleteUser.HopperAPIDeleteUserRequest
import cryptohopper.android.sdk.API.User.General.GetMobileNotifications.HopperAPIUpdateGetMobileNotificationRequest
import cryptohopper.android.sdk.API.User.General.GetMobileNotifications.HopperAPIUpdateGetMobileNotificationResponse
import cryptohopper.android.sdk.API.User.General.RegisterUser.HopperAPIRegisterUserResponse
Expand Down Expand Up @@ -408,6 +409,17 @@ class CryptohopperUser {
callback(null, error)
})
}
/// Delete User
///
///
fun deleteUser(callback: (String?, HopperAPIError?) -> Unit) {
HopperAPIDeleteUserRequest("").request<HopperCommonMessageResponse>({ data ->
callback(data.data, null)
}, { error ->
callback(null, error)
})
}


/// Get One Subscription Plan
///
Expand Down

0 comments on commit fa9e5b6

Please sign in to comment.