chainline-contracts / chainline.contracts / HubContract / travels_findMatchableTravel

travels_findMatchableTravel

private fun TravelList.travels_findMatchableTravel(repRequired: BigInteger, carrySpaceRequired: BigInteger, expiryLimit: BigInteger, nowTime: Int): Travel (source)

Finds a Travel in a TravelList that fits the given attributes.

Parameters

repRequired - the desired reputation of the traveller

carrySpaceRequired - the carry space required (scale of 1-5)

expiryLimit - must expire before this limit (normally the demand's expiry time)

nowTime - the current unix timestamp in seconds

Return
the Travel object or an empty array if nothing found