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 amountInWei
number 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 amountInWei
number amount in wei to be formatted Returns:
- Type
- string
-
getReturnType(returnType)
-
get return type for transaction
Parameters:
Name Type Description returnType
string 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 address
string Address Returns:
- Type
- boolean
-
isBTConversionRateValid(conversionRate)
-
Check if branded token conversion rate is valid or not
Parameters:
Name Type Description conversionRate
number Branded token conversion rate Returns:
- Type
- boolean
-
isBTNameValid(name)
-
Check if branded token name is valid or not
Parameters:
Name Type Description name
string Branded token name Returns:
- Type
- boolean
-
isBTSymbolValid(symbol)
-
Check if branded token symbol is valid or not
Parameters:
Name Type Description symbol
string Branded token symbol Returns:
- Type
- boolean
-
isNonZeroWeiValid(amountInWei)
-
Check if amount is valid wei number and not zero
Parameters:
Name Type Description amountInWei
number amount in wei Returns:
- Type
- boolean
-
isReturnTypeTxHash(returnType)
-
check if return type is txHash or not
Parameters:
Name Type Description returnType
string return type Returns:
- Type
- boolean
-
isReturnTypeTxReceipt(returnType)
-
check if return type is txReceipt or not
Parameters:
Name Type Description returnType
string return type Returns:
- Type
- boolean
-
isReturnTypeUUID(returnType)
-
check if return type is uuid or not
Parameters:
Name Type Description returnType
string return type Returns:
- Type
- boolean
-
isTxHashValid(transactionHash)
-
Check if transaction hash is valid or not
Parameters:
Name Type Description transactionHash
string Transaction hash Returns:
- Type
- boolean
-
isUuidValid(uuid)
-
Check if uuid is valid or not
Parameters:
Name Type Description uuid
string Branded Token UUID Returns:
- Type
- boolean
-
isValidChainId(chainId)
-
Check if chainId is valid
Parameters:
Name Type Description chainId
Number chainId Returns:
- Type
- Bool