@block52/poker-vm-sdk 1.8.0 → 1.10.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 +115 -3
- package/dist/index.esm.js +11 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -1
- package/dist/types/game.d.ts +114 -1
- package/dist/types/game.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -45258,7 +45258,9 @@ declare enum NonPlayerActionType {
|
|
|
45258
45258
|
TIMEOUT = "timeout",
|
|
45259
45259
|
TIME_BANK = "time-bank",
|
|
45260
45260
|
TOP_UP = "top-up",
|
|
45261
|
-
START = "start"
|
|
45261
|
+
START = "start",
|
|
45262
|
+
REVEAL_BOARD = "reveal-board",
|
|
45263
|
+
REVEAL_DEAL = "reveal-deal"
|
|
45262
45264
|
}
|
|
45263
45265
|
declare const AllPlayerActions: {
|
|
45264
45266
|
DEAD_SMALL_BLIND: NonPlayerActionType.DEAD_SMALL_BLIND;
|
|
@@ -45275,6 +45277,8 @@ declare const AllPlayerActions: {
|
|
|
45275
45277
|
TIME_BANK: NonPlayerActionType.TIME_BANK;
|
|
45276
45278
|
TOP_UP: NonPlayerActionType.TOP_UP;
|
|
45277
45279
|
START: NonPlayerActionType.START;
|
|
45280
|
+
REVEAL_BOARD: NonPlayerActionType.REVEAL_BOARD;
|
|
45281
|
+
REVEAL_DEAL: NonPlayerActionType.REVEAL_DEAL;
|
|
45278
45282
|
SMALL_BLIND: PlayerActionType.SMALL_BLIND;
|
|
45279
45283
|
BIG_BLIND: PlayerActionType.BIG_BLIND;
|
|
45280
45284
|
FOLD: PlayerActionType.FOLD;
|
|
@@ -45354,6 +45358,93 @@ type RakeConfigDTO = {
|
|
|
45354
45358
|
rakeCap: string;
|
|
45355
45359
|
owner?: string;
|
|
45356
45360
|
};
|
|
45361
|
+
/**
|
|
45362
|
+
* Blind structures (poker-vm#1734 via #2613 slice 2). A sit-and-go whose
|
|
45363
|
+
* `gameOptions.blindStructure` is set takes its blinds, big-blind ante and
|
|
45364
|
+
* level durations from the structure; absent, the blinds double every
|
|
45365
|
+
* `blindLevelDuration` minutes as before. The engine derives every level from
|
|
45366
|
+
* the structure with integer arithmetic (never from a persisted, escalated
|
|
45367
|
+
* blind) and re-emits the current level as `smallBlind` / `bigBlind` /
|
|
45368
|
+
* `nextSmallBlind` / `nextBigBlind` / `blindLevelDuration` / `ante`, so
|
|
45369
|
+
* readers of those fields are unchanged. Amounts are chip-unit strings
|
|
45370
|
+
* (Commandment 9). Mirrors pvm/go/engine/tournament.go field for field.
|
|
45371
|
+
*/
|
|
45372
|
+
type BlindPreset = "turbo" | "standard" | "deep_stack" | "hyper_turbo";
|
|
45373
|
+
declare const BLIND_PRESETS: readonly BlindPreset[];
|
|
45374
|
+
type BlindProgression = "double" | "linear" | "percentage" | "table";
|
|
45375
|
+
declare const BLIND_PROGRESSIONS: readonly BlindProgression[];
|
|
45376
|
+
/**
|
|
45377
|
+
* The algorithmic ante rule: from `startLevel` (0-based) on, the big-blind
|
|
45378
|
+
* ante is floor(bigBlind × bps / 10000). `bps: 10000` is the WSOP
|
|
45379
|
+
* ante-equals-big-blind structure; #1734's "10% from level 4" is
|
|
45380
|
+
* `{ startLevel: 4, bps: 1000 }`.
|
|
45381
|
+
*/
|
|
45382
|
+
type AnteRuleDTO = {
|
|
45383
|
+
startLevel: number;
|
|
45384
|
+
bps: number;
|
|
45385
|
+
};
|
|
45386
|
+
/**
|
|
45387
|
+
* One blind level: a table-mode row as authored, and what the engine derives
|
|
45388
|
+
* for any level of any progression. `level` is 0-based. A break level deals no
|
|
45389
|
+
* hands; breaks need a tournament director, so a sit-and-go rejects them.
|
|
45390
|
+
*/
|
|
45391
|
+
type BlindLevelDTO = {
|
|
45392
|
+
level: number;
|
|
45393
|
+
smallBlind: string;
|
|
45394
|
+
bigBlind: string;
|
|
45395
|
+
ante: string;
|
|
45396
|
+
durationMinutes: number;
|
|
45397
|
+
isBreak: boolean;
|
|
45398
|
+
};
|
|
45399
|
+
/**
|
|
45400
|
+
* A preset by name (#1734's library, engine data): turbo (double, 5 min,
|
|
45401
|
+
* 25/50, ante 10% from level 4), standard (double, 10 min, 25/50, ante 10% from
|
|
45402
|
+
* level 5), deep_stack (×1.5 per level rounded to 25, 15 min, 25/50, ante 12.5%
|
|
45403
|
+
* from level 6), hyper_turbo (double, 3 min, 50/100, ante 10% from level 3).
|
|
45404
|
+
* The engine resolves it into the concrete structure on the table's first
|
|
45405
|
+
* action and persists that, so a later preset edit never changes a running
|
|
45406
|
+
* table. No other field may be set alongside `preset`.
|
|
45407
|
+
*/
|
|
45408
|
+
type BlindStructurePresetDTO = {
|
|
45409
|
+
preset: BlindPreset;
|
|
45410
|
+
};
|
|
45411
|
+
type AlgorithmicBlindStructureBase = {
|
|
45412
|
+
startSmallBlind: string;
|
|
45413
|
+
startBigBlind: string;
|
|
45414
|
+
durationMinutes: number;
|
|
45415
|
+
maxLevel?: number;
|
|
45416
|
+
ante?: AnteRuleDTO;
|
|
45417
|
+
};
|
|
45418
|
+
/** sb_n = startSmallBlind × 2^n — bit-identical to the doubling a structure-less sit-and-go runs. */
|
|
45419
|
+
type DoubleBlindStructureDTO = AlgorithmicBlindStructureBase & {
|
|
45420
|
+
progression: "double";
|
|
45421
|
+
};
|
|
45422
|
+
/** sb_n = startSmallBlind + step × n. */
|
|
45423
|
+
type LinearBlindStructureDTO = AlgorithmicBlindStructureBase & {
|
|
45424
|
+
progression: "linear";
|
|
45425
|
+
step: string;
|
|
45426
|
+
};
|
|
45427
|
+
/**
|
|
45428
|
+
* sb_n = floor(sb_{n−1} × factorBps / 10000) rounded half-up to a multiple of
|
|
45429
|
+
* `roundTo`, never less than sb_{n−1} + roundTo (so a coarse roundTo cannot
|
|
45430
|
+
* stall the curve). `factorBps` must exceed 10000 (15000 = ×1.5 per level).
|
|
45431
|
+
*/
|
|
45432
|
+
type PercentageBlindStructureDTO = AlgorithmicBlindStructureBase & {
|
|
45433
|
+
progression: "percentage";
|
|
45434
|
+
factorBps: number;
|
|
45435
|
+
roundTo: string;
|
|
45436
|
+
};
|
|
45437
|
+
/**
|
|
45438
|
+
* Hand-crafted levels (the WSOP-style structure #1734 showed no formula can
|
|
45439
|
+
* reproduce): each row carries its own blinds, ante and duration. Past the
|
|
45440
|
+
* last row the schedule repeats it. The first and last rows may not be breaks.
|
|
45441
|
+
*/
|
|
45442
|
+
type TableBlindStructureDTO = {
|
|
45443
|
+
progression: "table";
|
|
45444
|
+
levels: BlindLevelDTO[];
|
|
45445
|
+
maxLevel?: number;
|
|
45446
|
+
};
|
|
45447
|
+
type BlindStructureDTO = BlindStructurePresetDTO | DoubleBlindStructureDTO | LinearBlindStructureDTO | PercentageBlindStructureDTO | TableBlindStructureDTO;
|
|
45357
45448
|
/**
|
|
45358
45449
|
* GameOptions represents game configuration (internal use with BigInt).
|
|
45359
45450
|
*
|
|
@@ -45408,6 +45499,7 @@ type GameOptionsDTO = {
|
|
|
45408
45499
|
protocolFeeBps?: number;
|
|
45409
45500
|
blindLevelDuration?: number;
|
|
45410
45501
|
blindLevel?: number;
|
|
45502
|
+
blindStructure?: BlindStructureDTO;
|
|
45411
45503
|
nextSmallBlind?: string;
|
|
45412
45504
|
nextBigBlind?: string;
|
|
45413
45505
|
scheduledStartTime?: number;
|
|
@@ -45483,6 +45575,25 @@ type PayoutPlaceDTO = {
|
|
|
45483
45575
|
place: number;
|
|
45484
45576
|
amount: string;
|
|
45485
45577
|
};
|
|
45578
|
+
/**
|
|
45579
|
+
* The reveal a sealed hand is stopped on (poker-vm#2695): "board" = the next
|
|
45580
|
+
* street is due from the dealer, "deal" = the deck is due at showdown, "" =
|
|
45581
|
+
* nothing pending. While non-empty no player is next to act and player
|
|
45582
|
+
* actions are rejected.
|
|
45583
|
+
*/
|
|
45584
|
+
type SealedAwaiting = "board" | "deal" | "";
|
|
45585
|
+
/**
|
|
45586
|
+
* The sealed-hand (commit-reveal) state of the current hand — poker-vm#2695,
|
|
45587
|
+
* phase 1 of the dealing design on #2643. Present as
|
|
45588
|
+
* `TexasHoldemStateDTO.sealed` only on a commit-reveal hand; omitted on an
|
|
45589
|
+
* ordinary hand. On a sealed hand `deck` is "" and each hidden hole card is
|
|
45590
|
+
* "??" until `revealed` is true.
|
|
45591
|
+
*/
|
|
45592
|
+
type SealedDTO = {
|
|
45593
|
+
awaiting: SealedAwaiting;
|
|
45594
|
+
dealtSeats: number[];
|
|
45595
|
+
revealed: boolean;
|
|
45596
|
+
};
|
|
45486
45597
|
type TexasHoldemGameState = {
|
|
45487
45598
|
type: string;
|
|
45488
45599
|
address: string;
|
|
@@ -45527,6 +45638,7 @@ type TexasHoldemStateDTO = {
|
|
|
45527
45638
|
availableSeats: number[];
|
|
45528
45639
|
rakeCollected?: string;
|
|
45529
45640
|
payouts?: PayoutPlaceDTO[];
|
|
45641
|
+
sealed?: SealedDTO;
|
|
45530
45642
|
signature: string;
|
|
45531
45643
|
};
|
|
45532
45644
|
/**
|
|
@@ -47241,5 +47353,5 @@ declare const Client: typeof IgniteClient & Constructor<{
|
|
|
47241
47353
|
}>;
|
|
47242
47354
|
declare const registry: Registry;
|
|
47243
47355
|
|
|
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 };
|
|
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 };
|
|
47357
|
+
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.esm.js
CHANGED
|
@@ -56113,6 +56113,14 @@ var NonPlayerActionType;
|
|
|
56113
56113
|
// starts the sit-and-go once gameOptions.scheduledStartTime has passed and
|
|
56114
56114
|
// at least minPlayers are seated. Offered in legalActions when it is due.
|
|
56115
56115
|
NonPlayerActionType["START"] = "start";
|
|
56116
|
+
// Sealed hands (poker-vm#2695, commit-reveal phase 1). Submitted by the
|
|
56117
|
+
// dealer, never by a player. REVEAL_BOARD supplies the next street's cards
|
|
56118
|
+
// (`cards=Xx-Yy-Zz`: 3 for the flop, 1 for the turn, 1 for the river) while
|
|
56119
|
+
// `sealed.awaiting === "board"`. REVEAL_DEAL supplies the full deck
|
|
56120
|
+
// (`deck=<52 cards>`) at showdown while `sealed.awaiting === "deal"`; the
|
|
56121
|
+
// engine replays the deal in `sealed.dealtSeats` order and settles.
|
|
56122
|
+
NonPlayerActionType["REVEAL_BOARD"] = "reveal-board";
|
|
56123
|
+
NonPlayerActionType["REVEAL_DEAL"] = "reveal-deal";
|
|
56116
56124
|
})(NonPlayerActionType || (NonPlayerActionType = {}));
|
|
56117
56125
|
const AllPlayerActions = { ...PlayerActionType, ...NonPlayerActionType };
|
|
56118
56126
|
/**
|
|
@@ -56185,6 +56193,8 @@ var TexasHoldemRound;
|
|
|
56185
56193
|
TexasHoldemRound["SHOWDOWN"] = "showdown";
|
|
56186
56194
|
TexasHoldemRound["END"] = "end";
|
|
56187
56195
|
})(TexasHoldemRound || (TexasHoldemRound = {}));
|
|
56196
|
+
const BLIND_PRESETS = ["turbo", "standard", "deep_stack", "hyper_turbo"];
|
|
56197
|
+
const BLIND_PROGRESSIONS = ["double", "linear", "percentage", "table"];
|
|
56188
56198
|
const SIT_OUT_METHOD_NEXT_HAND = "next-hand";
|
|
56189
56199
|
const SIT_OUT_METHOD_NEXT_BB = "next-bb";
|
|
56190
56200
|
var SUIT;
|
|
@@ -72168,5 +72178,5 @@ const registry = new Registry([
|
|
|
72168
72178
|
...msgTypes,
|
|
72169
72179
|
]);
|
|
72170
72180
|
|
|
72171
|
-
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$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, 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 };
|
|
72181
|
+
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$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, 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 };
|
|
72172
72182
|
//# sourceMappingURL=index.esm.js.map
|