Appearance
Match game responses
Match draws a permutation of numbered balls into numbered slots. A match occurs when a ball lands in its own slot.
Configuration and choices
Read config.minBalls, maxBalls, betModes, and bets. Each bet contains:
typescript
interface MatchBet {
balls: number;
betMode: 'EXACT' | 'AT_LEAST';
targetK: number;
table: string;
winProbability: number; // Fraction, not a percentage.
multiplier: number;
}Use the returned bets to build the selector. EXACT wins on exactly targetK matches. AT_LEAST wins on that count or more.
A table can have an ID such as balls_5_exact_2. Match bet.table to a returned buy option. Do not construct IDs from labels.
The creator uses a price-1 buy feature to select each ordinary bet. Apply the vertical-specific permission mapping. Lock ball count, mode, and target while the request runs.
Request
typescript
const option = config.buyFeatures?.find(f => f.feature === selectedBet.table);
if (!option) throw new Error('Selected table is unavailable');
const reply = await placeBet({
backendURL, token, config,
stake: selectedStake,
featureToBuy: option.id,
});
if (!reply.success) throw new Error(reply.error.message);
const result = reply.result.result;Match resolves in one call. The engine enriches the selected outcome with an arrangement. The round closes automatically. Do not call collect for an ordinary completed Match round.
Scenario
The SDK does not export IMatchScenario in version 0.2.18. Define this local type and validate it at the renderer boundary:
typescript
interface IMatchScenario {
balls: number;
betMode: 'EXACT' | 'AT_LEAST';
targetK: number;
matches: number;
won: boolean;
arrangement: number[];
matchedSlots: number[];
winProbability: number;
multiplier: number;
}arrangement[i] is the ball in slot i + 1. Ball numbers and matchedSlots are one-based. Array indexes are zero-based.
For example, [1, 3, 2, 5, 4] has one match, at slot 1. Animate that returned arrangement. Do not shuffle locally to choose the result.
multiplier describes the bet's winning payout. On a loss, it can remain positive while totalWin is zero. Use won and the authoritative result.
Convert the win using engineData.baseStake. Read per-bet odds and RTP from the supplied configuration. Rounding and outcome weights can make RTP differ between bets.
Recovery and tests
Restore a completed arrangement as history. Do not replay its bet. Test both modes, zero matches, maximum matches, a missing table, and a lost response.
Verify that matchedSlots agrees with the displayed arrangement. A permutation cannot have exactly balls - 1 matches. Do not offer an impossible target absent from the returned bet list.
For provably fair rounds, use PF verification with the original stake and feature ID.
Apply all shared frontend requirements, including stake limits, operator notifications, rules, and jurisdiction timing.