@block52/poker-vm-sdk 1.2.13 → 1.2.16
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 +13 -2
- package/dist/index.esm.js +18 -4
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +18 -4
- package/dist/index.js.map +1 -1
- package/dist/signingClient.d.ts +9 -2
- package/dist/signingClient.d.ts.map +1 -1
- package/dist/types/game.d.ts +4 -0
- package/dist/types/game.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -61055,19 +61055,33 @@ class SigningCosmosClient extends CosmosClient {
|
|
|
61055
61055
|
}
|
|
61056
61056
|
}
|
|
61057
61057
|
/**
|
|
61058
|
-
* Leave a poker game
|
|
61058
|
+
* Leave a poker game (signs AND broadcasts MsgLeaveGame directly).
|
|
61059
|
+
*
|
|
61060
|
+
* @param gameId the game to leave / claim from.
|
|
61061
|
+
* @param finishingOrder place-1-first player addresses for an SNG that
|
|
61062
|
+
* finalized off-chain (WS-first) — lets the chain recompute payouts when
|
|
61063
|
+
* its Results are empty. Defaults to `[]` (cash games / already-finalized
|
|
61064
|
+
* SNGs, where the chain settles from its own state). Broadcast counterpart
|
|
61065
|
+
* of {@link signLeaveGame}.
|
|
61059
61066
|
*/
|
|
61060
|
-
async leaveGame(gameId) {
|
|
61067
|
+
async leaveGame(gameId, finishingOrder = []) {
|
|
61061
61068
|
await this.initializeSigningClient();
|
|
61062
61069
|
if (!this.signingClient || !this.wallet) {
|
|
61063
61070
|
throw new Error("Signing client not initialized");
|
|
61064
61071
|
}
|
|
61065
61072
|
const [account] = await this.wallet.getAccounts();
|
|
61066
61073
|
const creator = account.address;
|
|
61067
|
-
// Create the message object
|
|
61074
|
+
// Create the message object.
|
|
61075
|
+
//
|
|
61076
|
+
// finishingOrder (place-1-first player addresses) is for an SNG that
|
|
61077
|
+
// finalized off-chain (WS-first): the chain's Results may be empty, so
|
|
61078
|
+
// the message supplies the ORDER and the chain recomputes payouts from
|
|
61079
|
+
// its own prize-pool math — never an amount. Empty for cash games and
|
|
61080
|
+
// for SNGs the chain already finalized. Mirrors signLeaveGame. (pokerchain#229)
|
|
61068
61081
|
const msgLeaveGame = {
|
|
61069
61082
|
creator,
|
|
61070
|
-
gameId
|
|
61083
|
+
gameId,
|
|
61084
|
+
finishingOrder
|
|
61071
61085
|
};
|
|
61072
61086
|
// Create the transaction message
|
|
61073
61087
|
const msg = {
|