@hashgraphonline/standards-sdk 0.1.168 → 0.1.169

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 (276) hide show
  1. package/README.md +1 -0
  2. package/dist/browser/hcs-11/client.d.ts.map +1 -1
  3. package/dist/browser/hcs-21/sdk.d.ts.map +1 -1
  4. package/dist/browser/hcs-27/base-client.d.ts +41 -0
  5. package/dist/browser/hcs-27/base-client.d.ts.map +1 -0
  6. package/dist/browser/hcs-27/index.d.ts +6 -0
  7. package/dist/browser/hcs-27/index.d.ts.map +1 -0
  8. package/dist/browser/hcs-27/memos.d.ts +5 -0
  9. package/dist/browser/hcs-27/memos.d.ts.map +1 -0
  10. package/dist/browser/hcs-27/merkle.d.ts +23 -0
  11. package/dist/browser/hcs-27/merkle.d.ts.map +1 -0
  12. package/dist/browser/hcs-27/sdk.d.ts +23 -0
  13. package/dist/browser/hcs-27/sdk.d.ts.map +1 -0
  14. package/dist/browser/hcs-27/types.d.ts +1611 -0
  15. package/dist/browser/hcs-27/types.d.ts.map +1 -0
  16. package/dist/browser/index.d.ts +1 -0
  17. package/dist/browser/index.d.ts.map +1 -1
  18. package/dist/browser/standards-sdk.browser.js +29 -5
  19. package/dist/browser/standards-sdk.browser.js.map +1 -1
  20. package/dist/browser/utils/key-type-detector.d.ts.map +1 -1
  21. package/dist/cjs/hcs-11/client.d.ts.map +1 -1
  22. package/dist/cjs/hcs-21/sdk.d.ts.map +1 -1
  23. package/dist/cjs/hcs-27/base-client.d.ts +41 -0
  24. package/dist/cjs/hcs-27/base-client.d.ts.map +1 -0
  25. package/dist/cjs/hcs-27/index.d.ts +6 -0
  26. package/dist/cjs/hcs-27/index.d.ts.map +1 -0
  27. package/dist/cjs/hcs-27/memos.d.ts +5 -0
  28. package/dist/cjs/hcs-27/memos.d.ts.map +1 -0
  29. package/dist/cjs/hcs-27/merkle.d.ts +23 -0
  30. package/dist/cjs/hcs-27/merkle.d.ts.map +1 -0
  31. package/dist/cjs/hcs-27/sdk.d.ts +23 -0
  32. package/dist/cjs/hcs-27/sdk.d.ts.map +1 -0
  33. package/dist/cjs/hcs-27/types.d.ts +1611 -0
  34. package/dist/cjs/hcs-27/types.d.ts.map +1 -0
  35. package/dist/cjs/index.d.ts +1 -0
  36. package/dist/cjs/index.d.ts.map +1 -1
  37. package/dist/cjs/standards-sdk.cjs +2 -2
  38. package/dist/cjs/standards-sdk.cjs.map +1 -1
  39. package/dist/cjs/utils/key-type-detector.d.ts.map +1 -1
  40. package/dist/es/hcs-11/client.d.ts.map +1 -1
  41. package/dist/es/hcs-21/sdk.d.ts.map +1 -1
  42. package/dist/es/hcs-27/base-client.d.ts +41 -0
  43. package/dist/es/hcs-27/base-client.d.ts.map +1 -0
  44. package/dist/es/hcs-27/index.d.ts +6 -0
  45. package/dist/es/hcs-27/index.d.ts.map +1 -0
  46. package/dist/es/hcs-27/memos.d.ts +5 -0
  47. package/dist/es/hcs-27/memos.d.ts.map +1 -0
  48. package/dist/es/hcs-27/merkle.d.ts +23 -0
  49. package/dist/es/hcs-27/merkle.d.ts.map +1 -0
  50. package/dist/es/hcs-27/sdk.d.ts +23 -0
  51. package/dist/es/hcs-27/sdk.d.ts.map +1 -0
  52. package/dist/es/hcs-27/types.d.ts +1611 -0
  53. package/dist/es/hcs-27/types.d.ts.map +1 -0
  54. package/dist/es/index.d.ts +1 -0
  55. package/dist/es/index.d.ts.map +1 -1
  56. package/dist/es/standards-sdk.es.js +67 -38
  57. package/dist/es/standards-sdk.es.js.map +1 -1
  58. package/dist/es/standards-sdk.es101.js +2 -2
  59. package/dist/es/standards-sdk.es103.js +2 -2
  60. package/dist/es/standards-sdk.es104.js +1 -1
  61. package/dist/es/standards-sdk.es106.js +1 -1
  62. package/dist/es/standards-sdk.es108.js +2 -2
  63. package/dist/es/standards-sdk.es11.js +1 -1
  64. package/dist/es/standards-sdk.es110.js +1 -1
  65. package/dist/es/standards-sdk.es111.js +2 -2
  66. package/dist/es/standards-sdk.es112.js +151 -234
  67. package/dist/es/standards-sdk.es112.js.map +1 -1
  68. package/dist/es/standards-sdk.es113.js +20 -471
  69. package/dist/es/standards-sdk.es113.js.map +1 -1
  70. package/dist/es/standards-sdk.es114.js +263 -104
  71. package/dist/es/standards-sdk.es114.js.map +1 -1
  72. package/dist/es/standards-sdk.es115.js +167 -138
  73. package/dist/es/standards-sdk.es115.js.map +1 -1
  74. package/dist/es/standards-sdk.es116.js +315 -29
  75. package/dist/es/standards-sdk.es116.js.map +1 -1
  76. package/dist/es/standards-sdk.es117.js +250 -10
  77. package/dist/es/standards-sdk.es117.js.map +1 -1
  78. package/dist/es/standards-sdk.es118.js +448 -152
  79. package/dist/es/standards-sdk.es118.js.map +1 -1
  80. package/dist/es/standards-sdk.es119.js +101 -25
  81. package/dist/es/standards-sdk.es119.js.map +1 -1
  82. package/dist/es/standards-sdk.es12.js +1 -1
  83. package/dist/es/standards-sdk.es120.js +155 -17
  84. package/dist/es/standards-sdk.es120.js.map +1 -1
  85. package/dist/es/standards-sdk.es121.js +29 -155
  86. package/dist/es/standards-sdk.es121.js.map +1 -1
  87. package/dist/es/standards-sdk.es122.js +9 -200
  88. package/dist/es/standards-sdk.es122.js.map +1 -1
  89. package/dist/es/standards-sdk.es123.js +146 -754
  90. package/dist/es/standards-sdk.es123.js.map +1 -1
  91. package/dist/es/standards-sdk.es124.js +27 -11
  92. package/dist/es/standards-sdk.es124.js.map +1 -1
  93. package/dist/es/standards-sdk.es125.js +19 -564
  94. package/dist/es/standards-sdk.es125.js.map +1 -1
  95. package/dist/es/standards-sdk.es126.js +140 -582
  96. package/dist/es/standards-sdk.es126.js.map +1 -1
  97. package/dist/es/standards-sdk.es127.js +202 -12
  98. package/dist/es/standards-sdk.es127.js.map +1 -1
  99. package/dist/es/standards-sdk.es128.js +790 -2
  100. package/dist/es/standards-sdk.es128.js.map +1 -1
  101. package/dist/es/standards-sdk.es129.js +10 -84
  102. package/dist/es/standards-sdk.es129.js.map +1 -1
  103. package/dist/es/standards-sdk.es13.js +1 -1
  104. package/dist/es/standards-sdk.es130.js +567 -40
  105. package/dist/es/standards-sdk.es130.js.map +1 -1
  106. package/dist/es/standards-sdk.es131.js +626 -2
  107. package/dist/es/standards-sdk.es131.js.map +1 -1
  108. package/dist/es/standards-sdk.es132.js +12 -234
  109. package/dist/es/standards-sdk.es132.js.map +1 -1
  110. package/dist/es/standards-sdk.es133.js +2 -1140
  111. package/dist/es/standards-sdk.es133.js.map +1 -1
  112. package/dist/es/standards-sdk.es134.js +73 -292
  113. package/dist/es/standards-sdk.es134.js.map +1 -1
  114. package/dist/es/standards-sdk.es135.js +36 -418
  115. package/dist/es/standards-sdk.es135.js.map +1 -1
  116. package/dist/es/standards-sdk.es136.js +2 -355
  117. package/dist/es/standards-sdk.es136.js.map +1 -1
  118. package/dist/es/standards-sdk.es137.js +198 -1079
  119. package/dist/es/standards-sdk.es137.js.map +1 -1
  120. package/dist/es/standards-sdk.es138.js +1107 -175
  121. package/dist/es/standards-sdk.es138.js.map +1 -1
  122. package/dist/es/standards-sdk.es139.js +218 -1479
  123. package/dist/es/standards-sdk.es139.js.map +1 -1
  124. package/dist/es/standards-sdk.es14.js +1 -1
  125. package/dist/es/standards-sdk.es140.js +422 -1500
  126. package/dist/es/standards-sdk.es140.js.map +1 -1
  127. package/dist/es/standards-sdk.es141.js +351 -13
  128. package/dist/es/standards-sdk.es141.js.map +1 -1
  129. package/dist/es/standards-sdk.es142.js +1102 -73
  130. package/dist/es/standards-sdk.es142.js.map +1 -1
  131. package/dist/es/standards-sdk.es143.js +203 -76
  132. package/dist/es/standards-sdk.es143.js.map +1 -1
  133. package/dist/es/standards-sdk.es144.js +1459 -830
  134. package/dist/es/standards-sdk.es144.js.map +1 -1
  135. package/dist/es/standards-sdk.es145.js +1499 -59
  136. package/dist/es/standards-sdk.es145.js.map +1 -1
  137. package/dist/es/standards-sdk.es146.js +14 -156
  138. package/dist/es/standards-sdk.es146.js.map +1 -1
  139. package/dist/es/standards-sdk.es147.js +87 -7
  140. package/dist/es/standards-sdk.es147.js.map +1 -1
  141. package/dist/es/standards-sdk.es148.js +74 -79
  142. package/dist/es/standards-sdk.es148.js.map +1 -1
  143. package/dist/es/standards-sdk.es149.js +934 -61
  144. package/dist/es/standards-sdk.es149.js.map +1 -1
  145. package/dist/es/standards-sdk.es15.js +1 -1
  146. package/dist/es/standards-sdk.es150.js +60 -30
  147. package/dist/es/standards-sdk.es150.js.map +1 -1
  148. package/dist/es/standards-sdk.es151.js +159 -34
  149. package/dist/es/standards-sdk.es151.js.map +1 -1
  150. package/dist/es/standards-sdk.es152.js +7 -48
  151. package/dist/es/standards-sdk.es152.js.map +1 -1
  152. package/dist/es/standards-sdk.es153.js +70 -122
  153. package/dist/es/standards-sdk.es153.js.map +1 -1
  154. package/dist/es/standards-sdk.es154.js +58 -35
  155. package/dist/es/standards-sdk.es154.js.map +1 -1
  156. package/dist/es/standards-sdk.es155.js +30 -56
  157. package/dist/es/standards-sdk.es155.js.map +1 -1
  158. package/dist/es/standards-sdk.es156.js +34 -84
  159. package/dist/es/standards-sdk.es156.js.map +1 -1
  160. package/dist/es/standards-sdk.es157.js +48 -81
  161. package/dist/es/standards-sdk.es157.js.map +1 -1
  162. package/dist/es/standards-sdk.es158.js +124 -186
  163. package/dist/es/standards-sdk.es158.js.map +1 -1
  164. package/dist/es/standards-sdk.es159.js +34 -12474
  165. package/dist/es/standards-sdk.es159.js.map +1 -1
  166. package/dist/es/standards-sdk.es16.js +5 -5
  167. package/dist/es/standards-sdk.es160.js +12477 -12
  168. package/dist/es/standards-sdk.es160.js.map +1 -1
  169. package/dist/es/standards-sdk.es161.js +15 -71
  170. package/dist/es/standards-sdk.es161.js.map +1 -1
  171. package/dist/es/standards-sdk.es162.js +48 -542
  172. package/dist/es/standards-sdk.es162.js.map +1 -1
  173. package/dist/es/standards-sdk.es163.js +72 -160
  174. package/dist/es/standards-sdk.es163.js.map +1 -1
  175. package/dist/es/standards-sdk.es164.js +71 -312
  176. package/dist/es/standards-sdk.es164.js.map +1 -1
  177. package/dist/es/standards-sdk.es165.js +187 -333
  178. package/dist/es/standards-sdk.es165.js.map +1 -1
  179. package/dist/es/standards-sdk.es166.js +538 -441
  180. package/dist/es/standards-sdk.es166.js.map +1 -1
  181. package/dist/es/standards-sdk.es167.js +65 -323
  182. package/dist/es/standards-sdk.es167.js.map +1 -1
  183. package/dist/es/standards-sdk.es168.js +162 -66
  184. package/dist/es/standards-sdk.es168.js.map +1 -1
  185. package/dist/es/standards-sdk.es169.js +310 -160
  186. package/dist/es/standards-sdk.es169.js.map +1 -1
  187. package/dist/es/standards-sdk.es170.js +336 -212
  188. package/dist/es/standards-sdk.es170.js.map +1 -1
  189. package/dist/es/standards-sdk.es171.js +437 -223
  190. package/dist/es/standards-sdk.es171.js.map +1 -1
  191. package/dist/es/standards-sdk.es172.js +324 -112
  192. package/dist/es/standards-sdk.es172.js.map +1 -1
  193. package/dist/es/standards-sdk.es173.js +65 -115
  194. package/dist/es/standards-sdk.es173.js.map +1 -1
  195. package/dist/es/standards-sdk.es174.js +151 -140
  196. package/dist/es/standards-sdk.es174.js.map +1 -1
  197. package/dist/es/standards-sdk.es175.js +193 -156
  198. package/dist/es/standards-sdk.es175.js.map +1 -1
  199. package/dist/es/standards-sdk.es176.js +221 -121
  200. package/dist/es/standards-sdk.es176.js.map +1 -1
  201. package/dist/es/standards-sdk.es177.js +81 -293
  202. package/dist/es/standards-sdk.es177.js.map +1 -1
  203. package/dist/es/standards-sdk.es178.js +114 -247
  204. package/dist/es/standards-sdk.es178.js.map +1 -1
  205. package/dist/es/standards-sdk.es179.js +119 -110
  206. package/dist/es/standards-sdk.es179.js.map +1 -1
  207. package/dist/es/standards-sdk.es18.js +12 -12
  208. package/dist/es/standards-sdk.es180.js +188 -0
  209. package/dist/es/standards-sdk.es180.js.map +1 -0
  210. package/dist/es/standards-sdk.es181.js +142 -0
  211. package/dist/es/standards-sdk.es181.js.map +1 -0
  212. package/dist/es/standards-sdk.es182.js +334 -0
  213. package/dist/es/standards-sdk.es182.js.map +1 -0
  214. package/dist/es/standards-sdk.es183.js +262 -0
  215. package/dist/es/standards-sdk.es183.js.map +1 -0
  216. package/dist/es/standards-sdk.es184.js +155 -0
  217. package/dist/es/standards-sdk.es184.js.map +1 -0
  218. package/dist/es/standards-sdk.es19.js +9 -9
  219. package/dist/es/standards-sdk.es2.js +2 -2
  220. package/dist/es/standards-sdk.es20.js +1 -1
  221. package/dist/es/standards-sdk.es21.js +1 -1
  222. package/dist/es/standards-sdk.es22.js +1 -1
  223. package/dist/es/standards-sdk.es23.js +1 -1
  224. package/dist/es/standards-sdk.es24.js +1 -1
  225. package/dist/es/standards-sdk.es25.js +1 -1
  226. package/dist/es/standards-sdk.es26.js +1 -1
  227. package/dist/es/standards-sdk.es27.js +12 -12
  228. package/dist/es/standards-sdk.es27.js.map +1 -1
  229. package/dist/es/standards-sdk.es30.js +2 -2
  230. package/dist/es/standards-sdk.es31.js +4 -4
  231. package/dist/es/standards-sdk.es32.js +1 -1
  232. package/dist/es/standards-sdk.es35.js +6 -6
  233. package/dist/es/standards-sdk.es36.js +4 -4
  234. package/dist/es/standards-sdk.es37.js +2 -2
  235. package/dist/es/standards-sdk.es38.js +2 -2
  236. package/dist/es/standards-sdk.es39.js +1 -1
  237. package/dist/es/standards-sdk.es4.js +2 -2
  238. package/dist/es/standards-sdk.es40.js +1 -1
  239. package/dist/es/standards-sdk.es41.js +2 -2
  240. package/dist/es/standards-sdk.es46.js +1 -1
  241. package/dist/es/standards-sdk.es5.js +2 -2
  242. package/dist/es/standards-sdk.es51.js +1 -1
  243. package/dist/es/standards-sdk.es53.js +1 -1
  244. package/dist/es/standards-sdk.es56.js +2 -2
  245. package/dist/es/standards-sdk.es59.js +1 -1
  246. package/dist/es/standards-sdk.es6.js +2 -2
  247. package/dist/es/standards-sdk.es60.js +1 -1
  248. package/dist/es/standards-sdk.es62.js +1 -1
  249. package/dist/es/standards-sdk.es63.js +2 -2
  250. package/dist/es/standards-sdk.es64.js +1 -1
  251. package/dist/es/standards-sdk.es65.js +1 -1
  252. package/dist/es/standards-sdk.es66.js +1 -1
  253. package/dist/es/standards-sdk.es67.js +7 -7
  254. package/dist/es/standards-sdk.es69.js +1 -1
  255. package/dist/es/standards-sdk.es7.js +1 -1
  256. package/dist/es/standards-sdk.es71.js +2 -2
  257. package/dist/es/standards-sdk.es72.js +3 -3
  258. package/dist/es/standards-sdk.es75.js +5 -5
  259. package/dist/es/standards-sdk.es76.js +3 -3
  260. package/dist/es/standards-sdk.es77.js +2 -2
  261. package/dist/es/standards-sdk.es78.js +1 -1
  262. package/dist/es/standards-sdk.es81.js +2 -2
  263. package/dist/es/standards-sdk.es83.js +2 -2
  264. package/dist/es/standards-sdk.es84.js +4 -4
  265. package/dist/es/standards-sdk.es85.js +1 -1
  266. package/dist/es/standards-sdk.es88.js +1 -1
  267. package/dist/es/standards-sdk.es89.js +2 -2
  268. package/dist/es/standards-sdk.es9.js +2 -2
  269. package/dist/es/standards-sdk.es90.js +4 -4
  270. package/dist/es/standards-sdk.es90.js.map +1 -1
  271. package/dist/es/standards-sdk.es94.js +3 -3
  272. package/dist/es/standards-sdk.es96.js +2 -2
  273. package/dist/es/standards-sdk.es98.js +1 -1
  274. package/dist/es/standards-sdk.es99.js +3 -3
  275. package/dist/es/utils/key-type-detector.d.ts.map +1 -1
  276. package/package.json +1 -1
