@block52/poker-vm-sdk 1.2.8 → 1.2.10

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
@@ -3242,7 +3242,7 @@ const MsgJoinGame = {
3242
3242
  },
3243
3243
  };
3244
3244
  function createBaseMsgLeaveGame() {
3245
- return { creator: "", gameId: "" };
3245
+ return { creator: "", gameId: "", finishingOrder: [] };
3246
3246
  }
3247
3247
  const MsgLeaveGame = {
3248
3248
  encode(message, writer = new BinaryWriter()) {
@@ -3252,6 +3252,9 @@ const MsgLeaveGame = {
3252
3252
  if (message.gameId !== "") {
3253
3253
  writer.uint32(18).string(message.gameId);
3254
3254
  }
3255
+ for (const v of message.finishingOrder) {
3256
+ writer.uint32(26).string(v);
3257
+ }
3255
3258
  return writer;
3256
3259
  },
3257
3260
  decode(input, length) {
@@ -3275,6 +3278,13 @@ const MsgLeaveGame = {
3275
3278
  message.gameId = reader.string();
3276
3279
  continue;
3277
3280
  }
3281
+ case 3: {
3282
+ if (tag !== 26) {
3283
+ break;
3284
+ }
3285
+ message.finishingOrder.push(reader.string());
3286
+ continue;
3287
+ }
3278
3288
  }
3279
3289
  if ((tag & 7) === 4 || tag === 0) {
3280
3290
  break;
@@ -3287,6 +3297,9 @@ const MsgLeaveGame = {
3287
3297
  return {
3288
3298
  creator: isSet$2b(object.creator) ? globalThis.String(object.creator) : "",
3289
3299
  gameId: isSet$2b(object.gameId) ? globalThis.String(object.gameId) : "",
3300
+ finishingOrder: globalThis.Array.isArray(object?.finishingOrder)
3301
+ ? object.finishingOrder.map((e) => globalThis.String(e))
3302
+ : [],
3290
3303
  };
3291
3304
  },
3292
3305
  toJSON(message) {
@@ -3297,6 +3310,9 @@ const MsgLeaveGame = {
3297
3310
  if (message.gameId !== "") {
3298
3311
  obj.gameId = message.gameId;
3299
3312
  }
3313
+ if (message.finishingOrder?.length) {
3314
+ obj.finishingOrder = message.finishingOrder;
3315
+ }
3300
3316
  return obj;
3301
3317
  },
3302
3318
  create(base) {
@@ -3306,6 +3322,7 @@ const MsgLeaveGame = {
3306
3322
  const message = createBaseMsgLeaveGame();
3307
3323
  message.creator = object.creator ?? "";
3308
3324
  message.gameId = object.gameId ?? "";
3325
+ message.finishingOrder = object.finishingOrder?.map((e) => e) || [];
3309
3326
  return message;
3310
3327
  },
3311
3328
  };
@@ -55930,6 +55947,11 @@ exports.PlayerActionType = void 0;
55930
55947
  })(exports.PlayerActionType || (exports.PlayerActionType = {}));
55931
55948
  exports.NonPlayerActionType = void 0;
55932
55949
  (function (NonPlayerActionType) {
55950
+ // Terminal SNG/Tournament settlement: a decided-tournament finisher claims
55951
+ // their prize-pool payout without leaving the (frozen) roster. Replaces the
55952
+ // post-start LEAVE that used to remove the seat and destabilise the terminal
55953
+ // state (#2318/#2184 root cause). (#2343)
55954
+ NonPlayerActionType["CLAIM"] = "claim";
55933
55955
  NonPlayerActionType["DEAD_SMALL_BLIND"] = "dead-small-blind";
55934
55956
  NonPlayerActionType["DEAL"] = "deal";
55935
55957
  NonPlayerActionType["FORCE_CLOSE"] = "force-close";
@@ -61253,17 +61275,26 @@ class SigningCosmosClient extends CosmosClient {
61253
61275
  return this.signMsgOnly(msg, "Join poker game (relay)", signerData);
61254
61276
  }
61255
61277
  /**
61256
- * Sign-only MsgLeaveGame (no broadcast) — the chain decides the refund
61257
- * from its own state; the message carries only {creator, gameId}. (#2325)
61278
+ * Sign-only MsgLeaveGame (no broadcast). For cash games and SNGs the chain
61279
+ * already finalized, the chain decides the refund from its own state and
61280
+ * the message carries only {creator, gameId}. (#2325)
61281
+ *
61282
+ * For an SNG that finalized off-chain (WS-first money-movers — the gateway
61283
+ * never relays the tournament-ending gameplay action, so the chain's
61284
+ * Results are empty), pass `finishingOrder`: the place-1-first list of
61285
+ * player addresses. The chain validates the ordering and recomputes the
61286
+ * payouts from its own prize-pool math — this message supplies only the
61287
+ * ORDER, never any amount. (pokerchain#229)
61258
61288
  */
61259
- async signLeaveGame(gameId, signerData) {
61289
+ async signLeaveGame(gameId, signerData, finishingOrder = []) {
61260
61290
  await this.initializeSigningClient();
61261
61291
  const [account] = await this.wallet.getAccounts();
61262
61292
  const msg = {
61263
61293
  typeUrl: "/pokerchain.poker.v1.MsgLeaveGame",
61264
61294
  value: {
61265
61295
  creator: account.address,
61266
- gameId
61296
+ gameId,
61297
+ finishingOrder
61267
61298
  }
61268
61299
  };
61269
61300
  return this.signMsgOnly(msg, "Leave poker game (relay)", signerData);