@block52/poker-vm-sdk 1.22.0 → 1.24.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 +24 -9
- package/dist/index.esm.js +28 -20
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +28 -20
- package/dist/index.js.map +1 -1
- package/dist/pokerchain.poker.v1/types/pokerchain/poker/v1/tx.d.ts +8 -8
- package/dist/signingClient.d.ts +5 -4
- package/dist/signingClient.d.ts.map +1 -1
- package/dist/types/game.d.ts +15 -0
- package/dist/types/game.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -44953,11 +44953,11 @@ interface MsgCreateGame {
|
|
|
44953
44953
|
*/
|
|
44954
44954
|
bettingLimit: string;
|
|
44955
44955
|
/**
|
|
44956
|
-
*
|
|
44957
|
-
*
|
|
44958
|
-
*
|
|
44959
|
-
* cancelled with refunds if fewer have registered 15 minutes after it.
|
|
44960
|
-
*
|
|
44956
|
+
* Start of a tournament, unix seconds (poker-vm#2680, #2776). Required for a
|
|
44957
|
+
* tournament and refused otherwise. It starts at this time with at least
|
|
44958
|
+
* min_players registered (the engine's START action), never earlier, and is
|
|
44959
|
+
* cancelled with refunds if fewer have registered 15 minutes after it. A
|
|
44960
|
+
* sit-and-go has none: it starts when the table fills.
|
|
44961
44961
|
*/
|
|
44962
44962
|
startTime: Long;
|
|
44963
44963
|
/**
|
|
@@ -44976,9 +44976,9 @@ interface MsgCreateGame {
|
|
|
44976
44976
|
*/
|
|
44977
44977
|
lateRegistrationLevels: number;
|
|
44978
44978
|
/**
|
|
44979
|
-
* Hold a
|
|
44980
|
-
*
|
|
44981
|
-
*
|
|
44979
|
+
* Hold a table until start_time even when it fills first (poker-vm#2760). A
|
|
44980
|
+
* tournament always does, whatever this says; only sent by older clients.
|
|
44981
|
+
* Refused on any other format.
|
|
44982
44982
|
*/
|
|
44983
44983
|
waitForStartTime: boolean;
|
|
44984
44984
|
}
|
|
@@ -45576,6 +45576,20 @@ type WinnerDTO = {
|
|
|
45576
45576
|
cards: string[] | undefined;
|
|
45577
45577
|
name: string | undefined;
|
|
45578
45578
|
description: string | undefined;
|
|
45579
|
+
/** What the winner took from each pot, main pot first (ui#918): `pot`
|
|
45580
|
+
* indexes the state's `pots` / `potDetails`, and `amount` is the sum of
|
|
45581
|
+
* these shares. Absent on states from an engine before 1.23.0. */
|
|
45582
|
+
pots?: WinnerPotDTO[];
|
|
45583
|
+
};
|
|
45584
|
+
/** One pot's share of a win (ui#918). */
|
|
45585
|
+
type WinnerPotDTO = {
|
|
45586
|
+
pot: number;
|
|
45587
|
+
amount: string;
|
|
45588
|
+
};
|
|
45589
|
+
/** One pot as players see it: its chips and the seats that can win it (ui#918). */
|
|
45590
|
+
type PotDTO = {
|
|
45591
|
+
amount: string;
|
|
45592
|
+
eligibleSeats: number[];
|
|
45579
45593
|
};
|
|
45580
45594
|
type SitOutMethod = "next-hand" | "next-bb";
|
|
45581
45595
|
declare const SIT_OUT_METHOD_NEXT_HAND: SitOutMethod;
|
|
@@ -45713,6 +45727,7 @@ type TexasHoldemStateDTO = {
|
|
|
45713
45727
|
communityCards: string[];
|
|
45714
45728
|
deck: string;
|
|
45715
45729
|
pots: string[];
|
|
45730
|
+
potDetails?: PotDTO[];
|
|
45716
45731
|
totalPot: string;
|
|
45717
45732
|
lastActedSeat?: number;
|
|
45718
45733
|
nextToAct: number;
|
|
@@ -47649,4 +47664,4 @@ declare const Client: typeof IgniteClient & Constructor<{
|
|
|
47649
47664
|
declare const registry: Registry;
|
|
47650
47665
|
|
|
47651
47666
|
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 };
|
|
47652
|
-
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, TxFailurePhase, WalletInfo, WinnerDTO, WithdrawResponseDTO };
|
|
47667
|
+
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, PotDTO, RPCRequest, RPCRequestParams, RPCResponse, RakeConfig, RakeConfigDTO, ResultDTO, SealedAwaiting, SealedDTO, SitInMethod, SitOutMethod, TableBlindStructureDTO, TexasHoldemGameState, TexasHoldemStateDTO, TournamentClockDTO, TournamentEntrantStatus, TournamentStatus, TransactionDTO, TransactionResponse, TxFailurePhase, WalletInfo, WinnerDTO, WinnerPotDTO, WithdrawResponseDTO };
|
package/dist/index.esm.js
CHANGED
|
@@ -71849,35 +71849,43 @@ function gaslessFee(gasLimit = DEFAULT_GAS_LIMIT) {
|
|
|
71849
71849
|
};
|
|
71850
71850
|
}
|
|
71851
71851
|
/**
|
|
71852
|
-
* Fail fast on a sit-and-go
|
|
71853
|
-
*
|
|
71854
|
-
* start in the future
|
|
71852
|
+
* Fail fast on a sit-and-go or tournament the chain would refuse. Both have seats
|
|
71853
|
+
* 2..9 and min <= max. A sit-and-go starts when the table fills, so its field is
|
|
71854
|
+
* fixed and it has no start time. A tournament needs a start time in the future
|
|
71855
|
+
* (poker-vm#2776). Mirrors x/poker/keeper/msg_server_create_game.go.
|
|
71855
71856
|
*/
|
|
71856
|
-
function assertCreatableSngField(minPlayers, maxPlayers, sngConfig, nowSeconds = Math.floor(Date.now() / 1000)) {
|
|
71857
|
+
function assertCreatableSngField(gameFormat, minPlayers, maxPlayers, sngConfig, nowSeconds = Math.floor(Date.now() / 1000)) {
|
|
71857
71858
|
if (maxPlayers < 2 || maxPlayers > 9) {
|
|
71858
|
-
throw new Error(
|
|
71859
|
+
throw new Error(`${gameFormat} maxPlayers must be 2..9; got ${maxPlayers}.`);
|
|
71859
71860
|
}
|
|
71860
71861
|
if (minPlayers < 2 || minPlayers > maxPlayers) {
|
|
71861
|
-
throw new Error(
|
|
71862
|
+
throw new Error(`${gameFormat} minPlayers must be 2..maxPlayers (${maxPlayers}); got ${minPlayers}.`);
|
|
71862
71863
|
}
|
|
71863
71864
|
const startTime = sngConfig?.startTime;
|
|
71864
|
-
if (minPlayers !== maxPlayers && !startTime) {
|
|
71865
|
-
throw new Error("sit-and-go with minPlayers < maxPlayers needs sngConfig.startTime (a scheduled start).");
|
|
71866
|
-
}
|
|
71867
|
-
if (startTime !== undefined && startTime <= nowSeconds) {
|
|
71868
|
-
throw new Error(`sngConfig.startTime ${startTime} must be in the future (now ${nowSeconds}).`);
|
|
71869
|
-
}
|
|
71870
71865
|
const levels = sngConfig?.lateRegistrationLevels;
|
|
71871
|
-
if (levels !== undefined) {
|
|
71872
|
-
|
|
71873
|
-
|
|
71874
|
-
|
|
71866
|
+
if (levels !== undefined && (!Number.isInteger(levels) || levels <= 0)) {
|
|
71867
|
+
throw new Error(`sngConfig.lateRegistrationLevels must be a positive whole number of levels; got ${levels}.`);
|
|
71868
|
+
}
|
|
71869
|
+
if (gameFormat === GameFormat.TOURNAMENT) {
|
|
71875
71870
|
if (!startTime) {
|
|
71876
|
-
throw new Error("
|
|
71871
|
+
throw new Error("tournament needs sngConfig.startTime.");
|
|
71872
|
+
}
|
|
71873
|
+
if (startTime <= nowSeconds) {
|
|
71874
|
+
throw new Error(`sngConfig.startTime ${startTime} must be in the future (now ${nowSeconds}).`);
|
|
71877
71875
|
}
|
|
71876
|
+
return;
|
|
71877
|
+
}
|
|
71878
|
+
if (minPlayers !== maxPlayers) {
|
|
71879
|
+
throw new Error("sit-and-go needs minPlayers == maxPlayers (it starts when the table fills); a flexible field is a tournament.");
|
|
71880
|
+
}
|
|
71881
|
+
if (startTime) {
|
|
71882
|
+
throw new Error("sngConfig.startTime is only valid for a tournament.");
|
|
71883
|
+
}
|
|
71884
|
+
if (levels !== undefined) {
|
|
71885
|
+
throw new Error("sngConfig.lateRegistrationLevels is only valid for a tournament.");
|
|
71878
71886
|
}
|
|
71879
|
-
if (sngConfig?.waitForStartTime
|
|
71880
|
-
throw new Error("sngConfig.waitForStartTime
|
|
71887
|
+
if (sngConfig?.waitForStartTime) {
|
|
71888
|
+
throw new Error("sngConfig.waitForStartTime is only valid for a tournament.");
|
|
71881
71889
|
}
|
|
71882
71890
|
}
|
|
71883
71891
|
/**
|
|
@@ -72012,7 +72020,7 @@ class SigningCosmosClient extends CosmosClient {
|
|
|
72012
72020
|
if (!sngConfig.blindStructure && (!sngConfig.blindLevelDuration || sngConfig.blindLevelDuration <= 0)) {
|
|
72013
72021
|
throw new Error(`${gameFormat} games require a positive blindLevelDuration (or a blindStructure); got ${sngConfig.blindLevelDuration}.`);
|
|
72014
72022
|
}
|
|
72015
|
-
assertCreatableSngField(minPlayers, maxPlayers, sngConfig);
|
|
72023
|
+
assertCreatableSngField(gameFormat, minPlayers, maxPlayers, sngConfig);
|
|
72016
72024
|
}
|
|
72017
72025
|
assertCreatableBettingLimit(bettingLimit, gameVariant);
|
|
72018
72026
|
await this.initializeSigningClient();
|