Skip to main content

HasIndexedBidsAndAsks

HasIndexedBidsAndAsks​

utilizes the IHasOfferListOfOfferType contract.

SetLength​

event SetLength(uint256 value)

the length of the index has been set. By emitting this data, an indexer will be able to keep track of what length is used.

Parameters​

NameTypeDescription
valueuint256the length.

SetIndexMapping​

event SetIndexMapping(enum OfferType ba, uint256 index, uint256 offerId)

a new offer of type ba with offerId was created at price index By emitting this data, an indexer will be able to keep track of what offer has what index.

Parameters​

NameTypeDescription
baenum OfferTypethe offer type
indexuint256the index
offerIduint256the Mangrove offer id.

length​

uint256 length

the length of the map.

offerIdOfIndex​

function offerIdOfIndex(enum OfferType ba, uint256 index) public view returns (uint256 offerId)

maps index of offers to offer id on Mangrove.

Parameters​

NameTypeDescription
baenum OfferTypethe offer type
indexuint256the index

Return Values​

NameTypeDescription
offerIduint256the Mangrove offer id.

indexOfOfferId​

function indexOfOfferId(enum OfferType ba, uint256 offerId) public view returns (uint256 index)

Maps an offer type and Mangrove offer id to index.

Parameters​

NameTypeDescription
baenum OfferTypethe offer type
offerIduint256the Mangrove offer id.

Return Values​

NameTypeDescription
indexuint256the index.

setIndexMapping​

function setIndexMapping(enum OfferType ba, uint256 index, uint256 offerId) internal

Sets the Mangrove offer id for an index and vice versa.

Parameters​

NameTypeDescription
baenum OfferTypethe offer type
indexuint256the index
offerIduint256the Mangrove offer id.

setLength​

function setLength(uint256 length_) internal

sets the length of the map.

Parameters​

NameTypeDescription
length_uint256the new length.