ODCutils
OmnichainAddresses
OmnichainAddresses
Library with utility functions to encode and decode OmnichainAddress
PREFIX_AND_RESERVED_BYTES
represent PPPPVVRR prefix
PREFIX_AND_RESERVED_BYTES_BIT_OFFSET
Offset of the OmnichainAddresses prefix
CHAINID_BIT_OFFSET
Offset of the OmnichainAddresses chainid
UnsupportedOmnichainAddressesStructure
Error thrown when OmnichainAddress structure is not supported
encode
Encode OmnichainAddress
Parameters
| Name | Type | Description |
|---|---|---|
| account | address | Address of the user |
Return Values
| Name | Type | Description |
|---|---|---|
| [0] | OmnichainAddress | Encoded OmnichainAddress |
encode
Encode OmnichainAddress
Parameters
| Name | Type | Description |
|---|---|---|
| chainid | uint32 | Chain ID to encode |
| account | address | Address of the user |
Return Values
| Name | Type | Description |
|---|---|---|
| [0] | OmnichainAddress | Encoded OmnichainAddress |
decode
Decode OmnichainAddress
Parameters
| Name | Type | Description |
|---|---|---|
| oa | OmnichainAddress | OmnichainAddress to decode |
Return Values
| Name | Type | Description |
|---|---|---|
| chainid | uint32 | Chain ID of the OmnichainAddress |
| account | address | Address of the user |

