@block52/poker-vm-sdk 1.5.1 → 1.6.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 +52 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +79 -3
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +82 -2
- package/dist/index.js.map +1 -1
- package/dist/pokerchain.poker.v1/types/pokerchain/poker/v1/tx.d.ts +6 -0
- package/dist/pokerchain.poker.v1/types/pokerchain/poker/v1/tx.d.ts.map +1 -1
- package/dist/signingClient.d.ts +13 -2
- package/dist/signingClient.d.ts.map +1 -1
- package/dist/types/game.d.ts +11 -0
- package/dist/types/game.d.ts.map +1 -1
- package/dist/utils/gameFormatUtils.d.ts +23 -1
- package/dist/utils/gameFormatUtils.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -44946,6 +44946,12 @@ interface MsgCreateGame {
|
|
|
44946
44946
|
* globally unique, $0.10/char to validators. Empty = unnamed. (block52/pokerchain#337)
|
|
44947
44947
|
*/
|
|
44948
44948
|
name: string;
|
|
44949
|
+
/**
|
|
44950
|
+
* Betting structure (field 20): "no-limit" | "pot-limit". Empty = the
|
|
44951
|
+
* variant's default, pot-limit for omaha, no-limit for texas-holdem.
|
|
44952
|
+
* (block52/pokerchain#407)
|
|
44953
|
+
*/
|
|
44954
|
+
bettingLimit: string;
|
|
44949
44955
|
}
|
|
44950
44956
|
declare const MsgCreateGame: MessageFns<MsgCreateGame>;
|
|
44951
44957
|
/** MsgJoinGame defines the MsgJoinGame message. */
|
|
@@ -45286,6 +45292,16 @@ declare enum GameVariant {
|
|
|
45286
45292
|
TEXAS_HOLDEM = "texas-holdem",
|
|
45287
45293
|
OMAHA = "omaha"
|
|
45288
45294
|
}
|
|
45295
|
+
/**
|
|
45296
|
+
* BettingLimit — the table's betting structure. Orthogonal to GameVariant: any
|
|
45297
|
+
* variant can be played at any limit (pot-limit Omaha, pot-limit Hold'em,
|
|
45298
|
+
* fixed-limit Hold'em, …). Absent on GameOptions ⇒ no-limit (current behavior).
|
|
45299
|
+
*/
|
|
45300
|
+
declare enum BettingLimit {
|
|
45301
|
+
NO_LIMIT = "no-limit",
|
|
45302
|
+
POT_LIMIT = "pot-limit",
|
|
45303
|
+
FIXED_LIMIT = "fixed-limit"
|
|
45304
|
+
}
|
|
45289
45305
|
declare enum GameStatus {
|
|
45290
45306
|
WAITING_FOR_PLAYERS = "waiting-for-players",
|
|
45291
45307
|
REGISTRATION = "registration",
|
|
@@ -45387,6 +45403,7 @@ type GameOptionsDTO = {
|
|
|
45387
45403
|
levelStartTime?: number;
|
|
45388
45404
|
timeBankMs?: number;
|
|
45389
45405
|
timeBankCapMs?: number;
|
|
45406
|
+
bettingLimit?: BettingLimit;
|
|
45390
45407
|
otherOptions?: Record<string, any>;
|
|
45391
45408
|
};
|
|
45392
45409
|
type ActionDTO = {
|
|
@@ -45941,6 +45958,28 @@ declare const getGameVariant: (variant: GameVariant | string | undefined) => Gam
|
|
|
45941
45958
|
* @returns GameVariant enum value, or "unknown" if invalid
|
|
45942
45959
|
*/
|
|
45943
45960
|
declare const parseGameVariant: (value: string | undefined) => GameVariant | "unknown";
|
|
45961
|
+
/**
|
|
45962
|
+
* The betting structure a table plays. The engine treats an absent
|
|
45963
|
+
* `gameOptions.bettingLimit` as no-limit (poker-vm#2652), so this mirrors that
|
|
45964
|
+
* rule rather than inventing a default (block52/pokerchain#407).
|
|
45965
|
+
*
|
|
45966
|
+
* @param options - the table's gameOptions (or anything carrying bettingLimit)
|
|
45967
|
+
* @returns the table's BettingLimit
|
|
45968
|
+
*/
|
|
45969
|
+
declare const getBettingLimit: (options: {
|
|
45970
|
+
bettingLimit?: BettingLimit;
|
|
45971
|
+
} | undefined) => BettingLimit;
|
|
45972
|
+
/**
|
|
45973
|
+
* Check whether a table is pot-limit (its max bet or raise is the pot cap).
|
|
45974
|
+
*/
|
|
45975
|
+
declare const isPotLimit: (options: {
|
|
45976
|
+
bettingLimit?: BettingLimit;
|
|
45977
|
+
} | undefined) => boolean;
|
|
45978
|
+
/**
|
|
45979
|
+
* How many hole cards a variant deals each player: 4 for Omaha, 2 for Texas
|
|
45980
|
+
* Hold'em. Mirrors the engine's HoleCardsPerPlayer (poker-vm#2650).
|
|
45981
|
+
*/
|
|
45982
|
+
declare const holeCardsPerPlayer: (variant: GameVariant | string | undefined) => number;
|
|
45944
45983
|
|
|
45945
45984
|
/**
|
|
45946
45985
|
* Check if a specific action is available in the legal actions list.
|
|
@@ -46607,9 +46646,14 @@ declare class SigningCosmosClient extends CosmosClient {
|
|
|
46607
46646
|
*/
|
|
46608
46647
|
sendB52USDC(fromAddress: string, toAddress: string, amount: bigint, memo?: string): Promise<string>;
|
|
46609
46648
|
/**
|
|
46610
|
-
* Create a new poker game
|
|
46649
|
+
* Create a new poker game.
|
|
46650
|
+
*
|
|
46651
|
+
* `bettingLimit` is the table's betting structure (block52/pokerchain#407).
|
|
46652
|
+
* Omit it for the variant's default: pot-limit for omaha (PLO), no-limit for
|
|
46653
|
+
* texas-holdem. Omitted, the field is not encoded at all, so a chain without
|
|
46654
|
+
* it accepts the tx unchanged. Fixed-limit is not playable yet (poker-vm#2654).
|
|
46611
46655
|
*/
|
|
46612
|
-
createGame(gameFormat: string, gameVariant: string, minPlayers: number, maxPlayers: number, minBuyInB52USDC: bigint, maxBuyInB52USDC: bigint, smallBlindB52USDC: bigint, bigBlindB52USDC: bigint, timeout: number, rakeConfig?: RakeConfig, sngConfig?: SNGConfig, name?: string): Promise<string>;
|
|
46656
|
+
createGame(gameFormat: string, gameVariant: string, minPlayers: number, maxPlayers: number, minBuyInB52USDC: bigint, maxBuyInB52USDC: bigint, smallBlindB52USDC: bigint, bigBlindB52USDC: bigint, timeout: number, rakeConfig?: RakeConfig, sngConfig?: SNGConfig, name?: string, bettingLimit?: BettingLimit): Promise<string>;
|
|
46613
46657
|
/**
|
|
46614
46658
|
* Join a poker game
|
|
46615
46659
|
*/
|
|
@@ -46852,6 +46896,11 @@ declare class SigningCosmosClient extends CosmosClient {
|
|
|
46852
46896
|
* Create a signing client from a mnemonic
|
|
46853
46897
|
*/
|
|
46854
46898
|
declare function createSigningClientFromMnemonic(config: CosmosConfig, mnemonic: string): Promise<SigningCosmosClient>;
|
|
46899
|
+
/**
|
|
46900
|
+
* Throws for a betting limit a table cannot be created with (block52/pokerchain#407).
|
|
46901
|
+
* Undefined is allowed: the chain applies the variant's default.
|
|
46902
|
+
*/
|
|
46903
|
+
declare function assertCreatableBettingLimit(bettingLimit?: BettingLimit): void;
|
|
46855
46904
|
|
|
46856
46905
|
/**
|
|
46857
46906
|
* The part of a broadcast result this module reads. Structurally a subset of
|
|
@@ -47167,5 +47216,5 @@ declare const Client: typeof IgniteClient & Constructor<{
|
|
|
47167
47216
|
}>;
|
|
47168
47217
|
declare const registry: Registry;
|
|
47169
47218
|
|
|
47170
|
-
export { AllPlayerActions, BLOCK52_HD_PATH, 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, assertExecuted, buildMsgCreateValidator, computeGameNameFee, createSigningClientFromMnemonic, createWalletFromMnemonic, decToAtomics, formatGameFormatDisplay, formatGameVariantDisplay, generateWallet, getActionByType, getAddressFromMnemonic, getDefaultCosmosConfig, getGameFormat, getGameFormatForCosmos, getGameFormatFromObject, getGameVariant, hasAction, isCashFormat, isEmptyAddress, isSitAndGoFormat, isTournamentFormat, isValidMnemonic, isValidPlayerAddress, parseGameFormat, parseGameVariant, registry, toValoperAddress, txFailureHash, txFailurePhase };
|
|
47219
|
+
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 };
|
|
47171
47220
|
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 };
|
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,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAkC/C,QAAA,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEV,CAAC;AAEH,QAAA,MAAM,QAAQ,UAiCZ,CAAA;AAGF,cAAc,6BAA6B,CAAA;AAG3C,cAAc,cAAc,CAAA;AAG5B,cAAc,SAAS,CAAA;AAGvB,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAGpG,cAAc,eAAe,CAAA;AAG7B,cAAc,eAAe,CAAA;AAG7B,cAAc,yBAAyB,CAAA;AAGvC,cAAc,qBAAqB,CAAA;AAGnC,cAAc,sBAAsB,CAAA;AAGpC,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAGrE,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAG7B,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAG/B,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAG7D,OAAO,EAAE,YAAY,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AACvF,OAAO,EAAE,mBAAmB,EAAE,+BAA+B,EAAE,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAA;
|
|
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,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAkC/C,QAAA,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEV,CAAC;AAEH,QAAA,MAAM,QAAQ,UAiCZ,CAAA;AAGF,cAAc,6BAA6B,CAAA;AAG3C,cAAc,cAAc,CAAA;AAG5B,cAAc,SAAS,CAAA;AAGvB,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAGpG,cAAc,eAAe,CAAA;AAG7B,cAAc,eAAe,CAAA;AAG7B,cAAc,yBAAyB,CAAA;AAGvC,cAAc,qBAAqB,CAAA;AAGnC,cAAc,sBAAsB,CAAA;AAGpC,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAGrE,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAG7B,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAG/B,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAG7D,OAAO,EAAE,YAAY,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AACvF,OAAO,EAAE,mBAAmB,EAAE,+BAA+B,EAAE,2BAA2B,EAAE,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAIpI,OAAO,EAAE,uBAAuB,EAAE,YAAY,EAAE,gBAAgB,EAAE,6BAA6B,EAAE,KAAK,qBAAqB,EAAE,MAAM,WAAW,CAAA;AAC9I,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,cAAc,EAAE,aAAa,EAAE,KAAK,cAAc,EAAE,KAAK,eAAe,EAAE,MAAM,YAAY,CAAA;AAGvI,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAGzF,OAAO,EACL,MAAM,EACN,QAAQ,EACR,kBAAkB,EACnB,CAAA"}
|
package/dist/index.esm.js
CHANGED
|
@@ -2845,6 +2845,7 @@ function createBaseMsgCreateGame() {
|
|
|
2845
2845
|
gameVariant: "",
|
|
2846
2846
|
entryFee: Long.UZERO,
|
|
2847
2847
|
name: "",
|
|
2848
|
+
bettingLimit: "",
|
|
2848
2849
|
};
|
|
2849
2850
|
}
|
|
2850
2851
|
const MsgCreateGame = {
|
|
@@ -2903,6 +2904,9 @@ const MsgCreateGame = {
|
|
|
2903
2904
|
if (message.name !== "") {
|
|
2904
2905
|
writer.uint32(154).string(message.name);
|
|
2905
2906
|
}
|
|
2907
|
+
if (message.bettingLimit !== "") {
|
|
2908
|
+
writer.uint32(162).string(message.bettingLimit);
|
|
2909
|
+
}
|
|
2906
2910
|
return writer;
|
|
2907
2911
|
},
|
|
2908
2912
|
decode(input, length) {
|
|
@@ -3038,6 +3042,13 @@ const MsgCreateGame = {
|
|
|
3038
3042
|
message.name = reader.string();
|
|
3039
3043
|
continue;
|
|
3040
3044
|
}
|
|
3045
|
+
case 20: {
|
|
3046
|
+
if (tag !== 162) {
|
|
3047
|
+
break;
|
|
3048
|
+
}
|
|
3049
|
+
message.bettingLimit = reader.string();
|
|
3050
|
+
continue;
|
|
3051
|
+
}
|
|
3041
3052
|
}
|
|
3042
3053
|
if ((tag & 7) === 4 || tag === 0) {
|
|
3043
3054
|
break;
|
|
@@ -3066,6 +3077,7 @@ const MsgCreateGame = {
|
|
|
3066
3077
|
gameVariant: isSet$2b(object.gameVariant) ? globalThis.String(object.gameVariant) : "",
|
|
3067
3078
|
entryFee: isSet$2b(object.entryFee) ? Long.fromValue(object.entryFee) : Long.UZERO,
|
|
3068
3079
|
name: isSet$2b(object.name) ? globalThis.String(object.name) : "",
|
|
3080
|
+
bettingLimit: isSet$2b(object.bettingLimit) ? globalThis.String(object.bettingLimit) : "",
|
|
3069
3081
|
};
|
|
3070
3082
|
},
|
|
3071
3083
|
toJSON(message) {
|
|
@@ -3124,6 +3136,9 @@ const MsgCreateGame = {
|
|
|
3124
3136
|
if (message.name !== "") {
|
|
3125
3137
|
obj.name = message.name;
|
|
3126
3138
|
}
|
|
3139
|
+
if (message.bettingLimit !== "") {
|
|
3140
|
+
obj.bettingLimit = message.bettingLimit;
|
|
3141
|
+
}
|
|
3127
3142
|
return obj;
|
|
3128
3143
|
},
|
|
3129
3144
|
create(base) {
|
|
@@ -3168,6 +3183,7 @@ const MsgCreateGame = {
|
|
|
3168
3183
|
message.blindLevelDuration = object.blindLevelDuration ?? 0;
|
|
3169
3184
|
message.gameVariant = object.gameVariant ?? "";
|
|
3170
3185
|
message.name = object.name ?? "";
|
|
3186
|
+
message.bettingLimit = object.bettingLimit ?? "";
|
|
3171
3187
|
message.entryFee = (object.entryFee !== undefined && object.entryFee !== null)
|
|
3172
3188
|
? Long.fromValue(object.entryFee)
|
|
3173
3189
|
: Long.UZERO;
|
|
@@ -56095,6 +56111,17 @@ var GameVariant;
|
|
|
56095
56111
|
GameVariant["TEXAS_HOLDEM"] = "texas-holdem";
|
|
56096
56112
|
GameVariant["OMAHA"] = "omaha";
|
|
56097
56113
|
})(GameVariant || (GameVariant = {}));
|
|
56114
|
+
/**
|
|
56115
|
+
* BettingLimit — the table's betting structure. Orthogonal to GameVariant: any
|
|
56116
|
+
* variant can be played at any limit (pot-limit Omaha, pot-limit Hold'em,
|
|
56117
|
+
* fixed-limit Hold'em, …). Absent on GameOptions ⇒ no-limit (current behavior).
|
|
56118
|
+
*/
|
|
56119
|
+
var BettingLimit;
|
|
56120
|
+
(function (BettingLimit) {
|
|
56121
|
+
BettingLimit["NO_LIMIT"] = "no-limit";
|
|
56122
|
+
BettingLimit["POT_LIMIT"] = "pot-limit";
|
|
56123
|
+
BettingLimit["FIXED_LIMIT"] = "fixed-limit";
|
|
56124
|
+
})(BettingLimit || (BettingLimit = {}));
|
|
56098
56125
|
var GameStatus;
|
|
56099
56126
|
(function (GameStatus) {
|
|
56100
56127
|
GameStatus["WAITING_FOR_PLAYERS"] = "waiting-for-players";
|
|
@@ -56466,6 +56493,30 @@ const parseGameVariant = (value) => {
|
|
|
56466
56493
|
return "unknown";
|
|
56467
56494
|
}
|
|
56468
56495
|
};
|
|
56496
|
+
/**
|
|
56497
|
+
* The betting structure a table plays. The engine treats an absent
|
|
56498
|
+
* `gameOptions.bettingLimit` as no-limit (poker-vm#2652), so this mirrors that
|
|
56499
|
+
* rule rather than inventing a default (block52/pokerchain#407).
|
|
56500
|
+
*
|
|
56501
|
+
* @param options - the table's gameOptions (or anything carrying bettingLimit)
|
|
56502
|
+
* @returns the table's BettingLimit
|
|
56503
|
+
*/
|
|
56504
|
+
const getBettingLimit = (options) => {
|
|
56505
|
+
return options?.bettingLimit ?? BettingLimit.NO_LIMIT;
|
|
56506
|
+
};
|
|
56507
|
+
/**
|
|
56508
|
+
* Check whether a table is pot-limit (its max bet or raise is the pot cap).
|
|
56509
|
+
*/
|
|
56510
|
+
const isPotLimit = (options) => {
|
|
56511
|
+
return getBettingLimit(options) === BettingLimit.POT_LIMIT;
|
|
56512
|
+
};
|
|
56513
|
+
/**
|
|
56514
|
+
* How many hole cards a variant deals each player: 4 for Omaha, 2 for Texas
|
|
56515
|
+
* Hold'em. Mirrors the engine's HoleCardsPerPlayer (poker-vm#2650).
|
|
56516
|
+
*/
|
|
56517
|
+
const holeCardsPerPlayer = (variant) => {
|
|
56518
|
+
return variant === GameVariant.OMAHA ? 4 : 2;
|
|
56519
|
+
};
|
|
56469
56520
|
|
|
56470
56521
|
/**
|
|
56471
56522
|
* Check if a specific action is available in the legal actions list.
|
|
@@ -71023,9 +71074,14 @@ class SigningCosmosClient extends CosmosClient {
|
|
|
71023
71074
|
return this.sendTokens(fromAddress, toAddress, amount, undefined, memo);
|
|
71024
71075
|
}
|
|
71025
71076
|
/**
|
|
71026
|
-
* Create a new poker game
|
|
71077
|
+
* Create a new poker game.
|
|
71078
|
+
*
|
|
71079
|
+
* `bettingLimit` is the table's betting structure (block52/pokerchain#407).
|
|
71080
|
+
* Omit it for the variant's default: pot-limit for omaha (PLO), no-limit for
|
|
71081
|
+
* texas-holdem. Omitted, the field is not encoded at all, so a chain without
|
|
71082
|
+
* it accepts the tx unchanged. Fixed-limit is not playable yet (poker-vm#2654).
|
|
71027
71083
|
*/
|
|
71028
|
-
async createGame(gameFormat, gameVariant, minPlayers, maxPlayers, minBuyInB52USDC, maxBuyInB52USDC, smallBlindB52USDC, bigBlindB52USDC, timeout, rakeConfig, sngConfig, name) {
|
|
71084
|
+
async createGame(gameFormat, gameVariant, minPlayers, maxPlayers, minBuyInB52USDC, maxBuyInB52USDC, smallBlindB52USDC, bigBlindB52USDC, timeout, rakeConfig, sngConfig, name, bettingLimit) {
|
|
71029
71085
|
// Validate SNG/Tournament config BEFORE any network work — fail fast.
|
|
71030
71086
|
// SNG/Tournament games are DEFINED by startingStack + blindLevelDuration.
|
|
71031
71087
|
// Refuse to create one with missing/zero values rather than silently
|
|
@@ -71045,6 +71101,7 @@ class SigningCosmosClient extends CosmosClient {
|
|
|
71045
71101
|
throw new Error(`${gameFormat} games require a positive blindLevelDuration; got ${sngConfig.blindLevelDuration}.`);
|
|
71046
71102
|
}
|
|
71047
71103
|
}
|
|
71104
|
+
assertCreatableBettingLimit(bettingLimit);
|
|
71048
71105
|
await this.initializeSigningClient();
|
|
71049
71106
|
if (!this.signingClient || !this.wallet) {
|
|
71050
71107
|
throw new Error("Signing client not initialized");
|
|
@@ -71077,6 +71134,9 @@ class SigningCosmosClient extends CosmosClient {
|
|
|
71077
71134
|
// Optional ENS-style table name (block52/pokerchain#337). Empty = unnamed
|
|
71078
71135
|
// (no fee); a non-empty name costs $0.10/char and must be globally unique.
|
|
71079
71136
|
name: name ?? "",
|
|
71137
|
+
// Betting structure (block52/pokerchain#407). "" = the variant's default
|
|
71138
|
+
// on chain, and an empty proto3 string is not encoded at all.
|
|
71139
|
+
bettingLimit: bettingLimit ?? "",
|
|
71080
71140
|
});
|
|
71081
71141
|
// Create the transaction message
|
|
71082
71142
|
const msg = {
|
|
@@ -71096,6 +71156,7 @@ class SigningCosmosClient extends CosmosClient {
|
|
|
71096
71156
|
smallBlind: smallBlindB52USDC.toString(),
|
|
71097
71157
|
bigBlind: bigBlindB52USDC.toString(),
|
|
71098
71158
|
timeout,
|
|
71159
|
+
...(bettingLimit && { bettingLimit }),
|
|
71099
71160
|
...(rakeConfig && {
|
|
71100
71161
|
rakeFreeThreshold: rakeConfig.rakeFreeThreshold.toString(),
|
|
71101
71162
|
rakePercentage: rakeConfig.rakePercentage,
|
|
@@ -71972,6 +72033,21 @@ async function createSigningClientFromMnemonic(config, mnemonic) {
|
|
|
71972
72033
|
});
|
|
71973
72034
|
return createSigningCosmosClient(config, wallet);
|
|
71974
72035
|
}
|
|
72036
|
+
/**
|
|
72037
|
+
* Throws for a betting limit a table cannot be created with (block52/pokerchain#407).
|
|
72038
|
+
* Undefined is allowed: the chain applies the variant's default.
|
|
72039
|
+
*/
|
|
72040
|
+
function assertCreatableBettingLimit(bettingLimit) {
|
|
72041
|
+
if (bettingLimit === undefined) {
|
|
72042
|
+
return;
|
|
72043
|
+
}
|
|
72044
|
+
if (bettingLimit === BettingLimit.FIXED_LIMIT) {
|
|
72045
|
+
throw new Error("Fixed-limit tables are not available yet (poker-vm#2654).");
|
|
72046
|
+
}
|
|
72047
|
+
if (bettingLimit !== BettingLimit.NO_LIMIT && bettingLimit !== BettingLimit.POT_LIMIT) {
|
|
72048
|
+
throw new Error(`Invalid betting limit: ${bettingLimit}.`);
|
|
72049
|
+
}
|
|
72050
|
+
}
|
|
71975
72051
|
|
|
71976
72052
|
// Generated by Ignite ignite.com/cli
|
|
71977
72053
|
const Client = IgniteClient.plugin([
|
|
@@ -72011,5 +72087,5 @@ const registry = new Registry([
|
|
|
72011
72087
|
...msgTypes,
|
|
72012
72088
|
]);
|
|
72013
72089
|
|
|
72014
|
-
export { AllPlayerActions, BLOCK52_HD_PATH, 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, assertExecuted, buildMsgCreateValidator, computeGameNameFee, createSigningClientFromMnemonic, createWalletFromMnemonic, decToAtomics, formatGameFormatDisplay, formatGameVariantDisplay, generateWallet, getActionByType, getAddressFromMnemonic, getDefaultCosmosConfig, getGameFormat, getGameFormatForCosmos, getGameFormatFromObject, getGameVariant, hasAction, isCashFormat, isEmptyAddress, isSitAndGoFormat, isTournamentFormat, isValidMnemonic, isValidPlayerAddress, parseGameFormat, parseGameVariant, registry, toValoperAddress, txFailureHash, txFailurePhase };
|
|
72090
|
+
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 };
|
|
72015
72091
|
//# sourceMappingURL=index.esm.js.map
|