@block52/poker-vm-sdk 1.14.0 → 1.15.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.js CHANGED
@@ -71798,7 +71798,8 @@ class SigningCosmosClient extends CosmosClient {
71798
71798
  * `bettingLimit` is the table's betting structure (block52/pokerchain#407).
71799
71799
  * Omit it for the variant's default: pot-limit for omaha (PLO), no-limit for
71800
71800
  * texas-holdem. Omitted, the field is not encoded at all, so a chain without
71801
- * it accepts the tx unchanged. Fixed-limit is not playable yet (poker-vm#2654).
71801
+ * it accepts the tx unchanged. Fixed-limit is texas-holdem only (poker-vm#2654,
71802
+ * block52/pokerchain#439).
71802
71803
  */
71803
71804
  async createGame(gameFormat, gameVariant, minPlayers, maxPlayers, minBuyInB52USDC, maxBuyInB52USDC, smallBlindB52USDC, bigBlindB52USDC, timeout, rakeConfig, sngConfig, name, bettingLimit) {
71804
71805
  // Validate SNG/Tournament config BEFORE any network work — fail fast.
@@ -71821,7 +71822,7 @@ class SigningCosmosClient extends CosmosClient {
71821
71822
  }
71822
71823
  assertCreatableSngField(minPlayers, maxPlayers, sngConfig);
71823
71824
  }
71824
- assertCreatableBettingLimit(bettingLimit);
71825
+ assertCreatableBettingLimit(bettingLimit, gameVariant);
71825
71826
  await this.initializeSigningClient();
71826
71827
  if (!this.signingClient || !this.wallet) {
71827
71828
  throw new Error("Signing client not initialized");
@@ -72764,14 +72765,18 @@ async function createSigningClientFromMnemonic(config, mnemonic) {
72764
72765
  }
72765
72766
  /**
72766
72767
  * Throws for a betting limit a table cannot be created with (block52/pokerchain#407).
72767
- * Undefined is allowed: the chain applies the variant's default.
72768
+ * Undefined is allowed: the chain applies the variant's default. Fixed-limit is
72769
+ * texas-holdem only, as the chain decides (block52/pokerchain#439, poker-vm#2654).
72768
72770
  */
72769
- function assertCreatableBettingLimit(bettingLimit) {
72771
+ function assertCreatableBettingLimit(bettingLimit, gameVariant) {
72770
72772
  if (bettingLimit === undefined) {
72771
72773
  return;
72772
72774
  }
72773
72775
  if (bettingLimit === exports.BettingLimit.FIXED_LIMIT) {
72774
- throw new Error("Fixed-limit tables are not available yet (poker-vm#2654).");
72776
+ if (gameVariant !== exports.GameVariant.TEXAS_HOLDEM) {
72777
+ throw new Error(`Betting limit fixed-limit is only available for texas-holdem; got ${gameVariant}.`);
72778
+ }
72779
+ return;
72775
72780
  }
72776
72781
  if (bettingLimit !== exports.BettingLimit.NO_LIMIT && bettingLimit !== exports.BettingLimit.POT_LIMIT) {
72777
72782
  throw new Error(`Invalid betting limit: ${bettingLimit}.`);