@block52/poker-vm-sdk 1.0.0 → 1.0.2

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
@@ -1,19 +1,20 @@
1
+ import type { LegalActionDTO, GameOptionsResponse, GameListItem, BlockResponse, GameStateResponse } from "./types/game";
1
2
  export interface IClient {
2
3
  getAccount(address: string): Promise<any>;
3
4
  getAllBalances(address: string): Promise<any[]>;
4
5
  getBalance(address: string, denom?: string): Promise<bigint>;
5
6
  getHeight(): Promise<number>;
6
7
  getTx(txHash: string): Promise<any>;
7
- getBlock(height: number): Promise<any>;
8
- getLatestBlock(): Promise<any>;
9
- getBlocks(startHeight: number, count?: number): Promise<any[]>;
10
- getLatestBlocks(count?: number): Promise<any[]>;
11
- getGameState(gameId: string): Promise<any>;
12
- getGame(gameId: string): Promise<any>;
13
- getLegalActions(gameId: string, playerAddress?: string): Promise<any[]>;
14
- listGames(): Promise<any[]>;
15
- findGames(min?: number, max?: number): Promise<any[]>;
16
- getPlayerGames(player: string): Promise<any[]>;
8
+ getBlock(height: number): Promise<BlockResponse>;
9
+ getLatestBlock(): Promise<BlockResponse>;
10
+ getBlocks(startHeight: number, count?: number): Promise<BlockResponse[]>;
11
+ getLatestBlocks(count?: number): Promise<BlockResponse[]>;
12
+ getGameState(gameId: string): Promise<GameStateResponse>;
13
+ getGame(gameId: string): Promise<GameOptionsResponse>;
14
+ getLegalActions(gameId: string, playerAddress?: string): Promise<LegalActionDTO[]>;
15
+ listGames(): Promise<GameListItem[]>;
16
+ findGames(min?: number, max?: number): Promise<GameListItem[]>;
17
+ getPlayerGames(player: string): Promise<GameListItem[]>;
17
18
  getB52USDCBalance(address: string): Promise<bigint>;
18
19
  b52usdcToUsdc(b52usdcAmount: bigint): number;
19
20
  usdcToB52usdc(usdcAmount: number): bigint;
@@ -1 +1 @@
1
- {"version":3,"file":"IClient.d.ts","sourceRoot":"","sources":["../src/IClient.ts"],"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AAC;IACnB,kBAAkB,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACzE,sBAAsB,CAAC,aAAa,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;IAC/D,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC/B"}
@@ -1,9 +1,10 @@
1
- import { EquityResult, EquityResponse } from "./sdkTypes";
1
+ import { EquityResult, EquityResponse, CosmosConfig } from "./sdkTypes";
2
2
  import { IClient } from "./IClient";
3
+ import type { LegalActionDTO, GameOptionsResponse, GameListItem, BlockResponse, GameStateResponse } from "./types/game";
3
4
  export declare class CosmosClient implements IClient {
4
- protected readonly config: any;
5
+ protected readonly config: CosmosConfig;
5
6
  private readonly restClient;
6
- constructor(config: any);
7
+ constructor(config: CosmosConfig);
7
8
  /**
8
9
  * Get account information via REST API
9
10
  */
@@ -27,45 +28,45 @@ export declare class CosmosClient implements IClient {
27
28
  /**
28
29
  * Get a specific block by height via REST API
29
30
  */
30
- getBlock(height: number): Promise<any>;
31
+ getBlock(height: number): Promise<BlockResponse>;
31
32
  /**
32
33
  * Get the latest block via REST API
33
34
  */
34
- getLatestBlock(): Promise<any>;
35
+ getLatestBlock(): Promise<BlockResponse>;
35
36
  /**
36
37
  * Get multiple blocks starting from a specific height
37
38
  */
38
- getBlocks(startHeight: number, count?: number): Promise<any[]>;
39
+ getBlocks(startHeight: number, count?: number): Promise<BlockResponse[]>;
39
40
  /**
40
41
  * Get the latest blocks (most recent)
41
42
  */
42
- getLatestBlocks(count?: number): Promise<any[]>;
43
+ getLatestBlocks(count?: number): Promise<BlockResponse[]>;
43
44
  /**
44
45
  * Get game state via REST API
45
46
  */
46
- getGameState(gameId: string): Promise<any>;
47
+ getGameState(gameId: string): Promise<GameStateResponse>;
47
48
  /**
48
49
  * Get game info via REST API
49
50
  */
50
- getGame(gameId: string): Promise<any>;
51
+ getGame(gameId: string): Promise<GameOptionsResponse>;
51
52
  /**
52
53
  * Get legal actions for a game via REST API
53
54
  */
54
- getLegalActions(gameId: string, playerAddress?: string): Promise<any[]>;
55
+ getLegalActions(gameId: string, playerAddress?: string): Promise<LegalActionDTO[]>;
55
56
  /**
56
57
  * List all games via REST API
57
58
  */
58
- listGames(): Promise<any[]>;
59
+ listGames(): Promise<GameListItem[]>;
59
60
  /**
60
61
  * Find games (alias for listGames - matches IClient interface)
61
62
  * @param min Optional minimum players filter
62
63
  * @param max Optional maximum players filter
63
64
  */
64
- findGames(min?: number, max?: number): Promise<any[]>;
65
+ findGames(min?: number, max?: number): Promise<GameListItem[]>;
65
66
  /**
66
67
  * Get player's games via REST API
67
68
  */
68
- getPlayerGames(player: string): Promise<any[]>;
69
+ getPlayerGames(player: string): Promise<GameListItem[]>;
69
70
  /**
70
71
  * Get b52USDC balance for an address via REST API
71
72
  */
@@ -117,7 +118,7 @@ export declare class CosmosClient implements IClient {
117
118
  disconnect(): Promise<void>;
118
119
  }
119
120
  export declare const getCosmosClient: (config?: any) => CosmosClient;
120
- export declare const initializeCosmosClient: (config: any) => CosmosClient;
121
- export declare const getDefaultCosmosConfig: (domain?: string) => any;
121
+ export declare const initializeCosmosClient: (config: CosmosConfig) => CosmosClient;
122
+ export declare const getDefaultCosmosConfig: (domain?: string) => CosmosConfig;
122
123
  export { COSMOS_CONSTANTS, type CosmosConfig, type Coin, type CustomAccountResponse, type TxResponse, type BlockResponse, type GameState, type Game, type LegalAction, type GameStateResponse, type GameResponse, type ListGamesResponse, type PlayerGamesResponse, type EquityHand, type EquityResult, type EquityRequest, type EquityResponse } from "./sdkTypes";
123
124
  //# sourceMappingURL=cosmosClient.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"cosmosClient.d.ts","sourceRoot":"","sources":["../src/cosmosClient.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,YAAY,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5E,OAAO,EAAE,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,EAClB,KAAK,SAAS,EACd,KAAK,IAAI,EACT,KAAK,WAAW,EAChB,KAAK,iBAAiB,EACtB,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,cAAc,EACtB,MAAM,YAAY,CAAC"}
package/dist/index.d.ts CHANGED
@@ -45260,8 +45260,58 @@ type Card = {
45260
45260
  mnemonic: string;
45261
45261
  };
45262
45262
  type GameOptionsResponse = {
45263
+ address?: string;
45264
+ game?: string;
45265
+ gameOptions?: GameOptionsDTO;
45266
+ };
45267
+ type GameListItem = {
45268
+ id?: string;
45269
+ game_id?: string;
45270
+ gameId?: string;
45263
45271
  address: string;
45264
45272
  gameOptions: GameOptionsDTO;
45273
+ current_players?: number;
45274
+ };
45275
+ type BlockID = {
45276
+ hash: string;
45277
+ part_set_header?: {
45278
+ total: number;
45279
+ hash: string;
45280
+ };
45281
+ };
45282
+ type BlockHeader = {
45283
+ version?: {
45284
+ block: string;
45285
+ app: string;
45286
+ };
45287
+ chain_id: string;
45288
+ height: string;
45289
+ time: string;
45290
+ last_block_id?: BlockID;
45291
+ last_commit_hash?: string;
45292
+ data_hash?: string;
45293
+ validators_hash?: string;
45294
+ next_validators_hash?: string;
45295
+ consensus_hash?: string;
45296
+ app_hash?: string;
45297
+ last_results_hash?: string;
45298
+ evidence_hash?: string;
45299
+ proposer_address?: string;
45300
+ };
45301
+ type Block = {
45302
+ header: BlockHeader;
45303
+ data: {
45304
+ txs: string[];
45305
+ };
45306
+ evidence?: {
45307
+ evidence?: any[];
45308
+ };
45309
+ last_commit?: any;
45310
+ };
45311
+ type BlockResponse = {
45312
+ block_id: BlockID;
45313
+ block: Block;
45314
+ sdk_block?: Block;
45265
45315
  };
45266
45316
  type TransactionResponse = {
45267
45317
  nonce: string;
@@ -45274,7 +45324,7 @@ type TransactionResponse = {
45274
45324
  data?: string;
45275
45325
  };
45276
45326
  type GameStateResponse = {
45277
- state: TexasHoldemStateDTO;
45327
+ game_state: string;
45278
45328
  };
45279
45329
  type PerformActionResponse = {
45280
45330
  state: TexasHoldemStateDTO;
@@ -45782,16 +45832,16 @@ interface IClient {
45782
45832
  getBalance(address: string, denom?: string): Promise<bigint>;
45783
45833
  getHeight(): Promise<number>;
45784
45834
  getTx(txHash: string): Promise<any>;
45785
- getBlock(height: number): Promise<any>;
45786
- getLatestBlock(): Promise<any>;
45787
- getBlocks(startHeight: number, count?: number): Promise<any[]>;
45788
- getLatestBlocks(count?: number): Promise<any[]>;
45789
- getGameState(gameId: string): Promise<any>;
45790
- getGame(gameId: string): Promise<any>;
45791
- getLegalActions(gameId: string, playerAddress?: string): Promise<any[]>;
45792
- listGames(): Promise<any[]>;
45793
- findGames(min?: number, max?: number): Promise<any[]>;
45794
- getPlayerGames(player: string): Promise<any[]>;
45835
+ getBlock(height: number): Promise<BlockResponse>;
45836
+ getLatestBlock(): Promise<BlockResponse>;
45837
+ getBlocks(startHeight: number, count?: number): Promise<BlockResponse[]>;
45838
+ getLatestBlocks(count?: number): Promise<BlockResponse[]>;
45839
+ getGameState(gameId: string): Promise<GameStateResponse>;
45840
+ getGame(gameId: string): Promise<GameOptionsResponse>;
45841
+ getLegalActions(gameId: string, playerAddress?: string): Promise<LegalActionDTO[]>;
45842
+ listGames(): Promise<GameListItem[]>;
45843
+ findGames(min?: number, max?: number): Promise<GameListItem[]>;
45844
+ getPlayerGames(player: string): Promise<GameListItem[]>;
45795
45845
  getB52USDCBalance(address: string): Promise<bigint>;
45796
45846
  b52usdcToUsdc(b52usdcAmount: bigint): number;
45797
45847
  usdcToB52usdc(usdcAmount: number): bigint;
@@ -45807,9 +45857,9 @@ interface IClient {
45807
45857
  }
45808
45858
 
45809
45859
  declare class CosmosClient implements IClient {
45810
- protected readonly config: any;
45860
+ protected readonly config: CosmosConfig;
45811
45861
  private readonly restClient;
45812
- constructor(config: any);
45862
+ constructor(config: CosmosConfig);
45813
45863
  /**
45814
45864
  * Get account information via REST API
45815
45865
  */
@@ -45833,45 +45883,45 @@ declare class CosmosClient implements IClient {
45833
45883
  /**
45834
45884
  * Get a specific block by height via REST API
45835
45885
  */
45836
- getBlock(height: number): Promise<any>;
45886
+ getBlock(height: number): Promise<BlockResponse>;
45837
45887
  /**
45838
45888
  * Get the latest block via REST API
45839
45889
  */
45840
- getLatestBlock(): Promise<any>;
45890
+ getLatestBlock(): Promise<BlockResponse>;
45841
45891
  /**
45842
45892
  * Get multiple blocks starting from a specific height
45843
45893
  */
45844
- getBlocks(startHeight: number, count?: number): Promise<any[]>;
45894
+ getBlocks(startHeight: number, count?: number): Promise<BlockResponse[]>;
45845
45895
  /**
45846
45896
  * Get the latest blocks (most recent)
45847
45897
  */
45848
- getLatestBlocks(count?: number): Promise<any[]>;
45898
+ getLatestBlocks(count?: number): Promise<BlockResponse[]>;
45849
45899
  /**
45850
45900
  * Get game state via REST API
45851
45901
  */
45852
- getGameState(gameId: string): Promise<any>;
45902
+ getGameState(gameId: string): Promise<GameStateResponse>;
45853
45903
  /**
45854
45904
  * Get game info via REST API
45855
45905
  */
45856
- getGame(gameId: string): Promise<any>;
45906
+ getGame(gameId: string): Promise<GameOptionsResponse>;
45857
45907
  /**
45858
45908
  * Get legal actions for a game via REST API
45859
45909
  */
45860
- getLegalActions(gameId: string, playerAddress?: string): Promise<any[]>;
45910
+ getLegalActions(gameId: string, playerAddress?: string): Promise<LegalActionDTO[]>;
45861
45911
  /**
45862
45912
  * List all games via REST API
45863
45913
  */
45864
- listGames(): Promise<any[]>;
45914
+ listGames(): Promise<GameListItem[]>;
45865
45915
  /**
45866
45916
  * Find games (alias for listGames - matches IClient interface)
45867
45917
  * @param min Optional minimum players filter
45868
45918
  * @param max Optional maximum players filter
45869
45919
  */
45870
- findGames(min?: number, max?: number): Promise<any[]>;
45920
+ findGames(min?: number, max?: number): Promise<GameListItem[]>;
45871
45921
  /**
45872
45922
  * Get player's games via REST API
45873
45923
  */
45874
- getPlayerGames(player: string): Promise<any[]>;
45924
+ getPlayerGames(player: string): Promise<GameListItem[]>;
45875
45925
  /**
45876
45926
  * Get b52USDC balance for an address via REST API
45877
45927
  */
@@ -45922,7 +45972,7 @@ declare class CosmosClient implements IClient {
45922
45972
  */
45923
45973
  disconnect(): Promise<void>;
45924
45974
  }
45925
- declare const getDefaultCosmosConfig: (domain?: string) => any;
45975
+ declare const getDefaultCosmosConfig: (domain?: string) => CosmosConfig;
45926
45976
 
45927
45977
  /**
45928
45978
  * Extended configuration for signing client
@@ -46296,4 +46346,4 @@ declare const Client: typeof IgniteClient & Constructor<{
46296
46346
  declare const registry: Registry;
46297
46347
 
46298
46348
  export { AllPlayerActions, BLOCK52_HD_PATH, COSMOS_CONSTANTS, Client, CosmosClient, Deck, GameStatus, GameType, HandType, KEYS, MissingWalletError, NonPlayerActionType, Params, PlayerActionType, PlayerStatus, PokerGameIntegration, PokerSolver, RPCMethods, SUIT, SigningCosmosClient, TexasHoldemRound, WithdrawalRequest, createSigningClientFromMnemonic, createWalletFromMnemonic, generateWallet, getAddressFromMnemonic, getDefaultCosmosConfig, isValidMnemonic, registry };
46299
- export type { AccountDTO, ActionDTO, BlockDTO, BlockHeaderDTO, BurnResponseDTO, Card, EquityHand, EquityRequest, EquityResponse, EquityResult, GameOptions, GameOptionsDTO, GameOptionsResponse, GameStateResponse, HandEvaluation, ISignedResponse, LegalActionDTO, PerformActionResponse, PlayerDTO, RPCRequest, RPCRequestParams, RPCResponse, RakeConfig, RakeConfigDTO, ResultDTO, TexasHoldemGameState, TexasHoldemStateDTO, TransactionDTO, TransactionResponse, WalletInfo, WinnerDTO, WithdrawResponseDTO };
46349
+ export type { AccountDTO, ActionDTO, Block, BlockDTO, BlockHeader, BlockHeaderDTO, BlockID, BlockResponse, BurnResponseDTO, Card, EquityHand, EquityRequest, EquityResponse, EquityResult, GameListItem, GameOptions, GameOptionsDTO, GameOptionsResponse, GameStateResponse, HandEvaluation, ISignedResponse, LegalActionDTO, PerformActionResponse, PlayerDTO, RPCRequest, RPCRequestParams, RPCResponse, RakeConfig, RakeConfigDTO, ResultDTO, TexasHoldemGameState, TexasHoldemStateDTO, TransactionDTO, TransactionResponse, WalletInfo, WinnerDTO, WithdrawResponseDTO };