Keno
Use Keno to build a standard wager with a selected Keno configuration and pick values.
What the builder does
createGameBet({ game: 'keno', ...options }) validates the configuration and
picks as u8 values, then builds the Keno play transaction.
Required options
ownercoinTypestakeconfigIdpicks
Shared optional options
cashStakebetCountmetadatagasBudgetuseGasCoin
Example
const tx = client.suigar.tx.createGameBet({
game: 'keno',
owner: '0x123',
coinType: '0x2::sui::SUI',
stake: 1_000_000_000n,
configId: 0,
picks: [1, 7, 12, 20],
});
Read current limits
const parameters = await client.suigar.getGameParameters({
game: 'keno',
coinType: '0x2::sui::SUI',
});
console.log(parameters.min_stake);
console.log(parameters.max_stake);
Use the current on-chain parameters to drive the configurations and pick rules your product presents before the player signs.
Notes
configIdand every value inpicksmust be integers in the inclusive0..255range.- The SDK throws
TypeErrorfor unsupported input shapes andRangeErrorfor out-of-range values. - Partner attribution is injected automatically when the extension is registered with
partner. - Reserved metadata keys such as
partnerandreferrerare ignored with a warning when supplied manually.