@block52/poker-vm-sdk 1.8.0 → 1.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -44960,6 +44960,14 @@ interface MsgCreateGame {
44960
44960
  * 0 = unscheduled: starts only when full. (poker-vm#2680)
44961
44961
  */
44962
44962
  startTime: Long;
44963
+ /**
44964
+ * Blind structure for a sit-and-go / tournament (field 22): JSON of the SDK's
44965
+ * BlindStructureDTO — a preset ({"preset":"turbo"}) or an explicit double /
44966
+ * linear / percentage / table structure. Empty = the blinds double every
44967
+ * blind_level_duration minutes. Cash games must leave it empty.
44968
+ * (poker-vm#1734, block52/pokerchain#434)
44969
+ */
44970
+ blindStructure: string;
44963
44971
  }
44964
44972
  declare const MsgCreateGame: MessageFns<MsgCreateGame>;
44965
44973
  /** MsgJoinGame defines the MsgJoinGame message. */
@@ -45258,7 +45266,9 @@ declare enum NonPlayerActionType {
45258
45266
  TIMEOUT = "timeout",
45259
45267
  TIME_BANK = "time-bank",
45260
45268
  TOP_UP = "top-up",
45261
- START = "start"
45269
+ START = "start",
45270
+ REVEAL_BOARD = "reveal-board",
45271
+ REVEAL_DEAL = "reveal-deal"
45262
45272
  }
45263
45273
  declare const AllPlayerActions: {
45264
45274
  DEAD_SMALL_BLIND: NonPlayerActionType.DEAD_SMALL_BLIND;
@@ -45275,6 +45285,8 @@ declare const AllPlayerActions: {
45275
45285
  TIME_BANK: NonPlayerActionType.TIME_BANK;
45276
45286
  TOP_UP: NonPlayerActionType.TOP_UP;
45277
45287
  START: NonPlayerActionType.START;
45288
+ REVEAL_BOARD: NonPlayerActionType.REVEAL_BOARD;
45289
+ REVEAL_DEAL: NonPlayerActionType.REVEAL_DEAL;
45278
45290
  SMALL_BLIND: PlayerActionType.SMALL_BLIND;
45279
45291
  BIG_BLIND: PlayerActionType.BIG_BLIND;
45280
45292
  FOLD: PlayerActionType.FOLD;
@@ -45354,6 +45366,93 @@ type RakeConfigDTO = {
45354
45366
  rakeCap: string;
45355
45367
  owner?: string;
45356
45368
  };
45369
+ /**
45370
+ * Blind structures (poker-vm#1734 via #2613 slice 2). A sit-and-go whose
45371
+ * `gameOptions.blindStructure` is set takes its blinds, big-blind ante and
45372
+ * level durations from the structure; absent, the blinds double every
45373
+ * `blindLevelDuration` minutes as before. The engine derives every level from
45374
+ * the structure with integer arithmetic (never from a persisted, escalated
45375
+ * blind) and re-emits the current level as `smallBlind` / `bigBlind` /
45376
+ * `nextSmallBlind` / `nextBigBlind` / `blindLevelDuration` / `ante`, so
45377
+ * readers of those fields are unchanged. Amounts are chip-unit strings
45378
+ * (Commandment 9). Mirrors pvm/go/engine/tournament.go field for field.
45379
+ */
45380
+ type BlindPreset = "turbo" | "standard" | "deep_stack" | "hyper_turbo";
45381
+ declare const BLIND_PRESETS: readonly BlindPreset[];
45382
+ type BlindProgression = "double" | "linear" | "percentage" | "table";
45383
+ declare const BLIND_PROGRESSIONS: readonly BlindProgression[];
45384
+ /**
45385
+ * The algorithmic ante rule: from `startLevel` (0-based) on, the big-blind
45386
+ * ante is floor(bigBlind × bps / 10000). `bps: 10000` is the WSOP
45387
+ * ante-equals-big-blind structure; #1734's "10% from level 4" is
45388
+ * `{ startLevel: 4, bps: 1000 }`.
45389
+ */
45390
+ type AnteRuleDTO = {
45391
+ startLevel: number;
45392
+ bps: number;
45393
+ };
45394
+ /**
45395
+ * One blind level: a table-mode row as authored, and what the engine derives
45396
+ * for any level of any progression. `level` is 0-based. A break level deals no
45397
+ * hands; breaks need a tournament director, so a sit-and-go rejects them.
45398
+ */
45399
+ type BlindLevelDTO = {
45400
+ level: number;
45401
+ smallBlind: string;
45402
+ bigBlind: string;
45403
+ ante: string;
45404
+ durationMinutes: number;
45405
+ isBreak: boolean;
45406
+ };
45407
+ /**
45408
+ * A preset by name (#1734's library, engine data): turbo (double, 5 min,
45409
+ * 25/50, ante 10% from level 4), standard (double, 10 min, 25/50, ante 10% from
45410
+ * level 5), deep_stack (×1.5 per level rounded to 25, 15 min, 25/50, ante 12.5%
45411
+ * from level 6), hyper_turbo (double, 3 min, 50/100, ante 10% from level 3).
45412
+ * The engine resolves it into the concrete structure on the table's first
45413
+ * action and persists that, so a later preset edit never changes a running
45414
+ * table. No other field may be set alongside `preset`.
45415
+ */
45416
+ type BlindStructurePresetDTO = {
45417
+ preset: BlindPreset;
45418
+ };
45419
+ type AlgorithmicBlindStructureBase = {
45420
+ startSmallBlind: string;
45421
+ startBigBlind: string;
45422
+ durationMinutes: number;
45423
+ maxLevel?: number;
45424
+ ante?: AnteRuleDTO;
45425
+ };
45426
+ /** sb_n = startSmallBlind × 2^n — bit-identical to the doubling a structure-less sit-and-go runs. */
45427
+ type DoubleBlindStructureDTO = AlgorithmicBlindStructureBase & {
45428
+ progression: "double";
45429
+ };
45430
+ /** sb_n = startSmallBlind + step × n. */
45431
+ type LinearBlindStructureDTO = AlgorithmicBlindStructureBase & {
45432
+ progression: "linear";
45433
+ step: string;
45434
+ };
45435
+ /**
45436
+ * sb_n = floor(sb_{n−1} × factorBps / 10000) rounded half-up to a multiple of
45437
+ * `roundTo`, never less than sb_{n−1} + roundTo (so a coarse roundTo cannot
45438
+ * stall the curve). `factorBps` must exceed 10000 (15000 = ×1.5 per level).
45439
+ */
45440
+ type PercentageBlindStructureDTO = AlgorithmicBlindStructureBase & {
45441
+ progression: "percentage";
45442
+ factorBps: number;
45443
+ roundTo: string;
45444
+ };
45445
+ /**
45446
+ * Hand-crafted levels (the WSOP-style structure #1734 showed no formula can
45447
+ * reproduce): each row carries its own blinds, ante and duration. Past the
45448
+ * last row the schedule repeats it. The first and last rows may not be breaks.
45449
+ */
45450
+ type TableBlindStructureDTO = {
45451
+ progression: "table";
45452
+ levels: BlindLevelDTO[];
45453
+ maxLevel?: number;
45454
+ };
45455
+ type BlindStructureDTO = BlindStructurePresetDTO | DoubleBlindStructureDTO | LinearBlindStructureDTO | PercentageBlindStructureDTO | TableBlindStructureDTO;
45357
45456
  /**
45358
45457
  * GameOptions represents game configuration (internal use with BigInt).
45359
45458
  *
@@ -45408,6 +45507,7 @@ type GameOptionsDTO = {
45408
45507
  protocolFeeBps?: number;
45409
45508
  blindLevelDuration?: number;
45410
45509
  blindLevel?: number;
45510
+ blindStructure?: BlindStructureDTO;
45411
45511
  nextSmallBlind?: string;
45412
45512
  nextBigBlind?: string;
45413
45513
  scheduledStartTime?: number;
@@ -45483,6 +45583,25 @@ type PayoutPlaceDTO = {
45483
45583
  place: number;
45484
45584
  amount: string;
45485
45585
  };
45586
+ /**
45587
+ * The reveal a sealed hand is stopped on (poker-vm#2695): "board" = the next
45588
+ * street is due from the dealer, "deal" = the deck is due at showdown, "" =
45589
+ * nothing pending. While non-empty no player is next to act and player
45590
+ * actions are rejected.
45591
+ */
45592
+ type SealedAwaiting = "board" | "deal" | "";
45593
+ /**
45594
+ * The sealed-hand (commit-reveal) state of the current hand — poker-vm#2695,
45595
+ * phase 1 of the dealing design on #2643. Present as
45596
+ * `TexasHoldemStateDTO.sealed` only on a commit-reveal hand; omitted on an
45597
+ * ordinary hand. On a sealed hand `deck` is "" and each hidden hole card is
45598
+ * "??" until `revealed` is true.
45599
+ */
45600
+ type SealedDTO = {
45601
+ awaiting: SealedAwaiting;
45602
+ dealtSeats: number[];
45603
+ revealed: boolean;
45604
+ };
45486
45605
  type TexasHoldemGameState = {
45487
45606
  type: string;
45488
45607
  address: string;
@@ -45527,6 +45646,7 @@ type TexasHoldemStateDTO = {
45527
45646
  availableSeats: number[];
45528
45647
  rakeCollected?: string;
45529
45648
  payouts?: PayoutPlaceDTO[];
45649
+ sealed?: SealedDTO;
45530
45650
  signature: string;
45531
45651
  };
45532
45652
  /**
@@ -46032,6 +46152,34 @@ declare const isEmptyAddress: (address: string | null | undefined) => boolean;
46032
46152
  */
46033
46153
  declare const isValidPlayerAddress: (address: string | null | undefined) => boolean;
46034
46154
 
46155
+ /**
46156
+ * Parses the text form into the typed structure. Throws on anything the
46157
+ * engine would refuse that can be seen without expanding levels; the engine
46158
+ * validates the result again on load.
46159
+ */
46160
+ declare function parseBlindStructure(text: string): BlindStructureDTO;
46161
+ /**
46162
+ * The inverse of parseBlindStructure. A preset formats as `BLINDS <preset>`;
46163
+ * anything else as a block under `name` (default "custom").
46164
+ */
46165
+ declare function formatBlindStructure(structure: BlindStructureDTO, name?: string): string;
46166
+ /**
46167
+ * #1734's preset library, as the engine resolves it (pvm/go/engine
46168
+ * tournament_blinds.go blindPresets). The engine resolves a preset on the
46169
+ * table's first action; `resolveBlindPreset` does the same client-side so the
46170
+ * levels can be previewed before the table exists.
46171
+ */
46172
+ declare const BLIND_PRESET_STRUCTURES: Readonly<Record<BlindPreset, Exclude<BlindStructureDTO, BlindStructurePresetDTO>>>;
46173
+ /** Replaces a preset with its concrete structure (a deep copy); anything else is returned as is. */
46174
+ declare function resolveBlindPreset(structure: BlindStructureDTO): Exclude<BlindStructureDTO, BlindStructurePresetDTO>;
46175
+ /**
46176
+ * Level n (0-based) of a structure, exactly as the engine expands it: the cap
46177
+ * (`maxLevel`) freezes the blinds while the level number keeps counting; a
46178
+ * table schedule repeats its last row once it runs out; the ante rule applies
46179
+ * from its start level. A preset must be resolved first (`resolveBlindPreset`).
46180
+ */
46181
+ declare function expandBlindLevel(structure: BlindStructureDTO, n: number): BlindLevelDTO;
46182
+
46035
46183
  /**
46036
46184
  * Poker hand types in order of strength (weakest to strongest)
46037
46185
  */
@@ -46634,6 +46782,7 @@ interface SNGConfig {
46634
46782
  blindLevelDuration: number;
46635
46783
  entryFee?: bigint;
46636
46784
  startTime?: number;
46785
+ blindStructure?: BlindStructureDTO;
46637
46786
  }
46638
46787
  /**
46639
46788
  * Signing Cosmos Client that extends the read-only CosmosClient with transaction capabilities
@@ -47241,5 +47390,5 @@ declare const Client: typeof IgniteClient & Constructor<{
47241
47390
  }>;
47242
47391
  declare const registry: Registry;
47243
47392
 
47244
- export { AllPlayerActions, BLOCK52_HD_PATH, BettingLimit, Board, COSMOS_CONSTANTS, Client, CosmosClient, Deck, GAME_NAME_MICRO_PER_CHAR, GameFormat, GameStatus, GameVariant, HandType, KEYS, MAX_GAME_NAME_LENGTH, MSG_CREATE_VALIDATOR_TYPE_URL, MissingWalletError, NonPlayerActionType, Params, PlayerActionType, PlayerStatus, PokerGameIntegration, PokerSolver, RPCMethods, SIT_IN_METHOD_NEXT_BB, SIT_IN_METHOD_POST_NOW, SIT_OUT_METHOD_NEXT_BB, SIT_OUT_METHOD_NEXT_HAND, SUIT, SigningCosmosClient, TexasHoldemRound, TxExecutionError, ValidatorBond, WithdrawalRequest, assertCreatableBettingLimit, assertExecuted, buildMsgCreateValidator, computeGameNameFee, createSigningClientFromMnemonic, createWalletFromMnemonic, decToAtomics, formatGameFormatDisplay, formatGameVariantDisplay, generateWallet, getActionByType, getAddressFromMnemonic, getBettingLimit, getDefaultCosmosConfig, getGameFormat, getGameFormatForCosmos, getGameFormatFromObject, getGameVariant, hasAction, holeCardsPerPlayer, isCashFormat, isEmptyAddress, isPotLimit, isSitAndGoFormat, isTournamentFormat, isValidMnemonic, isValidPlayerAddress, parseGameFormat, parseGameVariant, registry, toValoperAddress, txFailureHash, txFailurePhase };
47245
- export type { AccountDTO, ActionDTO, Block, BlockDTO, BlockHeader, BlockHeaderDTO, BlockID, BlockResponse, BurnResponseDTO, Card, CreateValidatorParams, EquityHand, EquityRequest, EquityResponse, EquityResult, ExecutionResult, GameListItem, GameOptions, GameOptionsDTO, GameOptionsResponse, GameStateResponse, GameStateResponseDTO, HandEvaluation, ISignedResponse, LegalActionDTO, PayoutPlaceDTO, PerformActionResponse, PlayerDTO, RPCRequest, RPCRequestParams, RPCResponse, RakeConfig, RakeConfigDTO, ResultDTO, SitInMethod, SitOutMethod, TexasHoldemGameState, TexasHoldemStateDTO, TransactionDTO, TransactionResponse, TxFailurePhase, WalletInfo, WinnerDTO, WithdrawResponseDTO };
47393
+ export { AllPlayerActions, BLIND_PRESETS, BLIND_PRESET_STRUCTURES, BLIND_PROGRESSIONS, BLOCK52_HD_PATH, BettingLimit, Board, COSMOS_CONSTANTS, Client, CosmosClient, Deck, GAME_NAME_MICRO_PER_CHAR, GameFormat, GameStatus, GameVariant, HandType, KEYS, MAX_GAME_NAME_LENGTH, MSG_CREATE_VALIDATOR_TYPE_URL, MissingWalletError, NonPlayerActionType, Params, PlayerActionType, PlayerStatus, PokerGameIntegration, PokerSolver, RPCMethods, SIT_IN_METHOD_NEXT_BB, SIT_IN_METHOD_POST_NOW, SIT_OUT_METHOD_NEXT_BB, SIT_OUT_METHOD_NEXT_HAND, SUIT, SigningCosmosClient, TexasHoldemRound, TxExecutionError, ValidatorBond, WithdrawalRequest, assertCreatableBettingLimit, assertExecuted, buildMsgCreateValidator, computeGameNameFee, createSigningClientFromMnemonic, createWalletFromMnemonic, decToAtomics, expandBlindLevel, formatBlindStructure, formatGameFormatDisplay, formatGameVariantDisplay, generateWallet, getActionByType, getAddressFromMnemonic, getBettingLimit, getDefaultCosmosConfig, getGameFormat, getGameFormatForCosmos, getGameFormatFromObject, getGameVariant, hasAction, holeCardsPerPlayer, isCashFormat, isEmptyAddress, isPotLimit, isSitAndGoFormat, isTournamentFormat, isValidMnemonic, isValidPlayerAddress, parseBlindStructure, parseGameFormat, parseGameVariant, registry, resolveBlindPreset, toValoperAddress, txFailureHash, txFailurePhase };
47394
+ export type { AccountDTO, ActionDTO, AnteRuleDTO, BlindLevelDTO, BlindPreset, BlindProgression, BlindStructureDTO, BlindStructurePresetDTO, Block, BlockDTO, BlockHeader, BlockHeaderDTO, BlockID, BlockResponse, BurnResponseDTO, Card, CreateValidatorParams, DoubleBlindStructureDTO, EquityHand, EquityRequest, EquityResponse, EquityResult, ExecutionResult, GameListItem, GameOptions, GameOptionsDTO, GameOptionsResponse, GameStateResponse, GameStateResponseDTO, HandEvaluation, ISignedResponse, LegalActionDTO, LinearBlindStructureDTO, PayoutPlaceDTO, PercentageBlindStructureDTO, PerformActionResponse, PlayerDTO, RPCRequest, RPCRequestParams, RPCResponse, RakeConfig, RakeConfigDTO, ResultDTO, SealedAwaiting, SealedDTO, SitInMethod, SitOutMethod, TableBlindStructureDTO, TexasHoldemGameState, TexasHoldemStateDTO, TransactionDTO, TransactionResponse, TxFailurePhase, WalletInfo, WinnerDTO, WithdrawResponseDTO };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAkC/C,QAAA,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEV,CAAC;AAEH,QAAA,MAAM,QAAQ,UAiCZ,CAAA;AAGF,cAAc,6BAA6B,CAAA;AAG3C,cAAc,cAAc,CAAA;AAG5B,cAAc,SAAS,CAAA;AAGvB,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAGpG,cAAc,eAAe,CAAA;AAG7B,cAAc,eAAe,CAAA;AAG7B,cAAc,yBAAyB,CAAA;AAGvC,cAAc,qBAAqB,CAAA;AAGnC,cAAc,sBAAsB,CAAA;AAGpC,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAGrE,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAG7B,OAAO,EAAE,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