@block52/poker-vm-sdk 1.1.10 → 1.1.11

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
@@ -57964,6 +57964,42 @@ class SigningCosmosClient extends CosmosClient {
57964
57964
  throw error;
57965
57965
  }
57966
57966
  }
57967
+ /**
57968
+ * Sign a pending withdrawal request (validator/relayer operation)
57969
+ * Generates an ECDSA signature compatible with the Base chain CosmosBridge contract
57970
+ */
57971
+ async signWithdrawal(nonce, validatorEthKeyHex) {
57972
+ await this.initializeSigningClient();
57973
+ if (!this.signingClient || !this.wallet) {
57974
+ throw new Error("Signing client not initialized");
57975
+ }
57976
+ const [account] = await this.wallet.getAccounts();
57977
+ const signer = account.address;
57978
+ const msgSignWithdrawal = {
57979
+ signer,
57980
+ nonce,
57981
+ validatorEthKeyHex
57982
+ };
57983
+ const msg = {
57984
+ typeUrl: "/pokerchain.poker.v1.MsgSignWithdrawal",
57985
+ value: msgSignWithdrawal
57986
+ };
57987
+ const fee = gaslessFee();
57988
+ const memo = "Sign pending withdrawal request";
57989
+ console.log("🔏 Signing withdrawal:", {
57990
+ signer,
57991
+ nonce
57992
+ });
57993
+ try {
57994
+ const result = await this.signingClient.signAndBroadcast(signer, [msg], fee, memo);
57995
+ console.log("✅ Withdrawal signing successful:", result.transactionHash);
57996
+ return result.transactionHash;
57997
+ }
57998
+ catch (error) {
57999
+ console.error("❌ Withdrawal signing failed:", error);
58000
+ throw error;
58001
+ }
58002
+ }
57967
58003
  /**
57968
58004
  * Query a specific withdrawal request by nonce
57969
58005
  */