Address.from
Converts a stringified address to a typed (optionally checksummed) Address.Address.
Imports
Named
import { Address } from 'ox'Examples
import { Address } from 'ox'
Address.from('0xa0cf798816d4b9b9866b5330eea46a18382f251e')
'0xa0cf798816d4b9b9866b5330eea46a18382f251e'import { Address } from 'ox'
Address.from('0xa0cf798816d4b9b9866b5330eea46a18382f251e', {
checksum: true
})
'0xA0Cf798816D4b9b9866b5330EEa46a18382f251e'import { Address } from 'ox'
Address.from('hello')
InvalidAddressError: Address "0xa" is invalid.Definition
function from(
address: string,
options?: from.Options,
): AddressSource: src/core/Address.ts
Parameters
address
- Type:
string
An address string to convert to a typed Address.
options
- Type:
from.Options - Optional
Conversion options.
options.checksum
- Type:
boolean - Optional
Whether to checksum the address.
Return Type
The typed Address.
Address

