@block52/poker-vm-sdk 1.1.13 → 1.1.15
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 +1 -0
- package/dist/cosmosClient.d.ts +1 -0
- package/dist/cosmosClient.d.ts.map +1 -1
- package/dist/helpers.d.ts +1 -1
- package/dist/helpers.d.ts.map +1 -1
- package/dist/index.d.ts +7 -0
- package/dist/index.esm.js +164 -3
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +164 -3
- package/dist/index.js.map +1 -1
- package/dist/pokerchain.poker.v1/module.d.ts.map +1 -1
- package/dist/pokerchain.poker.v1/registry.d.ts.map +1 -1
- package/dist/pokerchain.poker.v1/types/pokerchain/poker/v1/tx.d.ts +22 -0
- package/dist/pokerchain.poker.v1/types/pokerchain/poker/v1/tx.d.ts.map +1 -1
- package/dist/signingClient.d.ts +6 -0
- package/dist/signingClient.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# @block52/poker-vm-sdk
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/@block52/poker-vm-sdk)
|
|
4
|
+
[](https://github.com/block52/poker-vm/actions/workflows/sdk-test.yml)
|
|
4
5
|
[](https://opensource.org/licenses/MIT)
|
|
5
6
|
|
|
6
7
|
TypeScript SDK for Block52 Poker VM - A blockchain-based poker platform built on Cosmos.
|
package/dist/cosmosClient.d.ts
CHANGED
|
@@ -94,6 +94,7 @@ export declare class CosmosClient implements IClient {
|
|
|
94
94
|
* Initiate a withdrawal request via REST API
|
|
95
95
|
*/
|
|
96
96
|
initiateWithdrawal(baseAddress: string, amount: bigint): Promise<string>;
|
|
97
|
+
signWithdrawal(nonce: string, validatorEthKeyHex: string): Promise<string>;
|
|
97
98
|
/**
|
|
98
99
|
* List withdrawal requests via REST API
|
|
99
100
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cosmosClient.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C,YAAY,EAAE,CAAC;IAgC1B;;OAEG;IACG,mBAAmB,CACrB,KAAK,EAAE,MAAM,EAAE,EAAE,EACjB,KAAK,GAAE,MAAM,EAAO,EACpB,IAAI,GAAE,MAAM,EAAO,EACnB,WAAW,GAAE,MAAc,GAC5B,OAAO,CAAC,cAAc,CAAC;IAmB1B;;OAEG;IACG,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;CAGpC;AAKD,eAAO,MAAM,eAAe,GAAI,SAAS,GAAG,KAAG,YAU9C,CAAC;AAEF,eAAO,MAAM,sBAAsB,GAAI,QAAQ,YAAY,KAAG,YAG7D,CAAC;AAGF,eAAO,MAAM,sBAAsB,GAAI,SAAQ,MAAoB,KAAG,YAOpE,CAAC;AAGH,OAAO,EACH,gBAAgB,EAChB,KAAK,YAAY,EACjB,KAAK,IAAI,EACT,KAAK,qBAAqB,EAC1B,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,SAAS,EACd,KAAK,oBAAoB,EACzB,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/helpers.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export type AnyFunction = (...args: any) => any;
|
|
|
3
3
|
export type UnionToIntersection<Union> = (Union extends any ? (argument: Union) => void : never) extends (argument: infer Intersection) => void ? Intersection : never;
|
|
4
4
|
export type Return<T> = T extends AnyFunction ? ReturnType<T> : T extends AnyFunction[] ? UnionToIntersection<ReturnType<T[number]>> : never;
|
|
5
5
|
export declare const MissingWalletError: Error;
|
|
6
|
-
export declare function getStructure(template:
|
|
6
|
+
export declare function getStructure(template: Record<string, unknown>): {
|
|
7
7
|
fields: Array<unknown>;
|
|
8
8
|
};
|
|
9
9
|
//# sourceMappingURL=helpers.d.ts.map
|
package/dist/helpers.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;AAEvD,MAAM,MAAM,WAAW,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,KAAK,GAAG,CAAC;AAEhD,MAAM,MAAM,mBAAmB,CAAC,KAAK,IACnC,CAAC,KAAK,SAAS,GAAG,GACd,CAAC,QAAQ,EAAE,KAAK,KAAK,IAAI,GACzB,KAAK,CACR,SAAS,CAAC,QAAQ,EAAE,MAAM,YAAY,KAAK,IAAI,GAC1C,YAAY,GAChB,KAAK,CAAC;AAEV,MAAM,MAAM,MAAM,CAAC,CAAC,IAClB,CAAC,SAAS,WAAW,GACnB,UAAU,CAAC,CAAC,CAAC,GACb,CAAC,SAAS,WAAW,EAAE,GACvB,mBAAmB,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GACtC,KAAK,CAAA;AAGb,eAAO,MAAM,kBAAkB,OAAkC,CAAC;AAElE,wBAAgB,YAAY,CAAC,QAAQ,
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;AAEvD,MAAM,MAAM,WAAW,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,KAAK,GAAG,CAAC;AAEhD,MAAM,MAAM,mBAAmB,CAAC,KAAK,IACnC,CAAC,KAAK,SAAS,GAAG,GACd,CAAC,QAAQ,EAAE,KAAK,KAAK,IAAI,GACzB,KAAK,CACR,SAAS,CAAC,QAAQ,EAAE,MAAM,YAAY,KAAK,IAAI,GAC1C,YAAY,GAChB,KAAK,CAAC;AAEV,MAAM,MAAM,MAAM,CAAC,CAAC,IAClB,CAAC,SAAS,WAAW,GACnB,UAAU,CAAC,CAAC,CAAC,GACb,CAAC,SAAS,WAAW,EAAE,GACvB,mBAAmB,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GACtC,KAAK,CAAA;AAGb,eAAO,MAAM,kBAAkB,OAAkC,CAAC;AAElE,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;YAC5B,KAAK,CAAC,OAAO,CAAC;EAQ/C"}
|
package/dist/index.d.ts
CHANGED
|
@@ -46309,6 +46309,7 @@ declare class CosmosClient implements IClient {
|
|
|
46309
46309
|
* Initiate a withdrawal request via REST API
|
|
46310
46310
|
*/
|
|
46311
46311
|
initiateWithdrawal(baseAddress: string, amount: bigint): Promise<string>;
|
|
46312
|
+
signWithdrawal(nonce: string, validatorEthKeyHex: string): Promise<string>;
|
|
46312
46313
|
/**
|
|
46313
46314
|
* List withdrawal requests via REST API
|
|
46314
46315
|
*/
|
|
@@ -46441,6 +46442,12 @@ declare class SigningCosmosClient extends CosmosClient {
|
|
|
46441
46442
|
* List all withdrawal requests for a specific address (or all if no address provided)
|
|
46442
46443
|
*/
|
|
46443
46444
|
listWithdrawalRequests(cosmosAddress?: string): Promise<any[]>;
|
|
46445
|
+
/**
|
|
46446
|
+
* Register an NFT avatar on-chain
|
|
46447
|
+
* Associates a cosmos address with an Ethereum NFT (contract + tokenId)
|
|
46448
|
+
* The validator verifies the ETH signature via ecrecover
|
|
46449
|
+
*/
|
|
46450
|
+
registerNftAvatar(ethAddress: string, contractAddress: string, tokenId: string, ethSignature: string): Promise<string>;
|
|
46444
46451
|
/**
|
|
46445
46452
|
* Get next action index for a game - matches original client pattern
|
|
46446
46453
|
* Checks previousActions array first, falls back to actionCount + 1
|
package/dist/index.esm.js
CHANGED
|
@@ -4167,11 +4167,124 @@ const MsgDeleteGame = {
|
|
|
4167
4167
|
return message;
|
|
4168
4168
|
},
|
|
4169
4169
|
};
|
|
4170
|
+
function createBaseMsgRegisterNftAvatar() {
|
|
4171
|
+
return { creator: "", ethAddress: "", contractAddress: "", tokenId: "", ethSignature: "" };
|
|
4172
|
+
}
|
|
4173
|
+
const MsgRegisterNftAvatar = {
|
|
4174
|
+
encode(message, writer = new BinaryWriter()) {
|
|
4175
|
+
if (message.creator !== "") {
|
|
4176
|
+
writer.uint32(10).string(message.creator);
|
|
4177
|
+
}
|
|
4178
|
+
if (message.ethAddress !== "") {
|
|
4179
|
+
writer.uint32(18).string(message.ethAddress);
|
|
4180
|
+
}
|
|
4181
|
+
if (message.contractAddress !== "") {
|
|
4182
|
+
writer.uint32(26).string(message.contractAddress);
|
|
4183
|
+
}
|
|
4184
|
+
if (message.tokenId !== "") {
|
|
4185
|
+
writer.uint32(34).string(message.tokenId);
|
|
4186
|
+
}
|
|
4187
|
+
if (message.ethSignature !== "") {
|
|
4188
|
+
writer.uint32(42).string(message.ethSignature);
|
|
4189
|
+
}
|
|
4190
|
+
return writer;
|
|
4191
|
+
},
|
|
4192
|
+
decode(input, length) {
|
|
4193
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
4194
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
4195
|
+
const message = createBaseMsgRegisterNftAvatar();
|
|
4196
|
+
while (reader.pos < end) {
|
|
4197
|
+
const tag = reader.uint32();
|
|
4198
|
+
switch (tag >>> 3) {
|
|
4199
|
+
case 1: {
|
|
4200
|
+
if (tag !== 10) {
|
|
4201
|
+
break;
|
|
4202
|
+
}
|
|
4203
|
+
message.creator = reader.string();
|
|
4204
|
+
continue;
|
|
4205
|
+
}
|
|
4206
|
+
case 2: {
|
|
4207
|
+
if (tag !== 18) {
|
|
4208
|
+
break;
|
|
4209
|
+
}
|
|
4210
|
+
message.ethAddress = reader.string();
|
|
4211
|
+
continue;
|
|
4212
|
+
}
|
|
4213
|
+
case 3: {
|
|
4214
|
+
if (tag !== 26) {
|
|
4215
|
+
break;
|
|
4216
|
+
}
|
|
4217
|
+
message.contractAddress = reader.string();
|
|
4218
|
+
continue;
|
|
4219
|
+
}
|
|
4220
|
+
case 4: {
|
|
4221
|
+
if (tag !== 34) {
|
|
4222
|
+
break;
|
|
4223
|
+
}
|
|
4224
|
+
message.tokenId = reader.string();
|
|
4225
|
+
continue;
|
|
4226
|
+
}
|
|
4227
|
+
case 5: {
|
|
4228
|
+
if (tag !== 42) {
|
|
4229
|
+
break;
|
|
4230
|
+
}
|
|
4231
|
+
message.ethSignature = reader.string();
|
|
4232
|
+
continue;
|
|
4233
|
+
}
|
|
4234
|
+
}
|
|
4235
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
4236
|
+
break;
|
|
4237
|
+
}
|
|
4238
|
+
reader.skip(tag & 7);
|
|
4239
|
+
}
|
|
4240
|
+
return message;
|
|
4241
|
+
},
|
|
4242
|
+
fromJSON(object) {
|
|
4243
|
+
return {
|
|
4244
|
+
creator: isSet$2b(object.creator) ? globalThis.String(object.creator) : "",
|
|
4245
|
+
ethAddress: isSet$2b(object.ethAddress) ? globalThis.String(object.ethAddress) : "",
|
|
4246
|
+
contractAddress: isSet$2b(object.contractAddress) ? globalThis.String(object.contractAddress) : "",
|
|
4247
|
+
tokenId: isSet$2b(object.tokenId) ? globalThis.String(object.tokenId) : "",
|
|
4248
|
+
ethSignature: isSet$2b(object.ethSignature) ? globalThis.String(object.ethSignature) : "",
|
|
4249
|
+
};
|
|
4250
|
+
},
|
|
4251
|
+
toJSON(message) {
|
|
4252
|
+
const obj = {};
|
|
4253
|
+
if (message.creator !== "") {
|
|
4254
|
+
obj.creator = message.creator;
|
|
4255
|
+
}
|
|
4256
|
+
if (message.ethAddress !== "") {
|
|
4257
|
+
obj.ethAddress = message.ethAddress;
|
|
4258
|
+
}
|
|
4259
|
+
if (message.contractAddress !== "") {
|
|
4260
|
+
obj.contractAddress = message.contractAddress;
|
|
4261
|
+
}
|
|
4262
|
+
if (message.tokenId !== "") {
|
|
4263
|
+
obj.tokenId = message.tokenId;
|
|
4264
|
+
}
|
|
4265
|
+
if (message.ethSignature !== "") {
|
|
4266
|
+
obj.ethSignature = message.ethSignature;
|
|
4267
|
+
}
|
|
4268
|
+
return obj;
|
|
4269
|
+
},
|
|
4270
|
+
create(base) {
|
|
4271
|
+
return MsgRegisterNftAvatar.fromPartial(base ?? {});
|
|
4272
|
+
},
|
|
4273
|
+
fromPartial(object) {
|
|
4274
|
+
const message = createBaseMsgRegisterNftAvatar();
|
|
4275
|
+
message.creator = object.creator ?? "";
|
|
4276
|
+
message.ethAddress = object.ethAddress ?? "";
|
|
4277
|
+
message.contractAddress = object.contractAddress ?? "";
|
|
4278
|
+
message.tokenId = object.tokenId ?? "";
|
|
4279
|
+
message.ethSignature = object.ethSignature ?? "";
|
|
4280
|
+
return message;
|
|
4281
|
+
},
|
|
4282
|
+
};
|
|
4170
4283
|
function isSet$2b(value) {
|
|
4171
4284
|
return value !== null && value !== undefined;
|
|
4172
4285
|
}
|
|
4173
4286
|
|
|
4174
|
-
//
|
|
4287
|
+
// Proto-generated MessageFns types need casting to cosmjs GeneratedType
|
|
4175
4288
|
const msgTypes$u = [
|
|
4176
4289
|
["/pokerchain.poker.v1.MsgUpdateParams", MsgUpdateParams$d],
|
|
4177
4290
|
["/pokerchain.poker.v1.MsgCreateGame", MsgCreateGame],
|
|
@@ -4187,6 +4300,7 @@ const msgTypes$u = [
|
|
|
4187
4300
|
["/pokerchain.poker.v1.MsgUpdateEthBlockHeight", MsgUpdateEthBlockHeight],
|
|
4188
4301
|
["/pokerchain.poker.v1.MsgTopUp", MsgTopUp],
|
|
4189
4302
|
["/pokerchain.poker.v1.MsgDeleteGame", MsgDeleteGame],
|
|
4303
|
+
["/pokerchain.poker.v1.MsgRegisterNftAvatar", MsgRegisterNftAvatar],
|
|
4190
4304
|
];
|
|
4191
4305
|
|
|
4192
4306
|
/**
|
|
@@ -8121,6 +8235,7 @@ let HttpClient$u = class HttpClient {
|
|
|
8121
8235
|
const requestParams = this.mergeRequestParams(params, secureParams);
|
|
8122
8236
|
const responseFormat = (format && this.format) || void 0;
|
|
8123
8237
|
if (type === ContentType$u.FormData && body && body !== null && typeof body === "object") {
|
|
8238
|
+
requestParams.headers = requestParams.headers || {};
|
|
8124
8239
|
requestParams.headers.common = { Accept: "*/*" };
|
|
8125
8240
|
requestParams.headers.post = {};
|
|
8126
8241
|
requestParams.headers.put = {};
|
|
@@ -8556,7 +8671,7 @@ function isSet$2a(value) {
|
|
|
8556
8671
|
const registry$q = new Registry(msgTypes$u);
|
|
8557
8672
|
function getStructure$s(template) {
|
|
8558
8673
|
const structure = { fields: [] };
|
|
8559
|
-
for (
|
|
8674
|
+
for (const [key, value] of Object.entries(template)) {
|
|
8560
8675
|
let field = { name: key, type: typeof value };
|
|
8561
8676
|
structure.fields.push(field);
|
|
8562
8677
|
}
|
|
@@ -8881,7 +8996,7 @@ let SDKModule$u = class SDKModule {
|
|
|
8881
8996
|
prefix: client.env.prefix ?? "cosmos",
|
|
8882
8997
|
});
|
|
8883
8998
|
this.tx = methods;
|
|
8884
|
-
for (
|
|
8999
|
+
for (const m in methods) {
|
|
8885
9000
|
this.tx[m] = methods[m].bind(this.tx);
|
|
8886
9001
|
}
|
|
8887
9002
|
}
|
|
@@ -57473,6 +57588,9 @@ class CosmosClient {
|
|
|
57473
57588
|
async initiateWithdrawal(baseAddress, amount) {
|
|
57474
57589
|
throw new Error("Transaction signing not implemented in REST-only mode. Use a wallet implementation.");
|
|
57475
57590
|
}
|
|
57591
|
+
async signWithdrawal(nonce, validatorEthKeyHex) {
|
|
57592
|
+
throw new Error("Transaction signing not implemented in REST-only mode. Use SigningCosmosClient instead.");
|
|
57593
|
+
}
|
|
57476
57594
|
/**
|
|
57477
57595
|
* List withdrawal requests via REST API
|
|
57478
57596
|
*/
|
|
@@ -58069,6 +58187,49 @@ class SigningCosmosClient extends CosmosClient {
|
|
|
58069
58187
|
throw error;
|
|
58070
58188
|
}
|
|
58071
58189
|
}
|
|
58190
|
+
/**
|
|
58191
|
+
* Register an NFT avatar on-chain
|
|
58192
|
+
* Associates a cosmos address with an Ethereum NFT (contract + tokenId)
|
|
58193
|
+
* The validator verifies the ETH signature via ecrecover
|
|
58194
|
+
*/
|
|
58195
|
+
async registerNftAvatar(ethAddress, contractAddress, tokenId, ethSignature) {
|
|
58196
|
+
await this.initializeSigningClient();
|
|
58197
|
+
if (!this.signingClient || !this.wallet) {
|
|
58198
|
+
throw new Error("Signing client not initialized");
|
|
58199
|
+
}
|
|
58200
|
+
const [account] = await this.wallet.getAccounts();
|
|
58201
|
+
const creator = account.address;
|
|
58202
|
+
// Create the message object
|
|
58203
|
+
const msgRegisterNftAvatar = {
|
|
58204
|
+
creator,
|
|
58205
|
+
ethAddress,
|
|
58206
|
+
contractAddress,
|
|
58207
|
+
tokenId,
|
|
58208
|
+
ethSignature
|
|
58209
|
+
};
|
|
58210
|
+
// Create the transaction message
|
|
58211
|
+
const msg = {
|
|
58212
|
+
typeUrl: "/pokerchain.poker.v1.MsgRegisterNftAvatar",
|
|
58213
|
+
value: msgRegisterNftAvatar
|
|
58214
|
+
};
|
|
58215
|
+
const fee = gaslessFee();
|
|
58216
|
+
const memo = "Register NFT avatar via SDK";
|
|
58217
|
+
console.log("🖼️ Registering NFT avatar:", {
|
|
58218
|
+
creator,
|
|
58219
|
+
ethAddress,
|
|
58220
|
+
contractAddress,
|
|
58221
|
+
tokenId
|
|
58222
|
+
});
|
|
58223
|
+
try {
|
|
58224
|
+
const result = await this.signingClient.signAndBroadcast(creator, [msg], fee, memo);
|
|
58225
|
+
console.log("✅ NFT avatar registration successful:", result.transactionHash);
|
|
58226
|
+
return result.transactionHash;
|
|
58227
|
+
}
|
|
58228
|
+
catch (error) {
|
|
58229
|
+
console.error("❌ NFT avatar registration failed:", error);
|
|
58230
|
+
throw error;
|
|
58231
|
+
}
|
|
58232
|
+
}
|
|
58072
58233
|
/**
|
|
58073
58234
|
* Get next action index for a game - matches original client pattern
|
|
58074
58235
|
* Checks previousActions array first, falls back to actionCount + 1
|