Skip to main content

Wheel

Use Wheel when you want to build a wager against one of the supported Wheel configs.

What the builder does

createBetTransaction('wheel', options) validates the selected configId, converts it to u8, and builds the Wheel play transaction.

Required options

  • owner
  • coinType
  • stake
  • configId

Shared optional options

  • cashStake
  • betCount
  • metadata
  • gasBudget
  • allowGasCoinShortcut

Example

const tx = client.suigar.tx.createBetTransaction('wheel', {
owner: '0x123',
coinType: '0x2::sui::SUI',
stake: 750_000_000n,
configId: 1,
});

Typical usage

The usual Wheel flow is:

  1. read live stake bounds
  2. let the player choose one supported configId
  3. build the transaction
  4. sign and execute it
  5. decode results if you want to show structured wheel outcome data

Read current limits

If your app needs current stake bounds before building a Wheel transaction, read the live parameter object first:

const parameters = await client.suigar.getGameParameters('wheel', {
coinType: '0x2::sui::SUI',
});

console.log(parameters.min_stake);
console.log(parameters.max_stake);

This is useful when the Wheel form is driven by dynamic config selection and you want live stake validation before the player signs.

Notes

  • configId must be an integer from 0 to 255.
  • This builder follows the same standard-game flow as Coinflip, Limbo, Plinko, and Range.
  • 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
  • configId validation is strict, so treat values from route params or form state as untrusted input