Range
Use Range when you want to bet on whether the final value lands inside or outside a selected interval.
What the builder does
createGameBet({ game: 'range', ...options }) converts the left and right points into fixed-point integers, then builds the Range play transaction.
Required options
ownercoinTypestakeleftPointrightPoint
Optional game-specific options
outOfRangescale
Example
const tx = client.suigar.tx.createGameBet({
game: 'range',
owner: '0x123',
coinType: '0x2::sui::SUI',
stake: 1_000_000_000n,
leftPoint: 25,
rightPoint: 75,
outOfRange: false,
});
Shared optional options
cashStakebetCountmetadatagasBudgetuseGasCoin
Read current limits
Range parameter reads are useful when your app needs live stake limits or decoded RTP bounds:
const parameters = await client.suigar.getGameParameters({
game: 'range',
coinType: '0x2::sui::SUI',
});
const minRtp = parameters.min_rtp;
const maxRtp = parameters.max_rtp;
This helps when your UI needs to:
- Display RTP bounds alongside the selected range
- Check that the chosen points still make sense under the current live config
- Refresh a stale open form before letting the user submit
Typical usage
The usual Range flow is:
- read live stake and range-related parameters
- collect human interval values such as
25and75 - decide whether the bet is in-range or out-of-range
- build the transaction without pre-scaling the points
- sign and execute it
Notes
- The SDK uses
DEFAULT_RANGE_SCALEfrom@suigar/sdk/utilsas the default fixed-point scale. Its current value is1_000_000. RANGE_POINT_LIMITfrom@suigar/sdk/utilsis the maximum scaled range point. With the default scale, the human range is0to100.leftPointandrightPointare rounded after scaling.- Set
outOfRange: truewhen the bet should win only if the final value is outside the selected interval. - Partner attribution is injected automatically when the extension is registered with
partner - Reserved metadata keys such as
partnerandreferrerare ignored with a warning when passed manually - If you change
scale, pass human values once and let the SDK apply the fixed-point conversion - If your product stores range inputs as percentages or decimal strings, normalize them consistently before passing them into the builder