@block52/poker-vm-sdk 1.3.5 → 1.4.0
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.d.ts +23 -2
- package/dist/index.esm.js +35 -2
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +37 -1
- package/dist/index.js.map +1 -1
- package/dist/pokerchain.poker.v1/types/pokerchain/poker/v1/tx.d.ts +5 -0
- package/dist/pokerchain.poker.v1/types/pokerchain/poker/v1/tx.d.ts.map +1 -1
- package/dist/signingClient.d.ts +1 -1
- package/dist/signingClient.d.ts.map +1 -1
- package/dist/types/game.d.ts +16 -0
- package/dist/types/game.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -44941,6 +44941,11 @@ interface MsgCreateGame {
|
|
|
44941
44941
|
gameVariant: string;
|
|
44942
44942
|
/** SNG flat entry fee in micro-units, skimmed to the creator (poker-vm#2118) */
|
|
44943
44943
|
entryFee: Long;
|
|
44944
|
+
/**
|
|
44945
|
+
* Optional ENS-style table name (field 19). Lowercase [a-z0-9-], 1-32 chars,
|
|
44946
|
+
* globally unique, $0.10/char to validators. Empty = unnamed. (block52/pokerchain#337)
|
|
44947
|
+
*/
|
|
44948
|
+
name: string;
|
|
44944
44949
|
}
|
|
44945
44950
|
declare const MsgCreateGame: MessageFns<MsgCreateGame>;
|
|
44946
44951
|
/** MsgJoinGame defines the MsgJoinGame message. */
|
|
@@ -45527,6 +45532,7 @@ type GameStateResponseDTO = {
|
|
|
45527
45532
|
creator: string;
|
|
45528
45533
|
format: GameFormat;
|
|
45529
45534
|
variant: GameVariant;
|
|
45535
|
+
name?: string;
|
|
45530
45536
|
gameState: TexasHoldemStateDTO;
|
|
45531
45537
|
};
|
|
45532
45538
|
declare enum SUIT {
|
|
@@ -45558,11 +45564,26 @@ type GameListItem = {
|
|
|
45558
45564
|
creator: string;
|
|
45559
45565
|
format: GameFormat;
|
|
45560
45566
|
variant: GameVariant;
|
|
45567
|
+
name?: string;
|
|
45561
45568
|
gameOptions: GameOptionsDTO;
|
|
45562
45569
|
currentPlayers: number;
|
|
45563
45570
|
createdAt?: string;
|
|
45564
45571
|
updatedAt?: string;
|
|
45565
45572
|
};
|
|
45573
|
+
/**
|
|
45574
|
+
* Cost of ONE character of a paid table name, in micro-USDC ($0.10). The total
|
|
45575
|
+
* naming fee is `length * GAME_NAME_MICRO_PER_CHAR`, charged on top of the
|
|
45576
|
+
* game-creation cost and paid to validators. This is the SINGLE SOURCE OF TRUTH
|
|
45577
|
+
* for the price so the UI preview and the chain agree. (block52/pokerchain#337)
|
|
45578
|
+
*/
|
|
45579
|
+
declare const GAME_NAME_MICRO_PER_CHAR = 100000n;
|
|
45580
|
+
/** Maximum table-name length (code points); bounds the max fee at 32 * $0.10. */
|
|
45581
|
+
declare const MAX_GAME_NAME_LENGTH = 32;
|
|
45582
|
+
/**
|
|
45583
|
+
* Total naming fee (micro-USDC) for a table name: $0.10 per character. Counts
|
|
45584
|
+
* code points to match the chain's rune-based charge. An empty name is free.
|
|
45585
|
+
*/
|
|
45586
|
+
declare const computeGameNameFee: (name: string) => bigint;
|
|
45566
45587
|
type BlockID = {
|
|
45567
45588
|
hash: string;
|
|
45568
45589
|
part_set_header?: {
|
|
@@ -46558,7 +46579,7 @@ declare class SigningCosmosClient extends CosmosClient {
|
|
|
46558
46579
|
/**
|
|
46559
46580
|
* Create a new poker game
|
|
46560
46581
|
*/
|
|
46561
|
-
createGame(gameFormat: string, gameVariant: string, minPlayers: number, maxPlayers: number, minBuyInB52USDC: bigint, maxBuyInB52USDC: bigint, smallBlindB52USDC: bigint, bigBlindB52USDC: bigint, timeout: number, rakeConfig?: RakeConfig, sngConfig?: SNGConfig): Promise<string>;
|
|
46582
|
+
createGame(gameFormat: string, gameVariant: string, minPlayers: number, maxPlayers: number, minBuyInB52USDC: bigint, maxBuyInB52USDC: bigint, smallBlindB52USDC: bigint, bigBlindB52USDC: bigint, timeout: number, rakeConfig?: RakeConfig, sngConfig?: SNGConfig, name?: string): Promise<string>;
|
|
46562
46583
|
/**
|
|
46563
46584
|
* Join a poker game
|
|
46564
46585
|
*/
|
|
@@ -47046,5 +47067,5 @@ declare const Client: typeof IgniteClient & Constructor<{
|
|
|
47046
47067
|
}>;
|
|
47047
47068
|
declare const registry: Registry;
|
|
47048
47069
|
|
|
47049
|
-
export { AllPlayerActions, BLOCK52_HD_PATH, Board, 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, ValidatorBond, WithdrawalRequest, createSigningClientFromMnemonic, createWalletFromMnemonic, formatGameFormatDisplay, formatGameVariantDisplay, generateWallet, getActionByType, getAddressFromMnemonic, getDefaultCosmosConfig, getGameFormat, getGameFormatForCosmos, getGameFormatFromObject, getGameVariant, hasAction, isCashFormat, isEmptyAddress, isSitAndGoFormat, isTournamentFormat, isValidMnemonic, isValidPlayerAddress, parseGameFormat, parseGameVariant, registry };
|
|
47070
|
+
export { AllPlayerActions, BLOCK52_HD_PATH, Board, COSMOS_CONSTANTS, Client, CosmosClient, Deck, GAME_NAME_MICRO_PER_CHAR, GameFormat, GameStatus, GameVariant, HandType, KEYS, MAX_GAME_NAME_LENGTH, 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, ValidatorBond, WithdrawalRequest, computeGameNameFee, createSigningClientFromMnemonic, createWalletFromMnemonic, formatGameFormatDisplay, formatGameVariantDisplay, generateWallet, getActionByType, getAddressFromMnemonic, getDefaultCosmosConfig, getGameFormat, getGameFormatForCosmos, getGameFormatFromObject, getGameVariant, hasAction, isCashFormat, isEmptyAddress, isSitAndGoFormat, isTournamentFormat, isValidMnemonic, isValidPlayerAddress, parseGameFormat, parseGameVariant, registry };
|
|
47050
47071
|
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, PayoutPlaceDTO, PerformActionResponse, PlayerDTO, RPCRequest, RPCRequestParams, RPCResponse, RakeConfig, RakeConfigDTO, ResultDTO, SitInMethod, SitOutMethod, TexasHoldemGameState, TexasHoldemStateDTO, TransactionDTO, TransactionResponse, WalletInfo, WinnerDTO, WithdrawResponseDTO };
|
package/dist/index.esm.js
CHANGED
|
@@ -2844,6 +2844,7 @@ function createBaseMsgCreateGame() {
|
|
|
2844
2844
|
blindLevelDuration: 0,
|
|
2845
2845
|
gameVariant: "",
|
|
2846
2846
|
entryFee: Long.UZERO,
|
|
2847
|
+
name: "",
|
|
2847
2848
|
};
|
|
2848
2849
|
}
|
|
2849
2850
|
const MsgCreateGame = {
|
|
@@ -2899,6 +2900,9 @@ const MsgCreateGame = {
|
|
|
2899
2900
|
if (!message.entryFee.equals(Long.UZERO)) {
|
|
2900
2901
|
writer.uint32(136).uint64(message.entryFee.toString());
|
|
2901
2902
|
}
|
|
2903
|
+
if (message.name !== "") {
|
|
2904
|
+
writer.uint32(154).string(message.name);
|
|
2905
|
+
}
|
|
2902
2906
|
return writer;
|
|
2903
2907
|
},
|
|
2904
2908
|
decode(input, length) {
|
|
@@ -3027,6 +3031,13 @@ const MsgCreateGame = {
|
|
|
3027
3031
|
message.entryFee = Long.fromString(reader.uint64().toString(), true);
|
|
3028
3032
|
continue;
|
|
3029
3033
|
}
|
|
3034
|
+
case 19: {
|
|
3035
|
+
if (tag !== 154) {
|
|
3036
|
+
break;
|
|
3037
|
+
}
|
|
3038
|
+
message.name = reader.string();
|
|
3039
|
+
continue;
|
|
3040
|
+
}
|
|
3030
3041
|
}
|
|
3031
3042
|
if ((tag & 7) === 4 || tag === 0) {
|
|
3032
3043
|
break;
|
|
@@ -3054,6 +3065,7 @@ const MsgCreateGame = {
|
|
|
3054
3065
|
blindLevelDuration: isSet$2b(object.blindLevelDuration) ? globalThis.Number(object.blindLevelDuration) : 0,
|
|
3055
3066
|
gameVariant: isSet$2b(object.gameVariant) ? globalThis.String(object.gameVariant) : "",
|
|
3056
3067
|
entryFee: isSet$2b(object.entryFee) ? Long.fromValue(object.entryFee) : Long.UZERO,
|
|
3068
|
+
name: isSet$2b(object.name) ? globalThis.String(object.name) : "",
|
|
3057
3069
|
};
|
|
3058
3070
|
},
|
|
3059
3071
|
toJSON(message) {
|
|
@@ -3109,6 +3121,9 @@ const MsgCreateGame = {
|
|
|
3109
3121
|
if (!message.entryFee.equals(Long.UZERO)) {
|
|
3110
3122
|
obj.entryFee = (message.entryFee || Long.UZERO).toString();
|
|
3111
3123
|
}
|
|
3124
|
+
if (message.name !== "") {
|
|
3125
|
+
obj.name = message.name;
|
|
3126
|
+
}
|
|
3112
3127
|
return obj;
|
|
3113
3128
|
},
|
|
3114
3129
|
create(base) {
|
|
@@ -3152,6 +3167,7 @@ const MsgCreateGame = {
|
|
|
3152
3167
|
: Long.UZERO;
|
|
3153
3168
|
message.blindLevelDuration = object.blindLevelDuration ?? 0;
|
|
3154
3169
|
message.gameVariant = object.gameVariant ?? "";
|
|
3170
|
+
message.name = object.name ?? "";
|
|
3155
3171
|
message.entryFee = (object.entryFee !== undefined && object.entryFee !== null)
|
|
3156
3172
|
? Long.fromValue(object.entryFee)
|
|
3157
3173
|
: Long.UZERO;
|
|
@@ -56220,6 +56236,20 @@ var SUIT;
|
|
|
56220
56236
|
SUIT[SUIT["HEARTS"] = 3] = "HEARTS";
|
|
56221
56237
|
SUIT[SUIT["SPADES"] = 4] = "SPADES";
|
|
56222
56238
|
})(SUIT || (SUIT = {}));
|
|
56239
|
+
/**
|
|
56240
|
+
* Cost of ONE character of a paid table name, in micro-USDC ($0.10). The total
|
|
56241
|
+
* naming fee is `length * GAME_NAME_MICRO_PER_CHAR`, charged on top of the
|
|
56242
|
+
* game-creation cost and paid to validators. This is the SINGLE SOURCE OF TRUTH
|
|
56243
|
+
* for the price so the UI preview and the chain agree. (block52/pokerchain#337)
|
|
56244
|
+
*/
|
|
56245
|
+
const GAME_NAME_MICRO_PER_CHAR = 100000n;
|
|
56246
|
+
/** Maximum table-name length (code points); bounds the max fee at 32 * $0.10. */
|
|
56247
|
+
const MAX_GAME_NAME_LENGTH = 32;
|
|
56248
|
+
/**
|
|
56249
|
+
* Total naming fee (micro-USDC) for a table name: $0.10 per character. Counts
|
|
56250
|
+
* code points to match the chain's rune-based charge. An empty name is free.
|
|
56251
|
+
*/
|
|
56252
|
+
const computeGameNameFee = (name) => BigInt([...name].length) * GAME_NAME_MICRO_PER_CHAR;
|
|
56223
56253
|
// Constants for URL parameters
|
|
56224
56254
|
const KEYS = {
|
|
56225
56255
|
ACTION_TYPE: "action_type",
|
|
@@ -61225,7 +61255,7 @@ class SigningCosmosClient extends CosmosClient {
|
|
|
61225
61255
|
/**
|
|
61226
61256
|
* Create a new poker game
|
|
61227
61257
|
*/
|
|
61228
|
-
async createGame(gameFormat, gameVariant, minPlayers, maxPlayers, minBuyInB52USDC, maxBuyInB52USDC, smallBlindB52USDC, bigBlindB52USDC, timeout, rakeConfig, sngConfig) {
|
|
61258
|
+
async createGame(gameFormat, gameVariant, minPlayers, maxPlayers, minBuyInB52USDC, maxBuyInB52USDC, smallBlindB52USDC, bigBlindB52USDC, timeout, rakeConfig, sngConfig, name) {
|
|
61229
61259
|
// Validate SNG/Tournament config BEFORE any network work — fail fast.
|
|
61230
61260
|
// SNG/Tournament games are DEFINED by startingStack + blindLevelDuration.
|
|
61231
61261
|
// Refuse to create one with missing/zero values rather than silently
|
|
@@ -61274,6 +61304,9 @@ class SigningCosmosClient extends CosmosClient {
|
|
|
61274
61304
|
blindLevelDuration: sngConfig?.blindLevelDuration ?? 0,
|
|
61275
61305
|
// SNG flat entry fee (micro-units), skimmed to the creator at join time (poker-vm#2118)
|
|
61276
61306
|
entryFee: sngConfig?.entryFee ? Long.fromString(sngConfig.entryFee.toString(), true) : Long.UZERO,
|
|
61307
|
+
// Optional ENS-style table name (block52/pokerchain#337). Empty = unnamed
|
|
61308
|
+
// (no fee); a non-empty name costs $0.10/char and must be globally unique.
|
|
61309
|
+
name: name ?? "",
|
|
61277
61310
|
});
|
|
61278
61311
|
// Create the transaction message
|
|
61279
61312
|
const msg = {
|
|
@@ -62209,5 +62242,5 @@ const registry = new Registry([
|
|
|
62209
62242
|
...msgTypes,
|
|
62210
62243
|
]);
|
|
62211
62244
|
|
|
62212
|
-
export { AllPlayerActions, BLOCK52_HD_PATH, Board, 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, ValidatorBond, WithdrawalRequest, createSigningClientFromMnemonic, createWalletFromMnemonic, formatGameFormatDisplay, formatGameVariantDisplay, generateWallet, getActionByType, getAddressFromMnemonic, getDefaultCosmosConfig, getGameFormat, getGameFormatForCosmos, getGameFormatFromObject, getGameVariant, hasAction, isCashFormat, isEmptyAddress, isSitAndGoFormat, isTournamentFormat, isValidMnemonic, isValidPlayerAddress, parseGameFormat, parseGameVariant, registry };
|
|
62245
|
+
export { AllPlayerActions, BLOCK52_HD_PATH, Board, COSMOS_CONSTANTS, Client, CosmosClient, Deck, GAME_NAME_MICRO_PER_CHAR, GameFormat, GameStatus, GameVariant, HandType, KEYS, MAX_GAME_NAME_LENGTH, 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, ValidatorBond, WithdrawalRequest, computeGameNameFee, createSigningClientFromMnemonic, createWalletFromMnemonic, formatGameFormatDisplay, formatGameVariantDisplay, generateWallet, getActionByType, getAddressFromMnemonic, getDefaultCosmosConfig, getGameFormat, getGameFormatForCosmos, getGameFormatFromObject, getGameVariant, hasAction, isCashFormat, isEmptyAddress, isSitAndGoFormat, isTournamentFormat, isValidMnemonic, isValidPlayerAddress, parseGameFormat, parseGameVariant, registry };
|
|
62213
62246
|
//# sourceMappingURL=index.esm.js.map
|