@block52/poker-vm-sdk 1.2.8 → 1.2.9

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
@@ -44938,6 +44938,13 @@ declare const MsgJoinGame: MessageFns<MsgJoinGame>;
44938
44938
  interface MsgLeaveGame {
44939
44939
  creator: string;
44940
44940
  gameId: string;
44941
+ /**
44942
+ * finishing_order: place-1-first player addresses for an SNG that finalized
44943
+ * off-chain (WS-first money-movers, poker-vm#2325). Empty for cash games and
44944
+ * for SNGs the chain already finalized. The chain validates this ordering
44945
+ * and recomputes payouts with its own prize-pool math. (pokerchain#229)
44946
+ */
44947
+ finishingOrder: string[];
44941
44948
  }
44942
44949
  declare const MsgLeaveGame: MessageFns<MsgLeaveGame>;
44943
44950
  /** MsgDealCards defines the MsgDealCards message. */
@@ -46513,10 +46520,18 @@ declare class SigningCosmosClient extends CosmosClient {
46513
46520
  accountNumber: number;
46514
46521
  }>;
46515
46522
  /**
46516
- * Sign-only MsgLeaveGame (no broadcast) the chain decides the refund
46517
- * from its own state; the message carries only {creator, gameId}. (#2325)
46523
+ * Sign-only MsgLeaveGame (no broadcast). For cash games and SNGs the chain
46524
+ * already finalized, the chain decides the refund from its own state and
46525
+ * the message carries only {creator, gameId}. (#2325)
46526
+ *
46527
+ * For an SNG that finalized off-chain (WS-first money-movers — the gateway
46528
+ * never relays the tournament-ending gameplay action, so the chain's
46529
+ * Results are empty), pass `finishingOrder`: the place-1-first list of
46530
+ * player addresses. The chain validates the ordering and recomputes the
46531
+ * payouts from its own prize-pool math — this message supplies only the
46532
+ * ORDER, never any amount. (pokerchain#229)
46518
46533
  */
46519
- signLeaveGame(gameId: string, signerData?: SignerData): Promise<{
46534
+ signLeaveGame(gameId: string, signerData?: SignerData, finishingOrder?: string[]): Promise<{
46520
46535
  base64: string;
46521
46536
  sequence: number;
46522
46537
  accountNumber: number;
package/dist/index.esm.js CHANGED
@@ -3240,7 +3240,7 @@ const MsgJoinGame = {
3240
3240
  },
3241
3241
  };
3242
3242
  function createBaseMsgLeaveGame() {
3243
- return { creator: "", gameId: "" };
3243
+ return { creator: "", gameId: "", finishingOrder: [] };
3244
3244
  }
3245
3245
  const MsgLeaveGame = {
3246
3246
  encode(message, writer = new BinaryWriter()) {
@@ -3250,6 +3250,9 @@ const MsgLeaveGame = {
3250
3250
  if (message.gameId !== "") {
3251
3251
  writer.uint32(18).string(message.gameId);
3252
3252
  }
3253
+ for (const v of message.finishingOrder) {
3254
+ writer.uint32(26).string(v);
3255
+ }
3253
3256
  return writer;
3254
3257
  },
3255
3258
  decode(input, length) {
@@ -3273,6 +3276,13 @@ const MsgLeaveGame = {
3273
3276
  message.gameId = reader.string();
3274
3277
  continue;
3275
3278
  }
3279
+ case 3: {
3280
+ if (tag !== 26) {
3281
+ break;
3282
+ }
3283
+ message.finishingOrder.push(reader.string());
3284
+ continue;
3285
+ }
3276
3286
  }
3277
3287
  if ((tag & 7) === 4 || tag === 0) {
3278
3288
  break;
@@ -3285,6 +3295,9 @@ const MsgLeaveGame = {
3285
3295
  return {
3286
3296
  creator: isSet$2b(object.creator) ? globalThis.String(object.creator) : "",
3287
3297
  gameId: isSet$2b(object.gameId) ? globalThis.String(object.gameId) : "",
3298
+ finishingOrder: globalThis.Array.isArray(object?.finishingOrder)
3299
+ ? object.finishingOrder.map((e) => globalThis.String(e))
3300
+ : [],
3288
3301
  };
3289
3302
  },
3290
3303
  toJSON(message) {
@@ -3295,6 +3308,9 @@ const MsgLeaveGame = {
3295
3308
  if (message.gameId !== "") {
3296
3309
  obj.gameId = message.gameId;
3297
3310
  }
3311
+ if (message.finishingOrder?.length) {
3312
+ obj.finishingOrder = message.finishingOrder;
3313
+ }
3298
3314
  return obj;
3299
3315
  },
3300
3316
  create(base) {
@@ -3304,6 +3320,7 @@ const MsgLeaveGame = {
3304
3320
  const message = createBaseMsgLeaveGame();
3305
3321
  message.creator = object.creator ?? "";
3306
3322
  message.gameId = object.gameId ?? "";
3323
+ message.finishingOrder = object.finishingOrder?.map((e) => e) || [];
3307
3324
  return message;
3308
3325
  },
3309
3326
  };
@@ -61251,17 +61268,26 @@ class SigningCosmosClient extends CosmosClient {
61251
61268
  return this.signMsgOnly(msg, "Join poker game (relay)", signerData);
61252
61269
  }
61253
61270
  /**
61254
- * Sign-only MsgLeaveGame (no broadcast) the chain decides the refund
61255
- * from its own state; the message carries only {creator, gameId}. (#2325)
61271
+ * Sign-only MsgLeaveGame (no broadcast). For cash games and SNGs the chain
61272
+ * already finalized, the chain decides the refund from its own state and
61273
+ * the message carries only {creator, gameId}. (#2325)
61274
+ *
61275
+ * For an SNG that finalized off-chain (WS-first money-movers — the gateway
61276
+ * never relays the tournament-ending gameplay action, so the chain's
61277
+ * Results are empty), pass `finishingOrder`: the place-1-first list of
61278
+ * player addresses. The chain validates the ordering and recomputes the
61279
+ * payouts from its own prize-pool math — this message supplies only the
61280
+ * ORDER, never any amount. (pokerchain#229)
61256
61281
  */
61257
- async signLeaveGame(gameId, signerData) {
61282
+ async signLeaveGame(gameId, signerData, finishingOrder = []) {
61258
61283
  await this.initializeSigningClient();
61259
61284
  const [account] = await this.wallet.getAccounts();
61260
61285
  const msg = {
61261
61286
  typeUrl: "/pokerchain.poker.v1.MsgLeaveGame",
61262
61287
  value: {
61263
61288
  creator: account.address,
61264
- gameId
61289
+ gameId,
61290
+ finishingOrder
61265
61291
  }
61266
61292
  };
61267
61293
  return this.signMsgOnly(msg, "Leave poker game (relay)", signerData);