Skip to main content

Plinko

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

What the builder does

createGameBet({ game: 'plinko', ...options }) validates the selected configId, converts it to u8, and builds the Plinko play transaction.

Required options

  • owner
  • coinType
  • stake
  • configId

Shared optional options

  • cashStake
  • betCount
  • metadata
  • gasBudget
  • useGasCoin

Example

const tx = client.suigar.tx.createGameBet({
game: 'plinko',
owner: '0x123',
coinType: '0x2::sui::SUI',
stake: 500_000_000n,
configId: 2,
betCount: 5,
});

Typical usage

The usual Plinko flow is:

  1. read stake bounds from chain
  2. let the player choose a supported configId
  3. optionally collect betCount
  4. build the transaction
  5. sign and execute it

Read current limits

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

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

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

Use this together with configId validation when your product lets players select both board config and stake in the same form.

Notes

  • configId must fit inside u8.
  • The SDK throws if configId is not an integer between 0 and 255.
  • 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 configId comes from URL params, JSON, or form fields, normalize it before use and expect RangeError on invalid values