ZumoKit

Objective-C

@interface ZumoKit : NSObject

Swift

class ZumoKit : NSObject

Entry point to ZumoKit iOS SDK.

See Getting Started guide for usage details.

  • ZumoKit SDK semantic version tag if exists, commit hash otherwise.

    Declaration

    Objective-C

    + (nonnull NSString *)version;

    Swift

    class func version() -> String
  • Sets log level for current logger.

    See

    ZKLogLevel

    Declaration

    Objective-C

    + (void)setLogLevel:(nonnull NSString *)logLevel;

    Swift

    class func setLogLevel(_ logLevel: String)

    Parameters

    logLevel

    log level, e.g. ‘debug’ or ‘info’

  • Sets log handler for all ZumoKit related logs.

    See

    ZKLogLevel

    Declaration

    Objective-C

    + (void)onLog:(nullable id<ZKLogListener>)logListener
         logLevel:(nonnull NSString *)logLevel;

    Swift

    class func onLog(_ logListener: ZKLogListener?, logLevel: String)

    Parameters

    logListener

    interface to listen to changes

    logLevel

    log level, e.g. ‘debug’ or ‘info’

  • Initializes ZumoKit SDK. Should only be called once.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithApiKey:(nonnull NSString *)apiKey
                                    apiUrl:(nonnull NSString *)apiUrl
                     transactionServiceUrl:(nonnull NSString *)transactionServiceUrl
                            cardServiceUrl:(nonnull NSString *)cardServiceUrl
                    notificationServiceUrl:
                        (nonnull NSString *)notificationServiceUrl;

    Swift

    init(apiKey: String, apiUrl: String, transactionServiceUrl: String, cardServiceUrl: String, notificationServiceUrl: String)

    Parameters

    apiKey

    ZumoKit API Key

    apiUrl

    ZumoKit API URL

    transactionServiceUrl

    ZumoKit Transaction Service URL

    cardServiceUrl

    ZumoKit Card Service URL

    notificationServiceUrl

    ZumoKit Notification Service URL

    Return Value

    ZumoKit instance

  • 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.

    See

    ZKUser

    Declaration

    Objective-C

    - (void)signIn:(nonnull NSString *)userTokenSet
        completion:(ZKUserCompletionBlock _Nonnull)completion;

    Swift

    func sign(in userTokenSet: String, completion: @escaping ZKUserCompletionBlock)

    Parameters

    userTokenSet

    user token set

    completion

    completion block to receive the result or error

  • Signs out current user.

    Declaration

    Objective-C

    - (void)signOut;

    Swift

    func signOut()
  • Get currently signed-in user or null.

    Declaration

    Objective-C

    - (nullable ZKUser *)getCurrentUser;

    Swift

    func getCurrentUser() -> ZKUser?

    Return Value

    current user or null

  • Get crypto utils.

    Declaration

    Objective-C

    - (nonnull ZKUtils *)getUtils;

    Swift

    func getUtils() -> ZKUtils

    Return Value

    crypto utils

  • Get exchange rate for selected currency pair.

    Declaration

    Objective-C

    - (nullable ZKExchangeRate *)getExchangeRate:(nonnull NSString *)fromCurrency
                                      toCurrency:(nonnull NSString *)toCurrency;

    Swift

    func getExchangeRate(_ fromCurrency: String, toCurrency: String) -> ZKExchangeRate?

    Parameters

    fromCurrency

    currency code

    toCurrency

    currency code

  • Get all available exchange rates.

    Declaration

    Objective-C

    - (nonnull ZKExchangeRates)getExchangeRates;

    Swift

    func getExchangeRates() -> [String : [String : ZKExchangeRate]]

    Return Value

    mapping between currency pairs and exchange rates

  • Get exchange settings for selected currency pair.

    Declaration

    Objective-C

    - (nullable ZKExchangeSetting *)
        getExchangeSetting:(nonnull NSString *)fromCurrency
                toCurrency:(nonnull NSString *)toCurrency;

    Swift

    func getExchangeSetting(_ fromCurrency: String, toCurrency: String) -> ZKExchangeSetting?

    Parameters

    fromCurrency

    currency code

    toCurrency

    currency code

  • Get all available exchange settings.

    Declaration

    Objective-C

    - (nonnull ZKExchangeSettings)getExchangeSettings;

    Swift

    func getExchangeSettings() -> [String : [String : ZKExchangeSetting]]

    Return Value

    mapping between currency pairs and exchange settings

  • Get transasction fee rate for selected crypto currency.

    Declaration

    Objective-C

    - (nullable ZKTransactionFeeRate *)getTransactionFeeRate:
        (nonnull NSString *)currency;

    Swift

    func getTransactionFeeRate(_ currency: String) -> ZKTransactionFeeRate?

    Parameters

    currency

    currency code

  • Get all available crypto transaction fee rates.

    Declaration

    Objective-C

    - (nonnull ZKTransactionFeeRates)getTransactionFeeRates;

    Swift

    func getTransactionFeeRates() -> [String : ZKTransactionFeeRate]

    Return Value

    mapping between cryptocurrencies and transaction fee rate

  • 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 and ZKExchangeRate objects.

    Declaration

    Objective-C

    - (void)fetchHistoricalExchangeRates:
        (ZKHistoricalExchangeRatesCompletionBlock _Nonnull)completion;

    Swift

    func fetchHistoricalExchangeRates(_ completion: @escaping ZKHistoricalExchangeRatesCompletionBlock)

    Parameters

    completion

    an interface to receive the result or error

  • Listen to changes in current user’s sign in state, exchange rates, exchange settings or transaction fee rates.

    Declaration

    Objective-C

    - (void)addChangeListener:(nullable id<ZKChangeListener>)listener;

    Swift

    func add(_ listener: ZKChangeListener?)

    Parameters

    listener

    interface to listen to changes

  • Remove change listener.

    Declaration

    Objective-C

    - (void)removeChangeListener:(nullable id<ZKChangeListener>)listener;

    Swift

    func remove(_ listener: ZKChangeListener?)

    Parameters

    listener

    interface to listen to changes