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

  • playerAddress
  • coinType
  • stake
  • leftPoint
  • rightPoint

Optional game-specific options

  • outOfRange
  • scale

Example

const tx = client.suigar.tx.createBetTransaction('range', {
playerAddress: '0x123',
coinType: '0x2::sui::SUI',
stake: 1_000_000_000n,
leftPoint: 0.95,
rightPoint: 1.05,
outOfRange: false,
});

Notes

  • The default fixed-point scale is 1_000_000.
  • 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