ZKUtils
@interface ZKUtils : NSObject
Class containing utility methods.
Retrieve an instance of ZKUtils
class by accessing utils property on ZumoKit instance.
Utilities provided by utils class:
- mnemonic phrase generation utility,
- conversion utils between different Bitcoin and Ethereum units,
- utils for Bitcoin and Ethereum address validation
−ethToWei:
- (nonnull NSString *)ethToWei:(nonnull NSString *)number;
Convert ETH to Wei.
−ethToGwei:
- (nonnull NSString *)ethToGwei:(nonnull NSString *)number;
Convert ETH to Gwei.
−generateMnemonic:
- (nonnull NSString *)generateMnemonic:(int32_t)wordCount;
Generate mnemonic phrase. Accepted word counts are 12, 15, 18, 21 and 24.
Generated according to BIP39 standard.
−gweiToEth:
- (nonnull NSString *)gweiToEth:(nonnull NSString *)number;
Convert Gwei to ETH.
−gweiToWei:
- (nonnull NSString *)gweiToWei:(nonnull NSString *)number;
Convert Wei To Gwei.
−isValidBtcAddress:
- (BOOL)isValidEthAddress:(nonnull NSString *)address;
Validates BTC blockchain address.
−isValidEthAddress:
- (BOOL)isValidBtcAddress:(nonnull NSString *)address
network:(ZKNetworkType)network;
Validates ETH blockchain address.
−weiToEth:
- (nonnull NSString *)weiToEth:(nonnull NSString *)number;
Convert Wei To ETH.
−weiToGwei:
- (nonnull NSString *)weiToGwei:(nonnull NSString *)number;
Convert Wei to Gwei.