Plinko
Use Plinko when you want to build a wager against one of the supported Plinko board configs.
What the builder does
createBetTransaction('plinko', options) validates the selected configId, converts it to u8, and builds the Plinko play transaction.
Required options
ownercoinTypestakeconfigId
Shared optional options
cashStakebetCountmetadatagasBudgetallowGasCoinShortcut
Example
const tx = client.suigar.tx.createBetTransaction('plinko', {
owner: '0x123',
coinType: '0x2::sui::SUI',
stake: 500_000_000n,
configId: 2,
betCount: 5,
});
Typical usage
The usual Plinko flow is:
- read stake bounds from chain
- let the player choose a supported
configId - optionally collect
betCount - build the transaction
- 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('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
configIdmust fit insideu8.- The SDK throws if
configIdis not an integer between0and255. - 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
configIdcomes from URL params, JSON, or form fields, normalize it before use and expectRangeErroron invalid values