@block52/poker-vm-sdk 1.10.0 → 1.12.1
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 +80 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +579 -16
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +583 -15
- package/dist/index.js.map +1 -1
- package/dist/pokerGameIntegration.d.ts +38 -2
- package/dist/pokerGameIntegration.d.ts.map +1 -1
- package/dist/pokerSolver.d.ts +5 -1
- package/dist/pokerSolver.d.ts.map +1 -1
- package/dist/pokerchain.poker.v1/types/pokerchain/poker/v1/tx.d.ts +8 -0
- package/dist/pokerchain.poker.v1/types/pokerchain/poker/v1/tx.d.ts.map +1 -1
- package/dist/signingClient.d.ts +2 -1
- package/dist/signingClient.d.ts.map +1 -1
- package/dist/utils/blindStructure.d.ts +29 -0
- package/dist/utils/blindStructure.d.ts.map +1 -0
- package/package.json +1 -1
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. */
|
|
@@ -46144,6 +46152,34 @@ declare const isEmptyAddress: (address: string | null | undefined) => boolean;
|
|
|
46144
46152
|
*/
|
|
46145
46153
|
declare const isValidPlayerAddress: (address: string | null | undefined) => boolean;
|
|
46146
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
|
+
|
|
46147
46183
|
/**
|
|
46148
46184
|
* Poker hand types in order of strength (weakest to strongest)
|
|
46149
46185
|
*/
|
|
@@ -46184,7 +46220,11 @@ declare class PokerSolver {
|
|
|
46184
46220
|
/**
|
|
46185
46221
|
* Evaluate a 5-card poker hand
|
|
46186
46222
|
*/
|
|
46187
|
-
|
|
46223
|
+
/**
|
|
46224
|
+
* Evaluate exactly 5 cards (a winner's best hand, WinnerDTO.cards). Use
|
|
46225
|
+
* findBestHand for 7.
|
|
46226
|
+
*/
|
|
46227
|
+
static evaluateHand(cards: Card[]): HandEvaluation;
|
|
46188
46228
|
/**
|
|
46189
46229
|
* Check if cards form a straight (excluding low straight A-2-3-4-5)
|
|
46190
46230
|
*/
|
|
@@ -46454,11 +46494,47 @@ declare class PokerGameIntegration {
|
|
|
46454
46494
|
hand2Evaluation: HandEvaluation;
|
|
46455
46495
|
};
|
|
46456
46496
|
/**
|
|
46457
|
-
*
|
|
46497
|
+
* The winning hand in words, from the winner's best five cards
|
|
46498
|
+
* (WinnerDTO.cards) and the board (communityCards): "Full House, Eights
|
|
46499
|
+
* over Sevens", "Diamond Flush, Six high", "Set of Sevens". The board tells
|
|
46500
|
+
* a set (pocket pair plus one on the board) from trips (one hole card plus a
|
|
46501
|
+
* board pair, or all three on the board), which the five cards alone can't.
|
|
46502
|
+
* @param cards The winner's five card mnemonics ("6D")
|
|
46503
|
+
* @param board The community cards
|
|
46504
|
+
* @returns The hand in words, or "" for an uncontested pot (no cards)
|
|
46505
|
+
*/
|
|
46506
|
+
static describeWinningHand(cards: string[] | undefined, board: string[]): string;
|
|
46507
|
+
/**
|
|
46508
|
+
* Fill in each winner's name and description from its cards and the board.
|
|
46509
|
+
* The engine no longer writes the hand's wording into chain state
|
|
46510
|
+
* (poker-vm#2721), so callers run game state through this as it arrives and
|
|
46511
|
+
* keep reading winner.name / winner.description as before.
|
|
46512
|
+
*
|
|
46513
|
+
* A winner with five cards gets "Full House, Eights over Sevens" in both
|
|
46514
|
+
* fields. A winner without five cards (an uncontested pot, or an older state
|
|
46515
|
+
* that recorded hole cards) is returned unchanged.
|
|
46516
|
+
*
|
|
46517
|
+
* Returns a new state object; the input is not modified.
|
|
46518
|
+
* @param state Any game state with winners and community cards
|
|
46519
|
+
*/
|
|
46520
|
+
static withWinnerDescriptions<T extends {
|
|
46521
|
+
winners: WinnerDTO[];
|
|
46522
|
+
communityCards: string[];
|
|
46523
|
+
}>(state: T): T;
|
|
46524
|
+
/**
|
|
46525
|
+
* The hand description in words: "Full House, Eights over Sevens", "Quad
|
|
46526
|
+
* Fours", "Diamond Flush, Six high", "Ace high". A flush names its suit from
|
|
46527
|
+
* the best hand. The rank and suit words mirror @block52/deck's rankName /
|
|
46528
|
+
* suitName.
|
|
46458
46529
|
* @param evaluation Hand evaluation result
|
|
46459
46530
|
* @returns Human-readable hand description
|
|
46460
46531
|
*/
|
|
46461
46532
|
static formatHandDescription(evaluation: HandEvaluation): string;
|
|
46533
|
+
private static readonly RANK_WORDS;
|
|
46534
|
+
/** A high-ace rank spelled out ("Ace", "Ten"); plural gives "Aces", "Sixes". */
|
|
46535
|
+
private static rankWord;
|
|
46536
|
+
/** The suit word every card of a flush shares ("Diamond"), or "" when the hand is empty or mixed. */
|
|
46537
|
+
private static flushSuitWord;
|
|
46462
46538
|
/**
|
|
46463
46539
|
* Example usage with string cards (for testing/debugging)
|
|
46464
46540
|
* @param playerCardStrings Array of player hands as mnemonic strings
|
|
@@ -46746,6 +46822,7 @@ interface SNGConfig {
|
|
|
46746
46822
|
blindLevelDuration: number;
|
|
46747
46823
|
entryFee?: bigint;
|
|
46748
46824
|
startTime?: number;
|
|
46825
|
+
blindStructure?: BlindStructureDTO;
|
|
46749
46826
|
}
|
|
46750
46827
|
/**
|
|
46751
46828
|
* Signing Cosmos Client that extends the read-only CosmosClient with transaction capabilities
|
|
@@ -47353,5 +47430,5 @@ declare const Client: typeof IgniteClient & Constructor<{
|
|
|
47353
47430
|
}>;
|
|
47354
47431
|
declare const registry: Registry;
|
|
47355
47432
|
|
|
47356
|
-
export { AllPlayerActions, BLIND_PRESETS, 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, 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 };
|
|
47433
|
+
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 };
|
|
47357
47434
|
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 };
|
package/dist/index.d.ts.map
CHANGED
|
@@ -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,YAA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