Range
Use Range when you want to bet on whether the final value lands inside or outside a selected interval.
What the builder does
createBetTransaction('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.createBetTransaction('range', {
owner: '0x123',
coinType: '0x2::sui::SUI',
stake: 1_000_000_000n,
leftPoint: 25,
rightPoint: 75,
outOfRange: false,
});
Shared optional options
cashStakebetCountmetadatagasBudgetallowGasCoinShortcut
Read current limits
Range parameter reads are useful when your app needs live stake limits or decoded RTP bounds:
import { fromMoveFloat } from '@suigar/sdk/utils';
const parameters = await client.suigar.getGameParameters('range', {
coinType: '0x2::sui::SUI',
});
const minRtp = fromMoveFloat(parameters.min_rtp);
const maxRtp = fromMoveFloat(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