Skip to content

Reference / @getenginex/sdk / depositRolloverCoveredPerMille

depositRolloverCoveredPerMille() ​

depositRolloverCoveredPerMille(deposit): number | null

How much of a deposit's requirement is already covered (wagered or waived), per mille: an integer from 0 to 1000, floored, so it only reaches 1000 when nothing remains. Computed with BigInt (no floating point rounding). null when nothing is required (requiredAmount is 0 or less): there is no bar to draw. A remainingAmount above the requirement counts as nothing covered (0); one below zero, as all of it (1000). Also null when an amount is not a safe integer, which a decoded response never has.

Parameters ​

deposit ​

Pick<DepositRolloverDeposit, "requiredAmount" | "remainingAmount">

A deposit of DepositRollover.deposits (only the two amounts are read).

Returns ​

number | null

Example ​

ts
const share = depositRolloverCoveredPerMille(deposit)
if (share !== null) bar.style.width = `${share / 10}%`

Throws ​

Nothing.