@@ -1,456 +1,553 @@
1
- import { proto } from "@hashgraph/proto";
2
- import { Long, Hbar, HbarUnit, ContractId, AccountId, FileId } from "@hashgraph/sdk";
3
- import { Buffer } from "buffer";
4
- import { hasTransactionType, parseKey } from "./standards-sdk.es168.js";
5
- class SCSParser {
6
- /**
7
- * Parse Smart Contract Service transaction using unified dual-branch approach
8
- * This handles both regular transactions and signed transaction variants
9
- */
10
- static parseSCSTransaction(transaction, originalBytes) {
11
- try {
12
- if (originalBytes || transaction.toBytes) {
13
- try {
14
- const bytesToParse = originalBytes || transaction.toBytes();
15
- const decoded = proto.TransactionList.decode(bytesToParse);
16
- if (decoded.transactionList && decoded.transactionList.length > 0) {
17
- const tx = decoded.transactionList[0];
18
- let txBody = null;
19
- if (tx.bodyBytes && tx.bodyBytes.length > 0) {
20
- txBody = proto.TransactionBody.decode(tx.bodyBytes);
21
- } else if (tx.signedTransactionBytes && tx.signedTransactionBytes.length > 0) {
22
- const signedTx = proto.SignedTransaction.decode(
23
- tx.signedTransactionBytes
24
- );
25
- if (signedTx.bodyBytes) {
26
- txBody = proto.TransactionBody.decode(signedTx.bodyBytes);
27
- }
28
- }
29
- if (txBody) {
30
- const protoResult = this.parseFromProtobufTxBody(txBody);
31
- if (protoResult.type && protoResult.type !== "UNKNOWN") {
32
- return protoResult;
33
- }
34
- }
35
- }
36
- } catch (protoError) {
37
- }
38
- }
39
- return this.parseFromTransactionInternals(transaction);
40
- } catch (error) {
41
- return {
42
- type: "UNKNOWN",
43
- humanReadableType: "Unknown Contract Transaction"
44
- };
45
- }
1
+ import { skillRegistryConfigResponseSchema, 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.es145.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 listSkills(client, params = {}) {
13
+ const query = new URLSearchParams();
14
+ if (params.name) {
15
+ query.set("name", params.name);
46
16
  }
47
- /**
48
- * Parse contract transaction from protobuf TransactionBody
49
- * Handles all contract operations from decoded protobuf data
50
- */
51
- static parseFromProtobufTxBody(txBody) {
52
- if (txBody.contractCall) {
53
- const contractCall = this.parseContractCall(txBody.contractCall);
54
- if (contractCall) {
55
- return {
56
- type: "CONTRACTCALL",
57
- humanReadableType: "Contract Call",
58
- contractCall
59
- };
60
- }
61
- }
62
- if (txBody.contractCreateInstance) {
63
- const contractCreate = this.parseContractCreate(
64
- txBody.contractCreateInstance
65
- );
66
- if (contractCreate) {
67
- return {
68
- type: "CONTRACTCREATE",
69
- humanReadableType: "Contract Create",
70
- contractCreate
71
- };
72
- }
73
- }
74
- if (txBody.contractUpdateInstance) {
75
- const contractUpdate = this.parseContractUpdate(
76
- txBody.contractUpdateInstance
77
- );
78
- if (contractUpdate) {
79
- return {
80
- type: "CONTRACTUPDATE",
81
- humanReadableType: "Contract Update",
82
- contractUpdate
83
- };
84
- }
85
- }
86
- if (txBody.contractDeleteInstance) {
87
- const contractDelete = this.parseContractDelete(
88
- txBody.contractDeleteInstance
89
- );
90
- if (contractDelete) {
91
- return {
92
- type: "CONTRACTDELETE",
93
- humanReadableType: "Contract Delete",
94
- contractDelete
95
- };
96
- }
97
- }
98
- if (txBody.ethereumTransaction) {
99
- const ethereumCall = this.parseEthereumTransaction(
100
- txBody.ethereumTransaction
101
- );
102
- if (ethereumCall) {
103
- return {
104
- type: "ETHEREUMTRANSACTION",
105
- humanReadableType: "Ethereum Transaction",
106
- ethereumTransaction: ethereumCall
107
- };
108
- }
109
- }
110
- return {};
111
- }
112
- /**
113
- * Extract contract data from Transaction internal fields
114
- * This handles cases where data is stored in Transaction object internals
115
- */
116
- static parseFromTransactionInternals(transaction) {
117
- try {
118
- const tx = transaction;
119
- if (tx._contractId && tx._gas) {
120
- const contractCall = {
121
- contractId: tx._contractId.toString(),
122
- gas: typeof tx._gas === "number" ? tx._gas : Long.fromValue(tx._gas).toNumber(),
123
- amount: tx._amount ? parseFloat(tx._amount.toString()) : 0
124
- };
125
- if (tx._functionParameters) {
126
- const funcParams = Buffer.from(tx._functionParameters).toString(
127
- "hex"
128
- );
129
- contractCall.functionParameters = funcParams;
130
- contractCall.functionName = this.extractFunctionName(funcParams);
131
- }
132
- return {
133
- type: "CONTRACTCALL",
134
- humanReadableType: "Contract Call",
135
- contractCall
136
- };
137
- }
138
- if (hasTransactionType(transaction, "contractCreateInstance")) {
139
- const contractCreate = {
140
- gas: tx._gas.toString(),
141
- initialBalance: tx._initialBalance?.toString() || "0"
142
- };
143
- if (tx._fileId) {
144
- contractCreate.initcodeSource = "fileID";
145
- contractCreate.initcode = tx._fileId.toString();
146
- } else if (tx._bytecode) {
147
- contractCreate.initcodeSource = "bytes";
148
- contractCreate.initcode = Buffer.from(tx._bytecode).toString("hex");
149
- }
150
- if (tx._constructorParameters) {
151
- contractCreate.constructorParameters = Buffer.from(
152
- tx._constructorParameters
153
- ).toString("hex");
154
- }
155
- if (tx._memo) contractCreate.memo = tx._memo;
156
- if (tx._adminKey) contractCreate.adminKey = parseKey(tx._adminKey);
157
- if (tx._maxAutomaticTokenAssociations !== void 0) {
158
- contractCreate.maxAutomaticTokenAssociations = tx._maxAutomaticTokenAssociations;
159
- }
160
- if (tx._stakedAccountId) {
161
- contractCreate.stakedAccountId = tx._stakedAccountId.toString();
162
- } else if (tx._stakedNodeId !== null && tx._stakedNodeId !== void 0) {
163
- contractCreate.stakedNodeId = Long.fromValue(
164
- tx._stakedNodeId
165
- ).toString();
166
- }
167
- if (tx._declineReward !== void 0)
168
- contractCreate.declineReward = tx._declineReward;
169
- if (tx._autoRenewPeriod)
170
- contractCreate.autoRenewPeriod = tx._autoRenewPeriod.toString();
171
- return {
172
- type: "CONTRACTCREATE",
173
- humanReadableType: "Contract Create",
174
- contractCreate
175
- };
176
- }
177
- if (hasTransactionType(transaction, "contractUpdateInstance")) {
178
- const contractUpdate = {
179
- contractIdToUpdate: tx._contractId.toString()
180
- };
181
- if (tx._memo) contractUpdate.memo = tx._memo;
182
- if (tx._adminKey) contractUpdate.adminKey = parseKey(tx._adminKey);
183
- if (tx._maxAutomaticTokenAssociations !== void 0) {
184
- contractUpdate.maxAutomaticTokenAssociations = tx._maxAutomaticTokenAssociations;
185
- }
186
- if (tx._stakedAccountId) {
187
- contractUpdate.stakedAccountId = tx._stakedAccountId.toString();
188
- } else if (tx._stakedNodeId !== null && tx._stakedNodeId !== void 0) {
189
- contractUpdate.stakedNodeId = Long.fromValue(
190
- tx._stakedNodeId
191
- ).toString();
192
- }
193
- if (tx._declineReward !== void 0)
194
- contractUpdate.declineReward = tx._declineReward;
195
- if (tx._autoRenewPeriod)
196
- contractUpdate.autoRenewPeriod = tx._autoRenewPeriod.toString();
197
- return {
198
- type: "CONTRACTUPDATE",
199
- humanReadableType: "Contract Update",
200
- contractUpdate
201
- };
202
- }
203
- if (hasTransactionType(transaction, "contractDeleteInstance")) {
204
- const contractDelete = {
205
- contractIdToDelete: tx._contractId.toString()
206
- };
207
- if (tx._transferAccountId) {
208
- contractDelete.transferAccountId = tx._transferAccountId.toString();
209
- } else if (tx._transferContractId) {
210
- contractDelete.transferContractId = tx._transferContractId.toString();
211
- }
212
- return {
213
- type: "CONTRACTDELETE",
214
- humanReadableType: "Contract Delete",
215
- contractDelete
216
- };
217
- }
218
- return {};
219
- } catch (error) {
220
- return {};
221
- }
17
+ if (params.version) {
18
+ query.set("version", params.version);
222
19
  }
223
- /**
224
- * Enhanced function name extraction from contract call parameters
225
- * Attempts to decode function selector and map to known function names
226
- */
227
- static extractFunctionName(functionParameters) {
228
- if (functionParameters.length < 8) return "unknown";
229
- const selector = functionParameters.substring(0, 8);
230
- const commonSelectors = {
231
- a9059cbb: "transfer",
232
- "095ea7b3": "approve",
233
- "23b872dd": "transferFrom",
234
- "70a08231": "balanceOf",
235
- dd62ed3e: "allowance",
236
- "18160ddd": "totalSupply",
237
- "06fdde03": "name",
238
- "95d89b41": "symbol",
239
- "313ce567": "decimals",
240
- "42842e0e": "safeTransferFrom",
241
- b88d4fde: "safeTransferFrom",
242
- e985e9c5: "isApprovedForAll",
243
- a22cb465: "setApprovalForAll",
244
- "6352211e": "ownerOf",
245
- c87b56dd: "tokenURI",
246
- "01ffc9a7": "supportsInterface",
247
- "40c10f19": "mint",
248
- "42966c68": "burn",
249
- f2fde38b: "transferOwnership",
250
- "715018a6": "renounceOwnership",
251
- "8da5cb5b": "owner"
252
- };
253
- return commonSelectors[selector] || selector;
254
- }
255
- /**
256
- * Parse Ethereum Transaction (was completely missing from original parser)
257
- */
258
- static parseEthereumTransaction(body) {
259
- if (!body) return void 0;
260
- const data = {
261
- contractId: "EVM",
262
- gas: body.maxGasAllowance ? Long.fromValue(body.maxGasAllowance).toNumber() : 0,
263
- amount: 0
264
- };
265
- if (body.ethereumData && body.ethereumData.length > 0) {
266
- const ethData = Buffer.from(body.ethereumData).toString("hex");
267
- data.functionParameters = ethData;
268
- if (ethData.length >= 8) {
269
- data.functionName = this.extractFunctionName(ethData);
270
- }
271
- }
272
- return data;
273
- }
274
- static parseContractCall(body) {
275
- if (!body) return void 0;
276
- const hbarAmount = Hbar.fromTinybars(Long.fromValue(body.amount ?? 0));
277
- const data = {
278
- contractId: new ContractId(
279
- body.contractID.shardNum ?? 0,
280
- body.contractID.realmNum ?? 0,
281
- body.contractID.contractNum ?? 0
282
- ).toString(),
283
- gas: Long.fromValue(body.gas ?? 0).toNumber(),
284
- amount: parseFloat(hbarAmount.toString(HbarUnit.Hbar))
285
- };
286
- if (body.functionParameters) {
287
- data.functionParameters = Buffer.from(body.functionParameters).toString(
288
- "hex"
289
- );
290
- if (data.functionParameters.length >= 8) {
291
- data.functionName = this.extractFunctionName(data.functionParameters);
292
- }
293
- }
294
- return data;
295
- }
296
- static parseContractCreate(body) {
297
- if (!body) return void 0;
298
- const data = {};
299
- if (body.initialBalance) {
300
- data.initialBalance = Hbar.fromTinybars(
301
- Long.fromValue(body.initialBalance)
302
- ).toString(HbarUnit.Hbar);
303
- }
304
- if (body.gas) {
305
- data.gas = Long.fromValue(body.gas).toString();
306
- }
307
- if (body.adminKey) {
308
- data.adminKey = parseKey(body.adminKey);
309
- }
310
- if (body.constructorParameters) {
311
- data.constructorParameters = Buffer.from(
312
- body.constructorParameters
313
- ).toString("hex");
314
- }
315
- if (body.memo) {
316
- data.memo = body.memo;
317
- }
318
- if (body.autoRenewPeriod?.seconds) {
319
- data.autoRenewPeriod = Long.fromValue(
320
- body.autoRenewPeriod.seconds
321
- ).toString();
322
- }
323
- if (body.stakedAccountId) {
324
- data.stakedAccountId = new AccountId(
325
- body.stakedAccountId.shardNum ?? 0,
326
- body.stakedAccountId.realmNum ?? 0,
327
- body.stakedAccountId.accountNum ?? 0
328
- ).toString();
329
- } else if (body.stakedNodeId !== null && body.stakedNodeId !== void 0) {
330
- data.stakedNodeId = Long.fromValue(body.stakedNodeId).toString();
331
- }
332
- if (body.declineReward !== void 0) {
333
- data.declineReward = body.declineReward;
334
- }
335
- if (body.maxAutomaticTokenAssociations !== void 0) {
336
- data.maxAutomaticTokenAssociations = body.maxAutomaticTokenAssociations;
337
- }
338
- if (body.fileID) {
339
- data.initcodeSource = "fileID";
340
- data.initcode = new FileId(
341
- body.fileID.shardNum ?? 0,
342
- body.fileID.realmNum ?? 0,
343
- body.fileID.fileNum ?? 0
344
- ).toString();
345
- } else if (body.initcode && body.initcode.length > 0) {
346
- data.initcodeSource = "bytes";
347
- data.initcode = Buffer.from(body.initcode).toString("hex");
348
- }
349
- return data;
350
- }
351
- static parseContractUpdate(body) {
352
- if (!body) return void 0;
353
- const data = {};
354
- if (body.contractID) {
355
- data.contractIdToUpdate = new ContractId(
356
- body.contractID.shardNum ?? 0,
357
- body.contractID.realmNum ?? 0,
358
- body.contractID.contractNum ?? 0
359
- ).toString();
360
- }
361
- if (body.adminKey) {
362
- data.adminKey = parseKey(body.adminKey);
363
- }
364
- if (body.expirationTime?.seconds) {
365
- data.expirationTime = `${Long.fromValue(
366
- body.expirationTime.seconds
367
- ).toString()}.${body.expirationTime.nanos}`;
20
+ if (typeof params.limit === "number" && Number.isFinite(params.limit)) {
21
+ query.set("limit", String(Math.trunc(params.limit)));
22
+ }
23
+ if (params.cursor) {
24
+ query.set("cursor", params.cursor);
25
+ }
26
+ if (typeof params.includeFiles === "boolean") {
27
+ query.set("includeFiles", params.includeFiles ? "true" : "false");
28
+ }
29
+ if (params.accountId) {
30
+ query.set("accountId", params.accountId);
31
+ }
32
+ if (params.q) {
33
+ query.set("q", params.q);
34
+ }
35
+ if (params.tag) {
36
+ query.set("tag", params.tag);
37
+ }
38
+ if (params.category) {
39
+ query.set("category", params.category);
40
+ }
41
+ if (typeof params.featured === "boolean") {
42
+ query.set("featured", params.featured ? "true" : "false");
43
+ }
44
+ if (typeof params.verified === "boolean") {
45
+ query.set("verified", params.verified ? "true" : "false");
46
+ }
47
+ if (params.view) {
48
+ query.set("view", params.view);
49
+ }
50
+ const suffix = query.size > 0 ? `?${query.toString()}` : "";
51
+ const raw = await client.requestJson(`/skills${suffix}`, {
52
+ method: "GET"
53
+ });
54
+ return client.parseWithSchema(
55
+ raw,
56
+ skillRegistryListResponseSchema,
57
+ "skill registry list response"
58
+ );
59
+ }
60
+ async function getSkillSecurityBreakdown(client, params) {
61
+ const normalizedJobId = params.jobId.trim();
62
+ if (!normalizedJobId) {
63
+ throw new Error("jobId is required");
64
+ }
65
+ const raw = await client.requestJson(
66
+ `/skills/${encodeURIComponent(normalizedJobId)}/security-breakdown`,
67
+ { method: "GET" }
68
+ );
69
+ return client.parseWithSchema(
70
+ raw,
71
+ skillSecurityBreakdownResponseSchema,
72
+ "skill security breakdown response"
73
+ );
74
+ }
75
+ async function getSkillsCatalog(client, params = {}) {
76
+ const query = new URLSearchParams();
77
+ if (params.q) {
78
+ query.set("q", params.q);
79
+ }
80
+ if (params.category) {
81
+ query.set("category", params.category);
82
+ }
83
+ params.tags?.forEach((tag) => {
84
+ if (tag.trim()) {
85
+ query.append("tag", tag.trim());
368
86
  }
369
- if (body.autoRenewPeriod?.seconds) {
370
- data.autoRenewPeriod = Long.fromValue(
371
- body.autoRenewPeriod.seconds
372
- ).toString();
87
+ });
88
+ if (typeof params.featured === "boolean") {
89
+ query.set("featured", params.featured ? "true" : "false");
90
+ }
91
+ if (typeof params.verified === "boolean") {
92
+ query.set("verified", params.verified ? "true" : "false");
93
+ }
94
+ if (params.channel) {
95
+ query.set("channel", params.channel);
96
+ }
97
+ if (params.sortBy) {
98
+ query.set("sortBy", params.sortBy);
99
+ }
100
+ if (typeof params.limit === "number" && Number.isFinite(params.limit)) {
101
+ query.set("limit", String(Math.trunc(params.limit)));
102
+ }
103
+ if (params.cursor) {
104
+ query.set("cursor", params.cursor);
105
+ }
106
+ const suffix = query.size > 0 ? `?${query.toString()}` : "";
107
+ const raw = await client.requestJson(`/skills/catalog${suffix}`, {
108
+ method: "GET"
109
+ });
110
+ return client.parseWithSchema(
111
+ raw,
112
+ skillCatalogResponseSchema,
113
+ "skill catalog response"
114
+ );
115
+ }
116
+ async function listSkillVersions(client, params) {
117
+ const normalizedName = params.name.trim();
118
+ if (!normalizedName) {
119
+ throw new Error("name is required");
120
+ }
121
+ const query = new URLSearchParams();
122
+ query.set("name", normalizedName);
123
+ const raw = await client.requestJson(
124
+ `/skills/versions?${query.toString()}`,
125
+ { method: "GET" }
126
+ );
127
+ return client.parseWithSchema(
128
+ raw,
129
+ skillRegistryVersionsResponseSchema,
130
+ "skill registry versions response"
131
+ );
132
+ }
133
+ async function listMySkills(client, params = {}) {
134
+ const query = new URLSearchParams();
135
+ if (typeof params.limit === "number" && Number.isFinite(params.limit)) {
136
+ query.set("limit", String(Math.trunc(params.limit)));
137
+ }
138
+ const suffix = query.size > 0 ? `?${query.toString()}` : "";
139
+ const raw = await client.requestJson(`/skills/mine${suffix}`, {
140
+ method: "GET"
141
+ });
142
+ return client.parseWithSchema(
143
+ raw,
144
+ skillRegistryMineResponseSchema,
145
+ "skill registry mine response"
146
+ );
147
+ }
148
+ async function getMySkillsList(client, params = {}) {
149
+ const query = new URLSearchParams();
150
+ if (typeof params.limit === "number" && Number.isFinite(params.limit)) {
151
+ query.set("limit", String(Math.trunc(params.limit)));
152
+ }
153
+ if (params.cursor) {
154
+ query.set("cursor", params.cursor);
155
+ }
156
+ if (params.accountId) {
157
+ query.set("accountId", params.accountId);
158
+ }
159
+ const suffix = query.size > 0 ? `?${query.toString()}` : "";
160
+ const raw = await client.requestJson(`/skills/my-list${suffix}`, {
161
+ method: "GET"
162
+ });
163
+ return client.parseWithSchema(
164
+ raw,
165
+ skillRegistryMyListResponseSchema,
166
+ "skill registry my list response"
167
+ );
168
+ }
169
+ async function quoteSkillPublish(client, payload) {
170
+ const raw = await client.requestJson("/skills/quote", {
171
+ method: "POST",
172
+ body: payload,
173
+ headers: { "content-type": "application/json" }
174
+ });
175
+ return client.parseWithSchema(
176
+ raw,
177
+ skillRegistryQuoteResponseSchema,
178
+ "skill registry quote response"
179
+ );
180
+ }
181
+ async function publishSkill(client, payload) {
182
+ const raw = await client.requestJson("/skills/publish", {
183
+ method: "POST",
184
+ body: payload,
185
+ headers: { "content-type": "application/json" }
186
+ });
187
+ return client.parseWithSchema(
188
+ raw,
189
+ skillRegistryPublishResponseSchema,
190
+ "skill registry publish response"
191
+ );
192
+ }
193
+ async function getSkillPublishJob(client, jobId, params = {}) {
194
+ const normalized = jobId.trim();
195
+ if (!normalized) {
196
+ throw new Error("jobId is required");
197
+ }
198
+ const query = new URLSearchParams();
199
+ if (params.accountId) {
200
+ query.set("accountId", params.accountId);
201
+ }
202
+ const suffix = query.size > 0 ? `?${query.toString()}` : "";
203
+ const raw = await client.requestJson(
204
+ `/skills/jobs/${encodeURIComponent(normalized)}${suffix}`,
205
+ { method: "GET" }
206
+ );
207
+ return client.parseWithSchema(
208
+ raw,
209
+ skillRegistryJobStatusResponseSchema,
210
+ "skill registry job status response"
211
+ );
212
+ }
213
+ async function getSkillOwnership(client, params) {
214
+ const normalizedName = params.name.trim();
215
+ if (!normalizedName) {
216
+ throw new Error("name is required");
217
+ }
218
+ const query = new URLSearchParams();
219
+ query.set("name", normalizedName);
220
+ if (params.accountId) {
221
+ query.set("accountId", params.accountId);
222
+ }
223
+ const raw = await client.requestJson(
224
+ `/skills/ownership?${query.toString()}`,
225
+ {
226
+ method: "GET"
373
227
  }
374
- if (body.memo) {
375
- const memoUnion = body.memo;
376
- if (memoUnion && typeof memoUnion === "object" && Object.prototype.hasOwnProperty.call(memoUnion, "value")) {
377
- const value = memoUnion.value;
378
- if (value === null || value === void 0) {
379
- data.memo = void 0;
380
- } else {
381
- data.memo = String(value);
382
- }
383
- } else if (typeof memoUnion === "string") {
384
- data.memo = memoUnion;
385
- } else {
386
- data.memo = void 0;
228
+ );
229
+ return client.parseWithSchema(
230
+ raw,
231
+ skillRegistryOwnershipResponseSchema,
232
+ "skill registry ownership response"
233
+ );
234
+ }
235
+ async function getRecommendedSkillVersion(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
+ const raw = await client.requestJson(
243
+ `/skills/recommended?${query.toString()}`,
244
+ { method: "GET" }
245
+ );
246
+ return client.parseWithSchema(
247
+ raw,
248
+ skillRecommendedVersionResponseSchema,
249
+ "skill recommended version response"
250
+ );
251
+ }
252
+ async function setRecommendedSkillVersion(client, payload) {
253
+ const normalizedName = payload.name.trim();
254
+ const normalizedVersion = payload.version.trim();
255
+ if (!normalizedName) {
256
+ throw new Error("name is required");
257
+ }
258
+ if (!normalizedVersion) {
259
+ throw new Error("version is required");
260
+ }
261
+ const raw = await client.requestJson("/skills/recommended", {
262
+ method: "POST",
263
+ body: {
264
+ name: normalizedName,
265
+ version: normalizedVersion
266
+ },
267
+ headers: { "content-type": "application/json" }
268
+ });
269
+ return client.parseWithSchema(
270
+ raw,
271
+ skillRecommendedVersionResponseSchema,
272
+ "skill recommended version response"
273
+ );
274
+ }
275
+ async function getSkillDeprecations(client, params) {
276
+ const normalizedName = params.name.trim();
277
+ if (!normalizedName) {
278
+ throw new Error("name is required");
279
+ }
280
+ const query = new URLSearchParams();
281
+ query.set("name", normalizedName);
282
+ const raw = await client.requestJson(
283
+ `/skills/deprecations?${query.toString()}`,
284
+ { method: "GET" }
285
+ );
286
+ return client.parseWithSchema(
287
+ raw,
288
+ skillDeprecationsResponseSchema,
289
+ "skill deprecations response"
290
+ );
291
+ }
292
+ async function setSkillDeprecation(client, payload) {
293
+ const normalizedName = payload.name.trim();
294
+ if (!normalizedName) {
295
+ throw new Error("name is required");
296
+ }
297
+ const version = payload.version?.trim();
298
+ const reason = payload.reason.trim();
299
+ if (!reason) {
300
+ throw new Error("reason is required");
301
+ }
302
+ const replacementRef = payload.replacementRef?.trim();
303
+ const raw = await client.requestJson("/skills/deprecate", {
304
+ method: "POST",
305
+ body: {
306
+ name: normalizedName,
307
+ version,
308
+ reason,
309
+ replacementRef
310
+ },
311
+ headers: { "content-type": "application/json" }
312
+ });
313
+ return client.parseWithSchema(
314
+ raw,
315
+ skillDeprecationRecordSchema,
316
+ "skill deprecation response"
317
+ );
318
+ }
319
+ async function getSkillBadge(client, params) {
320
+ const normalizedName = params.name.trim();
321
+ if (!normalizedName) {
322
+ throw new Error("name is required");
323
+ }
324
+ const query = new URLSearchParams();
325
+ query.set("name", normalizedName);
326
+ if (params.metric) {
327
+ query.set("metric", params.metric);
328
+ }
329
+ if (params.label?.trim()) {
330
+ query.set("label", params.label.trim());
331
+ }
332
+ if (params.style) {
333
+ query.set("style", params.style);
334
+ }
335
+ const raw = await client.requestJson(
336
+ `/skills/badge?${query.toString()}`,
337
+ { method: "GET" }
338
+ );
339
+ return client.parseWithSchema(
340
+ raw,
341
+ skillBadgeResponseSchema,
342
+ "skill badge response"
343
+ );
344
+ }
345
+ async function listSkillTags(client) {
346
+ const raw = await client.requestJson("/skills/tags", {
347
+ method: "GET"
348
+ });
349
+ return client.parseWithSchema(
350
+ raw,
351
+ skillRegistryTagsResponseSchema,
352
+ "skill tags response"
353
+ );
354
+ }
355
+ async function listSkillCategories(client) {
356
+ const raw = await client.requestJson("/skills/categories", {
357
+ method: "GET"
358
+ });
359
+ return client.parseWithSchema(
360
+ raw,
361
+ skillRegistryCategoriesResponseSchema,
362
+ "skill categories response"
363
+ );
364
+ }
365
+ async function resolveSkillMarkdown(client, skillRef) {
366
+ const normalizedSkillRef = skillRef.trim();
367
+ if (!normalizedSkillRef) {
368
+ throw new Error("skillRef is required");
369
+ }
370
+ const response = await client.request(
371
+ `/skills/${encodeURIComponent(normalizedSkillRef)}/SKILL.md`,
372
+ {
373
+ method: "GET",
374
+ headers: {
375
+ accept: "text/markdown, text/plain;q=0.9, */*;q=0.8"
387
376
  }
388
- } else {
389
- data.memo = void 0;
390
- }
391
- if (body.stakedAccountId) {
392
- data.stakedAccountId = new AccountId(
393
- body.stakedAccountId.shardNum ?? 0,
394
- body.stakedAccountId.realmNum ?? 0,
395
- body.stakedAccountId.accountNum ?? 0
396
- ).toString();
397
- data.stakedNodeId = void 0;
398
- } else if (body.stakedNodeId !== null && body.stakedNodeId !== void 0 && Long.fromValue(body.stakedNodeId).notEquals(-1)) {
399
- data.stakedNodeId = Long.fromValue(body.stakedNodeId).toString();
400
- data.stakedAccountId = void 0;
401
- } else {
402
- data.stakedNodeId = void 0;
403
- data.stakedAccountId = void 0;
404
- }
405
- if (body.declineReward?.value !== void 0) {
406
- data.declineReward = body.declineReward.value;
407
377
  }
408
- if (body.maxAutomaticTokenAssociations?.value !== void 0) {
409
- data.maxAutomaticTokenAssociations = body.maxAutomaticTokenAssociations.value;
410
- }
411
- if (body.autoRenewAccountId) {
412
- data.autoRenewAccountId = new AccountId(
413
- body.autoRenewAccountId.shardNum ?? 0,
414
- body.autoRenewAccountId.realmNum ?? 0,
415
- body.autoRenewAccountId.accountNum ?? 0
416
- ).toString();
378
+ );
379
+ return response.text();
380
+ }
381
+ async function resolveSkillManifest(client, skillRef) {
382
+ const normalizedSkillRef = skillRef.trim();
383
+ if (!normalizedSkillRef) {
384
+ throw new Error("skillRef is required");
385
+ }
386
+ const raw = await client.requestJson(
387
+ `/skills/${encodeURIComponent(normalizedSkillRef)}/manifest`,
388
+ {
389
+ method: "GET"
417
390
  }
418
- return data;
419
- }
420
- static parseContractDelete(body) {
421
- if (!body) return void 0;
422
- const data = {};
423
- if (body.contractID) {
424
- data.contractIdToDelete = new ContractId(
425
- body.contractID.shardNum ?? 0,
426
- body.contractID.realmNum ?? 0,
427
- body.contractID.contractNum ?? 0
428
- ).toString();
391
+ );
392
+ return client.parseWithSchema(
393
+ raw,
394
+ skillResolverManifestResponseSchema,
395
+ "skill resolver manifest response"
396
+ );
397
+ }
398
+ async function getSkillVoteStatus(client, params) {
399
+ const normalizedName = params.name.trim();
400
+ if (!normalizedName) {
401
+ throw new Error("name is required");
402
+ }
403
+ const query = new URLSearchParams();
404
+ query.set("name", normalizedName);
405
+ const raw = await client.requestJson(
406
+ `/skills/vote?${query.toString()}`,
407
+ { method: "GET" }
408
+ );
409
+ return client.parseWithSchema(
410
+ raw,
411
+ skillRegistryVoteStatusResponseSchema,
412
+ "skill registry vote status response"
413
+ );
414
+ }
415
+ async function setSkillVote(client, payload) {
416
+ const normalizedName = payload.name.trim();
417
+ if (!normalizedName) {
418
+ throw new Error("name is required");
419
+ }
420
+ const raw = await client.requestJson("/skills/vote", {
421
+ method: "POST",
422
+ body: { name: normalizedName, upvoted: payload.upvoted },
423
+ headers: { "content-type": "application/json" }
424
+ });
425
+ return client.parseWithSchema(
426
+ raw,
427
+ skillRegistryVoteStatusResponseSchema,
428
+ "skill registry vote status response"
429
+ );
430
+ }
431
+ async function requestSkillVerification(client, payload) {
432
+ const normalizedName = payload.name.trim();
433
+ if (!normalizedName) {
434
+ throw new Error("name is required");
435
+ }
436
+ const raw = await client.requestJson(
437
+ "/skills/verification/request",
438
+ {
439
+ method: "POST",
440
+ body: {
441
+ name: normalizedName,
442
+ version: payload.version,
443
+ tier: payload.tier
444
+ },
445
+ headers: { "content-type": "application/json" }
429
446
  }
430
- if (body.transferAccountID) {
431
- data.transferAccountId = new AccountId(
432
- body.transferAccountID.shardNum ?? 0,
433
- body.transferAccountID.realmNum ?? 0,
434
- body.transferAccountID.accountNum ?? 0
435
- ).toString();
436
- } else if (body.transferContractID) {
437
- data.transferContractId = new ContractId(
438
- body.transferContractID.shardNum ?? 0,
439
- body.transferContractID.realmNum ?? 0,
440
- body.transferContractID.contractNum ?? 0
441
- ).toString();
447
+ );
448
+ return client.parseWithSchema(
449
+ raw,
450
+ skillVerificationRequestCreateResponseSchema,
451
+ "skill verification request create response"
452
+ );
453
+ }
454
+ async function getSkillVerificationStatus(client, params) {
455
+ const normalizedName = params.name.trim();
456
+ if (!normalizedName) {
457
+ throw new Error("name is required");
458
+ }
459
+ const query = new URLSearchParams();
460
+ query.set("name", normalizedName);
461
+ if (params.version) {
462
+ query.set("version", params.version);
463
+ }
464
+ const raw = await client.requestJson(
465
+ `/skills/verification/status?${query.toString()}`,
466
+ { method: "GET" }
467
+ );
468
+ return client.parseWithSchema(
469
+ raw,
470
+ skillVerificationStatusResponseSchema,
471
+ "skill verification status response"
472
+ );
473
+ }
474
+ async function createSkillDomainProofChallenge(client, payload) {
475
+ const normalizedName = payload.name.trim();
476
+ if (!normalizedName) {
477
+ throw new Error("name is required");
478
+ }
479
+ const raw = await client.requestJson(
480
+ "/skills/verification/domain/challenge",
481
+ {
482
+ method: "POST",
483
+ body: {
484
+ name: normalizedName,
485
+ version: payload.version,
486
+ domain: payload.domain
487
+ },
488
+ headers: { "content-type": "application/json" }
442
489
  }
443
- return data;
490
+ );
491
+ return client.parseWithSchema(
492
+ raw,
493
+ skillVerificationDomainProofChallengeResponseSchema,
494
+ "skill domain proof challenge response"
495
+ );
496
+ }
497
+ async function verifySkillDomainProof(client, payload) {
498
+ const normalizedName = payload.name.trim();
499
+ const challengeToken = payload.challengeToken.trim();
500
+ if (!normalizedName) {
501
+ throw new Error("name is required");
444
502
  }
445
- /**
446
- * Parse SCS (Smart Contract Service) transaction from Transaction object
447
- * This is the unified entry point that delegates to the comprehensive parsing logic
448
- */
449
- static parseFromTransactionObject(transaction) {
450
- return this.parseSCSTransaction(transaction);
503
+ if (!challengeToken) {
504
+ throw new Error("challengeToken is required");
451
505
  }
506
+ const raw = await client.requestJson(
507
+ "/skills/verification/domain/verify",
508
+ {
509
+ method: "POST",
510
+ body: {
511
+ name: normalizedName,
512
+ version: payload.version,
513
+ domain: payload.domain,
514
+ challengeToken
515
+ },
516
+ headers: { "content-type": "application/json" }
517
+ }
518
+ );
519
+ return client.parseWithSchema(
520
+ raw,
521
+ skillVerificationDomainProofVerifyResponseSchema,
522
+ "skill domain proof verify response"
523
+ );
452
524
  }
453
525
  export {
454
- SCSParser
526
+ createSkillDomainProofChallenge,
527
+ getMySkillsList,
528
+ getRecommendedSkillVersion,
529
+ getSkillBadge,
530
+ getSkillDeprecations,
531
+ getSkillOwnership,
532
+ getSkillPublishJob,
533
+ getSkillSecurityBreakdown,
534
+ getSkillVerificationStatus,
535
+ getSkillVoteStatus,
536
+ getSkillsCatalog,
537
+ listMySkills,
538
+ listSkillCategories,
539
+ listSkillTags,
540
+ listSkillVersions,
541
+ listSkills,
542
+ publishSkill,
543
+ quoteSkillPublish,
544
+ requestSkillVerification,
545
+ resolveSkillManifest,
546
+ resolveSkillMarkdown,
547
+ setRecommendedSkillVersion,
548
+ setSkillDeprecation,
549
+ setSkillVote,
550
+ skillsConfig,
551
+ verifySkillDomainProof
455
552
  };
456
553
  //# sourceMappingURL=standards-sdk.es166.js.map