Utils
public interface Utils
Class containing utility methods.
Retrieve an instance of Utils
class by calling utils method 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
Public Method Summary
Type | Method |
---|---|
String | ethToWei(String number) Convert ETH to Wei. |
String | ethToGwei(String number) Convert ETH to Gwei. |
String | generateMnemonic(int wordCount) Generate mnemonic phrase. Accepted word counts are 12, 15, 18, 21 and 24. |
String | gweiToEth(String number) Convert Gwei to ETH. |
String | gweiToWei(String number) Convert Wei To Gwei. |
boolean | isValidBtcAddress(String address) Validates BTC blockchain address. |
boolean | isValidEthAddress(String address) Validates ETH blockchain address. |
String | weiToEth(String number) Convert Wei To ETH. |
String | weiToGwei(String number) Convert Wei to Gwei. |
Public Methods
ethToWei
String ethToWei(String number)
Convert ETH to Wei.
ethToGwei
String ethToGwei(String number)
Convert ETH to Gwei.
generateMnemonic
String generateMnemonic(int wordCount)
Generate mnemonic phrase. Accepted word counts are 12, 15, 18, 21 and 24.
Generated according to BIP39 standard.
gweiToEth
String gweiToEth(String number)
Convert Gwei to ETH.
gweiToWei
String gweiToWei(String number)
Convert Wei To Gwei.
isValidBtcAddress
boolean isValidBtcAddress(String address)
Validates BTC blockchain address.
isValidEthAddress
boolean isValidEthAddress(String address)
Validates ETH blockchain address.
weiToEth
String weiToEth(String number)
Convert Wei To ETH.
weiToGwei
String weiToGwei(String number)
Convert Wei to Gwei.