Class ColizeumAPI
Namespace: ColizeumSDK.API
Assembly: cs.temp.dll.dll
Syntax
public class ColizeumAPI : MonoBehaviour
Methods
ConsumeUserEnergy(Int32, String, Action<ConsumeEnergyResponse>, Action<Exception>)
Consumes the specified amount of energy. If tokenId is provided, tries to consume energy for that specific token
Declaration
public void ConsumeUserEnergy(int amount, string tokenId, Action<ConsumeEnergyResponse> onSuccess, Action<Exception> onError = null)
Parameters
Type | Name | Description |
---|---|---|
Int32 | amount | |
String | tokenId | |
Action<ConsumeEnergyResponse> | onSuccess | |
Action<Exception> | onError |
GetEarnings(Action<GetEarningsResponse>, Action<Exception>)
Returns secondary earnings for this specific game
Declaration
public void GetEarnings(Action<GetEarningsResponse> onSuccess, Action<Exception> onError = null)
Parameters
Type | Name | Description |
---|---|---|
Action<GetEarningsResponse> | onSuccess | |
Action<Exception> | onError |
GetMe(Action<UserResponse>, Action<Exception>)
Returns user information
Declaration
public void GetMe(Action<UserResponse> onSuccess, Action<Exception> onError = null)
Parameters
Type | Name | Description |
---|---|---|
Action<UserResponse> | onSuccess | |
Action<Exception> | onError |
GetSecondaryCurrency(Action<GetSecondaryCurrencyResponse>, Action<Exception>)
Returns currently available secondary currency the user has in Colizeum platform
Declaration
public void GetSecondaryCurrency(Action<GetSecondaryCurrencyResponse> onSuccess, Action<Exception> onError = null)
Parameters
Type | Name | Description |
---|---|---|
Action<GetSecondaryCurrencyResponse> | onSuccess | |
Action<Exception> | onError |
GetTokensFromCode(String, String, Action<TokenResponse>, Action<Exception>)
Returns user tokens from the provided authorization code
Declaration
public void GetTokensFromCode(string code, string codeVerifier, Action<TokenResponse> onSuccess, Action<Exception> onError = null)
Parameters
Type | Name | Description |
---|---|---|
String | code | |
String | codeVerifier | |
Action<TokenResponse> | onSuccess | |
Action<Exception> | onError |
GetUserEnergy(Action<GetEnergyResponse>, Action<Exception>)
Returns available energy amount which user has
Declaration
public void GetUserEnergy(Action<GetEnergyResponse> onSuccess, Action<Exception> onError = null)
Parameters
Type | Name | Description |
---|---|---|
Action<GetEnergyResponse> | onSuccess | |
Action<Exception> | onError |
RefreshAccessToken(String, Action<TokenResponse>, Action<Exception>)
Tries to fetch a new access token using the existing refresh token
Declaration
public void RefreshAccessToken(string refreshToken, Action<TokenResponse> onSuccess, Action<Exception> onError = null)
Parameters
Type | Name | Description |
---|---|---|
String | refreshToken | |
Action<TokenResponse> | onSuccess | |
Action<Exception> | onError |
RevokeToken(String, Action<GenericResponse>, Action<Exception>)
Revokes provided token, making it unusable
Declaration
public void RevokeToken(string token, Action<GenericResponse> onSuccess = null, Action<Exception> onError = null)
Parameters
Type | Name | Description |
---|---|---|
String | token | |
Action<GenericResponse> | onSuccess | |
Action<Exception> | onError |
StopAll()
Stops all currently active API requests
Declaration
public void StopAll()