Package money.zumo.zumokit
Interface ZumoCore
-
- All Known Implementing Classes:
ZumoCore.CppProxy
public interface ZumoCore
Entry point to ZumoKit C++ SDK
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
ZumoCore.CppProxy
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addChangeListener(ChangeListener listener)
Listen to changes in current user’s sign in state, exchange settings and transaction fee rates.void
fetchHistoricalExchangeRates(HistoricalExchangeRatesCallback callback)
Fetch historical exchange rates for supported time intervals.User
getCurrentUser()
Get currently signed-in user or null.ExchangeRate
getExchangeRate(java.lang.String fromCurrency, java.lang.String toCurrency)
Get exchange rate for selected currency pair.java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,ExchangeRate>>
getExchangeRates()
Get all available exchange rates.TransactionFeeRate
getTransactionFeeRate(java.lang.String currency)
Get transaction fee rates for selected crypto currency.java.util.HashMap<java.lang.String,TransactionFeeRate>
getTransactionFeeRates()
Get all available crypto transaction fee rates.Utils
getUtils()
Get crypto utils class.static java.lang.String
getVersion()
Get ZumoKit SDK version.static ZumoCore
init(HttpProvider httpProvider, WebSocketFactory webSocketFactory, java.lang.String apiKey, java.lang.String apiUrl, java.lang.String transactionServiceUrl, java.lang.String cardServiceUrl, java.lang.String notificationServiceUrl, java.lang.String exchangeServiceUrl, java.lang.String custodyServiceUrl)
Initializes ZumoKit SDK.static void
onLog(LogListener logListener, java.lang.String logLevel)
Sets log handler for all ZumoKit related logs.void
removeChangeListener(ChangeListener listener)
Remove change listener.static void
setLogLevel(java.lang.String logLevel)
Sets log level for current logger.void
signIn(java.lang.String userTokenSet, UserCallback callback)
Signs in user corresponding to user token set.void
signOut()
Signs out current user.
-
-
-
Method Detail
-
signIn
void signIn(java.lang.String userTokenSet, UserCallback callback)
Signs in user corresponding to user token set. Sets current user to the newly signed in user. Refer to Server guide for details on how to get user token set.- Parameters:
userTokenSet
- user token setcallback
- an interface to receive the result or error- See Also:
User
-
signOut
void signOut()
Signs out current user.
-
getCurrentUser
User getCurrentUser()
Get currently signed-in user or null.- Returns:
- current user or null
-
getUtils
Utils getUtils()
Get crypto utils class.- Returns:
- crypto utils
-
getExchangeRate
ExchangeRate getExchangeRate(java.lang.String fromCurrency, java.lang.String toCurrency)
Get exchange rate for selected currency pair.- Parameters:
fromCurrency
- currency codetoCurrency
- currency code- Returns:
- exchange rate or null
-
getExchangeRates
java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,ExchangeRate>> getExchangeRates()
Get all available exchange rates.- Returns:
- mapping between currency pairs and exchange rates
-
getTransactionFeeRate
TransactionFeeRate getTransactionFeeRate(java.lang.String currency)
Get transaction fee rates for selected crypto currency.- Parameters:
currency
- currency code- Returns:
- transaction fee rate or null
-
getTransactionFeeRates
java.util.HashMap<java.lang.String,TransactionFeeRate> getTransactionFeeRates()
Get all available crypto transaction fee rates.- Returns:
- mapping between cryptocurrencies and transaction fee rate
-
fetchHistoricalExchangeRates
void fetchHistoricalExchangeRates(HistoricalExchangeRatesCallback callback)
Fetch historical exchange rates for supported time intervals. On success callback returns historical exchange rates are contained in a mapping between time interval on a top level, from currency on second level, to currency on third level andExchangeRate
objects.- Parameters:
callback
- an interface to receive the result or error- See Also:
TimeInterval
-
addChangeListener
void addChangeListener(ChangeListener listener)
Listen to changes in current user’s sign in state, exchange settings and transaction fee rates.- Parameters:
listener
- interface to listen to changes
-
removeChangeListener
void removeChangeListener(ChangeListener listener)
Remove change listener.- Parameters:
listener
- interface to listen to changes
-
getVersion
static java.lang.String getVersion()
Get ZumoKit SDK version.- Returns:
- semantic version tag if exists, commit hash otherwise
-
setLogLevel
static void setLogLevel(java.lang.String logLevel)
Sets log level for current logger.- Parameters:
logLevel
- log level, 'trace', 'debug', 'info', 'warning', 'error', 'critical' or 'off'
-
onLog
static void onLog(LogListener logListener, java.lang.String logLevel)
Sets log handler for all ZumoKit related logs.- Parameters:
logListener
- interface to listen to changeslogLevel
- log level, 'trace', 'debug', 'info', 'warning', 'error', 'critical' or 'off'
-
init
static ZumoCore init(HttpProvider httpProvider, WebSocketFactory webSocketFactory, java.lang.String apiKey, java.lang.String apiUrl, java.lang.String transactionServiceUrl, java.lang.String cardServiceUrl, java.lang.String notificationServiceUrl, java.lang.String exchangeServiceUrl, java.lang.String custodyServiceUrl)
Initializes ZumoKit SDK. Should only be called once.- Parameters:
httpProvider
- HTTP providerwebSocketFactory
- WebSocket factoryapiKey
- ZumoKit API KeyapiUrl
- ZumoKit API URLtransactionServiceUrl
- ZumoKit Transaction Service URLcardServiceUrl
- ZumoKit Card Service URLnotificationServiceUrl
- ZumoKit Notification Service URLexchangeServiceUrl
- ZumoKit Exchange Service URLcustodyServiceUrl
- ZumoKit Custody Service URL- Returns:
- ZumoKit instance
-
-