@block52/poker-vm-sdk 1.17.0 → 1.21.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/IClient.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import type { Coin } from "./sdkTypes";
2
2
  import type { AccountQueryResponse, GetTxResponse, WithdrawalRequestResponse } from "./types/rest";
3
- import type { LegalActionDTO, GameOptionsResponse, GameListItem, BlockResponse, GameStateResponse } from "./types/game";
3
+ import type { LegalActionDTO, GameOptionsResponse, GameListItem, BlockResponse, GameStateResponse, LeaderboardDTO } from "./types/game";
4
4
  export interface IClient {
5
5
  getAccount(address: string): Promise<AccountQueryResponse>;
6
6
  getAllBalances(address: string): Promise<Coin[]>;
@@ -28,6 +28,7 @@ export interface IClient {
28
28
  createGame(gameFormat: string, gameVariant: string, minPlayers: number, maxPlayers: number, minBuyInB52USDC: bigint, maxBuyInB52USDC: bigint, smallBlindB52USDC: bigint, bigBlindB52USDC: bigint, timeout: number): Promise<string>;
29
29
  initiateWithdrawal(baseAddress: string, amount: bigint): Promise<string>;
30
30
  listWithdrawalRequests(cosmosAddress?: string): Promise<WithdrawalRequestResponse[]>;
31
+ getTournamentLeaderboard(tournamentId: string): Promise<LeaderboardDTO | null>;
31
32
  disconnect(): Promise<void>;
32
33
  }
33
34
  //# sourceMappingURL=IClient.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"IClient.d.ts","sourceRoot":"","sources":["../src/IClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,KAAK,EAAE,oBAAoB,EAAE,aAAa,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC;AACnG,OAAO,KAAK,EAAE,cAAc,EAAE,mBAAmB,EAAE,YAAY,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAExH,MAAM,WAAW,OAAO;IACpB,UAAU,CAAC,OA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AAe,EAAE,MAAM,EACvB,eAAe,EAAE,MAAM,EACvB,iBAAiB,EAAE,MAAM,EACzB,eAAe,EAAE,MAAM,EACvB,OAAO,EAAE,MAAM,GAChB,OAAO,CAAC,MAAM,CAAC,CAAC;IACnB,kBAAkB,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACzE,sBAAsB,CAAC,aAAa,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,yBAAyB,EAAE,CAAC,CAAC;IACrF,wBAAwB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IAC/E,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC/B"}
@@ -1,7 +1,7 @@
1
1
  import { EquityResult, EquityResponse, CosmosConfig, Coin } from "./sdkTypes";
2
2
  import type { AccountQueryResponse, GetTxResponse, WithdrawalRequestResponse } from "./types/rest";
3
3
  import { IClient } from "./IClient";
4
- import type { LegalActionDTO, GameOptionsResponse, GameListItem, BlockResponse, GameStateResponse } from "./types/game";
4
+ import type { LegalActionDTO, GameOptionsResponse, GameListItem, BlockResponse, GameStateResponse, LeaderboardDTO } from "./types/game";
5
5
  export declare class CosmosClient implements IClient {
6
6
  protected readonly config: CosmosConfig;
7
7
  private readonly restClient;
@@ -99,6 +99,17 @@ export declare class CosmosClient implements IClient {
99
99
  * List withdrawal requests via REST API
100
100
  */
101
101
  listWithdrawalRequests(cosmosAddress?: string): Promise<WithdrawalRequestResponse[]>;
102
+ /**
103
+ * A multi-table tournament's live standings (block52/pokerchain#405,
104
+ * poker-vm#2613), ranked by the engine: the chain runs engine.Leaderboard
105
+ * over the stored tournament state and serves the LeaderboardDTO verbatim.
106
+ * Unauthenticated: standings are public.
107
+ *
108
+ * @returns the board, or null when the chain has no tournament with this ID
109
+ * (gRPC NotFound, HTTP 404). Any other failure — including an empty or
110
+ * malformed leaderboard — throws.
111
+ */
112
+ getTournamentLeaderboard(tournamentId: string): Promise<LeaderboardDTO | null>;
102
113
  /**
103
114
  * Calculate equity for multiple hands using Monte Carlo simulation
104
115
  * Used when players are all-in and showing to display win percentages
@@ -1 +1 @@
1
- {"version":3,"file":"cosmosClient.d.ts","sourceRoot":"","sources":["../src/cosmosClient.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,YAAY,EAAE,cAAc,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAChG,OAAO,KAAK,EAAE,oBAAoB,EAAE,aAAa,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC;AACnG,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,EAAE,cAAc,EAAE,mBAAmB,EAAE,YAAY,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAExH,qBAAa,YAAa,YAAW,OAAO;IACxC,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IACxC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAgB;gBAE/B,MAAM,EAAE,YAAY;IAahC;;OAEG;IACG,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAUhE;;OAEG;IACG,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;IAUtD;;OAEG;IACG,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAYlE;;OAEG;IACG,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC;IAUlC;;OAEG;IACG,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAUnD;;OAEG;IACG,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAUtD;;OAEG;IACG,cAAc,IAAI,OAAO,CAA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MAAM,GAAG,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC;IAqBpF;;;;;;;;;OASG;IACG,eAAe,CACjB,KAAK,EAAE,MAAM,EAAE,EAAE,EACjB,KAAK,GAAE,MAAM,EAAO,EACpB,IAAI,GAAE,MAAM,EAAO,EACnB,WAAW,GAAE,MAAc,GAC5B,OAAO,CAAC,YAAY,EAAE,CAAC;IAgC1B;;OAEG;IACG,mBAAmB,CACrB,KAAK,EAAE,MAAM,EAAE,EAAE,EACjB,KAAK,GAAE,MAAM,EAAO,EACpB,IAAI,GAAE,MAAM,EAAO,EACnB,WAAW,GAAE,MAAc,GAC5B,OAAO,CAAC,cAAc,CAAC;IAmB1B;;OAEG;IACG,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;CAGpC;AAKD,eAAO,MAAM,eAAe,GAAI,SAAS,YAAY,KAAG,YAUvD,CAAC;AAEF,eAAO,MAAM,sBAAsB,GAAI,QAAQ,YAAY,KAAG,YAG7D,CAAC;AAGF,eAAO,MAAM,sBAAsB,GAAI,SAAQ,MAAoB,KAAG,YAOpE,CAAC;AAGH,OAAO,EACH,gBAAgB,EAChB,KAAK,YAAY,EACjB,KAAK,IAAI,EACT,KAAK,qBAAqB,EAC1B,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,SAAS,EACd,KAAK,oBAAoB,EACzB,KAAK,WAAW,EAChB,KAAK,iBAAiB,EACtB,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,cAAc,EACtB,MAAM,YAAY,CAAC"}
package/dist/index.d.ts CHANGED
@@ -44975,6 +44975,12 @@ interface MsgCreateGame {
44975
44975
  * field is fixed at the start. (poker-vm#2731)
44976
44976
  */
44977
44977
  lateRegistrationLevels: number;
44978
+ /**
44979
+ * Hold a scheduled sit-and-go until start_time even when the table fills
44980
+ * first (poker-vm#2760): it starts only at the start time. Requires
44981
+ * start_time. false = it starts when the table fills, as before.
44982
+ */
44983
+ waitForStartTime: boolean;
44978
44984
  }
44979
44985
  declare const MsgCreateGame: MessageFns<MsgCreateGame>;
44980
44986
  /** MsgJoinGame defines the MsgJoinGame message. */
@@ -45268,6 +45274,7 @@ declare enum NonPlayerActionType {
45268
45274
  LEAVE = "leave",
45269
45275
  NEW_HAND = "new-hand",
45270
45276
  POST = "post",
45277
+ POST_DEAD = "post-dead",
45271
45278
  SIT_IN = "sit-in",
45272
45279
  SIT_IN_AND_WAIT = "sit-in-and-wait",
45273
45280
  SIT_OUT = "sit-out",
@@ -45287,6 +45294,7 @@ declare const AllPlayerActions: {
45287
45294
  LEAVE: NonPlayerActionType.LEAVE;
45288
45295
  NEW_HAND: NonPlayerActionType.NEW_HAND;
45289
45296
  POST: NonPlayerActionType.POST;
45297
+ POST_DEAD: NonPlayerActionType.POST_DEAD;
45290
45298
  SIT_IN: NonPlayerActionType.SIT_IN;
45291
45299
  SIT_IN_AND_WAIT: NonPlayerActionType.SIT_IN_AND_WAIT;
45292
45300
  SIT_OUT: NonPlayerActionType.SIT_OUT;
@@ -45492,6 +45500,7 @@ type GameOptions = {
45492
45500
  blindLevel?: number;
45493
45501
  scheduledStartTime?: number;
45494
45502
  lateRegistrationLevels?: number;
45503
+ waitForStartTime?: boolean;
45495
45504
  ante?: string;
45496
45505
  sngStartTime?: number;
45497
45506
  levelStartTime?: number;
@@ -45531,6 +45540,7 @@ type GameOptionsDTO = {
45531
45540
  nextBigBlind?: string;
45532
45541
  scheduledStartTime?: number;
45533
45542
  lateRegistrationLevels?: number;
45543
+ waitForStartTime?: boolean;
45534
45544
  ante?: string;
45535
45545
  sngStartTime?: number;
45536
45546
  levelStartTime?: number;
@@ -45587,7 +45597,12 @@ type PlayerDTO = {
45587
45597
  sitInMethod?: SitInMethod;
45588
45598
  pendingSitOut?: string;
45589
45599
  pendingTopUpAmount?: string;
45600
+ missedSmallBlind?: boolean;
45601
+ missedBigBlind?: boolean;
45602
+ cardsShown?: boolean;
45590
45603
  timeBankRemainingMs?: number;
45604
+ timeBankUses?: number;
45605
+ timeBankLastGrantMs?: number;
45591
45606
  signature: string;
45592
45607
  };
45593
45608
  type ResultDTO = {
@@ -45604,6 +45619,50 @@ type PayoutPlaceDTO = {
45604
45619
  place: number;
45605
45620
  amount: string;
45606
45621
  };
45622
+ /**
45623
+ * Multi-table tournament standings (poker-vm#2613, block52/pokerchain#405).
45624
+ * Mirrors pvm/go/engine/tournament.go and tournament_leaderboard.go field for
45625
+ * field: the chain's TournamentLeaderboard query serves the engine's
45626
+ * LeaderboardDTO as JSON verbatim, so these are the wire shapes. Optional
45627
+ * fields are the Go `omitempty` ones.
45628
+ */
45629
+ type TournamentStatus = "registering" | "running" | "finished" | "cancelled";
45630
+ declare const TOURNAMENT_STATUSES: readonly TournamentStatus[];
45631
+ /** An entrant's status in a tournament (engine Entrant* constants). */
45632
+ type TournamentEntrantStatus = "registered" | "playing" | "busted" | "unregistered";
45633
+ declare const TOURNAMENT_ENTRANT_STATUSES: readonly TournamentEntrantStatus[];
45634
+ /** The current blind level of a running tournament. Amounts are chip strings. */
45635
+ type TournamentClockDTO = {
45636
+ level: number;
45637
+ smallBlind: string;
45638
+ bigBlind: string;
45639
+ ante: string;
45640
+ levelStartTime?: number;
45641
+ };
45642
+ /** One entrant's line on the leaderboard. */
45643
+ type LeaderboardEntryDTO = {
45644
+ rank: number;
45645
+ address: string;
45646
+ status: TournamentEntrantStatus;
45647
+ stack: string;
45648
+ tableId?: string;
45649
+ seat?: number;
45650
+ place?: number;
45651
+ payout?: string;
45652
+ };
45653
+ /** A tournament's standings, ranked by the engine (engine.Leaderboard). */
45654
+ type LeaderboardDTO = {
45655
+ tournamentId: string;
45656
+ status: TournamentStatus;
45657
+ entrants: number;
45658
+ remaining: number;
45659
+ averageStack: string;
45660
+ prizePool: string;
45661
+ payouts: PayoutPlaceDTO[];
45662
+ clock?: TournamentClockDTO;
45663
+ nextLevelAt?: number;
45664
+ entries: LeaderboardEntryDTO[];
45665
+ };
45607
45666
  /**
45608
45667
  * The reveal a sealed hand is stopped on (poker-vm#2695): "board" = the next
45609
45668
  * street is due from the dealer, "deal" = the deck is due at showdown, "" =
@@ -46223,6 +46282,14 @@ declare function lateRegistrationClosesAt(options: GameOptionsDTO): number | und
46223
46282
  * lateRegistrationClosesAt, or once any result carries a payout. */
46224
46283
  declare function isLateRegistrationOpen(options: GameOptionsDTO, results: ResultDTO[], nowMs: number): boolean;
46225
46284
 
46285
+ /**
46286
+ * Parses the `leaderboard` JSON string of the chain's TournamentLeaderboard
46287
+ * query (block52/pokerchain#405, poker-vm#2613) into a LeaderboardDTO. Checks
46288
+ * the required fields and throws on anything missing or mistyped — never fills
46289
+ * a default (Commandment 7): a malformed board is a chain/engine bug to surface.
46290
+ */
46291
+ declare function parseLeaderboardDTO(json: string): LeaderboardDTO;
46292
+
46226
46293
  /**
46227
46294
  * Poker hand types in order of strength (weakest to strongest)
46228
46295
  */
@@ -46776,6 +46843,7 @@ interface IClient {
46776
46843
  createGame(gameFormat: string, gameVariant: string, minPlayers: number, maxPlayers: number, minBuyInB52USDC: bigint, maxBuyInB52USDC: bigint, smallBlindB52USDC: bigint, bigBlindB52USDC: bigint, timeout: number): Promise<string>;
46777
46844
  initiateWithdrawal(baseAddress: string, amount: bigint): Promise<string>;
46778
46845
  listWithdrawalRequests(cosmosAddress?: string): Promise<WithdrawalRequestResponse[]>;
46846
+ getTournamentLeaderboard(tournamentId: string): Promise<LeaderboardDTO | null>;
46779
46847
  disconnect(): Promise<void>;
46780
46848
  }
46781
46849
 
@@ -46876,6 +46944,17 @@ declare class CosmosClient implements IClient {
46876
46944
  * List withdrawal requests via REST API
46877
46945
  */
46878
46946
  listWithdrawalRequests(cosmosAddress?: string): Promise<WithdrawalRequestResponse[]>;
46947
+ /**
46948
+ * A multi-table tournament's live standings (block52/pokerchain#405,
46949
+ * poker-vm#2613), ranked by the engine: the chain runs engine.Leaderboard
46950
+ * over the stored tournament state and serves the LeaderboardDTO verbatim.
46951
+ * Unauthenticated: standings are public.
46952
+ *
46953
+ * @returns the board, or null when the chain has no tournament with this ID
46954
+ * (gRPC NotFound, HTTP 404). Any other failure — including an empty or
46955
+ * malformed leaderboard — throws.
46956
+ */
46957
+ getTournamentLeaderboard(tournamentId: string): Promise<LeaderboardDTO | null>;
46879
46958
  /**
46880
46959
  * Calculate equity for multiple hands using Monte Carlo simulation
46881
46960
  * Used when players are all-in and showing to display win percentages
@@ -46960,6 +47039,7 @@ interface SNGConfig {
46960
47039
  startTime?: number;
46961
47040
  blindStructure?: BlindStructureDTO;
46962
47041
  lateRegistrationLevels?: number;
47042
+ waitForStartTime?: boolean;
46963
47043
  }
46964
47044
  /**
46965
47045
  * Signing Cosmos Client that extends the read-only CosmosClient with transaction capabilities
@@ -47567,5 +47647,5 @@ declare const Client: typeof IgniteClient & Constructor<{
47567
47647
  }>;
47568
47648
  declare const registry: Registry;
47569
47649
 
47570
- 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, isLateRegistrationOpen, isPotLimit, isSitAndGoFormat, isTournamentFormat, isValidMnemonic, isValidPlayerAddress, lateRegistrationClosesAt, parseBlindStructure, parseGameFormat, parseGameVariant, registry, resolveBlindPreset, roundBlind, toValoperAddress, txFailureHash, txFailurePhase };
47571
- 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 };
47650
+ 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, TOURNAMENT_ENTRANT_STATUSES, TOURNAMENT_STATUSES, 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, isLateRegistrationOpen, isPotLimit, isSitAndGoFormat, isTournamentFormat, isValidMnemonic, isValidPlayerAddress, lateRegistrationClosesAt, parseBlindStructure, parseGameFormat, parseGameVariant, parseLeaderboardDTO, registry, resolveBlindPreset, roundBlind, toValoperAddress, txFailureHash, txFailurePhase };
47651
+ 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, LeaderboardDTO, LeaderboardEntryDTO, LegalActionDTO, LinearBlindStructureDTO, PayoutPlaceDTO, PercentageBlindStructureDTO, PerformActionResponse, PlayerDTO, RPCRequest, RPCRequestParams, RPCResponse, RakeConfig, RakeConfigDTO, ResultDTO, SealedAwaiting, SealedDTO, SitInMethod, SitOutMethod, TableBlindStructureDTO, TexasHoldemGameState, TexasHoldemStateDTO, TournamentClockDTO, TournamentEntrantStatus, TournamentStatus, TransactionDTO, TransactionResponse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
  lateRegistrationLevels: 0,
2852
+ waitForStartTime: false,
2852
2853
  };
2853
2854
  }
2854
2855
  const MsgCreateGame = {
@@ -2919,6 +2920,9 @@ const MsgCreateGame = {
2919
2920
  if (message.lateRegistrationLevels !== 0) {
2920
2921
  writer.uint32(184).uint32(message.lateRegistrationLevels);
2921
2922
  }
2923
+ if (message.waitForStartTime !== false) {
2924
+ writer.uint32(192).bool(message.waitForStartTime);
2925
+ }
2922
2926
  return writer;
2923
2927
  },
2924
2928
  decode(input, length) {
@@ -3082,6 +3086,13 @@ const MsgCreateGame = {
3082
3086
  message.lateRegistrationLevels = reader.uint32();
3083
3087
  continue;
3084
3088
  }
3089
+ case 24: {
3090
+ if (tag !== 192) {
3091
+ break;
3092
+ }
3093
+ message.waitForStartTime = reader.bool();
3094
+ continue;
3095
+ }
3085
3096
  }
3086
3097
  if ((tag & 7) === 4 || tag === 0) {
3087
3098
  break;
@@ -3114,6 +3125,7 @@ const MsgCreateGame = {
3114
3125
  startTime: isSet$2b(object.startTime) ? Long.fromValue(object.startTime) : Long.ZERO,
3115
3126
  blindStructure: isSet$2b(object.blindStructure) ? globalThis.String(object.blindStructure) : "",
3116
3127
  lateRegistrationLevels: isSet$2b(object.lateRegistrationLevels) ? globalThis.Number(object.lateRegistrationLevels) : 0,
3128
+ waitForStartTime: isSet$2b(object.waitForStartTime) ? globalThis.Boolean(object.waitForStartTime) : false,
3117
3129
  };
3118
3130
  },
3119
3131
  toJSON(message) {
@@ -3184,6 +3196,9 @@ const MsgCreateGame = {
3184
3196
  if (message.lateRegistrationLevels !== 0) {
3185
3197
  obj.lateRegistrationLevels = Math.round(message.lateRegistrationLevels);
3186
3198
  }
3199
+ if (message.waitForStartTime !== false) {
3200
+ obj.waitForStartTime = message.waitForStartTime;
3201
+ }
3187
3202
  return obj;
3188
3203
  },
3189
3204
  create(base) {
@@ -3234,6 +3249,7 @@ const MsgCreateGame = {
3234
3249
  : Long.ZERO;
3235
3250
  message.blindStructure = object.blindStructure ?? "";
3236
3251
  message.lateRegistrationLevels = object.lateRegistrationLevels ?? 0;
3252
+ message.waitForStartTime = object.waitForStartTime ?? false;
3237
3253
  message.entryFee = (object.entryFee !== undefined && object.entryFee !== null)
3238
3254
  ? Long.fromValue(object.entryFee)
3239
3255
  : Long.UZERO;
@@ -56134,6 +56150,9 @@ var NonPlayerActionType;
56134
56150
  // player's bet (they're matched) but excluded from the first-to-act /
56135
56151
  // has-acted scans (it's a non-player action, like DEAD_SMALL_BLIND).
56136
56152
  NonPlayerActionType["POST"] = "post";
56153
+ // A missed small blind posted dead on sitting back in (poker-vm#2200).
56154
+ // Recorded in ANTE; in the pot but not a bet anyone must match (like ANTE).
56155
+ NonPlayerActionType["POST_DEAD"] = "post-dead";
56137
56156
  NonPlayerActionType["SIT_IN"] = "sit-in";
56138
56157
  // Sit in and wait for the big blind — distinct action from SIT_IN (post now)
56139
56158
  // so each has a single responsibility. Sets WAITING_FOR_BIG_BLIND. (#2139)
@@ -56147,12 +56166,13 @@ var NonPlayerActionType;
56147
56166
  // SHOW at showdown — and records THAT action; no "timeout" turn is ever
56148
56167
  // written to previousActions. Rejected while the turn has time remaining.
56149
56168
  NonPlayerActionType["TIMEOUT"] = "timeout";
56150
- // Time bank (ui#19): the player to act extends their turn's action-clock
56151
- // deadline by gameOptions.timeBankMs, once per decision, up to
56152
- // gameOptions.timeBankCapMs held per player (refilled per orbit in ui#20).
56153
- // Records a no-chip turn that does NOT advance the betting order or move the
56154
- // clock anchor; the deadline is derived by counting TIME_BANK turns for the
56155
- // current turn. Rejected off-turn, past the deadline, or with no bank left.
56169
+ // Time bank (ui#19/#20): the player to act extends their turn's action-clock
56170
+ // deadline by their whole bank, once per decision: gameOptions.timeBankMs
56171
+ // the first time, 30s the second, then 5s refilling 5s per orbit up to
56172
+ // gameOptions.timeBankCapMs. Records a no-chip turn that does NOT advance the
56173
+ // betting order or move the clock anchor; the deadline adds the user's
56174
+ // PlayerDTO.timeBankLastGrantMs for the current turn. Rejected off-turn,
56175
+ // past the deadline, or with no bank left.
56156
56176
  NonPlayerActionType["TIME_BANK"] = "time-bank";
56157
56177
  NonPlayerActionType["TOP_UP"] = "top-up";
56158
56178
  // Scheduled single-table tournament (poker-vm#2680): any registered player
@@ -56243,6 +56263,8 @@ const BLIND_PRESETS = ["turbo", "standard", "deep_stack", "hyper_turbo"];
56243
56263
  const BLIND_PROGRESSIONS = ["double", "linear", "percentage", "table"];
56244
56264
  const SIT_OUT_METHOD_NEXT_HAND = "next-hand";
56245
56265
  const SIT_OUT_METHOD_NEXT_BB = "next-bb";
56266
+ const TOURNAMENT_STATUSES = ["registering", "running", "finished", "cancelled"];
56267
+ const TOURNAMENT_ENTRANT_STATUSES = ["registered", "playing", "busted", "unregistered"];
56246
56268
  var SUIT;
56247
56269
  (function (SUIT) {
56248
56270
  SUIT[SUIT["CLUBS"] = 1] = "CLUBS";
@@ -57163,6 +57185,91 @@ function levelMinutes(options) {
57163
57185
  return options.blindLevelDuration;
57164
57186
  }
57165
57187
 
57188
+ /**
57189
+ * Parses the `leaderboard` JSON string of the chain's TournamentLeaderboard
57190
+ * query (block52/pokerchain#405, poker-vm#2613) into a LeaderboardDTO. Checks
57191
+ * the required fields and throws on anything missing or mistyped — never fills
57192
+ * a default (Commandment 7): a malformed board is a chain/engine bug to surface.
57193
+ */
57194
+ function parseLeaderboardDTO(json) {
57195
+ if (json === "") {
57196
+ throw new Error("tournament leaderboard: empty leaderboard JSON");
57197
+ }
57198
+ const raw = JSON.parse(json);
57199
+ if (!isRecord(raw)) {
57200
+ throw new Error("tournament leaderboard: expected a JSON object");
57201
+ }
57202
+ requireString(raw, "tournamentId", "leaderboard");
57203
+ requireStatus(raw, "leaderboard");
57204
+ requireNumber(raw, "entrants", "leaderboard");
57205
+ requireNumber(raw, "remaining", "leaderboard");
57206
+ requireString(raw, "averageStack", "leaderboard");
57207
+ requireString(raw, "prizePool", "leaderboard");
57208
+ if (!Array.isArray(raw.payouts)) {
57209
+ throw new Error("tournament leaderboard: payouts must be an array");
57210
+ }
57211
+ raw.payouts.forEach((p, i) => {
57212
+ const where = `payouts[${i}]`;
57213
+ if (!isRecord(p))
57214
+ throw new Error(`tournament leaderboard: ${where} must be an object`);
57215
+ requireNumber(p, "place", where);
57216
+ requireString(p, "amount", where);
57217
+ });
57218
+ if (raw.clock !== undefined) {
57219
+ if (!isRecord(raw.clock))
57220
+ throw new Error("tournament leaderboard: clock must be an object");
57221
+ requireNumber(raw.clock, "level", "clock");
57222
+ requireString(raw.clock, "smallBlind", "clock");
57223
+ requireString(raw.clock, "bigBlind", "clock");
57224
+ requireString(raw.clock, "ante", "clock");
57225
+ optionalNumber(raw.clock, "levelStartTime", "clock");
57226
+ }
57227
+ optionalNumber(raw, "nextLevelAt", "leaderboard");
57228
+ if (!Array.isArray(raw.entries)) {
57229
+ throw new Error("tournament leaderboard: entries must be an array");
57230
+ }
57231
+ raw.entries.forEach((e, i) => requireEntry(e, `entries[${i}]`));
57232
+ return raw;
57233
+ }
57234
+ function requireEntry(e, where) {
57235
+ if (!isRecord(e))
57236
+ throw new Error(`tournament leaderboard: ${where} must be an object`);
57237
+ requireNumber(e, "rank", where);
57238
+ requireString(e, "address", where);
57239
+ if (!TOURNAMENT_ENTRANT_STATUSES.includes(e.status)) {
57240
+ throw new Error(`tournament leaderboard: ${where}.status "${String(e.status)}" is not an entrant status`);
57241
+ }
57242
+ requireString(e, "stack", where);
57243
+ optionalString(e, "tableId", where);
57244
+ optionalNumber(e, "seat", where);
57245
+ optionalNumber(e, "place", where);
57246
+ optionalString(e, "payout", where);
57247
+ }
57248
+ function requireStatus(o, where) {
57249
+ if (!TOURNAMENT_STATUSES.includes(o.status)) {
57250
+ throw new Error(`tournament leaderboard: ${where}.status "${String(o.status)}" is not a tournament status`);
57251
+ }
57252
+ }
57253
+ function isRecord(v) {
57254
+ return typeof v === "object" && v !== null && !Array.isArray(v);
57255
+ }
57256
+ function requireString(o, key, where) {
57257
+ if (typeof o[key] !== "string")
57258
+ throw new Error(`tournament leaderboard: ${where}.${key} must be a string`);
57259
+ }
57260
+ function requireNumber(o, key, where) {
57261
+ if (typeof o[key] !== "number")
57262
+ throw new Error(`tournament leaderboard: ${where}.${key} must be a number`);
57263
+ }
57264
+ function optionalString(o, key, where) {
57265
+ if (o[key] !== undefined)
57266
+ requireString(o, key, where);
57267
+ }
57268
+ function optionalNumber(o, key, where) {
57269
+ if (o[key] !== undefined)
57270
+ requireNumber(o, key, where);
57271
+ }
57272
+
57166
57273
  /**
57167
57274
  * Poker hand types in order of strength (weakest to strongest)
57168
57275
  */
@@ -58794,6 +58901,35 @@ class CosmosClient {
58794
58901
  return [];
58795
58902
  }
58796
58903
  }
58904
+ /**
58905
+ * A multi-table tournament's live standings (block52/pokerchain#405,
58906
+ * poker-vm#2613), ranked by the engine: the chain runs engine.Leaderboard
58907
+ * over the stored tournament state and serves the LeaderboardDTO verbatim.
58908
+ * Unauthenticated: standings are public.
58909
+ *
58910
+ * @returns the board, or null when the chain has no tournament with this ID
58911
+ * (gRPC NotFound, HTTP 404). Any other failure — including an empty or
58912
+ * malformed leaderboard — throws.
58913
+ */
58914
+ async getTournamentLeaderboard(tournamentId) {
58915
+ if (tournamentId === "") {
58916
+ throw new Error("tournamentId is required");
58917
+ }
58918
+ try {
58919
+ const response = await this.restClient.get(`/block52/pokerchain/poker/v1/tournament_leaderboard/${encodeURIComponent(tournamentId)}`);
58920
+ if (!response.data || typeof response.data.leaderboard !== "string") {
58921
+ throw new Error(`Empty tournament leaderboard response for ${tournamentId}`);
58922
+ }
58923
+ return parseLeaderboardDTO(response.data.leaderboard);
58924
+ }
58925
+ catch (error) {
58926
+ if (isGrpcNotFound(error)) {
58927
+ return null;
58928
+ }
58929
+ console.error("Error fetching tournament leaderboard:", error);
58930
+ throw error;
58931
+ }
58932
+ }
58797
58933
  /**
58798
58934
  * Calculate equity for multiple hands using Monte Carlo simulation
58799
58935
  * Used when players are all-in and showing to display win percentages
@@ -58864,6 +59000,19 @@ const getDefaultCosmosConfig = (domain = "localhost") => ({
58864
59000
  denom: "stake", // Use stake as the denomination (lowercase, as stored on blockchain)
58865
59001
  gasPrice: "0.0stake" // Gas price in stake (not used in REST-only mode)
58866
59002
  });
59003
+ /** gRPC code NOT_FOUND as grpc-gateway reports it in an error body. */
59004
+ const GRPC_NOT_FOUND = 5;
59005
+ /**
59006
+ * True for a grpc-gateway NotFound reply: HTTP 404 whose body carries gRPC code
59007
+ * 5. An unknown route (an older chain without the query) is a 501, not this.
59008
+ */
59009
+ function isGrpcNotFound(error) {
59010
+ if (!axios.isAxiosError(error) || error.response?.status !== 404) {
59011
+ return false;
59012
+ }
59013
+ const body = error.response.data;
59014
+ return typeof body === "object" && body !== null && body.code === GRPC_NOT_FOUND;
59015
+ }
58867
59016
 
58868
59017
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
58869
59018
 
@@ -71727,6 +71876,9 @@ function assertCreatableSngField(minPlayers, maxPlayers, sngConfig, nowSeconds =
71727
71876
  throw new Error("sngConfig.lateRegistrationLevels needs sngConfig.startTime (late registration is for a scheduled sit-and-go).");
71728
71877
  }
71729
71878
  }
71879
+ if (sngConfig?.waitForStartTime && !startTime) {
71880
+ throw new Error("sngConfig.waitForStartTime needs sngConfig.startTime (it holds a scheduled sit-and-go until its start time).");
71881
+ }
71730
71882
  }
71731
71883
  /**
71732
71884
  * Signing Cosmos Client that extends the read-only CosmosClient with transaction capabilities
@@ -71905,6 +72057,9 @@ class SigningCosmosClient extends CosmosClient {
71905
72057
  // an empty proto3 string is not encoded at all.
71906
72058
  blindStructure: sngConfig?.blindStructure ? JSON.stringify(sngConfig.blindStructure) : "",
71907
72059
  lateRegistrationLevels: sngConfig?.lateRegistrationLevels ?? 0,
72060
+ // Hold a full table until the start time (poker-vm#2760). false is
72061
+ // not encoded, so chains without the field accept the message.
72062
+ waitForStartTime: sngConfig?.waitForStartTime ?? false,
71908
72063
  });
71909
72064
  // Create the transaction message
71910
72065
  const msg = {
@@ -71936,7 +72091,8 @@ class SigningCosmosClient extends CosmosClient {
71936
72091
  blindLevelDuration: sngConfig.blindLevelDuration,
71937
72092
  entryFee: sngConfig.entryFee?.toString() ?? "0",
71938
72093
  ...(sngConfig.blindStructure && { blindStructure: sngConfig.blindStructure }),
71939
- ...(sngConfig.lateRegistrationLevels && { lateRegistrationLevels: sngConfig.lateRegistrationLevels })
72094
+ ...(sngConfig.lateRegistrationLevels && { lateRegistrationLevels: sngConfig.lateRegistrationLevels }),
72095
+ ...(sngConfig.waitForStartTime && { waitForStartTime: true })
71940
72096
  })
71941
72097
  });
71942
72098
  try {
@@ -72805,5 +72961,5 @@ const registry = new Registry([
72805
72961
  ...msgTypes,
72806
72962
  ]);
72807
72963
 
72808
- 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$c as 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, isLateRegistrationOpen, isPotLimit, isSitAndGoFormat, isTournamentFormat, isValidMnemonic, isValidPlayerAddress, lateRegistrationClosesAt, parseBlindStructure, parseGameFormat, parseGameVariant, registry, resolveBlindPreset, roundBlind, toValoperAddress, txFailureHash, txFailurePhase };
72964
+ 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$c as 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, TOURNAMENT_ENTRANT_STATUSES, TOURNAMENT_STATUSES, 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, isLateRegistrationOpen, isPotLimit, isSitAndGoFormat, isTournamentFormat, isValidMnemonic, isValidPlayerAddress, lateRegistrationClosesAt, parseBlindStructure, parseGameFormat, parseGameVariant, parseLeaderboardDTO, registry, resolveBlindPreset, roundBlind, toValoperAddress, txFailureHash, txFailurePhase };
72809
72965
  //# sourceMappingURL=index.esm.js.map