ODCutils
DataPoints
DataPoints
Library with utility functions to encode and decode DataPoint
PREFIX
Represents PPPPVVRR prefix
PREFIX_BIT_OFFSET
Offset of the DataPoint prefix
ID_BIT_OFFSET
Offset of the DataPoint id
CHAINID_BIT_OFFSET
Offset of the DataPoint chainid
UnsupportedDataPointStructure
Error thrown when DataPoint structure is not supported
encode
Encode DataPoint
Parameters
Name | Type | Description |
---|---|---|
registry | address | Address of the registry which allocated the DataPoint |
id | uint32 | 32 bit implementation-specific id of the DataPoint |
Return Values
Name | Type | Description |
---|---|---|
[0] | DataPoint | Encoded DataPoint |
decode
Decode DataPoint
Parameters
Name | Type | Description |
---|---|---|
dp | DataPoint | DataPoint to decode |
Return Values
Name | Type | Description |
---|---|---|
chainid | uint32 | Chain ID of the DataPoint |
registry | address | Address of the registry which allocated the DataPoint |
id | uint32 | 32 bit implementation-specific id of the DataPoint |