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