Skip to main content

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

  • owner
  • coinType
  • stake
  • leftPoint
  • rightPoint

Optional game-specific options

  • outOfRange
  • scale

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

  • cashStake
  • betCount
  • metadata
  • gasBudget
  • allowGasCoinShortcut

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:

  1. read live stake and range-related parameters
  2. collect human interval values such as 25 and 75
  3. decide whether the bet is in-range or out-of-range
  4. build the transaction without pre-scaling the points
  5. sign and execute it

Notes

  • The SDK uses DEFAULT_RANGE_SCALE from @suigar/sdk/utils as the default fixed-point scale. Its current value is 1_000_000.
  • RANGE_POINT_LIMIT from @suigar/sdk/utils is the maximum scaled range point. With the default scale, the human range is 0 to 100.
  • leftPoint and rightPoint are rounded after scaling.
  • Set outOfRange: true when 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 partner and referrer are 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