@hashgraphonline/standards-sdk 0.1.174 → 0.1.175

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.
Files changed (79) hide show
  1. package/dist/browser/inscribe/inscriber.d.ts.map +1 -1
  2. package/dist/browser/standards-sdk.browser.js +16 -14
  3. package/dist/browser/standards-sdk.browser.js.map +1 -1
  4. package/dist/browser-root/inscribe/inscriber.d.ts.map +1 -1
  5. package/dist/cjs/inscribe/inscriber.d.ts.map +1 -1
  6. package/dist/cjs/standards-sdk.cjs +1 -1
  7. package/dist/cjs/standards-sdk.cjs.map +1 -1
  8. package/dist/es/inscribe/inscriber.d.ts.map +1 -1
  9. package/dist/es/standards-sdk.es116.js +1 -1
  10. package/dist/es/standards-sdk.es121.js +1 -1
  11. package/dist/es/standards-sdk.es127.js +1 -1
  12. package/dist/es/standards-sdk.es128.js +5 -5
  13. package/dist/es/standards-sdk.es138.js +1 -1
  14. package/dist/es/standards-sdk.es139.js +1 -1
  15. package/dist/es/standards-sdk.es140.js +5 -5
  16. package/dist/es/standards-sdk.es142.js +19 -17
  17. package/dist/es/standards-sdk.es142.js.map +1 -1
  18. package/dist/es/standards-sdk.es143.js +1 -1
  19. package/dist/es/standards-sdk.es145.js +3 -3
  20. package/dist/es/standards-sdk.es147.js +1 -1
  21. package/dist/es/standards-sdk.es148.js +1 -1
  22. package/dist/es/standards-sdk.es16.js +1 -1
  23. package/dist/es/standards-sdk.es160.js +12461 -1608
  24. package/dist/es/standards-sdk.es160.js.map +1 -1
  25. package/dist/es/standards-sdk.es161.js +1608 -12461
  26. package/dist/es/standards-sdk.es161.js.map +1 -1
  27. package/dist/es/standards-sdk.es163.js +159 -560
  28. package/dist/es/standards-sdk.es163.js.map +1 -1
  29. package/dist/es/standards-sdk.es164.js +289 -139
  30. package/dist/es/standards-sdk.es164.js.map +1 -1
  31. package/dist/es/standards-sdk.es165.js +298 -274
  32. package/dist/es/standards-sdk.es165.js.map +1 -1
  33. package/dist/es/standards-sdk.es166.js +369 -262
  34. package/dist/es/standards-sdk.es166.js.map +1 -1
  35. package/dist/es/standards-sdk.es167.js +194 -316
  36. package/dist/es/standards-sdk.es167.js.map +1 -1
  37. package/dist/es/standards-sdk.es168.js +64 -319
  38. package/dist/es/standards-sdk.es168.js.map +1 -1
  39. package/dist/es/standards-sdk.es169.js +87 -59
  40. package/dist/es/standards-sdk.es169.js.map +1 -1
  41. package/dist/es/standards-sdk.es170.js +59 -90
  42. package/dist/es/standards-sdk.es170.js.map +1 -1
  43. package/dist/es/standards-sdk.es171.js +51 -68
  44. package/dist/es/standards-sdk.es171.js.map +1 -1
  45. package/dist/es/standards-sdk.es172.js +73 -48
  46. package/dist/es/standards-sdk.es172.js.map +1 -1
  47. package/dist/es/standards-sdk.es173.js +180 -61
  48. package/dist/es/standards-sdk.es173.js.map +1 -1
  49. package/dist/es/standards-sdk.es174.js +560 -187
  50. package/dist/es/standards-sdk.es174.js.map +1 -1
  51. package/dist/es/standards-sdk.es175.js +1 -1
  52. package/dist/es/standards-sdk.es176.js +1 -1
  53. package/dist/es/standards-sdk.es178.js +2 -2
  54. package/dist/es/standards-sdk.es179.js +1 -1
  55. package/dist/es/standards-sdk.es18.js +2 -2
  56. package/dist/es/standards-sdk.es180.js +1 -1
  57. package/dist/es/standards-sdk.es181.js +2 -2
  58. package/dist/es/standards-sdk.es182.js +1 -1
  59. package/dist/es/standards-sdk.es183.js +1 -1
  60. package/dist/es/standards-sdk.es19.js +2 -2
  61. package/dist/es/standards-sdk.es27.js +2 -2
  62. package/dist/es/standards-sdk.es30.js +1 -1
  63. package/dist/es/standards-sdk.es31.js +1 -1
  64. package/dist/es/standards-sdk.es35.js +2 -2
  65. package/dist/es/standards-sdk.es36.js +1 -1
  66. package/dist/es/standards-sdk.es37.js +1 -1
  67. package/dist/es/standards-sdk.es56.js +1 -1
  68. package/dist/es/standards-sdk.es59.js +1 -1
  69. package/dist/es/standards-sdk.es60.js +1 -1
  70. package/dist/es/standards-sdk.es62.js +1 -1
  71. package/dist/es/standards-sdk.es63.js +2 -2
  72. package/dist/es/standards-sdk.es64.js +1 -1
  73. package/dist/es/standards-sdk.es65.js +1 -1
  74. package/dist/es/standards-sdk.es66.js +1 -1
  75. package/dist/es/standards-sdk.es67.js +1 -1
  76. package/dist/es/standards-sdk.es69.js +1 -1
  77. package/dist/es/standards-sdk.es75.js +1 -1
  78. package/dist/es/standards-sdk.es84.js +1 -1
  79. package/package.json +1 -1
