@block52/poker-vm-sdk 1.7.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 +128 -3
- package/dist/index.esm.js +57 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +58 -0
- package/dist/index.js.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 +7 -0
- package/dist/signingClient.d.ts.map +1 -1
- package/dist/types/game.d.ts +118 -1
- package/dist/types/game.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -44952,6 +44952,14 @@ interface MsgCreateGame {
|
|
|
44952
44952
|
* (block52/pokerchain#407)
|
|
44953
44953
|
*/
|
|
44954
44954
|
bettingLimit: string;
|
|
44955
|
+
/**
|
|
44956
|
+
* Scheduled start for a sit-and-go, unix seconds (field 21). With it,
|
|
44957
|
+
* min_players may be below max_players: the tournament starts when the table
|
|
44958
|
+
* fills or at this time with at least min_players registered, and is
|
|
44959
|
+
* cancelled with refunds if fewer have registered 15 minutes after it.
|
|
44960
|
+
* 0 = unscheduled: starts only when full. (poker-vm#2680)
|
|
44961
|
+
*/
|
|
44962
|
+
startTime: Long;
|
|
44955
44963
|
}
|
|
44956
44964
|
declare const MsgCreateGame: MessageFns<MsgCreateGame>;
|
|
44957
44965
|
/** MsgJoinGame defines the MsgJoinGame message. */
|
|
@@ -45249,7 +45257,10 @@ declare enum NonPlayerActionType {
|
|
|
45249
45257
|
SIT_OUT = "sit-out",
|
|
45250
45258
|
TIMEOUT = "timeout",
|
|
45251
45259
|
TIME_BANK = "time-bank",
|
|
45252
|
-
TOP_UP = "top-up"
|
|
45260
|
+
TOP_UP = "top-up",
|
|
45261
|
+
START = "start",
|
|
45262
|
+
REVEAL_BOARD = "reveal-board",
|
|
45263
|
+
REVEAL_DEAL = "reveal-deal"
|
|
45253
45264
|
}
|
|
45254
45265
|
declare const AllPlayerActions: {
|
|
45255
45266
|
DEAD_SMALL_BLIND: NonPlayerActionType.DEAD_SMALL_BLIND;
|
|
@@ -45265,6 +45276,9 @@ declare const AllPlayerActions: {
|
|
|
45265
45276
|
TIMEOUT: NonPlayerActionType.TIMEOUT;
|
|
45266
45277
|
TIME_BANK: NonPlayerActionType.TIME_BANK;
|
|
45267
45278
|
TOP_UP: NonPlayerActionType.TOP_UP;
|
|
45279
|
+
START: NonPlayerActionType.START;
|
|
45280
|
+
REVEAL_BOARD: NonPlayerActionType.REVEAL_BOARD;
|
|
45281
|
+
REVEAL_DEAL: NonPlayerActionType.REVEAL_DEAL;
|
|
45268
45282
|
SMALL_BLIND: PlayerActionType.SMALL_BLIND;
|
|
45269
45283
|
BIG_BLIND: PlayerActionType.BIG_BLIND;
|
|
45270
45284
|
FOLD: PlayerActionType.FOLD;
|
|
@@ -45344,6 +45358,93 @@ type RakeConfigDTO = {
|
|
|
45344
45358
|
rakeCap: string;
|
|
45345
45359
|
owner?: string;
|
|
45346
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;
|
|
45347
45448
|
/**
|
|
45348
45449
|
* GameOptions represents game configuration (internal use with BigInt).
|
|
45349
45450
|
*
|
|
@@ -45364,6 +45465,7 @@ type GameOptions = {
|
|
|
45364
45465
|
protocolFeeBps?: number;
|
|
45365
45466
|
blindLevelDuration?: number;
|
|
45366
45467
|
blindLevel?: number;
|
|
45468
|
+
scheduledStartTime?: number;
|
|
45367
45469
|
sngStartTime?: number;
|
|
45368
45470
|
levelStartTime?: number;
|
|
45369
45471
|
timeBankMs?: number;
|
|
@@ -45397,8 +45499,10 @@ type GameOptionsDTO = {
|
|
|
45397
45499
|
protocolFeeBps?: number;
|
|
45398
45500
|
blindLevelDuration?: number;
|
|
45399
45501
|
blindLevel?: number;
|
|
45502
|
+
blindStructure?: BlindStructureDTO;
|
|
45400
45503
|
nextSmallBlind?: string;
|
|
45401
45504
|
nextBigBlind?: string;
|
|
45505
|
+
scheduledStartTime?: number;
|
|
45402
45506
|
sngStartTime?: number;
|
|
45403
45507
|
levelStartTime?: number;
|
|
45404
45508
|
timeBankMs?: number;
|
|
@@ -45471,6 +45575,25 @@ type PayoutPlaceDTO = {
|
|
|
45471
45575
|
place: number;
|
|
45472
45576
|
amount: string;
|
|
45473
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
|
+
};
|
|
45474
45597
|
type TexasHoldemGameState = {
|
|
45475
45598
|
type: string;
|
|
45476
45599
|
address: string;
|
|
@@ -45515,6 +45638,7 @@ type TexasHoldemStateDTO = {
|
|
|
45515
45638
|
availableSeats: number[];
|
|
45516
45639
|
rakeCollected?: string;
|
|
45517
45640
|
payouts?: PayoutPlaceDTO[];
|
|
45641
|
+
sealed?: SealedDTO;
|
|
45518
45642
|
signature: string;
|
|
45519
45643
|
};
|
|
45520
45644
|
/**
|
|
@@ -46621,6 +46745,7 @@ interface SNGConfig {
|
|
|
46621
46745
|
startingStack: bigint;
|
|
46622
46746
|
blindLevelDuration: number;
|
|
46623
46747
|
entryFee?: bigint;
|
|
46748
|
+
startTime?: number;
|
|
46624
46749
|
}
|
|
46625
46750
|
/**
|
|
46626
46751
|
* Signing Cosmos Client that extends the read-only CosmosClient with transaction capabilities
|
|
@@ -47228,5 +47353,5 @@ declare const Client: typeof IgniteClient & Constructor<{
|
|
|
47228
47353
|
}>;
|
|
47229
47354
|
declare const registry: Registry;
|
|
47230
47355
|
|
|
47231
|
-
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 };
|
|
47232
|
-
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
|
@@ -2846,6 +2846,7 @@ function createBaseMsgCreateGame() {
|
|
|
2846
2846
|
entryFee: Long.UZERO,
|
|
2847
2847
|
name: "",
|
|
2848
2848
|
bettingLimit: "",
|
|
2849
|
+
startTime: Long.ZERO,
|
|
2849
2850
|
};
|
|
2850
2851
|
}
|
|
2851
2852
|
const MsgCreateGame = {
|
|
@@ -2907,6 +2908,9 @@ const MsgCreateGame = {
|
|
|
2907
2908
|
if (message.bettingLimit !== "") {
|
|
2908
2909
|
writer.uint32(162).string(message.bettingLimit);
|
|
2909
2910
|
}
|
|
2911
|
+
if (!message.startTime.equals(Long.ZERO)) {
|
|
2912
|
+
writer.uint32(168).int64(message.startTime.toString());
|
|
2913
|
+
}
|
|
2910
2914
|
return writer;
|
|
2911
2915
|
},
|
|
2912
2916
|
decode(input, length) {
|
|
@@ -3049,6 +3053,13 @@ const MsgCreateGame = {
|
|
|
3049
3053
|
message.bettingLimit = reader.string();
|
|
3050
3054
|
continue;
|
|
3051
3055
|
}
|
|
3056
|
+
case 21: {
|
|
3057
|
+
if (tag !== 168) {
|
|
3058
|
+
break;
|
|
3059
|
+
}
|
|
3060
|
+
message.startTime = Long.fromString(reader.int64().toString());
|
|
3061
|
+
continue;
|
|
3062
|
+
}
|
|
3052
3063
|
}
|
|
3053
3064
|
if ((tag & 7) === 4 || tag === 0) {
|
|
3054
3065
|
break;
|
|
@@ -3078,6 +3089,7 @@ const MsgCreateGame = {
|
|
|
3078
3089
|
entryFee: isSet$2b(object.entryFee) ? Long.fromValue(object.entryFee) : Long.UZERO,
|
|
3079
3090
|
name: isSet$2b(object.name) ? globalThis.String(object.name) : "",
|
|
3080
3091
|
bettingLimit: isSet$2b(object.bettingLimit) ? globalThis.String(object.bettingLimit) : "",
|
|
3092
|
+
startTime: isSet$2b(object.startTime) ? Long.fromValue(object.startTime) : Long.ZERO,
|
|
3081
3093
|
};
|
|
3082
3094
|
},
|
|
3083
3095
|
toJSON(message) {
|
|
@@ -3139,6 +3151,9 @@ const MsgCreateGame = {
|
|
|
3139
3151
|
if (message.bettingLimit !== "") {
|
|
3140
3152
|
obj.bettingLimit = message.bettingLimit;
|
|
3141
3153
|
}
|
|
3154
|
+
if (!message.startTime.equals(Long.ZERO)) {
|
|
3155
|
+
obj.startTime = (message.startTime || Long.ZERO).toString();
|
|
3156
|
+
}
|
|
3142
3157
|
return obj;
|
|
3143
3158
|
},
|
|
3144
3159
|
create(base) {
|
|
@@ -3184,6 +3199,9 @@ const MsgCreateGame = {
|
|
|
3184
3199
|
message.gameVariant = object.gameVariant ?? "";
|
|
3185
3200
|
message.name = object.name ?? "";
|
|
3186
3201
|
message.bettingLimit = object.bettingLimit ?? "";
|
|
3202
|
+
message.startTime = (object.startTime !== undefined && object.startTime !== null)
|
|
3203
|
+
? Long.fromValue(object.startTime)
|
|
3204
|
+
: Long.ZERO;
|
|
3187
3205
|
message.entryFee = (object.entryFee !== undefined && object.entryFee !== null)
|
|
3188
3206
|
? Long.fromValue(object.entryFee)
|
|
3189
3207
|
: Long.UZERO;
|
|
@@ -56091,6 +56109,18 @@ var NonPlayerActionType;
|
|
|
56091
56109
|
// current turn. Rejected off-turn, past the deadline, or with no bank left.
|
|
56092
56110
|
NonPlayerActionType["TIME_BANK"] = "time-bank";
|
|
56093
56111
|
NonPlayerActionType["TOP_UP"] = "top-up";
|
|
56112
|
+
// Scheduled single-table tournament (poker-vm#2680): any registered player
|
|
56113
|
+
// starts the sit-and-go once gameOptions.scheduledStartTime has passed and
|
|
56114
|
+
// at least minPlayers are seated. Offered in legalActions when it is due.
|
|
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";
|
|
56094
56124
|
})(NonPlayerActionType || (NonPlayerActionType = {}));
|
|
56095
56125
|
const AllPlayerActions = { ...PlayerActionType, ...NonPlayerActionType };
|
|
56096
56126
|
/**
|
|
@@ -56163,6 +56193,8 @@ var TexasHoldemRound;
|
|
|
56163
56193
|
TexasHoldemRound["SHOWDOWN"] = "showdown";
|
|
56164
56194
|
TexasHoldemRound["END"] = "end";
|
|
56165
56195
|
})(TexasHoldemRound || (TexasHoldemRound = {}));
|
|
56196
|
+
const BLIND_PRESETS = ["turbo", "standard", "deep_stack", "hyper_turbo"];
|
|
56197
|
+
const BLIND_PROGRESSIONS = ["double", "linear", "percentage", "table"];
|
|
56166
56198
|
const SIT_OUT_METHOD_NEXT_HAND = "next-hand";
|
|
56167
56199
|
const SIT_OUT_METHOD_NEXT_BB = "next-bb";
|
|
56168
56200
|
var SUIT;
|
|
@@ -71004,6 +71036,26 @@ function gaslessFee(gasLimit = DEFAULT_GAS_LIMIT) {
|
|
|
71004
71036
|
gas: gasLimit.toString()
|
|
71005
71037
|
};
|
|
71006
71038
|
}
|
|
71039
|
+
/**
|
|
71040
|
+
* Fail fast on a sit-and-go field the chain would refuse (poker-vm#2680):
|
|
71041
|
+
* seats 2..9, min <= max, and a flexible field (min < max) needs a scheduled
|
|
71042
|
+
* start in the future. Mirrors x/poker/keeper/msg_server_create_game.go.
|
|
71043
|
+
*/
|
|
71044
|
+
function assertCreatableSngField(minPlayers, maxPlayers, sngConfig, nowSeconds = Math.floor(Date.now() / 1000)) {
|
|
71045
|
+
if (maxPlayers < 2 || maxPlayers > 9) {
|
|
71046
|
+
throw new Error(`sit-and-go maxPlayers must be 2..9; got ${maxPlayers}.`);
|
|
71047
|
+
}
|
|
71048
|
+
if (minPlayers < 2 || minPlayers > maxPlayers) {
|
|
71049
|
+
throw new Error(`sit-and-go minPlayers must be 2..maxPlayers (${maxPlayers}); got ${minPlayers}.`);
|
|
71050
|
+
}
|
|
71051
|
+
const startTime = sngConfig?.startTime;
|
|
71052
|
+
if (minPlayers !== maxPlayers && !startTime) {
|
|
71053
|
+
throw new Error("sit-and-go with minPlayers < maxPlayers needs sngConfig.startTime (a scheduled start).");
|
|
71054
|
+
}
|
|
71055
|
+
if (startTime !== undefined && startTime <= nowSeconds) {
|
|
71056
|
+
throw new Error(`sngConfig.startTime ${startTime} must be in the future (now ${nowSeconds}).`);
|
|
71057
|
+
}
|
|
71058
|
+
}
|
|
71007
71059
|
/**
|
|
71008
71060
|
* Signing Cosmos Client that extends the read-only CosmosClient with transaction capabilities
|
|
71009
71061
|
*/
|
|
@@ -71135,6 +71187,7 @@ class SigningCosmosClient extends CosmosClient {
|
|
|
71135
71187
|
if (!sngConfig.blindLevelDuration || sngConfig.blindLevelDuration <= 0) {
|
|
71136
71188
|
throw new Error(`${gameFormat} games require a positive blindLevelDuration; got ${sngConfig.blindLevelDuration}.`);
|
|
71137
71189
|
}
|
|
71190
|
+
assertCreatableSngField(minPlayers, maxPlayers, sngConfig);
|
|
71138
71191
|
}
|
|
71139
71192
|
assertCreatableBettingLimit(bettingLimit);
|
|
71140
71193
|
await this.initializeSigningClient();
|
|
@@ -71172,6 +71225,9 @@ class SigningCosmosClient extends CosmosClient {
|
|
|
71172
71225
|
// Betting structure (block52/pokerchain#407). "" = the variant's default
|
|
71173
71226
|
// on chain, and an empty proto3 string is not encoded at all.
|
|
71174
71227
|
bettingLimit: bettingLimit ?? "",
|
|
71228
|
+
// Scheduled start (poker-vm#2680), unix seconds. 0 = unscheduled, and
|
|
71229
|
+
// a zero proto3 int64 is not encoded at all.
|
|
71230
|
+
startTime: sngConfig?.startTime ? Long.fromNumber(sngConfig.startTime) : Long.ZERO,
|
|
71175
71231
|
});
|
|
71176
71232
|
// Create the transaction message
|
|
71177
71233
|
const msg = {
|
|
@@ -72122,5 +72178,5 @@ const registry = new Registry([
|
|
|
72122
72178
|
...msgTypes,
|
|
72123
72179
|
]);
|
|
72124
72180
|
|
|
72125
|
-
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 };
|
|
72126
72182
|
//# sourceMappingURL=index.esm.js.map
|