new BasicHelperKlass()
Basic helper methods constructor
Methods
-
convertToBigNumber(amountInWei)
-
Convert number to big number. Make sure it's a valid number
Parameters:
Name Type Description amountInWeinumber amount in wei to be formatted Returns:
- Type
- BigNumber
-
formatWeiToString(amountInWei)
-
Convert wei to proper string. Make sure it's a valid number
Parameters:
Name Type Description amountInWeinumber amount in wei to be formatted Returns:
- Type
- string
-
getReturnType(returnType)
-
get return type for transaction
Parameters:
Name Type Description returnTypestring return from geth transactions when following event is received Returns:
- Type
- string
-
isAddressValid(address)
-
Check if address is valid or not
Parameters:
Name Type Description addressstring Address Returns:
- Type
- boolean
-
isBTConversionRateValid(conversionRate)
-
Check if branded token conversion rate is valid or not
Parameters:
Name Type Description conversionRatenumber Branded token conversion rate Returns:
- Type
- boolean
-
isBTNameValid(name)
-
Check if branded token name is valid or not
Parameters:
Name Type Description namestring Branded token name Returns:
- Type
- boolean
-
isBTSymbolValid(symbol)
-
Check if branded token symbol is valid or not
Parameters:
Name Type Description symbolstring Branded token symbol Returns:
- Type
- boolean
-
isNonZeroWeiValid(amountInWei)
-
Check if amount is valid wei number and not zero
Parameters:
Name Type Description amountInWeinumber amount in wei Returns:
- Type
- boolean
-
isReturnTypeTxHash(returnType)
-
check if return type is txHash or not
Parameters:
Name Type Description returnTypestring return type Returns:
- Type
- boolean
-
isReturnTypeTxReceipt(returnType)
-
check if return type is txReceipt or not
Parameters:
Name Type Description returnTypestring return type Returns:
- Type
- boolean
-
isReturnTypeUUID(returnType)
-
check if return type is uuid or not
Parameters:
Name Type Description returnTypestring return type Returns:
- Type
- boolean
-
isTxHashValid(transactionHash)
-
Check if transaction hash is valid or not
Parameters:
Name Type Description transactionHashstring Transaction hash Returns:
- Type
- boolean
-
isUuidValid(uuid)
-
Check if uuid is valid or not
Parameters:
Name Type Description uuidstring Branded Token UUID Returns:
- Type
- boolean
-
isValidChainId(chainId)
-
Check if chainId is valid
Parameters:
Name Type Description chainIdNumber chainId Returns:
- Type
- Bool