@block52/poker-vm-sdk 1.3.4 → 1.4.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 CHANGED
@@ -44006,6 +44006,21 @@ interface WithdrawalRequest {
44006
44006
  completedAt: Long;
44007
44007
  }
44008
44008
  declare const WithdrawalRequest: MessageFns$2<WithdrawalRequest>;
44009
+ /**
44010
+ * ValidatorBond mirrors a validator's bonded USDC from Vault.sol (Ethereum) into
44011
+ * poker-module state. Used to split the SNG protocol fee (poker-vm#2592) across
44012
+ * validators proportionally to true bonded USDC (NOT consensus power).
44013
+ * NOTE: bondedUsdc is mirrored from Vault.sol via the SyncEthereum EndBlock path,
44014
+ * so it is only as fresh as the last sync — a join between syncs splits on slightly
44015
+ * stale weights. Acceptable, as bonds change rarely.
44016
+ */
44017
+ interface ValidatorBond {
44018
+ /** Validator address (bond owner) */
44019
+ validator: string;
44020
+ /** Bonded USDC in microunits (6 decimals), mirrored from Vault.sol */
44021
+ bondedUsdc: Long;
44022
+ }
44023
+ declare const ValidatorBond: MessageFns$2<ValidatorBond>;
44009
44024
  type Builtin$2 = Date | Function | Uint8Array | string | number | boolean | undefined;
