Skip to content

RefPrice

The relay's reference mid (/api/v2/network), USDM per NIGHT as a ratio, polled and checked against a band (RefPriceBand). Off loopback the band needs min and max.

new RefPrice(relayUrl, everyMs?, band?): RefPrice

Parameter Type Default value
relayUrl string undefined
everyMs? number 2_000
band? RefPriceBand {}

RefPrice

mid: Mid | null = null


at: number = 0


refused: string | null = null

Why the last mid was refused, until one is taken again.


readonly relayUrl: string


readonly everyMs: number = 2_000


readonly band: RefPriceBand = {}

start(): Promise<void>

Promise<void>


stop(): void

void


offer(mid): boolean

Takes or refuses a mid (the poll's step, public for tests).

Parameter Type
mid Mid

boolean


fresh(maxAgeMs?): boolean

Parameter Type Default value
maxAgeMs? number 30_000

boolean