@@ -1,576 +1,175 @@
1
- import { skillRegistryConfigResponseSchema, skillStatusResponseSchema, skillRegistryListResponseSchema, skillSecurityBreakdownResponseSchema, skillCatalogResponseSchema, skillRegistryVersionsResponseSchema, skillRegistryMineResponseSchema, skillRegistryMyListResponseSchema, skillRegistryQuoteResponseSchema, skillRegistryPublishResponseSchema, skillRegistryJobStatusResponseSchema, skillRegistryOwnershipResponseSchema, skillRecommendedVersionResponseSchema, skillDeprecationsResponseSchema, skillDeprecationRecordSchema, skillBadgeResponseSchema, skillRegistryTagsResponseSchema, skillRegistryCategoriesResponseSchema, skillResolverManifestResponseSchema, skillRegistryVoteStatusResponseSchema, skillVerificationRequestCreateResponseSchema, skillVerificationStatusResponseSchema, skillVerificationDomainProofChallengeResponseSchema, skillVerificationDomainProofVerifyResponseSchema } from "./standards-sdk.es160.js";
2
- async function skillsConfig(client) {
3
- const raw = await client.requestJson("/skills/config", {
4
- method: "GET"
5
- });
6
- return client.parseWithSchema(
7
- raw,
8
- skillRegistryConfigResponseSchema,
9
- "skill registry config response"
10
- );
11
- }
12
- async function getSkillStatus(client, params) {
13
- const normalizedName = params.name.trim();
14
- if (!normalizedName) {
15
- throw new Error("name is required");
16
- }
17
- const query = new URLSearchParams();
18
- query.set("name", normalizedName);
19
- if (params.version?.trim()) {
20
- query.set("version", params.version.trim());
21
- }
22
- const raw = await client.requestJson(
23
- `/skills/status?${query.toString()}`,
24
- {
25
- method: "GET"
1
+ import { Long, AccountId } from "@hashgraph/sdk";
2
+ import { parseKey } from "./standards-sdk.es168.js";
3
+ import { Buffer } from "buffer";
4
+ class HCSParser {
5
+ static parseConsensusCreateTopic(body) {
6
+ if (!body) return void 0;
7
+ const data = {};
8
+ if (body.memo) {
9
+ data.memo = body.memo;
26
10
  }
27
- );
28
- return client.parseWithSchema(
29
- raw,
30
- skillStatusResponseSchema,
31
- "skill status response"
32
- );
33
- }
34
- async function listSkills(client, params = {}) {
35
- const query = new URLSearchParams();
36
- if (params.name) {
37
- query.set("name", params.name);
38
- }
39
- if (params.version) {
40
- query.set("version", params.version);
41
- }
42
- if (typeof params.limit === "number" && Number.isFinite(params.limit)) {
43
- query.set("limit", String(Math.trunc(params.limit)));
44
- }
45
- if (params.cursor) {
46
- query.set("cursor", params.cursor);
47
- }
48
- if (typeof params.includeFiles === "boolean") {
49
- query.set("includeFiles", params.includeFiles ? "true" : "false");
50
- }
51
- if (params.accountId) {
52
- query.set("accountId", params.accountId);
53
- }
54
- if (params.q) {
55
- query.set("q", params.q);
56
- }
57
- if (params.tag) {
58
- query.set("tag", params.tag);
59
- }
60
- if (params.category) {
61
- query.set("category", params.category);
62
- }
63
- if (typeof params.featured === "boolean") {
64
- query.set("featured", params.featured ? "true" : "false");
65
- }
66
- if (typeof params.verified === "boolean") {
67
- query.set("verified", params.verified ? "true" : "false");
68
- }
69
- if (params.view) {
70
- query.set("view", params.view);
71
- }
72
- const suffix = query.size > 0 ? `?${query.toString()}` : "";
73
- const raw = await client.requestJson(`/skills${suffix}`, {
74
- method: "GET"
75
- });
76
- return client.parseWithSchema(
77
- raw,
78
- skillRegistryListResponseSchema,
79
- "skill registry list response"
80
- );
81
- }
82
- async function getSkillSecurityBreakdown(client, params) {
83
- const normalizedJobId = params.jobId.trim();
84
- if (!normalizedJobId) {
85
- throw new Error("jobId is required");
86
- }
87
- const raw = await client.requestJson(
88
- `/skills/${encodeURIComponent(normalizedJobId)}/security-breakdown`,
89
- { method: "GET" }
90
- );
91
- return client.parseWithSchema(
92
- raw,
93
- skillSecurityBreakdownResponseSchema,
94
- "skill security breakdown response"
95
- );
96
- }
97
- async function getSkillsCatalog(client, params = {}) {
98
- const query = new URLSearchParams();
99
- if (params.q) {
100
- query.set("q", params.q);
101
- }
102
- if (params.category) {
103
- query.set("category", params.category);
104
- }
105
- params.tags?.forEach((tag) => {
106
- if (tag.trim()) {
107
- query.append("tag", tag.trim());
11
+ data.adminKey = parseKey(body.adminKey);
12
+ data.submitKey = parseKey(body.submitKey);
13
+ if (body.autoRenewPeriod?.seconds) {
14
+ data.autoRenewPeriod = Long.fromValue(
15
+ body.autoRenewPeriod.seconds
16
+ ).toString();
108
17
  }
109
- });
110
- if (typeof params.featured === "boolean") {
111
- query.set("featured", params.featured ? "true" : "false");
112
- }
113
- if (typeof params.verified === "boolean") {
114
- query.set("verified", params.verified ? "true" : "false");
115
- }
116
- if (params.channel) {
117
- query.set("channel", params.channel);
118
- }
119
- if (params.sortBy) {
120
- query.set("sortBy", params.sortBy);
121
- }
122
- if (typeof params.limit === "number" && Number.isFinite(params.limit)) {
123
- query.set("limit", String(Math.trunc(params.limit)));
124
- }
125
- if (params.cursor) {
126
- query.set("cursor", params.cursor);
127
- }
128
- const suffix = query.size > 0 ? `?${query.toString()}` : "";
129
- const raw = await client.requestJson(`/skills/catalog${suffix}`, {
130
- method: "GET"
131
- });
132
- return client.parseWithSchema(
133
- raw,
134
- skillCatalogResponseSchema,
135
- "skill catalog response"
136
- );
137
- }
138
- async function listSkillVersions(client, params) {
139
- const normalizedName = params.name.trim();
140
- if (!normalizedName) {
141
- throw new Error("name is required");
142
- }
143
- const query = new URLSearchParams();
144
- query.set("name", normalizedName);
145
- const raw = await client.requestJson(
146
- `/skills/versions?${query.toString()}`,
147
- { method: "GET" }
148
- );
149
- return client.parseWithSchema(
150
- raw,
151
- skillRegistryVersionsResponseSchema,
152
- "skill registry versions response"
153
- );
154
- }
155
- async function listMySkills(client, params = {}) {
156
- const query = new URLSearchParams();
157
- if (typeof params.limit === "number" && Number.isFinite(params.limit)) {
158
- query.set("limit", String(Math.trunc(params.limit)));
159
- }
160
- const suffix = query.size > 0 ? `?${query.toString()}` : "";
161
- const raw = await client.requestJson(`/skills/mine${suffix}`, {
162
- method: "GET"
163
- });
164
- return client.parseWithSchema(
165
- raw,
166
- skillRegistryMineResponseSchema,
167
- "skill registry mine response"
168
- );
169
- }
170
- async function getMySkillsList(client, params = {}) {
171
- const query = new URLSearchParams();
172
- if (typeof params.limit === "number" && Number.isFinite(params.limit)) {
173
- query.set("limit", String(Math.trunc(params.limit)));
174
- }
175
- if (params.cursor) {
176
- query.set("cursor", params.cursor);
177
- }
178
- if (params.accountId) {
179
- query.set("accountId", params.accountId);
180
- }
181
- const suffix = query.size > 0 ? `?${query.toString()}` : "";
182
- const raw = await client.requestJson(`/skills/my-list${suffix}`, {
183
- method: "GET"
184
- });
185
- return client.parseWithSchema(
186
- raw,
187
- skillRegistryMyListResponseSchema,
188
- "skill registry my list response"
189
- );
190
- }
191
- async function quoteSkillPublish(client, payload) {
192
- const raw = await client.requestJson("/skills/quote", {
193
- method: "POST",
194
- body: payload,
195
- headers: { "content-type": "application/json" }
196
- });
197
- return client.parseWithSchema(
198
- raw,
199
- skillRegistryQuoteResponseSchema,
200
- "skill registry quote response"
201
- );
202
- }
203
- async function publishSkill(client, payload) {
204
- const raw = await client.requestJson("/skills/publish", {
205
- method: "POST",
206
- body: payload,
207
- headers: { "content-type": "application/json" }
208
- });
209
- return client.parseWithSchema(
210
- raw,
211
- skillRegistryPublishResponseSchema,
212
- "skill registry publish response"
213
- );
214
- }
215
- async function getSkillPublishJob(client, jobId, params = {}) {
216
- const normalized = jobId.trim();
217
- if (!normalized) {
218
- throw new Error("jobId is required");
219
- }
220
- const query = new URLSearchParams();
221
- if (params.accountId) {
222
- query.set("accountId", params.accountId);
223
- }
224
- const suffix = query.size > 0 ? `?${query.toString()}` : "";
225
- const raw = await client.requestJson(
226
- `/skills/jobs/${encodeURIComponent(normalized)}${suffix}`,
227
- { method: "GET" }
228
- );
229
- return client.parseWithSchema(
230
- raw,
231
- skillRegistryJobStatusResponseSchema,
232
- "skill registry job status response"
233
- );
234
- }
235
- async function getSkillOwnership(client, params) {
236
- const normalizedName = params.name.trim();
237
- if (!normalizedName) {
238
- throw new Error("name is required");
239
- }
240
- const query = new URLSearchParams();
241
- query.set("name", normalizedName);
242
- if (params.accountId) {
243
- query.set("accountId", params.accountId);
244
- }
245
- const raw = await client.requestJson(
246
- `/skills/ownership?${query.toString()}`,
247
- {
248
- method: "GET"
18
+ if (body.autoRenewAccount) {
19
+ data.autoRenewAccountId = new AccountId(
20
+ body.autoRenewAccount.shardNum ?? 0,
21
+ body.autoRenewAccount.realmNum ?? 0,
22
+ body.autoRenewAccount.accountNum ?? 0
23
+ ).toString();
249
24
  }
250
- );
251
- return client.parseWithSchema(
252
- raw,
253
- skillRegistryOwnershipResponseSchema,
254
- "skill registry ownership response"
255
- );
256
- }
257
- async function getRecommendedSkillVersion(client, params) {
258
- const normalizedName = params.name.trim();
259
- if (!normalizedName) {
260
- throw new Error("name is required");
261
- }
262
- const query = new URLSearchParams();
263
- query.set("name", normalizedName);
264
- const raw = await client.requestJson(
265
- `/skills/recommended?${query.toString()}`,
266
- { method: "GET" }
267
- );
268
- return client.parseWithSchema(
269
- raw,
270
- skillRecommendedVersionResponseSchema,
271
- "skill recommended version response"
272
- );
273
- }
274
- async function setRecommendedSkillVersion(client, payload) {
275
- const normalizedName = payload.name.trim();
276
- const normalizedVersion = payload.version.trim();
277
- if (!normalizedName) {
278
- throw new Error("name is required");
279
- }
280
- if (!normalizedVersion) {
281
- throw new Error("version is required");
282
- }
283
- const raw = await client.requestJson("/skills/recommended", {
284
- method: "POST",
285
- body: {
286
- name: normalizedName,
287
- version: normalizedVersion
288
- },
289
- headers: { "content-type": "application/json" }
290
- });
291
- return client.parseWithSchema(
292
- raw,
293
- skillRecommendedVersionResponseSchema,
294
- "skill recommended version response"
295
- );
296
- }
297
- async function getSkillDeprecations(client, params) {
298
- const normalizedName = params.name.trim();
299
- if (!normalizedName) {
300
- throw new Error("name is required");
301
- }
302
- const query = new URLSearchParams();
303
- query.set("name", normalizedName);
304
- const raw = await client.requestJson(
305
- `/skills/deprecations?${query.toString()}`,
306
- { method: "GET" }
307
- );
308
- return client.parseWithSchema(
309
- raw,
310
- skillDeprecationsResponseSchema,
311
- "skill deprecations response"
312
- );
313
- }
314
- async function setSkillDeprecation(client, payload) {
315
- const normalizedName = payload.name.trim();
316
- if (!normalizedName) {
317
- throw new Error("name is required");
318
- }
319
- const version = payload.version?.trim();
320
- const reason = payload.reason.trim();
321
- if (!reason) {
322
- throw new Error("reason is required");
323
- }
324
- const replacementRef = payload.replacementRef?.trim();
325
- const raw = await client.requestJson("/skills/deprecate", {
326
- method: "POST",
327
- body: {
328
- name: normalizedName,
329
- version,
330
- reason,
331
- replacementRef
332
- },
333
- headers: { "content-type": "application/json" }
334
- });
335
- return client.parseWithSchema(
336
- raw,
337
- skillDeprecationRecordSchema,
338
- "skill deprecation response"
339
- );
340
- }
341
- async function getSkillBadge(client, params) {
342
- const normalizedName = params.name.trim();
343
- if (!normalizedName) {
344
- throw new Error("name is required");
345
- }
346
- const query = new URLSearchParams();
347
- query.set("name", normalizedName);
348
- if (params.metric) {
349
- query.set("metric", params.metric);
350
- }
351
- if (params.label?.trim()) {
352
- query.set("label", params.label.trim());
353
- }
354
- if (params.style) {
355
- query.set("style", params.style);
25
+ return data;
356
26
  }
357
- const raw = await client.requestJson(
358
- `/skills/badge?${query.toString()}`,
359
- { method: "GET" }
360
- );
361
- return client.parseWithSchema(
362
- raw,
363
- skillBadgeResponseSchema,
364
- "skill badge response"
365
- );
366
- }
367
- async function listSkillTags(client) {
368
- const raw = await client.requestJson("/skills/tags", {
369
- method: "GET"
370
- });
371
- return client.parseWithSchema(
372
- raw,
373
- skillRegistryTagsResponseSchema,
374
- "skill tags response"
375
- );
376
- }
377
- async function listSkillCategories(client) {
378
- const raw = await client.requestJson("/skills/categories", {
379
- method: "GET"
380
- });
381
- return client.parseWithSchema(
382
- raw,
383
- skillRegistryCategoriesResponseSchema,
384
- "skill categories response"
385
- );
386
- }
387
- async function resolveSkillMarkdown(client, skillRef) {
388
- const normalizedSkillRef = skillRef.trim();
389
- if (!normalizedSkillRef) {
390
- throw new Error("skillRef is required");
391
- }
392
- const response = await client.request(
393
- `/skills/${encodeURIComponent(normalizedSkillRef)}/SKILL.md`,
394
- {
395
- method: "GET",
396
- headers: {
397
- accept: "text/markdown, text/plain;q=0.9, */*;q=0.8"
27
+ static parseConsensusSubmitMessage(body) {
28
+ if (!body) return void 0;
29
+ const data = {};
30
+ if (body.topicID) {
31
+ data.topicId = `${body.topicID.shardNum ?? 0}.${body.topicID.realmNum ?? 0}.${body.topicID.topicNum ?? 0}`;
32
+ }
33
+ if (body.message?.length > 0) {
34
+ const messageBuffer = Buffer.from(body.message);
35
+ const utf8String = messageBuffer.toString("utf8");
36
+ if (/[\x00-\x08\x0B\x0E-\x1F\x7F]/.test(utf8String) || utf8String.includes("�")) {
37
+ data.message = messageBuffer.toString("base64");
38
+ data.messageEncoding = "base64";
39
+ } else {
40
+ data.message = utf8String;
41
+ data.messageEncoding = "utf8";
398
42
  }
399
43
  }
400
- );
401
- return response.text();
402
- }
403
- async function resolveSkillManifest(client, skillRef) {
404
- const normalizedSkillRef = skillRef.trim();
405
- if (!normalizedSkillRef) {
406
- throw new Error("skillRef is required");
407
- }
408
- const raw = await client.requestJson(
409
- `/skills/${encodeURIComponent(normalizedSkillRef)}/manifest`,
410
- {
411
- method: "GET"
44
+ if (body.chunkInfo) {
45
+ if (body.chunkInfo.initialTransactionID) {
46
+ const txId = body.chunkInfo.initialTransactionID.accountID;
47
+ const taValidStart = body.chunkInfo.initialTransactionID.transactionValidStart;
48
+ if (txId && taValidStart) {
49
+ data.chunkInfoInitialTransactionID = `${txId.shardNum ?? 0}.${txId.realmNum ?? 0}.${txId.accountNum ?? 0}@${taValidStart.seconds ?? 0}.${taValidStart.nanos ?? 0}`;
50
+ }
51
+ }
52
+ if (body.chunkInfo.number !== void 0 && body.chunkInfo.number !== null) {
53
+ data.chunkInfoNumber = body.chunkInfo.number;
54
+ }
55
+ if (body.chunkInfo.total !== void 0 && body.chunkInfo.total !== null) {
56
+ data.chunkInfoTotal = body.chunkInfo.total;
57
+ }
412
58
  }
413
- );
414
- return client.parseWithSchema(
415
- raw,
416
- skillResolverManifestResponseSchema,
417
- "skill resolver manifest response"
418
- );
419
- }
420
- async function getSkillVoteStatus(client, params) {
421
- const normalizedName = params.name.trim();
422
- if (!normalizedName) {
423
- throw new Error("name is required");
59
+ return data;
424
60
  }
425
- const query = new URLSearchParams();
426
- query.set("name", normalizedName);
427
- const raw = await client.requestJson(
428
- `/skills/vote?${query.toString()}`,
429
- { method: "GET" }
430
- );
431
- return client.parseWithSchema(
432
- raw,
433
- skillRegistryVoteStatusResponseSchema,
434
- "skill registry vote status response"
435
- );
436
- }
437
- async function setSkillVote(client, payload) {
438
- const normalizedName = payload.name.trim();
439
- if (!normalizedName) {
440
- throw new Error("name is required");
441
- }
442
- const raw = await client.requestJson("/skills/vote", {
443
- method: "POST",
444
- body: { name: normalizedName, upvoted: payload.upvoted },
445
- headers: { "content-type": "application/json" }
446
- });
447
- return client.parseWithSchema(
448
- raw,
449
- skillRegistryVoteStatusResponseSchema,
450
- "skill registry vote status response"
451
- );
452
- }
453
- async function requestSkillVerification(client, payload) {
454
- const normalizedName = payload.name.trim();
455
- if (!normalizedName) {
456
- throw new Error("name is required");
457
- }
458
- const raw = await client.requestJson(
459
- "/skills/verification/request",
460
- {
461
- method: "POST",
462
- body: {
463
- name: normalizedName,
464
- version: payload.version,
465
- tier: payload.tier
466
- },
467
- headers: { "content-type": "application/json" }
61
+ static parseConsensusUpdateTopic(body) {
62
+ if (!body) return void 0;
63
+ const data = {};
64
+ if (body.topicID) {
65
+ data.topicId = `${body.topicID.shardNum}.${body.topicID.realmNum}.${body.topicID.topicNum}`;
468
66
  }
469
- );
470
- return client.parseWithSchema(
471
- raw,
472
- skillVerificationRequestCreateResponseSchema,
473
- "skill verification request create response"
474
- );
475
- }
476
- async function getSkillVerificationStatus(client, params) {
477
- const normalizedName = params.name.trim();
478
- if (!normalizedName) {
479
- throw new Error("name is required");
480
- }
481
- const query = new URLSearchParams();
482
- query.set("name", normalizedName);
483
- if (params.version) {
484
- query.set("version", params.version);
485
- }
486
- const raw = await client.requestJson(
487
- `/skills/verification/status?${query.toString()}`,
488
- { method: "GET" }
489
- );
490
- return client.parseWithSchema(
491
- raw,
492
- skillVerificationStatusResponseSchema,
493
- "skill verification status response"
494
- );
495
- }
496
- async function createSkillDomainProofChallenge(client, payload) {
497
- const normalizedName = payload.name.trim();
498
- if (!normalizedName) {
499
- throw new Error("name is required");
500
- }
501
- const raw = await client.requestJson(
502
- "/skills/verification/domain/challenge",
503
- {
504
- method: "POST",
505
- body: {
506
- name: normalizedName,
507
- version: payload.version,
508
- domain: payload.domain
509
- },
510
- headers: { "content-type": "application/json" }
67
+ if (body.memo?.value !== void 0) {
68
+ data.memo = body.memo.value;
511
69
  }
512
- );
513
- return client.parseWithSchema(
514
- raw,
515
- skillVerificationDomainProofChallengeResponseSchema,
516
- "skill domain proof challenge response"
517
- );
518
- }
519
- async function verifySkillDomainProof(client, payload) {
520
- const normalizedName = payload.name.trim();
521
- const challengeToken = payload.challengeToken.trim();
522
- if (!normalizedName) {
523
- throw new Error("name is required");
524
- }
525
- if (!challengeToken) {
526
- throw new Error("challengeToken is required");
70
+ if (body.adminKey === null) {
71
+ data.clearAdminKey = true;
72
+ data.adminKey = void 0;
73
+ } else if (body.adminKey) {
74
+ data.adminKey = parseKey(body.adminKey);
75
+ } else {
76
+ data.adminKey = void 0;
77
+ }
78
+ if (body.submitKey === null) {
79
+ data.clearSubmitKey = true;
80
+ data.submitKey = void 0;
81
+ } else if (body.submitKey) {
82
+ data.submitKey = parseKey(body.submitKey);
83
+ } else {
84
+ data.submitKey = void 0;
85
+ }
86
+ if (body.autoRenewPeriod?.seconds) {
87
+ data.autoRenewPeriod = Long.fromValue(
88
+ body.autoRenewPeriod.seconds
89
+ ).toString();
90
+ }
91
+ if (body.autoRenewAccount) {
92
+ data.autoRenewAccountId = new AccountId(
93
+ body.autoRenewAccount.shardNum ?? 0,
94
+ body.autoRenewAccount.realmNum ?? 0,
95
+ body.autoRenewAccount.accountNum ?? 0
96
+ ).toString();
97
+ }
98
+ return data;
527
99
  }
528
- const raw = await client.requestJson(
529
- "/skills/verification/domain/verify",
530
- {
531
- method: "POST",
532
- body: {
533
- name: normalizedName,
534
- version: payload.version,
535
- domain: payload.domain,
536
- challengeToken
537
- },
538
- headers: { "content-type": "application/json" }
100
+ static parseConsensusDeleteTopic(body) {
101
+ if (!body) return void 0;
102
+ const data = {};
103
+ if (body.topicID) {
104
+ data.topicId = `${body.topicID.shardNum}.${body.topicID.realmNum ?? 0}.${body.topicID.topicNum ?? 0}`;
539
105
  }
540
- );
541
- return client.parseWithSchema(
542
- raw,
543
- skillVerificationDomainProofVerifyResponseSchema,
544
- "skill domain proof verify response"
545
- );
106
+ return data;
107
+ }
108
+ /**
109
+ * Parse HCS transaction from Transaction object with comprehensive extraction
110
+ * This is the unified entry point that handles both protobuf and internal field extraction
111
+ */
112
+ static parseFromTransactionObject(transaction) {
113
+ try {
114
+ const transactionBody = transaction._transactionBody;
115
+ if (!transactionBody) {
116
+ return {};
117
+ }
118
+ if (transactionBody.consensusCreateTopic) {
119
+ const consensusCreateTopic = this.parseConsensusCreateTopic(
120
+ transactionBody.consensusCreateTopic
121
+ );
122
+ if (consensusCreateTopic) {
123
+ return {
124
+ type: "TOPICCREATE",
125
+ humanReadableType: "Topic Create",
126
+ consensusCreateTopic
127
+ };
128
+ }
129
+ }
130
+ if (transactionBody.consensusSubmitMessage) {
131
+ const consensusSubmitMessage = this.parseConsensusSubmitMessage(
132
+ transactionBody.consensusSubmitMessage
133
+ );
134
+ if (consensusSubmitMessage) {
135
+ return {
136
+ type: "CONSENSUSSUBMITMESSAGE",
137
+ humanReadableType: "Submit Message",
138
+ consensusSubmitMessage
139
+ };
140
+ }
141
+ }
142
+ if (transactionBody.consensusUpdateTopic) {
143
+ const consensusUpdateTopic = this.parseConsensusUpdateTopic(
144
+ transactionBody.consensusUpdateTopic
145
+ );
146
+ if (consensusUpdateTopic) {
147
+ return {
148
+ type: "TOPICUPDATE",
149
+ humanReadableType: "Topic Update",
150
+ consensusUpdateTopic
151
+ };
152
+ }
153
+ }
154
+ if (transactionBody.consensusDeleteTopic) {
155
+ const consensusDeleteTopic = this.parseConsensusDeleteTopic(
156
+ transactionBody.consensusDeleteTopic
157
+ );
158
+ if (consensusDeleteTopic) {
159
+ return {
160
+ type: "TOPICDELETE",
161
+ humanReadableType: "Topic Delete",
162
+ consensusDeleteTopic
163
+ };
164
+ }
165
+ }
166
+ return {};
167
+ } catch (error) {
168
+ return {};
169
+ }
170
+ }
546
171
  }
547
172
  export {
548
- createSkillDomainProofChallenge,
549
- getMySkillsList,
550
- getRecommendedSkillVersion,
551
- getSkillBadge,
552
- getSkillDeprecations,
553
- getSkillOwnership,
554
- getSkillPublishJob,
555
- getSkillSecurityBreakdown,
556
- getSkillStatus,
557
- getSkillVerificationStatus,
558
- getSkillVoteStatus,
559
- getSkillsCatalog,
560
- listMySkills,
561
- listSkillCategories,
562
- listSkillTags,
563
- listSkillVersions,
564
- listSkills,
565
- publishSkill,
566
- quoteSkillPublish,
567
- requestSkillVerification,
568
- resolveSkillManifest,
569
- resolveSkillMarkdown,
570
- setRecommendedSkillVersion,
571
- setSkillDeprecation,
572
- setSkillVote,
573
- skillsConfig,
574
- verifySkillDomainProof
173
+ HCSParser
575
174
  };
576
175
  //# sourceMappingURL=standards-sdk.es163.js.map