@block52/poker-vm-sdk 1.1.0 → 1.1.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/index.d.ts CHANGED
@@ -45026,6 +45026,15 @@ interface MsgTopUp {
45026
45026
  amount: Long;
45027
45027
  }
45028
45028
  declare const MsgTopUp: MessageFns<MsgTopUp>;
45029
+ /**
45030
+ * MsgDeleteGame defines the MsgDeleteGame message.
45031
+ * Allows the game creator to delete a game when the table is empty.
45032
+ */
45033
+ interface MsgDeleteGame {
45034
+ creator: string;
45035
+ gameId: string;
45036
+ }
45037
+ declare const MsgDeleteGame: MessageFns<MsgDeleteGame>;
45029
45038
  type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
45030
45039
  type DeepPartial<T> = T extends Builtin ? T : T extends Long ? string | number | Long : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
45031
45040
  [K in keyof T]?: DeepPartial<T[K]>;
@@ -45105,6 +45114,11 @@ type sendMsgTopUpParams = {
45105
45114
  fee?: StdFee;
45106
45115
  memo?: string;
45107
45116
  };
45117
+ type sendMsgDeleteGameParams = {
45118
+ value: MsgDeleteGame;
45119
+ fee?: StdFee;
45120
+ memo?: string;
45121
+ };
45108
45122
  type msgUpdateParamsParams = {
45109
45123
  value: MsgUpdateParams;
45110
45124
  };
