Signature
- Namespace
- Class
Parameters
- hex - Hex-encoded string (with or without
0xprefix)
Returns
CallDataType - Branded Uint8Array representing transaction calldata
Examples
- Basic Usage
- Transaction Data
- Namespace API
Validation
Validates hex string format:Comparison with from()
fromHex is more explicit but less flexible than from:
fromHex when:
- Input is always hex string
- You want explicit type checking
- Code clarity is prioritized
from when:
- Input type varies
- Maximum flexibility needed
- Writing generic functions