44010
44025
  type DeepPartial$2<T> = T extends Builtin$2 ? T : T extends Long ? string | number | Long : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial$2<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial$2<U>> : T extends {} ? {
44011
44026
  [K in keyof T]?: DeepPartial$2<T[K]>;
@@ -44926,6 +44941,11 @@ interface MsgCreateGame {
44926
44941
  gameVariant: string;
44927
44942
  /** SNG flat entry fee in micro-units, skimmed to the creator (poker-vm#2118) */
44928
44943
  entryFee: Long;
44944
+ /**
44945
+ * Optional ENS-style table name (field 19). Lowercase [a-z0-9-], 1-32 chars,
44946
+ * globally unique, $0.10/char to validators. Empty = unnamed. (block52/pokerchain#337)
44947
+ */
44948
+ name: string;
44929
44949
  }
44930
44950
  declare const MsgCreateGame: MessageFns<MsgCreateGame>;
44931
44951
  /** MsgJoinGame defines the MsgJoinGame message. */
@@ -45301,7 +45321,8 @@ declare enum PlayerStatus {
45301
45321
  SITTING_OUT = "sitting-out",
45302
45322
  SITTING_IN = "sitting-in",
45303
45323
  WAITING_FOR_BIG_BLIND = "waiting-for-big-blind",
45304
- SHOWING = "showing"
45324
+ SHOWING = "showing",
45325
+ MUCKED = "mucked"
45305
45326
  }
45306
45327
  type SitInMethod = "next-bb" | "post-now";
45307
45328
  declare const SIT_IN_METHOD_NEXT_BB: SitInMethod;
@@ -45344,6 +45365,7 @@ type GameOptions = {
45344
45365
  rake?: RakeConfig$1;
45345
45366
  startingStack?: bigint;
45346
45367
  entryFee?: bigint;
45368
+ protocolFeeBps?: number;
45347
45369
  blindLevelDuration?: number;
45348
45370
  blindLevel?: number;
45349
45371
  sngStartTime?: number;
@@ -45374,6 +45396,7 @@ type GameOptionsDTO = {
45374
45396
  rake?: RakeConfigDTO;
45375
45397
  startingStack?: string;
45376
45398
  entryFee?: string;
45399
+ protocolFeeBps?: number;
45377
45400
  blindLevelDuration?: number;
45378
45401
  blindLevel?: number;
45379
45402
  nextSmallBlind?: string;
@@ -45509,6 +45532,7 @@ type GameStateResponseDTO = {
45509
45532
  creator: string;
45510
45533
  format: GameFormat;
45511
45534
  variant: GameVariant;
45535
+ name?: string;
45512
45536
  gameState: TexasHoldemStateDTO;
45513
45537
  };
45514
45538
  declare enum SUIT {
@@ -45540,11 +45564,26 @@ type GameListItem = {
45540
45564
  creator: string;
45541
45565
  format: GameFormat;
45542
45566
  variant: GameVariant;
45567
+ name?: string;
45543
45568
  gameOptions: GameOptionsDTO;
45544
45569
  currentPlayers: number;
45545
45570
  createdAt?: string;
45546
45571
  updatedAt?: string;
45547
45572
  };
45573
+ /**
45574
+ * Cost of ONE character of a paid table name, in micro-USDC ($0.10). The total
45575
+ * naming fee is `length * GAME_NAME_MICRO_PER_CHAR`, charged on top of the
45576
+ * game-creation cost and paid to validators. This is the SINGLE SOURCE OF TRUTH
45577
+ * for the price so the UI preview and the chain agree. (block52/pokerchain#337)
45578
+ */
45579
+ declare const GAME_NAME_MICRO_PER_CHAR = 100000n;
45580
+ /** Maximum table-name length (code points); bounds the max fee at 32 * $0.10. */
45581
+ declare const MAX_GAME_NAME_LENGTH = 32;
45582
+ /**
45583
+ * Total naming fee (micro-USDC) for a table name: $0.10 per character. Counts
45584
+ * code points to match the chain's rune-based charge. An empty name is free.
45585
+ */
45586
+ declare const computeGameNameFee: (name: string) => bigint;
45548
45587
  type BlockID = {
45549
45588
  hash: string;
45550
45589
  part_set_header?: {
@@ -46540,7 +46579,7 @@ declare class SigningCosmosClient extends CosmosClient {
46540
46579
  /**
46541
46580
  * Create a new poker game
46542
46581
  */
46543
- createGame(gameFormat: string, gameVariant: string, minPlayers: number, maxPlayers: number, minBuyInB52USDC: bigint, maxBuyInB52USDC: bigint, smallBlindB52USDC: bigint, bigBlindB52USDC: bigint, timeout: number, rakeConfig?: RakeConfig, sngConfig?: SNGConfig): Promise<string>;
46582
+ 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>;
46544
46583
  /**
46545
46584
  * Join a poker game
46546
46585
  */
@@ -47028,5 +47067,5 @@ declare const Client: typeof IgniteClient & Constructor<{
47028
47067
  }>;
47029
47068
  declare const registry: Registry;
47030
47069
 
47031
- export { AllPlayerActions, BLOCK52_HD_PATH, Board, COSMOS_CONSTANTS, Client, CosmosClient, Deck, GameFormat, GameStatus, GameVariant, HandType, KEYS, 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, WithdrawalRequest, createSigningClientFromMnemonic, createWalletFromMnemonic, formatGameFormatDisplay, formatGameVariantDisplay, generateWallet, getActionByType, getAddressFromMnemonic, getDefaultCosmosConfig, getGameFormat, getGameFormatForCosmos, getGameFormatFromObject, getGameVariant, hasAction, isCashFormat, isEmptyAddress, isSitAndGoFormat, isTournamentFormat, isValidMnemonic, isValidPlayerAddress, parseGameFormat, parseGameVariant, registry };
47070
+ 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, 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, ValidatorBond, WithdrawalRequest, computeGameNameFee, createSigningClientFromMnemonic, createWalletFromMnemonic, formatGameFormatDisplay, formatGameVariantDisplay, generateWallet, getActionByType, getAddressFromMnemonic, getDefaultCosmosConfig, getGameFormat, getGameFormatForCosmos, getGameFormatFromObject, getGameVariant, hasAction, isCashFormat, isEmptyAddress, isSitAndGoFormat, isTournamentFormat, isValidMnemonic, isValidPlayerAddress, parseGameFormat, parseGameVariant, registry };
47032
47071
  export type { AccountDTO, ActionDTO, Block, BlockDTO, BlockHeader, BlockHeaderDTO, BlockID, BlockResponse, BurnResponseDTO, Card, EquityHand, EquityRequest, EquityResponse, EquityResult, GameListItem, GameOptions, GameOptionsDTO, GameOptionsResponse, GameStateResponse, GameStateResponseDTO, HandEvaluation, ISignedResponse, LegalActionDTO, PayoutPlaceDTO, PerformActionResponse, PlayerDTO, RPCRequest, RPCRequestParams, RPCResponse, RakeConfig, RakeConfigDTO, ResultDTO, SitInMethod, SitOutMethod, TexasHoldemGameState, TexasHoldemStateDTO, TransactionDTO, TransactionResponse, WalletInfo, WinnerDTO, WithdrawResponseDTO };
package/dist/index.esm.js CHANGED
@@ -2844,6 +2844,7 @@ function createBaseMsgCreateGame() {
2844
2844
  blindLevelDuration: 0,
2845
2845
  gameVariant: "",
2846
2846
  entryFee: Long.UZERO,
2847
+ name: "",
2847
2848
  };
2848
2849
  }
2849
2850
  const MsgCreateGame = {
@@ -2899,6 +2900,9 @@ const MsgCreateGame = {
2899
2900
  if (!message.entryFee.equals(Long.UZERO)) {
2900
2901
  writer.uint32(136).uint64(message.entryFee.toString());
2901
2902
  }
2903
+ if (message.name !== "") {
2904
+ writer.uint32(154).string(message.name);
2905
+ }
2902
2906
  return writer;
2903
2907
  },
2904
2908
  decode(input, length) {
@@ -3027,6 +3031,13 @@ const MsgCreateGame = {
3027
3031
  message.entryFee = Long.fromString(reader.uint64().toString(), true);
3028
3032
  continue;
3029
3033
  }
3034
+ case 19: {
3035
+ if (tag !== 154) {
3036
+ break;
3037
+ }
3038
+ message.name = reader.string();
3039
+ continue;
3040
+ }
3030
3041
  }
3031
3042
  if ((tag & 7) === 4 || tag === 0) {
3032
3043
  break;
@@ -3054,6 +3065,7 @@ const MsgCreateGame = {
3054
3065
  blindLevelDuration: isSet$2b(object.blindLevelDuration) ? globalThis.Number(object.blindLevelDuration) : 0,
3055
3066
  gameVariant: isSet$2b(object.gameVariant) ? globalThis.String(object.gameVariant) : "",
3056
3067
  entryFee: isSet$2b(object.entryFee) ? Long.fromValue(object.entryFee) : Long.UZERO,
3068
+ name: isSet$2b(object.name) ? globalThis.String(object.name) : "",
3057
3069
  };
3058
3070
  },
3059
3071
  toJSON(message) {
@@ -3109,6 +3121,9 @@ const MsgCreateGame = {
3109
3121
  if (!message.entryFee.equals(Long.UZERO)) {
3110
3122
  obj.entryFee = (message.entryFee || Long.UZERO).toString();
3111
3123
  }
3124
+ if (message.name !== "") {
3125
+ obj.name = message.name;
3126
+ }
3112
3127
  return obj;
3113
3128
  },
3114
3129
  create(base) {
@@ -3152,6 +3167,7 @@ const MsgCreateGame = {
3152
3167
  : Long.UZERO;
3153
3168
  message.blindLevelDuration = object.blindLevelDuration ?? 0;
3154
3169
  message.gameVariant = object.gameVariant ?? "";
3170
+ message.name = object.name ?? "";
3155
3171
  message.entryFee = (object.entryFee !== undefined && object.entryFee !== null)
3156
3172
  ? Long.fromValue(object.entryFee)
3157
3173
  : Long.UZERO;
@@ -8828,6 +8844,76 @@ const WithdrawalRequest = {
8828
8844
  return message;
8829
8845
  },
8830
8846
  };
8847
+ function createBaseValidatorBond() {
8848
+ return { validator: "", bondedUsdc: Long.UZERO };
8849
+ }
8850
+ const ValidatorBond = {
8851
+ encode(message, writer = new BinaryWriter()) {
8852
+ if (message.validator !== "") {
8853
+ writer.uint32(10).string(message.validator);
8854
+ }
8855
+ if (!message.bondedUsdc.equals(Long.UZERO)) {
8856
+ writer.uint32(16).uint64(message.bondedUsdc.toString());
8857
+ }
8858
+ return writer;
8859
+ },
8860
+ decode(input, length) {
8861
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
8862
+ const end = length === undefined ? reader.len : reader.pos + length;
8863
+ const message = createBaseValidatorBond();
8864
+ while (reader.pos < end) {
8865
+ const tag = reader.uint32();
8866
+ switch (tag >>> 3) {
8867
+ case 1: {
8868
+ if (tag !== 10) {
8869
+ break;
8870
+ }
8871
+ message.validator = reader.string();
8872
+ continue;
8873
+ }
8874
+ case 2: {
8875
+ if (tag !== 16) {
8876
+ break;
8877
+ }
8878
+ message.bondedUsdc = Long.fromString(reader.uint64().toString(), true);
8879
+ continue;
8880
+ }
8881
+ }
8882
+ if ((tag & 7) === 4 || tag === 0) {
8883
+ break;
8884
+ }
8885
+ reader.skip(tag & 7);
8886
+ }
8887
+ return message;
8888
+ },
8889
+ fromJSON(object) {
8890
+ return {
8891
+ validator: isSet$2a(object.validator) ? globalThis.String(object.validator) : "",
8892
+ bondedUsdc: isSet$2a(object.bondedUsdc) ? Long.fromValue(object.bondedUsdc) : Long.UZERO,
8893
+ };
8894
+ },
8895
+ toJSON(message) {
8896
+ const obj = {};
8897
+ if (message.validator !== "") {
8898
+ obj.validator = message.validator;
8899
+ }
8900
+ if (!message.bondedUsdc.equals(Long.UZERO)) {
8901
+ obj.bondedUsdc = (message.bondedUsdc || Long.UZERO).toString();
8902
+ }
8903
+ return obj;
8904
+ },
8905
+ create(base) {
8906
+ return ValidatorBond.fromPartial(base ?? {});
8907
+ },
8908
+ fromPartial(object) {
8909
+ const message = createBaseValidatorBond();
8910
+ message.validator = object.validator ?? "";
8911
+ message.bondedUsdc = (object.bondedUsdc !== undefined && object.bondedUsdc !== null)
8912
+ ? Long.fromValue(object.bondedUsdc)
8913
+ : Long.UZERO;
8914
+ return message;
8915
+ },
8916
+ };
8831
8917
  function bytesFromBase64$E(b64) {
8832
8918
  if (globalThis.Buffer) {
8833
8919
  return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
@@ -56122,6 +56208,12 @@ var PlayerStatus;
56122
56208
  // post the big blind via the normal ante flow. (#2139)
56123
56209
  PlayerStatus["WAITING_FOR_BIG_BLIND"] = "waiting-for-big-blind";
56124
56210
  PlayerStatus["SHOWING"] = "showing";
56211
+ // A player who declined to show a losing hand at showdown. Distinct from
56212
+ // FOLDED (folded during a betting round) so the UI/logs can tell them apart;
56213
+ // excluded from hand evaluation exactly like folded. The engine keeps the
56214
+ // internal status FOLDED and surfaces MUCKED only in the serialized DTO
56215
+ // (poker-vm#2140).
56216
+ PlayerStatus["MUCKED"] = "mucked";
56125
56217
  })(PlayerStatus || (PlayerStatus = {}));
56126
56218
  const SIT_IN_METHOD_NEXT_BB = "next-bb";
56127
56219
  const SIT_IN_METHOD_POST_NOW = "post-now";
@@ -56144,6 +56236,20 @@ var SUIT;
56144
56236
  SUIT[SUIT["HEARTS"] = 3] = "HEARTS";
56145
56237
  SUIT[SUIT["SPADES"] = 4] = "SPADES";
56146
56238
  })(SUIT || (SUIT = {}));
56239
+ /**
56240
+ * Cost of ONE character of a paid table name, in micro-USDC ($0.10). The total
56241
+ * naming fee is `length * GAME_NAME_MICRO_PER_CHAR`, charged on top of the
56242
+ * game-creation cost and paid to validators. This is the SINGLE SOURCE OF TRUTH
56243
+ * for the price so the UI preview and the chain agree. (block52/pokerchain#337)
56244
+ */
56245
+ const GAME_NAME_MICRO_PER_CHAR = 100000n;
56246
+ /** Maximum table-name length (code points); bounds the max fee at 32 * $0.10. */
56247
+ const MAX_GAME_NAME_LENGTH = 32;
56248
+ /**
56249
+ * Total naming fee (micro-USDC) for a table name: $0.10 per character. Counts
56250
+ * code points to match the chain's rune-based charge. An empty name is free.
56251
+ */
56252
+ const computeGameNameFee = (name) => BigInt([...name].length) * GAME_NAME_MICRO_PER_CHAR;
56147
56253
  // Constants for URL parameters
56148
56254
  const KEYS = {
56149
56255
  ACTION_TYPE: "action_type",
@@ -61149,7 +61255,7 @@ class SigningCosmosClient extends CosmosClient {
61149
61255
  /**
61150
61256
  * Create a new poker game
61151
61257
  */
61152
- async createGame(gameFormat, gameVariant, minPlayers, maxPlayers, minBuyInB52USDC, maxBuyInB52USDC, smallBlindB52USDC, bigBlindB52USDC, timeout, rakeConfig, sngConfig) {
61258
+ async createGame(gameFormat, gameVariant, minPlayers, maxPlayers, minBuyInB52USDC, maxBuyInB52USDC, smallBlindB52USDC, bigBlindB52USDC, timeout, rakeConfig, sngConfig, name) {
61153
61259
  // Validate SNG/Tournament config BEFORE any network work — fail fast.
61154
61260
  // SNG/Tournament games are DEFINED by startingStack + blindLevelDuration.
61155
61261
  // Refuse to create one with missing/zero values rather than silently
@@ -61198,6 +61304,9 @@ class SigningCosmosClient extends CosmosClient {
61198
61304
  blindLevelDuration: sngConfig?.blindLevelDuration ?? 0,
61199
61305
  // SNG flat entry fee (micro-units), skimmed to the creator at join time (poker-vm#2118)
61200
61306
  entryFee: sngConfig?.entryFee ? Long.fromString(sngConfig.entryFee.toString(), true) : Long.UZERO,
61307
+ // Optional ENS-style table name (block52/pokerchain#337). Empty = unnamed
61308
+ // (no fee); a non-empty name costs $0.10/char and must be globally unique.
61309
+ name: name ?? "",
61201
61310
  });
61202
61311
  // Create the transaction message
61203
61312
  const msg = {
@@ -62133,5 +62242,5 @@ const registry = new Registry([
62133
62242
  ...msgTypes,
62134
62243
  ]);
62135
62244
 
62136
- export { AllPlayerActions, BLOCK52_HD_PATH, Board, COSMOS_CONSTANTS, Client, CosmosClient, Deck, GameFormat, GameStatus, GameVariant, HandType, KEYS, 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, WithdrawalRequest, createSigningClientFromMnemonic, createWalletFromMnemonic, formatGameFormatDisplay, formatGameVariantDisplay, generateWallet, getActionByType, getAddressFromMnemonic, getDefaultCosmosConfig, getGameFormat, getGameFormatForCosmos, getGameFormatFromObject, getGameVariant, hasAction, isCashFormat, isEmptyAddress, isSitAndGoFormat, isTournamentFormat, isValidMnemonic, isValidPlayerAddress, parseGameFormat, parseGameVariant, registry };
62245
+ 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, 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, ValidatorBond, WithdrawalRequest, computeGameNameFee, createSigningClientFromMnemonic, createWalletFromMnemonic, formatGameFormatDisplay, formatGameVariantDisplay, generateWallet, getActionByType, getAddressFromMnemonic, getDefaultCosmosConfig, getGameFormat, getGameFormatForCosmos, getGameFormatFromObject, getGameVariant, hasAction, isCashFormat, isEmptyAddress, isSitAndGoFormat, isTournamentFormat, isValidMnemonic, isValidPlayerAddress, parseGameFormat, parseGameVariant, registry };
62137
62246
  //# sourceMappingURL=index.esm.js.map