@@ -45141,6 +45155,9 @@ type msgSignWithdrawalParams = {
45141
45155
  type msgTopUpParams = {
45142
45156
  value: MsgTopUp;
45143
45157
  };
45158
+ type msgDeleteGameParams = {
45159
+ value: MsgDeleteGame;
45160
+ };
45144
45161
  interface TxClientOptions {
45145
45162
  addr: string;
45146
45163
  prefix: string;
@@ -45159,6 +45176,7 @@ declare const txClient: ({ signer, prefix, addr }?: TxClientOptions) => {
45159
45176
  sendMsgInitiateWithdrawal({ value, fee, memo }: sendMsgInitiateWithdrawalParams): Promise<DeliverTxResponse>;
45160
45177
  sendMsgSignWithdrawal({ value, fee, memo }: sendMsgSignWithdrawalParams): Promise<DeliverTxResponse>;
45161
45178
  sendMsgTopUp({ value, fee, memo }: sendMsgTopUpParams): Promise<DeliverTxResponse>;
45179
+ sendMsgDeleteGame({ value, fee, memo }: sendMsgDeleteGameParams): Promise<DeliverTxResponse>;
45162
45180
  msgUpdateParams({ value }: msgUpdateParamsParams): EncodeObject;
45163
45181
  msgCreateGame({ value }: msgCreateGameParams): EncodeObject;
45164
45182
  msgJoinGame({ value }: msgJoinGameParams): EncodeObject;
@@ -45171,6 +45189,7 @@ declare const txClient: ({ signer, prefix, addr }?: TxClientOptions) => {
45171
45189
  msgInitiateWithdrawal({ value }: msgInitiateWithdrawalParams): EncodeObject;
45172
45190
  msgSignWithdrawal({ value }: msgSignWithdrawalParams): EncodeObject;
45173
45191
  msgTopUp({ value }: msgTopUpParams): EncodeObject;
45192
+ msgDeleteGame({ value }: msgDeleteGameParams): EncodeObject;
45174
45193
  };
45175
45194
  interface QueryClientOptions {
45176
45195
  addr: string;
@@ -45389,6 +45408,7 @@ type TexasHoldemStateDTO = {
45389
45408
  communityCards: string[];
45390
45409
  deck: string;
45391
45410
  pots: string[];
45411
+ totalPot: string;
45392
45412
  lastActedSeat?: number;
45393
45413
  nextToAct: number;
45394
45414
  previousActions: ActionDTO[];
package/dist/index.esm.js CHANGED
@@ -4084,10 +4084,79 @@ const MsgTopUp = {
4084
4084
  return message;
4085
4085
  },
4086
4086
  };
4087
+ function createBaseMsgDeleteGame() {
4088
+ return { creator: "", gameId: "" };
4089
+ }
4090
+ const MsgDeleteGame = {
4091
+ encode(message, writer = new BinaryWriter()) {
4092
+ if (message.creator !== "") {
4093
+ writer.uint32(10).string(message.creator);
4094
+ }
4095
+ if (message.gameId !== "") {
4096
+ writer.uint32(18).string(message.gameId);
4097
+ }
4098
+ return writer;
4099
+ },
4100
+ decode(input, length) {
4101
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
4102
+ const end = length === undefined ? reader.len : reader.pos + length;
4103
+ const message = createBaseMsgDeleteGame();
4104
+ while (reader.pos < end) {
4105
+ const tag = reader.uint32();
4106
+ switch (tag >>> 3) {
4107
+ case 1: {
4108
+ if (tag !== 10) {
4109
+ break;
4110
+ }
4111
+ message.creator = reader.string();
4112
+ continue;
4113
+ }
4114
+ case 2: {
4115
+ if (tag !== 18) {
4116
+ break;
4117
+ }
4118
+ message.gameId = reader.string();
4119
+ continue;
4120
+ }
4121
+ }
4122
+ if ((tag & 7) === 4 || tag === 0) {
4123
+ break;
4124
+ }
4125
+ reader.skip(tag & 7);
4126
+ }
4127
+ return message;
4128
+ },
4129
+ fromJSON(object) {
4130
+ return {
4131
+ creator: isSet$2b(object.creator) ? globalThis.String(object.creator) : "",
4132
+ gameId: isSet$2b(object.gameId) ? globalThis.String(object.gameId) : "",
4133
+ };
4134
+ },
4135
+ toJSON(message) {
4136
+ const obj = {};
4137
+ if (message.creator !== "") {
4138
+ obj.creator = message.creator;
4139
+ }
4140
+ if (message.gameId !== "") {
4141
+ obj.gameId = message.gameId;
4142
+ }
4143
+ return obj;
4144
+ },
4145
+ create(base) {
4146
+ return MsgDeleteGame.fromPartial(base ?? {});
4147
+ },
4148
+ fromPartial(object) {
4149
+ const message = createBaseMsgDeleteGame();
4150
+ message.creator = object.creator ?? "";
4151
+ message.gameId = object.gameId ?? "";
4152
+ return message;
4153
+ },
4154
+ };
4087
4155
  function isSet$2b(value) {
4088
4156
  return value !== null && value !== undefined;
4089
4157
  }
4090
4158
 
4159
+ // Note: Some Ignite-generated types need casting due to interface mismatch with cosmjs
4091
4160
  const msgTypes$u = [
4092
4161
  ["/pokerchain.poker.v1.MsgUpdateParams", MsgUpdateParams$d],
4093
4162
  ["/pokerchain.poker.v1.MsgCreateGame", MsgCreateGame],
@@ -4102,6 +4171,7 @@ const msgTypes$u = [
4102
4171
  ["/pokerchain.poker.v1.MsgSignWithdrawal", MsgSignWithdrawal],
4103
4172
  ["/pokerchain.poker.v1.MsgUpdateEthBlockHeight", MsgUpdateEthBlockHeight],
4104
4173
  ["/pokerchain.poker.v1.MsgTopUp", MsgTopUp],
4174
+ ["/pokerchain.poker.v1.MsgDeleteGame", MsgDeleteGame],
4105
4175
  ];
4106
4176
 
4107
4177
  /**
@@ -8653,6 +8723,20 @@ const txClient$u = ({ signer, prefix, addr } = { addr: "http://localhost:26657",
8653
8723
  throw new Error('TxClient:sendMsgTopUp: Could not broadcast Tx: ' + e.message);
8654
8724
  }
8655
8725
  },
8726
+ async sendMsgDeleteGame({ value, fee, memo }) {
8727
+ if (!signer) {
8728
+ throw new Error('TxClient:sendMsgDeleteGame: Unable to sign Tx. Signer is not present.');
8729
+ }
8730
+ try {
8731
+ const { address } = (await signer.getAccounts())[0];
8732
+ const signingClient = await SigningStargateClient.connectWithSigner(addr, signer, { registry: registry$q });
8733
+ let msg = this.msgDeleteGame({ value: MsgDeleteGame.fromPartial(value) });
8734
+ return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee$p, memo);
8735
+ }
8736
+ catch (e) {
8737
+ throw new Error('TxClient:sendMsgDeleteGame: Could not broadcast Tx: ' + e.message);
8738
+ }
8739
+ },
8656
8740
  msgUpdateParams({ value }) {
8657
8741
  try {
8658
8742
  return { typeUrl: "/pokerchain.poker.v1.MsgUpdateParams", value: MsgUpdateParams$d.fromPartial(value) };
@@ -8749,6 +8833,14 @@ const txClient$u = ({ signer, prefix, addr } = { addr: "http://localhost:26657",
8749
8833
  throw new Error('TxClient:MsgTopUp: Could not create message: ' + e.message);
8750
8834
  }
8751
8835
  },
8836
+ msgDeleteGame({ value }) {
8837
+ try {
8838
+ return { typeUrl: "/pokerchain.poker.v1.MsgDeleteGame", value: MsgDeleteGame.fromPartial(value) };
8839
+ }
8840
+ catch (e) {
8841
+ throw new Error('TxClient:MsgDeleteGame: Could not create message: ' + e.message);
8842
+ }
8843
+ },
8752
8844
  };
8753
8845
  };
8754
8846
  const queryClient$u = ({ addr: addr } = { addr: "http://localhost:1317" }) => {