@block52/poker-vm-sdk 1.1.7 → 1.1.9
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/README.md +81 -15
- package/dist/index.d.ts +4 -0
- package/dist/index.esm.js +282 -335
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +282 -335
- package/dist/index.js.map +1 -1
- package/dist/pokerchain.poker.v1/types/pokerchain/poker/v1/tx.d.ts +2 -0
- package/dist/pokerchain.poker.v1/types/pokerchain/poker/v1/tx.d.ts.map +1 -1
- package/dist/signingClient.d.ts.map +1 -1
- package/dist/types/game.d.ts +2 -0
- package/dist/types/game.d.ts.map +1 -1
- package/package.json +75 -75
package/README.md
CHANGED
|
@@ -145,36 +145,65 @@ console.log("Balance:", client.b52usdcToUsdc(balance), "USDC");
|
|
|
145
145
|
|
|
146
146
|
### SigningCosmosClient
|
|
147
147
|
|
|
148
|
-
|
|
148
|
+
Extends `CosmosClient` with transaction signing capabilities. Includes all query methods from `CosmosClient` plus:
|
|
149
149
|
|
|
150
|
-
#### Methods
|
|
150
|
+
#### Transaction Methods
|
|
151
151
|
|
|
152
152
|
- `createGame(gameFormat, gameVariant, minPlayers, maxPlayers, minBuyIn, maxBuyIn, smallBlind, bigBlind, timeout, rakeConfig?, sngConfig?)` - Create a new poker game
|
|
153
153
|
- `joinGame(gameId, seat, buyInAmount)` - Join an existing game at a specific seat
|
|
154
|
-
- `performAction(gameId, action, amount?, data?)` - Perform a poker action (fold, call, raise, check)
|
|
155
154
|
- `leaveGame(gameId)` - Leave a game and cash out
|
|
155
|
+
- `performAction(gameId, action, amount?, data?)` - Perform a poker action (fold, call, raise, check, all-in, deal)
|
|
156
|
+
- `topUp(gameId, amount)` - Add chips to your stack at a table
|
|
157
|
+
- `sendTokens(fromAddress, toAddress, amount, denom?, memo?)` - Send tokens to another address
|
|
158
|
+
- `sendB52USDC(fromAddress, toAddress, amount, memo?)` - Send b52USDC tokens
|
|
159
|
+
|
|
160
|
+
#### Bridge Methods
|
|
161
|
+
|
|
162
|
+
- `processDeposit(depositIndex)` - Process a bridge deposit from Ethereum by index
|
|
163
|
+
- `initiateWithdrawal(baseAddress, amount)` - Initiate withdrawal to Base chain
|
|
164
|
+
- `getWithdrawalRequest(nonce)` - Query a specific withdrawal request by nonce
|
|
165
|
+
- `listWithdrawalRequests(cosmosAddress?)` - List withdrawal requests
|
|
166
|
+
|
|
167
|
+
#### Wallet Methods
|
|
168
|
+
|
|
156
169
|
- `getWalletAddress()` - Get the current wallet address
|
|
157
|
-
- `
|
|
158
|
-
- `
|
|
170
|
+
- `setWallet(wallet)` - Set a new wallet for signing
|
|
171
|
+
- `getWallet()` - Get the current wallet instance
|
|
159
172
|
- `disconnect()` - Close the client connection
|
|
160
173
|
|
|
161
174
|
### CosmosClient
|
|
162
175
|
|
|
163
|
-
Query-only client for reading blockchain state.
|
|
176
|
+
Query-only client for reading blockchain state via REST API.
|
|
164
177
|
|
|
165
|
-
#### Methods
|
|
178
|
+
#### Blockchain Query Methods
|
|
166
179
|
|
|
167
|
-
- `getGame(gameId)` - Get game options/configuration by ID
|
|
168
|
-
- `getGameState(gameId)` - Get current game state by ID
|
|
169
|
-
- `listGames()` - Get all games
|
|
170
|
-
- `findGames(min?, max?)` - Find games by blind range
|
|
171
|
-
- `getPlayerGames(playerAddress)` - Get games for a specific player
|
|
172
|
-
- `getLegalActions(gameId, playerAddress?)` - Get legal actions for a game
|
|
173
|
-
- `getBalance(address, denom?)` - Query token balance
|
|
174
|
-
- `getAllBalances(address)` - Get all token balances
|
|
175
180
|
- `getAccount(address)` - Get account information
|
|
181
|
+
- `getAllBalances(address)` - Get all token balances for an address
|
|
182
|
+
- `getBalance(address, denom?)` - Get specific token balance (default: b52USDC)
|
|
176
183
|
- `getHeight()` - Get current block height
|
|
177
184
|
- `getTx(txHash)` - Get transaction by hash
|
|
185
|
+
- `getBlock(height)` - Get a specific block by height
|
|
186
|
+
- `getLatestBlock()` - Get the most recent block
|
|
187
|
+
- `getBlocks(startHeight, count?)` - Get multiple blocks starting from a height
|
|
188
|
+
- `getLatestBlocks(count?)` - Get the most recent N blocks
|
|
189
|
+
|
|
190
|
+
#### Game Query Methods
|
|
191
|
+
|
|
192
|
+
- `getGame(gameId)` - Get game options/configuration by ID
|
|
193
|
+
- `getGameState(gameId)` - Get current game state by ID
|
|
194
|
+
- `listGames()` - Get all active games
|
|
195
|
+
- `findGames(min?, max?)` - Find games by player capacity (minPlayers/maxPlayers)
|
|
196
|
+
- `getPlayerGames(playerAddress)` - Get all games for a specific player
|
|
197
|
+
- `getLegalActions(gameId, playerAddress?)` - Get legal actions for a player in a game
|
|
198
|
+
|
|
199
|
+
#### Token & Utility Methods
|
|
200
|
+
|
|
201
|
+
- `getB52USDCBalance(address)` - Get b52USDC balance for an address
|
|
202
|
+
- `b52usdcToUsdc(amount)` - Convert b52USDC (micro units) to USDC display format
|
|
203
|
+
- `usdcToB52usdc(amount)` - Convert USDC to b52USDC (micro units)
|
|
204
|
+
- `calculateEquity(hands, board?, dead?, simulations?)` - Calculate hand equity via Monte Carlo
|
|
205
|
+
- `calculateEquityFull(hands, board?, dead?, simulations?)` - Calculate equity with full metadata
|
|
206
|
+
- `listWithdrawalRequests(cosmosAddress?)` - List withdrawal requests (all or for specific address)
|
|
178
207
|
|
|
179
208
|
### Deck
|
|
180
209
|
|
|
@@ -278,6 +307,43 @@ yarn test
|
|
|
278
307
|
yarn lint
|
|
279
308
|
```
|
|
280
309
|
|
|
310
|
+
### Publishing to npm
|
|
311
|
+
|
|
312
|
+
The SDK is automatically published to npm via GitHub Actions when a release is created.
|
|
313
|
+
|
|
314
|
+
#### Automated Publishing Process
|
|
315
|
+
|
|
316
|
+
1. **Update the version** in `package.json`:
|
|
317
|
+
```bash
|
|
318
|
+
cd sdk
|
|
319
|
+
# Edit package.json to update version (e.g., "1.1.9")
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
2. **Commit and push** the version change:
|
|
323
|
+
```bash
|
|
324
|
+
git add package.json
|
|
325
|
+
git commit -m "chore: update SDK version to 1.1.9"
|
|
326
|
+
git push
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
3. **Create a GitHub release** with a tag matching `sdk-v*`:
|
|
330
|
+
```bash
|
|
331
|
+
gh release create sdk-v1.1.9 --title "SDK v1.1.9" --notes "Release notes here"
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
The GitHub Action workflow will automatically:
|
|
335
|
+
- Install dependencies
|
|
336
|
+
- Run tests
|
|
337
|
+
- Build the SDK
|
|
338
|
+
- Verify the package.json version matches the release tag
|
|
339
|
+
- Publish to npm with public access
|
|
340
|
+
|
|
341
|
+
**Important Notes:**
|
|
342
|
+
- The release tag must start with `sdk-v` (e.g., `sdk-v1.1.9`)
|
|
343
|
+
- The version in `package.json` must match the tag version (e.g., `1.1.9` for tag `sdk-v1.1.9`)
|
|
344
|
+
- The `NPM_TOKEN` secret must be configured in GitHub repository settings
|
|
345
|
+
- The workflow uses `--ignore-scripts` to skip the `prepublishOnly` script since it already builds the SDK
|
|
346
|
+
|
|
281
347
|
### Project Structure
|
|
282
348
|
|
|
283
349
|
```
|
package/dist/index.d.ts
CHANGED
|
@@ -44952,6 +44952,8 @@ interface MsgPerformAction {
|
|
|
44952
44952
|
gameId: string;
|
|
44953
44953
|
action: string;
|
|
44954
44954
|
amount: Long;
|
|
44955
|
+
/** Optional action data (e.g., "method=post-now" for sit-in) */
|
|
44956
|
+
data: string;
|
|
44955
44957
|
}
|
|
44956
44958
|
declare const MsgPerformAction: MessageFns<MsgPerformAction>;
|
|
44957
44959
|
/** MsgMint defines the MsgMint message. */
|
|
@@ -45424,6 +45426,8 @@ type TexasHoldemStateDTO = {
|
|
|
45424
45426
|
round: TexasHoldemRound;
|
|
45425
45427
|
winners: WinnerDTO[];
|
|
45426
45428
|
results: ResultDTO[];
|
|
45429
|
+
legalActions: LegalActionDTO[];
|
|
45430
|
+
availableSeats: number[];
|
|
45427
45431
|
signature: string;
|
|
45428
45432
|
};
|
|
45429
45433
|
/**
|