@block52/poker-vm-sdk 1.1.9 → 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/IClient.d.ts CHANGED
@@ -25,6 +25,7 @@ export interface IClient {
25
25
  joinGame(gameId: string, seat: number, buyInAmount: bigint): Promise<string>;
26
26
  createGame(gameFormat: string, gameVariant: string, minPlayers: number, maxPlayers: number, minBuyInB52USDC: bigint, maxBuyInB52USDC: bigint, smallBlindB52USDC: bigint, bigBlindB52USDC: bigint, timeout: number): Promise<string>;
27
27
  initiateWithdrawal(baseAddress: string, amount: bigint): Promise<string>;
28
+ signWithdrawal(nonce: string, validatorEthKeyHex: string): Promise<string>;
28
29
  listWithdrawalRequests(cosmosAddress?: string): Promise<any[]>;
29
30
  disconnect(): Promise<void>;
30
31
  }
@@ -1 +1 @@
1
- {"version":3,"file":"IClient.d.ts","sourceRoot":"","sources":["../src/IClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,mBAAmB,EAAE,YAAY,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAExH,MAAM,WAAW,OAAO;IACpB,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;IAC1C,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;IAChD,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC7D,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAC7B,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;IACpC,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;IACjD,cAAc,IAAI,OAAO,CAAC,aAAa,CAAC,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AAE,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACnG,WAAW,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACpG,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAChF,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC7E,UAAU,CACN,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,EAClB,eAAe,EAAE,MAAM,EACvB,eAAe,EAAE,MAAM,EACvB,iBAAiB,EAAE,MAAM,EACzB,eAAe,EAAE,MAAM,EACvB,OAAO,EAAE,MAAM,GAChB,OAAO,CAAC,MAAM,CAAC,CAAC;IACnB,kBAAkB,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACzE,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC3E,sBAAsB,CAAC,aAAa,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;IAC/D,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC/B"}
package/dist/index.d.ts CHANGED
@@ -45272,6 +45272,9 @@ declare enum PlayerStatus {
45272
45272
  SITTING_IN = "sitting-in",
45273
45273
  SHOWING = "showing"
45274
45274
  }
45275
+ type SitInMethod = "next-bb" | "post-now";
45276
+ declare const SIT_IN_METHOD_NEXT_BB: SitInMethod;
45277
+ declare const SIT_IN_METHOD_POST_NOW: SitInMethod;
45275
45278
  declare enum TexasHoldemRound {
45276
45279
  ANTE = "ante",
45277
45280
  PREFLOP = "preflop",
@@ -45377,7 +45380,7 @@ type PlayerDTO = {
45377
45380
  legalActions: LegalActionDTO[];
45378
45381
  sumOfBets: string;
45379
45382
  timeout: number;
45380
- sitInMethod?: string;
45383
+ sitInMethod?: SitInMethod;
45381
45384
  pendingSitOut?: string;
45382
45385
  signature: string;
45383
45386
  };
@@ -46208,6 +46211,7 @@ interface IClient {
46208
46211
  joinGame(gameId: string, seat: number, buyInAmount: bigint): Promise<string>;
46209
46212
  createGame(gameFormat: string, gameVariant: string, minPlayers: number, maxPlayers: number, minBuyInB52USDC: bigint, maxBuyInB52USDC: bigint, smallBlindB52USDC: bigint, bigBlindB52USDC: bigint, timeout: number): Promise<string>;
46210
46213
  initiateWithdrawal(baseAddress: string, amount: bigint): Promise<string>;
46214
+ signWithdrawal(nonce: string, validatorEthKeyHex: string): Promise<string>;
46211
46215
  listWithdrawalRequests(cosmosAddress?: string): Promise<any[]>;
46212
46216
  disconnect(): Promise<void>;
46213
46217
  }
@@ -46419,6 +46423,11 @@ declare class SigningCosmosClient extends CosmosClient {
46419
46423
  * Burns USDC on Cosmos and creates a withdrawal request that can be completed on Base
46420
46424
  */
46421
46425
  initiateWithdrawal(baseAddress: string, amount: bigint): Promise<string>;
46426
+ /**
46427
+ * Sign a pending withdrawal request (validator/relayer operation)
46428
+ * Generates an ECDSA signature compatible with the Base chain CosmosBridge contract
46429
+ */
46430
+ signWithdrawal(nonce: string, validatorEthKeyHex: string): Promise<string>;
46422
46431
  /**
46423
46432
  * Query a specific withdrawal request by nonce
46424
46433
  */
@@ -46709,5 +46718,5 @@ declare const Client: typeof IgniteClient & Constructor<{
46709
46718
  }>;
46710
46719
  declare const registry: Registry;
46711
46720
 
46712
- export { AllPlayerActions, BLOCK52_HD_PATH, COSMOS_CONSTANTS, Client, CosmosClient, Deck, GameFormat, GameStatus, GameVariant, HandType, KEYS, MissingWalletError, NonPlayerActionType, Params, PlayerActionType, PlayerStatus, PokerGameIntegration, PokerSolver, RPCMethods, SIT_OUT_METHOD_NEXT_BB, SIT_OUT_METHOD_NEXT_HAND, SUIT, SigningCosmosClient, TexasHoldemRound, WithdrawalRequest, createSigningClientFromMnemonic, createWalletFromMnemonic, formatGameFormatDisplay, formatGameVariantDisplay, generateWallet, getActionByType, getAddressFromMnemonic, getDefaultCosmosConfig, getGameFormat, getGameFormatForCosmos, getGameFormatFromObject, getGameVariant, hasAction, isCashFormat, isEmptyAddress, isSitAndGoFormat, isTournamentFormat, isValidMnemonic, isValidPlayerAddress, parseGameFormat, parseGameVariant, registry };
46713
- export type { AccountDTO, ActionDTO, Block, BlockDTO, BlockHeader, BlockHeaderDTO, BlockID, BlockResponse, BurnResponseDTO, Card, EquityHand, EquityRequest, EquityResponse, EquityResult, GameListItem, GameOptions, GameOptionsDTO, GameOptionsResponse, GameStateResponse, GameStateResponseDTO, HandEvaluation, ISignedResponse, LegalActionDTO, PerformActionResponse, PlayerDTO, RPCRequest, RPCRequestParams, RPCResponse, RakeConfig, RakeConfigDTO, ResultDTO, SitOutMethod, TexasHoldemGameState, TexasHoldemStateDTO, TransactionDTO, TransactionResponse, WalletInfo, WinnerDTO, WithdrawResponseDTO };
46721
+ export { AllPlayerActions, BLOCK52_HD_PATH, COSMOS_CONSTANTS, Client, CosmosClient, Deck, GameFormat, GameStatus, GameVariant, HandType, KEYS, MissingWalletError, NonPlayerActionType, Params, PlayerActionType, PlayerStatus, PokerGameIntegration, PokerSolver, RPCMethods, SIT_IN_METHOD_NEXT_BB, SIT_IN_METHOD_POST_NOW, SIT_OUT_METHOD_NEXT_BB, SIT_OUT_METHOD_NEXT_HAND, SUIT, SigningCosmosClient, TexasHoldemRound, WithdrawalRequest, createSigningClientFromMnemonic, createWalletFromMnemonic, formatGameFormatDisplay, formatGameVariantDisplay, generateWallet, getActionByType, getAddressFromMnemonic, getDefaultCosmosConfig, getGameFormat, getGameFormatForCosmos, getGameFormatFromObject, getGameVariant, hasAction, isCashFormat, isEmptyAddress, isSitAndGoFormat, isTournamentFormat, isValidMnemonic, isValidPlayerAddress, parseGameFormat, parseGameVariant, registry };
46722
+ export type { AccountDTO, ActionDTO, Block, BlockDTO, BlockHeader, BlockHeaderDTO, BlockID, BlockResponse, BurnResponseDTO, Card, EquityHand, EquityRequest, EquityResponse, EquityResult, GameListItem, GameOptions, GameOptionsDTO, GameOptionsResponse, GameStateResponse, GameStateResponseDTO, HandEvaluation, ISignedResponse, LegalActionDTO, PerformActionResponse, PlayerDTO, RPCRequest, RPCRequestParams, RPCResponse, RakeConfig, RakeConfigDTO, ResultDTO, SitInMethod, SitOutMethod, TexasHoldemGameState, TexasHoldemStateDTO, TransactionDTO, TransactionResponse, WalletInfo, WinnerDTO, WithdrawResponseDTO };
package/dist/index.esm.js CHANGED
@@ -55789,6 +55789,8 @@ var PlayerStatus;
55789
55789
  PlayerStatus["SITTING_IN"] = "sitting-in";
55790
55790
  PlayerStatus["SHOWING"] = "showing";
55791
55791
  })(PlayerStatus || (PlayerStatus = {}));
55792
+ const SIT_IN_METHOD_NEXT_BB = "next-bb";
55793
+ const SIT_IN_METHOD_POST_NOW = "post-now";
55792
55794
  var TexasHoldemRound;
55793
55795
  (function (TexasHoldemRound) {
55794
55796
  TexasHoldemRound["ANTE"] = "ante";
@@ -57960,6 +57962,42 @@ class SigningCosmosClient extends CosmosClient {
57960
57962
  throw error;
57961
57963
  }
57962
57964
  }
57965
+ /**
57966
+ * Sign a pending withdrawal request (validator/relayer operation)
57967
+ * Generates an ECDSA signature compatible with the Base chain CosmosBridge contract
57968
+ */
57969
+ async signWithdrawal(nonce, validatorEthKeyHex) {
57970
+ await this.initializeSigningClient();
57971
+ if (!this.signingClient || !this.wallet) {
57972
+ throw new Error("Signing client not initialized");
57973
+ }
57974
+ const [account] = await this.wallet.getAccounts();
57975
+ const signer = account.address;
57976
+ const msgSignWithdrawal = {
57977
+ signer,
57978
+ nonce,
57979
+ validatorEthKeyHex
57980
+ };
57981
+ const msg = {
57982
+ typeUrl: "/pokerchain.poker.v1.MsgSignWithdrawal",
57983
+ value: msgSignWithdrawal
57984
+ };
57985
+ const fee = gaslessFee();
57986
+ const memo = "Sign pending withdrawal request";
57987
+ console.log("🔏 Signing withdrawal:", {
57988
+ signer,
57989
+ nonce
57990
+ });
57991
+ try {
57992
+ const result = await this.signingClient.signAndBroadcast(signer, [msg], fee, memo);
57993
+ console.log("✅ Withdrawal signing successful:", result.transactionHash);
57994
+ return result.transactionHash;
57995
+ }
57996
+ catch (error) {
57997
+ console.error("❌ Withdrawal signing failed:", error);
57998
+ throw error;
57999
+ }
58000
+ }
57963
58001
  /**
57964
58002
  * Query a specific withdrawal request by nonce
57965
58003
  */
@@ -58170,5 +58208,5 @@ const registry = new Registry([
58170
58208
  ...msgTypes,
58171
58209
  ]);
58172
58210
 
58173
- export { AllPlayerActions, BLOCK52_HD_PATH, COSMOS_CONSTANTS, Client, CosmosClient, Deck, GameFormat, GameStatus, GameVariant, HandType, KEYS, MissingWalletError, NonPlayerActionType, Params$c as Params, PlayerActionType, PlayerStatus, PokerGameIntegration, PokerSolver, RPCMethods, SIT_OUT_METHOD_NEXT_BB, SIT_OUT_METHOD_NEXT_HAND, SUIT, SigningCosmosClient, TexasHoldemRound, WithdrawalRequest, createSigningClientFromMnemonic, createWalletFromMnemonic, formatGameFormatDisplay, formatGameVariantDisplay, generateWallet, getActionByType, getAddressFromMnemonic, getDefaultCosmosConfig, getGameFormat, getGameFormatForCosmos, getGameFormatFromObject, getGameVariant, hasAction, isCashFormat, isEmptyAddress, isSitAndGoFormat, isTournamentFormat, isValidMnemonic, isValidPlayerAddress, parseGameFormat, parseGameVariant, registry };
58211
+ export { AllPlayerActions, BLOCK52_HD_PATH, COSMOS_CONSTANTS, Client, CosmosClient, Deck, GameFormat, GameStatus, GameVariant, HandType, KEYS, MissingWalletError, NonPlayerActionType, Params$c as Params, PlayerActionType, PlayerStatus, PokerGameIntegration, PokerSolver, RPCMethods, SIT_IN_METHOD_NEXT_BB, SIT_IN_METHOD_POST_NOW, SIT_OUT_METHOD_NEXT_BB, SIT_OUT_METHOD_NEXT_HAND, SUIT, SigningCosmosClient, TexasHoldemRound, WithdrawalRequest, createSigningClientFromMnemonic, createWalletFromMnemonic, formatGameFormatDisplay, formatGameVariantDisplay, generateWallet, getActionByType, getAddressFromMnemonic, getDefaultCosmosConfig, getGameFormat, getGameFormatForCosmos, getGameFormatFromObject, getGameVariant, hasAction, isCashFormat, isEmptyAddress, isSitAndGoFormat, isTournamentFormat, isValidMnemonic, isValidPlayerAddress, parseGameFormat, parseGameVariant, registry };
58174
58212
  //# sourceMappingURL=index.esm.js.map