@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.d.ts +20 -3
- package/dist/index.esm.js +36 -5
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +36 -5
- package/dist/index.js.map +1 -1
- package/dist/pokerchain.poker.v1/types/pokerchain/poker/v1/tx.d.ts +7 -0
- package/dist/pokerchain.poker.v1/types/pokerchain/poker/v1/tx.d.ts.map +1 -1
- package/dist/signingClient.d.ts +11 -3
- package/dist/signingClient.d.ts.map +1 -1
- package/dist/types/game.d.ts +2 -0
- package/dist/types/game.d.ts.map +1 -1
- package/package.json +1 -1
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. */
|
|
@@ -45211,6 +45218,7 @@ declare enum PlayerActionType {
|
|
|
45211
45218
|
SHOW = "show"
|
|
45212
45219
|
}
|
|
45213
45220
|
declare enum NonPlayerActionType {
|
|
45221
|
+
CLAIM = "claim",
|
|
45214
45222
|
DEAD_SMALL_BLIND = "dead-small-blind",
|
|
45215
45223
|
DEAL = "deal",
|
|
45216
45224
|
FORCE_CLOSE = "force-close",
|
|
@@ -45223,6 +45231,7 @@ declare enum NonPlayerActionType {
|
|
|
45223
45231
|
TOP_UP = "top-up"
|
|
45224
45232
|
}
|
|
45225
45233
|
declare const AllPlayerActions: {
|
|
45234
|
+
CLAIM: NonPlayerActionType.CLAIM;
|
|
45226
45235
|
DEAD_SMALL_BLIND: NonPlayerActionType.DEAD_SMALL_BLIND;
|
|
45227
45236
|
DEAL: NonPlayerActionType.DEAL;
|
|
45228
45237
|
FORCE_CLOSE: NonPlayerActionType.FORCE_CLOSE;
|
|
@@ -46513,10 +46522,18 @@ declare class SigningCosmosClient extends CosmosClient {
|
|
|
46513
46522
|
accountNumber: number;
|
|
46514
46523
|
}>;
|
|
46515
46524
|
/**
|
|
46516
|
-
* Sign-only MsgLeaveGame (no broadcast)
|
|
46517
|
-
*
|
|
46525
|
+
* Sign-only MsgLeaveGame (no broadcast). For cash games and SNGs the chain
|
|
46526
|
+
* already finalized, the chain decides the refund from its own state and
|
|
46527
|
+
* the message carries only {creator, gameId}. (#2325)
|
|
46528
|
+
*
|
|
46529
|
+
* For an SNG that finalized off-chain (WS-first money-movers — the gateway
|
|
46530
|
+
* never relays the tournament-ending gameplay action, so the chain's
|
|
46531
|
+
* Results are empty), pass `finishingOrder`: the place-1-first list of
|
|
46532
|
+
* player addresses. The chain validates the ordering and recomputes the
|
|
46533
|
+
* payouts from its own prize-pool math — this message supplies only the
|
|
46534
|
+
* ORDER, never any amount. (pokerchain#229)
|
|
46518
46535
|
*/
|
|
46519
|
-
signLeaveGame(gameId: string, signerData?: SignerData): Promise<{
|
|
46536
|
+
signLeaveGame(gameId: string, signerData?: SignerData, finishingOrder?: string[]): Promise<{
|
|
46520
46537
|
base64: string;
|
|
46521
46538
|
sequence: number;
|
|
46522
46539
|
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
|
};
|
|
@@ -55928,6 +55945,11 @@ var PlayerActionType;
|
|
|
55928
55945
|
})(PlayerActionType || (PlayerActionType = {}));
|
|
55929
55946
|
var NonPlayerActionType;
|
|
55930
55947
|
(function (NonPlayerActionType) {
|
|
55948
|
+
// Terminal SNG/Tournament settlement: a decided-tournament finisher claims
|
|
55949
|
+
// their prize-pool payout without leaving the (frozen) roster. Replaces the
|
|
55950
|
+
// post-start LEAVE that used to remove the seat and destabilise the terminal
|
|
55951
|
+
// state (#2318/#2184 root cause). (#2343)
|
|
55952
|
+
NonPlayerActionType["CLAIM"] = "claim";
|
|
55931
55953
|
NonPlayerActionType["DEAD_SMALL_BLIND"] = "dead-small-blind";
|
|
55932
55954
|
NonPlayerActionType["DEAL"] = "deal";
|
|
55933
55955
|
NonPlayerActionType["FORCE_CLOSE"] = "force-close";
|
|
@@ -61251,17 +61273,26 @@ class SigningCosmosClient extends CosmosClient {
|
|
|
61251
61273
|
return this.signMsgOnly(msg, "Join poker game (relay)", signerData);
|
|
61252
61274
|
}
|
|
61253
61275
|
/**
|
|
61254
|
-
* Sign-only MsgLeaveGame (no broadcast)
|
|
61255
|
-
*
|
|
61276
|
+
* Sign-only MsgLeaveGame (no broadcast). For cash games and SNGs the chain
|
|
61277
|
+
* already finalized, the chain decides the refund from its own state and
|
|
61278
|
+
* the message carries only {creator, gameId}. (#2325)
|
|
61279
|
+
*
|
|
61280
|
+
* For an SNG that finalized off-chain (WS-first money-movers — the gateway
|
|
61281
|
+
* never relays the tournament-ending gameplay action, so the chain's
|
|
61282
|
+
* Results are empty), pass `finishingOrder`: the place-1-first list of
|
|
61283
|
+
* player addresses. The chain validates the ordering and recomputes the
|
|
61284
|
+
* payouts from its own prize-pool math — this message supplies only the
|
|
61285
|
+
* ORDER, never any amount. (pokerchain#229)
|
|
61256
61286
|
*/
|
|
61257
|
-
async signLeaveGame(gameId, signerData) {
|
|
61287
|
+
async signLeaveGame(gameId, signerData, finishingOrder = []) {
|
|
61258
61288
|
await this.initializeSigningClient();
|
|
61259
61289
|
const [account] = await this.wallet.getAccounts();
|
|
61260
61290
|
const msg = {
|
|
61261
61291
|
typeUrl: "/pokerchain.poker.v1.MsgLeaveGame",
|
|
61262
61292
|
value: {
|
|
61263
61293
|
creator: account.address,
|
|
61264
|
-
gameId
|
|
61294
|
+
gameId,
|
|
61295
|
+
finishingOrder
|
|
61265
61296
|
}
|
|
61266
61297
|
};
|
|
61267
61298
|
return this.signMsgOnly(msg, "Leave poker game (relay)", signerData);
|