@block52/poker-vm-sdk 1.1.11 → 1.1.13

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
@@ -46394,6 +46394,11 @@ declare class SigningCosmosClient extends CosmosClient {
46394
46394
  * Leave a poker game
46395
46395
  */
46396
46396
  leaveGame(gameId: string): Promise<string>;
46397
+ /**
46398
+ * Delete a poker game
46399
+ * Only the game creator can delete a game, and the game must have no active players
46400
+ */
46401
+ deleteGame(gameId: string): Promise<string>;
46397
46402
  /**
46398
46403
  * Perform a game action (fold, call, raise, etc.)
46399
46404
  * The keeper calculates the action index automatically
package/dist/index.esm.js CHANGED
@@ -57795,6 +57795,40 @@ class SigningCosmosClient extends CosmosClient {
57795
57795
  throw error;
57796
57796
  }
57797
57797
  }
57798
+ /**
57799
+ * Delete a poker game
57800
+ * Only the game creator can delete a game, and the game must have no active players
57801
+ */
57802
+ async deleteGame(gameId) {
57803
+ await this.initializeSigningClient();
57804
+ if (!this.signingClient || !this.wallet) {
57805
+ throw new Error("Signing client not initialized");
57806
+ }
57807
+ const [account] = await this.wallet.getAccounts();
57808
+ const creator = account.address;
57809
+ // Create the message object
57810
+ const msgDeleteGame = {
57811
+ creator,
57812
+ gameId
57813
+ };
57814
+ // Create the transaction message
57815
+ const msg = {
57816
+ typeUrl: "/pokerchain.poker.v1.MsgDeleteGame",
57817
+ value: msgDeleteGame
57818
+ };
57819
+ const fee = gaslessFee();
57820
+ const memo = "Delete poker game via SDK";
57821
+ console.log("🗑️ Deleting game:", { gameId });
57822
+ try {
57823
+ const result = await this.signingClient.signAndBroadcast(creator, [msg], fee, memo);
57824
+ console.log("✅ Delete game transaction successful:", result.transactionHash);
57825
+ return result.transactionHash;
57826
+ }
57827
+ catch (error) {
57828
+ console.error("❌ Delete game failed:", error);
57829
+ throw error;
57830
+ }
57831
+ }
57798
57832
  /**
57799
57833
  * Perform a game action (fold, call, raise, etc.)
57800
57834
  * The keeper calculates the action index automatically