ZKUtils

Objective-C

@interface ZKUtils : NSObject

Swift

class ZKUtils : NSObject

Utility class providing blockchain related utility methods. Accessed from ZKZumoKit class.

This class provides mnemonic phrase generation utility and Bitcoin & Ethereum address validation utilities.

  • Generates mnemonic seed phrase used in wallet creation process.

    Declaration

    Objective-C

    - (nonnull NSString *)generateMnemonic:(int32_t)wordCount;

    Swift

    func generateMnemonic(_ wordCount: Int32) -> String

    Parameters

    wordCount

    12, 15, 18, 21 or 24

  • Validates Ethereum, Bitcoin or Bitcoin SV address.

    Declaration

    Objective-C

    - (BOOL)isValidAddress:(nonnull NSString *)currencyCode
                   address:(nonnull NSString *)address
                   network:(nonnull NSString *)network;

    Swift

    func isValidAddress(_ currencyCode: String, address: String, network: String) -> Bool

    Parameters

    currencyCode

    ‘ETH’, ‘BTC’ or ‘BSV’

    address

    blockchain address

    network

    network type

    Return Value

    true if address is valid on the given network