@hashgraphonline/standards-sdk 0.1.184 → 0.1.185

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 (262) hide show
  1. package/dist/browser/hcs-25/identifiers.d.ts +24 -0
  2. package/dist/browser/hcs-25/identifiers.d.ts.map +1 -0
  3. package/dist/browser/hcs-25/index.d.ts +4 -0
  4. package/dist/browser/hcs-25/index.d.ts.map +1 -0
  5. package/dist/browser/hcs-25/scoring.d.ts +32 -0
  6. package/dist/browser/hcs-25/scoring.d.ts.map +1 -0
  7. package/dist/browser/hcs-25/types.d.ts +363 -0
  8. package/dist/browser/hcs-25/types.d.ts.map +1 -0
  9. package/dist/browser/index.d.ts +1 -0
  10. package/dist/browser/index.d.ts.map +1 -1
  11. package/dist/browser-root/hcs-25/identifiers.d.ts +24 -0
  12. package/dist/browser-root/hcs-25/identifiers.d.ts.map +1 -0
  13. package/dist/browser-root/hcs-25/index.d.ts +4 -0
  14. package/dist/browser-root/hcs-25/index.d.ts.map +1 -0
  15. package/dist/browser-root/hcs-25/scoring.d.ts +32 -0
  16. package/dist/browser-root/hcs-25/scoring.d.ts.map +1 -0
  17. package/dist/browser-root/hcs-25/types.d.ts +363 -0
  18. package/dist/browser-root/hcs-25/types.d.ts.map +1 -0
  19. package/dist/browser-root/index.d.ts +1 -0
  20. package/dist/browser-root/index.d.ts.map +1 -1
  21. package/dist/cjs/hcs-25/identifiers.d.ts +24 -0
  22. package/dist/cjs/hcs-25/identifiers.d.ts.map +1 -0
  23. package/dist/cjs/hcs-25/index.d.ts +4 -0
  24. package/dist/cjs/hcs-25/index.d.ts.map +1 -0
  25. package/dist/cjs/hcs-25/scoring.d.ts +32 -0
  26. package/dist/cjs/hcs-25/scoring.d.ts.map +1 -0
  27. package/dist/cjs/hcs-25/types.d.ts +363 -0
  28. package/dist/cjs/hcs-25/types.d.ts.map +1 -0
  29. package/dist/cjs/index.d.ts +1 -0
  30. package/dist/cjs/index.d.ts.map +1 -1
  31. package/dist/cjs/standards-sdk.cjs +1 -1
  32. package/dist/cjs/standards-sdk.cjs.map +1 -1
  33. package/dist/es/hcs-25/identifiers.d.ts +24 -0
  34. package/dist/es/hcs-25/identifiers.d.ts.map +1 -0
  35. package/dist/es/hcs-25/index.d.ts +4 -0
  36. package/dist/es/hcs-25/index.d.ts.map +1 -0
  37. package/dist/es/hcs-25/scoring.d.ts +32 -0
  38. package/dist/es/hcs-25/scoring.d.ts.map +1 -0
  39. package/dist/es/hcs-25/types.d.ts +363 -0
  40. package/dist/es/hcs-25/types.d.ts.map +1 -0
  41. package/dist/es/index.d.ts +1 -0
  42. package/dist/es/index.d.ts.map +1 -1
  43. package/dist/es/standards-sdk.es.js +62 -40
  44. package/dist/es/standards-sdk.es.js.map +1 -1
  45. package/dist/es/standards-sdk.es101.js +2 -2
  46. package/dist/es/standards-sdk.es103.js +2 -2
  47. package/dist/es/standards-sdk.es104.js +1 -1
  48. package/dist/es/standards-sdk.es106.js +1 -1
  49. package/dist/es/standards-sdk.es108.js +2 -2
  50. package/dist/es/standards-sdk.es11.js +1 -1
  51. package/dist/es/standards-sdk.es110.js +1 -1
  52. package/dist/es/standards-sdk.es111.js +2 -2
  53. package/dist/es/standards-sdk.es115.js +3 -3
  54. package/dist/es/standards-sdk.es116.js +4 -4
  55. package/dist/es/standards-sdk.es117.js +19 -251
  56. package/dist/es/standards-sdk.es117.js.map +1 -1
  57. package/dist/es/standards-sdk.es118.js +60 -475
  58. package/dist/es/standards-sdk.es118.js.map +1 -1
  59. package/dist/es/standards-sdk.es119.js +217 -86
  60. package/dist/es/standards-sdk.es119.js.map +1 -1
  61. package/dist/es/standards-sdk.es12.js +1 -1
  62. package/dist/es/standards-sdk.es120.js +242 -150
  63. package/dist/es/standards-sdk.es120.js.map +1 -1
  64. package/dist/es/standards-sdk.es121.js +470 -26
  65. package/dist/es/standards-sdk.es121.js.map +1 -1
  66. package/dist/es/standards-sdk.es122.js +103 -10
  67. package/dist/es/standards-sdk.es122.js.map +1 -1
  68. package/dist/es/standards-sdk.es123.js +145 -167
  69. package/dist/es/standards-sdk.es123.js.map +1 -1
  70. package/dist/es/standards-sdk.es124.js +30 -25
  71. package/dist/es/standards-sdk.es124.js.map +1 -1
  72. package/dist/es/standards-sdk.es125.js +10 -20
  73. package/dist/es/standards-sdk.es125.js.map +1 -1
  74. package/dist/es/standards-sdk.es126.js +159 -137
  75. package/dist/es/standards-sdk.es126.js.map +1 -1
  76. package/dist/es/standards-sdk.es127.js +27 -199
  77. package/dist/es/standards-sdk.es127.js.map +1 -1
  78. package/dist/es/standards-sdk.es128.js +15 -783
  79. package/dist/es/standards-sdk.es128.js.map +1 -1
  80. package/dist/es/standards-sdk.es129.js +157 -10
  81. package/dist/es/standards-sdk.es129.js.map +1 -1
  82. package/dist/es/standards-sdk.es13.js +1 -1
  83. package/dist/es/standards-sdk.es130.js +198 -564
  84. package/dist/es/standards-sdk.es130.js.map +1 -1
  85. package/dist/es/standards-sdk.es131.js +703 -539
  86. package/dist/es/standards-sdk.es131.js.map +1 -1
  87. package/dist/es/standards-sdk.es132.js +12 -12
  88. package/dist/es/standards-sdk.es132.js.map +1 -1
  89. package/dist/es/standards-sdk.es133.js +567 -2
  90. package/dist/es/standards-sdk.es133.js.map +1 -1
  91. package/dist/es/standards-sdk.es134.js +610 -71
  92. package/dist/es/standards-sdk.es134.js.map +1 -1
  93. package/dist/es/standards-sdk.es135.js +12 -39
  94. package/dist/es/standards-sdk.es135.js.map +1 -1
  95. package/dist/es/standards-sdk.es136.js +2 -2
  96. package/dist/es/standards-sdk.es136.js.map +1 -1
  97. package/dist/es/standards-sdk.es137.js +42 -190
  98. package/dist/es/standards-sdk.es137.js.map +1 -1
  99. package/dist/es/standards-sdk.es138.js +39 -1139
  100. package/dist/es/standards-sdk.es138.js.map +1 -1
  101. package/dist/es/standards-sdk.es139.js +2 -306
  102. package/dist/es/standards-sdk.es139.js.map +1 -1
  103. package/dist/es/standards-sdk.es14.js +1 -1
  104. package/dist/es/standards-sdk.es140.js +231 -418
  105. package/dist/es/standards-sdk.es140.js.map +1 -1
  106. package/dist/es/standards-sdk.es141.js +1135 -350
  107. package/dist/es/standards-sdk.es141.js.map +1 -1
  108. package/dist/es/standards-sdk.es142.js +268 -1084
  109. package/dist/es/standards-sdk.es142.js.map +1 -1
  110. package/dist/es/standards-sdk.es143.js +418 -204
  111. package/dist/es/standards-sdk.es143.js.map +1 -1
  112. package/dist/es/standards-sdk.es144.js +350 -1562
  113. package/dist/es/standards-sdk.es144.js.map +1 -1
  114. package/dist/es/standards-sdk.es145.js +1061 -1096
  115. package/dist/es/standards-sdk.es145.js.map +1 -1
  116. package/dist/es/standards-sdk.es146.js +204 -13
  117. package/dist/es/standards-sdk.es146.js.map +1 -1
  118. package/dist/es/standards-sdk.es147.js +1541 -233
  119. package/dist/es/standards-sdk.es147.js.map +1 -1
  120. package/dist/es/standards-sdk.es148.js +1157 -4
  121. package/dist/es/standards-sdk.es148.js.map +1 -1
  122. package/dist/es/standards-sdk.es149.js +15 -79
  123. package/dist/es/standards-sdk.es149.js.map +1 -1
  124. package/dist/es/standards-sdk.es15.js +1 -1
  125. package/dist/es/standards-sdk.es150.js +250 -78
  126. package/dist/es/standards-sdk.es150.js.map +1 -1
  127. package/dist/es/standards-sdk.es151.js +4 -60
  128. package/dist/es/standards-sdk.es151.js.map +1 -1
  129. package/dist/es/standards-sdk.es152.js +80 -2546
  130. package/dist/es/standards-sdk.es152.js.map +1 -1
  131. package/dist/es/standards-sdk.es153.js +80 -152
  132. package/dist/es/standards-sdk.es153.js.map +1 -1
  133. package/dist/es/standards-sdk.es154.js +60 -7
  134. package/dist/es/standards-sdk.es154.js.map +1 -1
  135. package/dist/es/standards-sdk.es155.js +2547 -86
  136. package/dist/es/standards-sdk.es155.js.map +1 -1
  137. package/dist/es/standards-sdk.es156.js +144 -50
  138. package/dist/es/standards-sdk.es156.js.map +1 -1
  139. package/dist/es/standards-sdk.es157.js +7 -30
  140. package/dist/es/standards-sdk.es157.js.map +1 -1
  141. package/dist/es/standards-sdk.es158.js +86 -34
  142. package/dist/es/standards-sdk.es158.js.map +1 -1
  143. package/dist/es/standards-sdk.es159.js +65 -48
  144. package/dist/es/standards-sdk.es159.js.map +1 -1
  145. package/dist/es/standards-sdk.es16.js +5 -5
  146. package/dist/es/standards-sdk.es160.js +30 -138
  147. package/dist/es/standards-sdk.es160.js.map +1 -1
  148. package/dist/es/standards-sdk.es161.js +34 -42
  149. package/dist/es/standards-sdk.es161.js.map +1 -1
  150. package/dist/es/standards-sdk.es162.js +48 -12482
  151. package/dist/es/standards-sdk.es162.js.map +1 -1
  152. package/dist/es/standards-sdk.es163.js +12479 -53
  153. package/dist/es/standards-sdk.es163.js.map +1 -1
  154. package/dist/es/standards-sdk.es164.js +124 -97
  155. package/dist/es/standards-sdk.es164.js.map +1 -1
  156. package/dist/es/standards-sdk.es165.js +35 -74
  157. package/dist/es/standards-sdk.es165.js.map +1 -1
  158. package/dist/es/standards-sdk.es166.js +14 -197
  159. package/dist/es/standards-sdk.es166.js.map +1 -1
  160. package/dist/es/standards-sdk.es167.js +54 -15
  161. package/dist/es/standards-sdk.es167.js.map +1 -1
  162. package/dist/es/standards-sdk.es168.js +90 -651
  163. package/dist/es/standards-sdk.es168.js.map +1 -1
  164. package/dist/es/standards-sdk.es169.js +70 -161
  165. package/dist/es/standards-sdk.es169.js.map +1 -1
  166. package/dist/es/standards-sdk.es170.js +187 -309
  167. package/dist/es/standards-sdk.es170.js.map +1 -1
  168. package/dist/es/standards-sdk.es171.js +661 -335
  169. package/dist/es/standards-sdk.es171.js.map +1 -1
  170. package/dist/es/standards-sdk.es172.js +64 -444
  171. package/dist/es/standards-sdk.es172.js.map +1 -1
  172. package/dist/es/standards-sdk.es173.js +142 -301
  173. package/dist/es/standards-sdk.es173.js.map +1 -1
  174. package/dist/es/standards-sdk.es174.js +310 -64
  175. package/dist/es/standards-sdk.es174.js.map +1 -1
  176. package/dist/es/standards-sdk.es175.js +337 -64
  177. package/dist/es/standards-sdk.es175.js.map +1 -1
  178. package/dist/es/standards-sdk.es176.js +438 -124
  179. package/dist/es/standards-sdk.es176.js.map +1 -1
  180. package/dist/es/standards-sdk.es177.js +310 -496
  181. package/dist/es/standards-sdk.es177.js.map +1 -1
  182. package/dist/es/standards-sdk.es178.js +60 -243
  183. package/dist/es/standards-sdk.es178.js.map +1 -1
  184. package/dist/es/standards-sdk.es179.js +118 -175
  185. package/dist/es/standards-sdk.es179.js.map +1 -1
  186. package/dist/es/standards-sdk.es18.js +12 -12
  187. package/dist/es/standards-sdk.es180.js +465 -67
  188. package/dist/es/standards-sdk.es180.js.map +1 -1
  189. package/dist/es/standards-sdk.es181.js +250 -143
  190. package/dist/es/standards-sdk.es181.js.map +1 -1
  191. package/dist/es/standards-sdk.es182.js +172 -160
  192. package/dist/es/standards-sdk.es182.js.map +1 -1
  193. package/dist/es/standards-sdk.es183.js +65 -630
  194. package/dist/es/standards-sdk.es183.js.map +1 -1
  195. package/dist/es/standards-sdk.es184.js +128 -161
  196. package/dist/es/standards-sdk.es184.js.map +1 -1
  197. package/dist/es/standards-sdk.es185.js +144 -195
  198. package/dist/es/standards-sdk.es185.js.map +1 -1
  199. package/dist/es/standards-sdk.es186.js +668 -223
  200. package/dist/es/standards-sdk.es186.js.map +1 -1
  201. package/dist/es/standards-sdk.es187.js +188 -0
  202. package/dist/es/standards-sdk.es187.js.map +1 -0
  203. package/dist/es/standards-sdk.es188.js +238 -0
  204. package/dist/es/standards-sdk.es188.js.map +1 -0
  205. package/dist/es/standards-sdk.es189.js +242 -0
  206. package/dist/es/standards-sdk.es189.js.map +1 -0
  207. package/dist/es/standards-sdk.es19.js +9 -9
  208. package/dist/es/standards-sdk.es2.js +2 -2
  209. package/dist/es/standards-sdk.es20.js +1 -1
  210. package/dist/es/standards-sdk.es21.js +1 -1
  211. package/dist/es/standards-sdk.es22.js +1 -1
  212. package/dist/es/standards-sdk.es23.js +1 -1
  213. package/dist/es/standards-sdk.es24.js +1 -1
  214. package/dist/es/standards-sdk.es25.js +1 -1
  215. package/dist/es/standards-sdk.es26.js +1 -1
  216. package/dist/es/standards-sdk.es27.js +12 -12
  217. package/dist/es/standards-sdk.es30.js +2 -2
  218. package/dist/es/standards-sdk.es31.js +4 -4
  219. package/dist/es/standards-sdk.es32.js +1 -1
  220. package/dist/es/standards-sdk.es35.js +6 -6
  221. package/dist/es/standards-sdk.es36.js +4 -4
  222. package/dist/es/standards-sdk.es37.js +2 -2
  223. package/dist/es/standards-sdk.es38.js +2 -2
  224. package/dist/es/standards-sdk.es39.js +1 -1
  225. package/dist/es/standards-sdk.es4.js +2 -2
  226. package/dist/es/standards-sdk.es40.js +1 -1
  227. package/dist/es/standards-sdk.es41.js +2 -2
  228. package/dist/es/standards-sdk.es46.js +1 -1
  229. package/dist/es/standards-sdk.es5.js +2 -2
  230. package/dist/es/standards-sdk.es51.js +1 -1
  231. package/dist/es/standards-sdk.es53.js +1 -1
  232. package/dist/es/standards-sdk.es56.js +2 -2
  233. package/dist/es/standards-sdk.es59.js +1 -1
  234. package/dist/es/standards-sdk.es6.js +2 -2
  235. package/dist/es/standards-sdk.es60.js +1 -1
  236. package/dist/es/standards-sdk.es62.js +1 -1
  237. package/dist/es/standards-sdk.es63.js +2 -2
  238. package/dist/es/standards-sdk.es64.js +1 -1
  239. package/dist/es/standards-sdk.es65.js +1 -1
  240. package/dist/es/standards-sdk.es66.js +1 -1
  241. package/dist/es/standards-sdk.es67.js +7 -7
  242. package/dist/es/standards-sdk.es69.js +1 -1
  243. package/dist/es/standards-sdk.es7.js +1 -1
  244. package/dist/es/standards-sdk.es71.js +2 -2
  245. package/dist/es/standards-sdk.es72.js +3 -3
  246. package/dist/es/standards-sdk.es75.js +5 -5
  247. package/dist/es/standards-sdk.es76.js +3 -3
  248. package/dist/es/standards-sdk.es77.js +2 -2
  249. package/dist/es/standards-sdk.es78.js +1 -1
  250. package/dist/es/standards-sdk.es81.js +2 -2
  251. package/dist/es/standards-sdk.es83.js +2 -2
  252. package/dist/es/standards-sdk.es84.js +4 -4
  253. package/dist/es/standards-sdk.es85.js +1 -1
  254. package/dist/es/standards-sdk.es88.js +1 -1
  255. package/dist/es/standards-sdk.es89.js +2 -2
  256. package/dist/es/standards-sdk.es9.js +2 -2
  257. package/dist/es/standards-sdk.es90.js +4 -4
  258. package/dist/es/standards-sdk.es94.js +3 -3
  259. package/dist/es/standards-sdk.es96.js +2 -2
  260. package/dist/es/standards-sdk.es98.js +1 -1
  261. package/dist/es/standards-sdk.es99.js +3 -3
  262. package/package.json +1 -1
@@ -1,349 +1,675 @@
1
- import { AccountId, Hbar, Long, HbarUnit, TokenId } from "@hashgraph/sdk";
2
- import { parseKey } from "./standards-sdk.es174.js";
3
- class CryptoParser {
4
- static parseCryptoTransfers(cryptoTransfer, result) {
5
- if (cryptoTransfer.transfers?.accountAmounts) {
6
- result.transfers = cryptoTransfer.transfers.accountAmounts.map((aa) => {
7
- const accountId = new AccountId(
8
- aa.accountID.shardNum ?? 0,
9
- aa.accountID.realmNum ?? 0,
10
- aa.accountID.accountNum ?? 0
11
- );
12
- const hbarAmount = Hbar.fromTinybars(Long.fromValue(aa.amount));
13
- return {
14
- accountId: accountId.toString(),
15
- amount: hbarAmount.toString(HbarUnit.Hbar),
16
- isDecimal: true
17
- };
18
- });
19
- }
20
- if (cryptoTransfer.tokenTransfers) {
21
- for (const tokenTransferList of cryptoTransfer.tokenTransfers) {
22
- const tokenId = new TokenId(
23
- tokenTransferList.token.shardNum ?? 0,
24
- tokenTransferList.token.realmNum ?? 0,
25
- tokenTransferList.token.tokenNum ?? 0
26
- );
27
- if (tokenTransferList.transfers) {
28
- for (const transfer of tokenTransferList.transfers) {
29
- const accountId = new AccountId(
30
- transfer.accountID.shardNum ?? 0,
31
- transfer.accountID.realmNum ?? 0,
32
- transfer.accountID.accountNum ?? 0
33
- );
34
- const tokenAmount = Long.fromValue(transfer.amount).toNumber();
35
- result.tokenTransfers.push({
36
- tokenId: tokenId.toString(),
37
- accountId: accountId.toString(),
38
- amount: tokenAmount
39
- });
40
- }
41
- }
42
- }
43
- }
1
+ import { skillRegistryConfigResponseSchema, skillRegistryListResponseSchema, skillCatalogResponseSchema, skillRegistryVersionsResponseSchema, skillRegistryMineResponseSchema, skillRegistryMyListResponseSchema, skillRegistryQuoteResponseSchema, skillQuotePreviewResponseSchema, skillRegistryPublishResponseSchema, skillRegistryJobStatusResponseSchema, skillRegistryOwnershipResponseSchema, skillRecommendedVersionResponseSchema, skillDeprecationsResponseSchema, skillDeprecationRecordSchema, skillBadgeResponseSchema, skillStatusResponseSchema, skillSecurityBreakdownResponseSchema, skillConversionSignalsResponseSchema, skillPreviewRecordSchema, skillPreviewLookupResponseSchema, skillInstallResponseSchema, skillInstallCopyTelemetryResponseSchema, skillRegistryTagsResponseSchema, skillRegistryCategoriesResponseSchema, skillResolverManifestResponseSchema, skillRegistryVoteStatusResponseSchema, skillVerificationRequestCreateResponseSchema, skillVerificationStatusResponseSchema, skillVerificationDomainProofChallengeResponseSchema, skillVerificationDomainProofVerifyResponseSchema } from "./standards-sdk.es155.js";
2
+ function requireTrimmedString(value, fieldName) {
3
+ const normalizedValue = value.trim();
4
+ if (!normalizedValue) {
5
+ throw new Error(`${fieldName} is required`);
44
6
  }
45
- static parseCryptoDelete(body) {
46
- if (!body) return void 0;
47
- const data = {};
48
- if (body.deleteAccountID) {
49
- data.deleteAccountId = new AccountId(
50
- body.deleteAccountID.shardNum ?? 0,
51
- body.deleteAccountID.realmNum ?? 0,
52
- body.deleteAccountID.accountNum ?? 0
53
- ).toString();
54
- }
55
- if (body.transferAccountID) {
56
- data.transferAccountId = new AccountId(
57
- body.transferAccountID.shardNum ?? 0,
58
- body.transferAccountID.realmNum ?? 0,
59
- body.transferAccountID.accountNum ?? 0
60
- ).toString();
61
- }
62
- return data;
63
- }
64
- static parseCryptoCreateAccount(body) {
65
- if (!body) return void 0;
66
- const data = {};
67
- if (body.initialBalance) {
68
- data.initialBalance = Hbar.fromTinybars(
69
- Long.fromValue(body.initialBalance)
70
- ).toString(HbarUnit.Hbar);
71
- }
72
- if (body.key) {
73
- data.key = parseKey(body.key);
74
- }
75
- if (body.receiverSigRequired !== void 0) {
76
- data.receiverSigRequired = body.receiverSigRequired;
77
- }
78
- if (body.autoRenewPeriod?.seconds) {
79
- data.autoRenewPeriod = Long.fromValue(
80
- body.autoRenewPeriod.seconds
81
- ).toString();
82
- }
83
- if (body.memo) {
84
- data.memo = body.memo;
85
- }
86
- if (body.maxAutomaticTokenAssociations !== void 0) {
87
- data.maxAutomaticTokenAssociations = body.maxAutomaticTokenAssociations;
88
- }
89
- if (body.stakedAccountId) {
90
- data.stakedAccountId = new AccountId(
91
- body.stakedAccountId.shardNum ?? 0,
92
- body.stakedAccountId.realmNum ?? 0,
93
- body.stakedAccountId.accountNum ?? 0
94
- ).toString();
95
- } else if (body.stakedNodeId !== null && body.stakedNodeId !== void 0) {
96
- data.stakedNodeId = Long.fromValue(body.stakedNodeId).toString();
97
- }
98
- if (body.declineReward !== void 0) {
99
- data.declineReward = body.declineReward;
100
- }
101
- if (body.alias && body.alias.length > 0) {
102
- data.alias = Buffer.from(body.alias).toString("hex");
103
- }
104
- return data;
105
- }
106
- static parseCryptoUpdateAccount(body) {
107
- if (!body) return void 0;
108
- const data = {};
109
- if (body.accountIDToUpdate) {
110
- data.accountIdToUpdate = new AccountId(
111
- body.accountIDToUpdate.shardNum ?? 0,
112
- body.accountIDToUpdate.realmNum ?? 0,
113
- body.accountIDToUpdate.accountNum ?? 0
114
- ).toString();
115
- }
116
- if (body.key) {
117
- data.key = parseKey(body.key);
118
- }
119
- if (body.expirationTime?.seconds) {
120
- data.expirationTime = `${Long.fromValue(
121
- body.expirationTime.seconds
122
- ).toString()}.${body.expirationTime.nanos}`;
123
- }
124
- if (body.receiverSigRequired !== null && body.receiverSigRequired !== void 0) {
125
- data.receiverSigRequired = Boolean(body.receiverSigRequired);
126
- }
127
- if (body.autoRenewPeriod?.seconds) {
128
- data.autoRenewPeriod = Long.fromValue(
129
- body.autoRenewPeriod.seconds
130
- ).toString();
131
- }
132
- if (body.memo?.value !== void 0) {
133
- data.memo = body.memo.value;
134
- }
135
- if (body.maxAutomaticTokenAssociations?.value !== void 0) {
136
- data.maxAutomaticTokenAssociations = body.maxAutomaticTokenAssociations.value;
137
- }
138
- if (body.stakedAccountId) {
139
- data.stakedAccountId = new AccountId(
140
- body.stakedAccountId.shardNum ?? 0,
141
- body.stakedAccountId.realmNum ?? 0,
142
- body.stakedAccountId.accountNum ?? 0
143
- ).toString();
144
- data.stakedNodeId = void 0;
145
- } else if (body.stakedNodeId !== null && body.stakedNodeId !== void 0) {
146
- data.stakedNodeId = Long.fromValue(body.stakedNodeId).toString();
147
- data.stakedAccountId = void 0;
148
- } else {
149
- data.stakedAccountId = void 0;
150
- data.stakedNodeId = void 0;
151
- }
152
- if (body.declineReward !== null && body.declineReward !== void 0) {
153
- data.declineReward = Boolean(body.declineReward);
154
- }
155
- return data;
156
- }
157
- static parseCryptoApproveAllowance(body) {
158
- if (!body) return void 0;
159
- const data = {};
160
- if (body.cryptoAllowances && body.cryptoAllowances.length > 0) {
161
- data.hbarAllowances = body.cryptoAllowances.map((a) => ({
162
- ownerAccountId: new AccountId(
163
- a.owner.shardNum ?? 0,
164
- a.owner.realmNum ?? 0,
165
- a.owner.accountNum ?? 0
166
- ).toString(),
167
- spenderAccountId: new AccountId(
168
- a.spender.shardNum ?? 0,
169
- a.spender.realmNum ?? 0,
170
- a.spender.accountNum ?? 0
171
- ).toString(),
172
- amount: Hbar.fromTinybars(Long.fromValue(a.amount)).toString(
173
- HbarUnit.Hbar
174
- )
175
- }));
7
+ return normalizedValue;
8
+ }
9
+ async function skillsConfig(client) {
10
+ const raw = await client.requestJson("/skills/config", {
11
+ method: "GET"
12
+ });
13
+ return client.parseWithSchema(
14
+ raw,
15
+ skillRegistryConfigResponseSchema,
16
+ "skill registry config response"
17
+ );
18
+ }
19
+ async function listSkills(client, params = {}) {
20
+ const query = new URLSearchParams();
21
+ if (params.name) {
22
+ query.set("name", params.name);
23
+ }
24
+ if (params.version) {
25
+ query.set("version", params.version);
26
+ }
27
+ if (typeof params.limit === "number" && Number.isFinite(params.limit)) {
28
+ query.set("limit", String(Math.trunc(params.limit)));
29
+ }
30
+ if (params.cursor) {
31
+ query.set("cursor", params.cursor);
32
+ }
33
+ if (typeof params.includeFiles === "boolean") {
34
+ query.set("includeFiles", params.includeFiles ? "true" : "false");
35
+ }
36
+ if (params.accountId) {
37
+ query.set("accountId", params.accountId);
38
+ }
39
+ if (params.q) {
40
+ query.set("q", params.q);
41
+ }
42
+ if (params.tag) {
43
+ query.set("tag", params.tag);
44
+ }
45
+ if (params.category) {
46
+ query.set("category", params.category);
47
+ }
48
+ if (typeof params.featured === "boolean") {
49
+ query.set("featured", params.featured ? "true" : "false");
50
+ }
51
+ if (typeof params.verified === "boolean") {
52
+ query.set("verified", params.verified ? "true" : "false");
53
+ }
54
+ if (params.view) {
55
+ query.set("view", params.view);
56
+ }
57
+ const suffix = query.size > 0 ? `?${query.toString()}` : "";
58
+ const raw = await client.requestJson(`/skills${suffix}`, {
59
+ method: "GET"
60
+ });
61
+ return client.parseWithSchema(
62
+ raw,
63
+ skillRegistryListResponseSchema,
64
+ "skill registry list response"
65
+ );
66
+ }
67
+ async function getSkillSecurityBreakdown(client, params) {
68
+ const normalizedJobId = requireTrimmedString(params.jobId, "jobId");
69
+ const raw = await client.requestJson(
70
+ `/skills/${encodeURIComponent(normalizedJobId)}/security-breakdown`,
71
+ { method: "GET" }
72
+ );
73
+ return client.parseWithSchema(
74
+ raw,
75
+ skillSecurityBreakdownResponseSchema,
76
+ "skill security breakdown response"
77
+ );
78
+ }
79
+ async function getSkillsCatalog(client, params = {}) {
80
+ const query = new URLSearchParams();
81
+ if (params.q) {
82
+ query.set("q", params.q);
83
+ }
84
+ if (params.category) {
85
+ query.set("category", params.category);
86
+ }
87
+ params.tags?.forEach((tag) => {
88
+ if (tag.trim()) {
89
+ query.append("tag", tag.trim());
176
90
  }
177
- if (body.tokenAllowances && body.tokenAllowances.length > 0) {
178
- data.tokenAllowances = body.tokenAllowances.map((a) => ({
179
- tokenId: new TokenId(
180
- a.tokenId.shardNum ?? 0,
181
- a.tokenId.realmNum ?? 0,
182
- a.tokenId.tokenNum ?? 0
183
- ).toString(),
184
- ownerAccountId: new AccountId(
185
- a.owner.shardNum ?? 0,
186
- a.owner.realmNum ?? 0,
187
- a.owner.accountNum ?? 0
188
- ).toString(),
189
- spenderAccountId: new AccountId(
190
- a.spender.shardNum ?? 0,
191
- a.spender.realmNum ?? 0,
192
- a.spender.accountNum ?? 0
193
- ).toString(),
194
- amount: Long.fromValue(a.amount).toString()
195
- }));
91
+ });
92
+ if (typeof params.featured === "boolean") {
93
+ query.set("featured", params.featured ? "true" : "false");
94
+ }
95
+ if (typeof params.verified === "boolean") {
96
+ query.set("verified", params.verified ? "true" : "false");
97
+ }
98
+ if (params.channel) {
99
+ query.set("channel", params.channel);
100
+ }
101
+ if (params.sortBy) {
102
+ query.set("sortBy", params.sortBy);
103
+ }
104
+ if (typeof params.limit === "number" && Number.isFinite(params.limit)) {
105
+ query.set("limit", String(Math.trunc(params.limit)));
106
+ }
107
+ if (params.cursor) {
108
+ query.set("cursor", params.cursor);
109
+ }
110
+ const suffix = query.size > 0 ? `?${query.toString()}` : "";
111
+ const raw = await client.requestJson(`/skills/catalog${suffix}`, {
112
+ method: "GET"
113
+ });
114
+ return client.parseWithSchema(
115
+ raw,
116
+ skillCatalogResponseSchema,
117
+ "skill catalog response"
118
+ );
119
+ }
120
+ async function listSkillVersions(client, params) {
121
+ const normalizedName = requireTrimmedString(params.name, "name");
122
+ const query = new URLSearchParams();
123
+ query.set("name", normalizedName);
124
+ const raw = await client.requestJson(
125
+ `/skills/versions?${query.toString()}`,
126
+ { method: "GET" }
127
+ );
128
+ return client.parseWithSchema(
129
+ raw,
130
+ skillRegistryVersionsResponseSchema,
131
+ "skill registry versions response"
132
+ );
133
+ }
134
+ async function listMySkills(client, params = {}) {
135
+ const query = new URLSearchParams();
136
+ if (typeof params.limit === "number" && Number.isFinite(params.limit)) {
137
+ query.set("limit", String(Math.trunc(params.limit)));
138
+ }
139
+ const suffix = query.size > 0 ? `?${query.toString()}` : "";
140
+ const raw = await client.requestJson(`/skills/mine${suffix}`, {
141
+ method: "GET"
142
+ });
143
+ return client.parseWithSchema(
144
+ raw,
145
+ skillRegistryMineResponseSchema,
146
+ "skill registry mine response"
147
+ );
148
+ }
149
+ async function getMySkillsList(client, params = {}) {
150
+ const query = new URLSearchParams();
151
+ if (typeof params.limit === "number" && Number.isFinite(params.limit)) {
152
+ query.set("limit", String(Math.trunc(params.limit)));
153
+ }
154
+ if (params.cursor) {
155
+ query.set("cursor", params.cursor);
156
+ }
157
+ if (params.accountId) {
158
+ query.set("accountId", params.accountId);
159
+ }
160
+ const suffix = query.size > 0 ? `?${query.toString()}` : "";
161
+ const raw = await client.requestJson(`/skills/my-list${suffix}`, {
162
+ method: "GET"
163
+ });
164
+ return client.parseWithSchema(
165
+ raw,
166
+ skillRegistryMyListResponseSchema,
167
+ "skill registry my list response"
168
+ );
169
+ }
170
+ async function quoteSkillPublish(client, payload) {
171
+ const raw = await client.requestJson("/skills/quote", {
172
+ method: "POST",
173
+ body: payload,
174
+ headers: { "content-type": "application/json" }
175
+ });
176
+ return client.parseWithSchema(
177
+ raw,
178
+ skillRegistryQuoteResponseSchema,
179
+ "skill registry quote response"
180
+ );
181
+ }
182
+ async function quoteSkillPublishPreview(client, payload) {
183
+ const raw = await client.requestJson("/skills/quote-preview", {
184
+ method: "POST",
185
+ body: payload,
186
+ headers: { "content-type": "application/json" }
187
+ });
188
+ return client.parseWithSchema(
189
+ raw,
190
+ skillQuotePreviewResponseSchema,
191
+ "skill quote preview response"
192
+ );
193
+ }
194
+ async function publishSkill(client, payload) {
195
+ const raw = await client.requestJson("/skills/publish", {
196
+ method: "POST",
197
+ body: payload,
198
+ headers: { "content-type": "application/json" }
199
+ });
200
+ return client.parseWithSchema(
201
+ raw,
202
+ skillRegistryPublishResponseSchema,
203
+ "skill registry publish response"
204
+ );
205
+ }
206
+ async function getSkillPublishJob(client, jobId, params = {}) {
207
+ const normalized = requireTrimmedString(jobId, "jobId");
208
+ const query = new URLSearchParams();
209
+ if (params.accountId) {
210
+ query.set("accountId", params.accountId);
211
+ }
212
+ const suffix = query.size > 0 ? `?${query.toString()}` : "";
213
+ const raw = await client.requestJson(
214
+ `/skills/jobs/${encodeURIComponent(normalized)}${suffix}`,
215
+ { method: "GET" }
216
+ );
217
+ return client.parseWithSchema(
218
+ raw,
219
+ skillRegistryJobStatusResponseSchema,
220
+ "skill registry job status response"
221
+ );
222
+ }
223
+ async function getSkillOwnership(client, params) {
224
+ const normalizedName = requireTrimmedString(params.name, "name");
225
+ const query = new URLSearchParams();
226
+ query.set("name", normalizedName);
227
+ if (params.accountId) {
228
+ query.set("accountId", params.accountId);
229
+ }
230
+ const raw = await client.requestJson(
231
+ `/skills/ownership?${query.toString()}`,
232
+ {
233
+ method: "GET"
196
234
  }
197
- if (body.nftAllowances && body.nftAllowances.length > 0) {
198
- data.nftAllowances = body.nftAllowances.map((a) => {
199
- const allowance = {};
200
- if (a.tokenId)
201
- allowance.tokenId = new TokenId(
202
- a.tokenId.shardNum ?? 0,
203
- a.tokenId.realmNum ?? 0,
204
- a.tokenId.tokenNum ?? 0
205
- ).toString();
206
- if (a.owner)
207
- allowance.ownerAccountId = new AccountId(
208
- a.owner.shardNum ?? 0,
209
- a.owner.realmNum ?? 0,
210
- a.owner.accountNum ?? 0
211
- ).toString();
212
- if (a.spender)
213
- allowance.spenderAccountId = new AccountId(
214
- a.spender.shardNum ?? 0,
215
- a.spender.realmNum ?? 0,
216
- a.spender.accountNum ?? 0
217
- ).toString();
218
- if (a.serialNumbers && a.serialNumbers.length > 0)
219
- allowance.serialNumbers = a.serialNumbers.map(
220
- (sn) => Long.fromValue(sn).toString()
221
- );
222
- if (a.approvedForAll?.value !== void 0)
223
- allowance.approvedForAll = a.approvedForAll.value;
224
- if (a.delegatingSpender)
225
- allowance.delegatingSpender = new AccountId(
226
- a.delegatingSpender.shardNum ?? 0,
227
- a.delegatingSpender.realmNum ?? 0,
228
- a.delegatingSpender.accountNum ?? 0
229
- ).toString();
230
- return allowance;
231
- });
235
+ );
236
+ return client.parseWithSchema(
237
+ raw,
238
+ skillRegistryOwnershipResponseSchema,
239
+ "skill registry ownership response"
240
+ );
241
+ }
242
+ async function getRecommendedSkillVersion(client, params) {
243
+ const normalizedName = requireTrimmedString(params.name, "name");
244
+ const query = new URLSearchParams();
245
+ query.set("name", normalizedName);
246
+ const raw = await client.requestJson(
247
+ `/skills/recommended?${query.toString()}`,
248
+ { method: "GET" }
249
+ );
250
+ return client.parseWithSchema(
251
+ raw,
252
+ skillRecommendedVersionResponseSchema,
253
+ "skill recommended version response"
254
+ );
255
+ }
256
+ async function setRecommendedSkillVersion(client, payload) {
257
+ const normalizedName = requireTrimmedString(payload.name, "name");
258
+ const normalizedVersion = requireTrimmedString(payload.version, "version");
259
+ const raw = await client.requestJson("/skills/recommended", {
260
+ method: "POST",
261
+ body: {
262
+ name: normalizedName,
263
+ version: normalizedVersion
264
+ },
265
+ headers: { "content-type": "application/json" }
266
+ });
267
+ return client.parseWithSchema(
268
+ raw,
269
+ skillRecommendedVersionResponseSchema,
270
+ "skill recommended version response"
271
+ );
272
+ }
273
+ async function getSkillDeprecations(client, params) {
274
+ const normalizedName = requireTrimmedString(params.name, "name");
275
+ const query = new URLSearchParams();
276
+ query.set("name", normalizedName);
277
+ const raw = await client.requestJson(
278
+ `/skills/deprecations?${query.toString()}`,
279
+ { method: "GET" }
280
+ );
281
+ return client.parseWithSchema(
282
+ raw,
283
+ skillDeprecationsResponseSchema,
284
+ "skill deprecations response"
285
+ );
286
+ }
287
+ async function setSkillDeprecation(client, payload) {
288
+ const normalizedName = requireTrimmedString(payload.name, "name");
289
+ const version = payload.version?.trim();
290
+ const reason = requireTrimmedString(payload.reason, "reason");
291
+ const replacementRef = payload.replacementRef?.trim();
292
+ const raw = await client.requestJson("/skills/deprecate", {
293
+ method: "POST",
294
+ body: {
295
+ name: normalizedName,
296
+ version,
297
+ reason,
298
+ replacementRef
299
+ },
300
+ headers: { "content-type": "application/json" }
301
+ });
302
+ return client.parseWithSchema(
303
+ raw,
304
+ skillDeprecationRecordSchema,
305
+ "skill deprecation response"
306
+ );
307
+ }
308
+ async function getSkillBadge(client, params) {
309
+ const normalizedName = requireTrimmedString(params.name, "name");
310
+ const query = new URLSearchParams();
311
+ query.set("name", normalizedName);
312
+ if (params.metric) {
313
+ query.set("metric", params.metric);
314
+ }
315
+ if (params.label?.trim()) {
316
+ query.set("label", params.label.trim());
317
+ }
318
+ if (params.style) {
319
+ query.set("style", params.style);
320
+ }
321
+ const raw = await client.requestJson(
322
+ `/skills/badge?${query.toString()}`,
323
+ { method: "GET" }
324
+ );
325
+ return client.parseWithSchema(
326
+ raw,
327
+ skillBadgeResponseSchema,
328
+ "skill badge response"
329
+ );
330
+ }
331
+ async function getSkillStatus(client, params) {
332
+ const normalizedName = requireTrimmedString(params.name, "name");
333
+ const query = new URLSearchParams();
334
+ query.set("name", normalizedName);
335
+ if (params.version?.trim()) {
336
+ query.set("version", params.version.trim());
337
+ }
338
+ const raw = await client.requestJson(
339
+ `/skills/status?${query.toString()}`,
340
+ { method: "GET" }
341
+ );
342
+ return client.parseWithSchema(
343
+ raw,
344
+ skillStatusResponseSchema,
345
+ "skill status response"
346
+ );
347
+ }
348
+ async function getSkillStatusByRepo(client, params) {
349
+ const repo = requireTrimmedString(params.repo, "repo");
350
+ const skillDir = requireTrimmedString(params.skillDir, "skillDir");
351
+ const query = new URLSearchParams();
352
+ query.set("repo", repo);
353
+ query.set("skillDir", skillDir);
354
+ if (params.ref?.trim()) {
355
+ query.set("ref", params.ref.trim());
356
+ }
357
+ const raw = await client.requestJson(
358
+ `/skills/status/by-repo?${query.toString()}`,
359
+ { method: "GET" }
360
+ );
361
+ return client.parseWithSchema(
362
+ raw,
363
+ skillStatusResponseSchema,
364
+ "skill status response"
365
+ );
366
+ }
367
+ async function getSkillConversionSignalsByRepo(client, params) {
368
+ const repo = requireTrimmedString(params.repo, "repo");
369
+ const skillDir = requireTrimmedString(params.skillDir, "skillDir");
370
+ const query = new URLSearchParams();
371
+ query.set("repo", repo);
372
+ query.set("skillDir", skillDir);
373
+ if (params.ref?.trim()) {
374
+ query.set("ref", params.ref.trim());
375
+ }
376
+ const raw = await client.requestJson(
377
+ `/skills/conversion-signals/by-repo?${query.toString()}`,
378
+ { method: "GET" }
379
+ );
380
+ return client.parseWithSchema(
381
+ raw,
382
+ skillConversionSignalsResponseSchema,
383
+ "skill conversion signals response"
384
+ );
385
+ }
386
+ async function uploadSkillPreviewFromGithubOidc(client, payload) {
387
+ const token = requireTrimmedString(payload.token, "token");
388
+ const raw = await client.requestJson(
389
+ "/skills/preview/github-oidc",
390
+ {
391
+ method: "POST",
392
+ body: payload.report,
393
+ headers: {
394
+ "content-type": "application/json",
395
+ authorization: `Bearer ${token}`
396
+ }
232
397
  }
233
- return data;
234
- }
235
- static parseCryptoDeleteAllowance(body) {
236
- if (!body) return void 0;
237
- const data = {};
238
- if (body.nftAllowances && body.nftAllowances.length > 0) {
239
- data.nftAllowancesToRemove = body.nftAllowances.map((a) => ({
240
- ownerAccountId: new AccountId(
241
- a.owner.shardNum ?? 0,
242
- a.owner.realmNum ?? 0,
243
- a.owner.accountNum ?? 0
244
- ).toString(),
245
- tokenId: new TokenId(
246
- a.tokenId.shardNum ?? 0,
247
- a.tokenId.realmNum ?? 0,
248
- a.tokenId.tokenNum ?? 0
249
- ).toString(),
250
- serialNumbers: a.serialNumbers ? a.serialNumbers.map((sn) => Long.fromValue(sn).toString()) : []
251
- }));
398
+ );
399
+ return client.parseWithSchema(
400
+ raw,
401
+ skillPreviewRecordSchema,
402
+ "skill preview record response"
403
+ );
404
+ }
405
+ async function getSkillPreview(client, params) {
406
+ const normalizedName = requireTrimmedString(params.name, "name");
407
+ const query = new URLSearchParams();
408
+ query.set("name", normalizedName);
409
+ if (params.version?.trim()) {
410
+ query.set("version", params.version.trim());
411
+ }
412
+ const raw = await client.requestJson(
413
+ `/skills/preview?${query.toString()}`,
414
+ { method: "GET" }
415
+ );
416
+ return client.parseWithSchema(
417
+ raw,
418
+ skillPreviewLookupResponseSchema,
419
+ "skill preview response"
420
+ );
421
+ }
422
+ async function getSkillPreviewByRepo(client, params) {
423
+ const repo = requireTrimmedString(params.repo, "repo");
424
+ const skillDir = requireTrimmedString(params.skillDir, "skillDir");
425
+ const query = new URLSearchParams();
426
+ query.set("repo", repo);
427
+ query.set("skillDir", skillDir);
428
+ if (params.ref?.trim()) {
429
+ query.set("ref", params.ref.trim());
430
+ }
431
+ const raw = await client.requestJson(
432
+ `/skills/preview/by-repo?${query.toString()}`,
433
+ { method: "GET" }
434
+ );
435
+ return client.parseWithSchema(
436
+ raw,
437
+ skillPreviewLookupResponseSchema,
438
+ "skill preview by repo response"
439
+ );
440
+ }
441
+ async function getSkillPreviewById(client, previewId) {
442
+ const normalizedPreviewId = requireTrimmedString(previewId, "previewId");
443
+ const raw = await client.requestJson(
444
+ `/skills/preview/${encodeURIComponent(normalizedPreviewId)}`,
445
+ { method: "GET" }
446
+ );
447
+ return client.parseWithSchema(
448
+ raw,
449
+ skillPreviewLookupResponseSchema,
450
+ "skill preview by id response"
451
+ );
452
+ }
453
+ async function getSkillInstall(client, skillRef) {
454
+ const normalizedSkillRef = requireTrimmedString(skillRef, "skillRef");
455
+ const raw = await client.requestJson(
456
+ `/skills/${encodeURIComponent(normalizedSkillRef)}/install`,
457
+ { method: "GET" }
458
+ );
459
+ return client.parseWithSchema(
460
+ raw,
461
+ skillInstallResponseSchema,
462
+ "skill install response"
463
+ );
464
+ }
465
+ async function recordSkillInstallCopy(client, skillRef, payload = {}) {
466
+ const normalizedSkillRef = requireTrimmedString(skillRef, "skillRef");
467
+ const raw = await client.requestJson(
468
+ `/skills/${encodeURIComponent(normalizedSkillRef)}/telemetry/install-copy`,
469
+ {
470
+ method: "POST",
471
+ body: payload,
472
+ headers: { "content-type": "application/json" }
252
473
  }
253
- return data;
254
- }
255
- /**
256
- * Extract HBAR transfers from Transaction object
257
- */
258
- static extractHbarTransfersFromTransaction(transaction) {
259
- const transfers = [];
260
- try {
261
- const hbarTransfers = transaction._hbarTransfers;
262
- if (Array.isArray(hbarTransfers)) {
263
- hbarTransfers.forEach((transfer) => {
264
- if (transfer.accountId && transfer.amount) {
265
- const amountInTinybars = transfer.amount.toTinybars();
266
- const amountInHbar = Number(amountInTinybars) / 1e8;
267
- transfers.push({
268
- accountId: transfer.accountId.toString(),
269
- amount: amountInHbar
270
- });
271
- }
272
- });
474
+ );
475
+ return client.parseWithSchema(
476
+ raw,
477
+ skillInstallCopyTelemetryResponseSchema,
478
+ "skill install copy telemetry response"
479
+ );
480
+ }
481
+ async function listSkillTags(client) {
482
+ const raw = await client.requestJson("/skills/tags", {
483
+ method: "GET"
484
+ });
485
+ return client.parseWithSchema(
486
+ raw,
487
+ skillRegistryTagsResponseSchema,
488
+ "skill tags response"
489
+ );
490
+ }
491
+ async function listSkillCategories(client) {
492
+ const raw = await client.requestJson("/skills/categories", {
493
+ method: "GET"
494
+ });
495
+ return client.parseWithSchema(
496
+ raw,
497
+ skillRegistryCategoriesResponseSchema,
498
+ "skill categories response"
499
+ );
500
+ }
501
+ async function resolveSkillMarkdown(client, skillRef) {
502
+ const normalizedSkillRef = requireTrimmedString(skillRef, "skillRef");
503
+ const response = await client.request(
504
+ `/skills/${encodeURIComponent(normalizedSkillRef)}/SKILL.md`,
505
+ {
506
+ method: "GET",
507
+ headers: {
508
+ accept: "text/markdown, text/plain;q=0.9, */*;q=0.8"
273
509
  }
274
- } catch (error) {
275
510
  }
276
- return transfers;
277
- }
278
- /**
279
- * Extract token transfers from Transaction object
280
- */
281
- static extractTokenTransfersFromTransaction(transaction) {
282
- const tokenTransfers = [];
283
- try {
284
- const tokenTransfersList = transaction._tokenTransfers;
285
- if (Array.isArray(tokenTransfersList)) {
286
- tokenTransfersList.forEach((tokenTransfer) => {
287
- if (tokenTransfer.tokenId && Array.isArray(tokenTransfer.transfers)) {
288
- const transfers = tokenTransfer.transfers.map((transfer) => ({
289
- accountId: transfer.accountId?.toString() || "Unknown",
290
- amount: Number(transfer.amount || 0)
291
- }));
292
- tokenTransfers.push({
293
- tokenId: tokenTransfer.tokenId.toString(),
294
- transfers
295
- });
296
- }
297
- });
298
- }
299
- } catch (error) {
511
+ );
512
+ return response.text();
513
+ }
514
+ async function resolveSkillManifest(client, skillRef) {
515
+ const normalizedSkillRef = requireTrimmedString(skillRef, "skillRef");
516
+ const raw = await client.requestJson(
517
+ `/skills/${encodeURIComponent(normalizedSkillRef)}/manifest`,
518
+ {
519
+ method: "GET"
300
520
  }
301
- return tokenTransfers;
302
- }
303
- /**
304
- * Parse crypto transaction from Transaction object with comprehensive extraction
305
- * This is the unified entry point that handles both protobuf and internal field extraction
306
- */
307
- static parseFromTransactionObject(transaction) {
308
- try {
309
- const hbarTransfers = this.extractHbarTransfersFromTransaction(transaction);
310
- const tokenTransfers = this.extractTokenTransfersFromTransaction(transaction);
311
- if (hbarTransfers.length > 0 || tokenTransfers.length > 0) {
312
- const convertedTransfers = hbarTransfers.map((transfer) => ({
313
- accountId: transfer.accountId,
314
- amount: transfer.amount.toString() + " ℏ",
315
- isDecimal: true
316
- }));
317
- const convertedTokenTransfers = tokenTransfers.flatMap(
318
- (tokenGroup) => tokenGroup.transfers.map((transfer) => ({
319
- tokenId: tokenGroup.tokenId,
320
- accountId: transfer.accountId,
321
- amount: transfer.amount
322
- }))
323
- );
324
- if (hbarTransfers.length > 0) {
325
- return {
326
- type: "CRYPTOTRANSFER",
327
- humanReadableType: "Crypto Transfer",
328
- transfers: convertedTransfers,
329
- tokenTransfers: convertedTokenTransfers
330
- };
331
- } else if (tokenTransfers.length > 0) {
332
- return {
333
- type: "TOKENTRANSFER",
334
- humanReadableType: "Token Transfer",
335
- transfers: convertedTransfers,
336
- tokenTransfers: convertedTokenTransfers
337
- };
338
- }
339
- }
340
- return {};
341
- } catch (error) {
342
- return {};
521
+ );
522
+ return client.parseWithSchema(
523
+ raw,
524
+ skillResolverManifestResponseSchema,
525
+ "skill resolver manifest response"
526
+ );
527
+ }
528
+ async function getSkillVoteStatus(client, params) {
529
+ const normalizedName = requireTrimmedString(params.name, "name");
530
+ const query = new URLSearchParams();
531
+ query.set("name", normalizedName);
532
+ const raw = await client.requestJson(
533
+ `/skills/vote?${query.toString()}`,
534
+ { method: "GET" }
535
+ );
536
+ return client.parseWithSchema(
537
+ raw,
538
+ skillRegistryVoteStatusResponseSchema,
539
+ "skill registry vote status response"
540
+ );
541
+ }
542
+ async function setSkillVote(client, payload) {
543
+ const normalizedName = requireTrimmedString(payload.name, "name");
544
+ const raw = await client.requestJson("/skills/vote", {
545
+ method: "POST",
546
+ body: { name: normalizedName, upvoted: payload.upvoted },
547
+ headers: { "content-type": "application/json" }
548
+ });
549
+ return client.parseWithSchema(
550
+ raw,
551
+ skillRegistryVoteStatusResponseSchema,
552
+ "skill registry vote status response"
553
+ );
554
+ }
555
+ async function requestSkillVerification(client, payload) {
556
+ const normalizedName = requireTrimmedString(payload.name, "name");
557
+ const raw = await client.requestJson(
558
+ "/skills/verification/request",
559
+ {
560
+ method: "POST",
561
+ body: {
562
+ name: normalizedName,
563
+ version: payload.version,
564
+ tier: payload.tier
565
+ },
566
+ headers: { "content-type": "application/json" }
343
567
  }
568
+ );
569
+ return client.parseWithSchema(
570
+ raw,
571
+ skillVerificationRequestCreateResponseSchema,
572
+ "skill verification request create response"
573
+ );
574
+ }
575
+ async function getSkillVerificationStatus(client, params) {
576
+ const normalizedName = requireTrimmedString(params.name, "name");
577
+ const query = new URLSearchParams();
578
+ query.set("name", normalizedName);
579
+ if (params.version) {
580
+ query.set("version", params.version);
344
581
  }
582
+ const raw = await client.requestJson(
583
+ `/skills/verification/status?${query.toString()}`,
584
+ { method: "GET" }
585
+ );
586
+ return client.parseWithSchema(
587
+ raw,
588
+ skillVerificationStatusResponseSchema,
589
+ "skill verification status response"
590
+ );
591
+ }
592
+ async function createSkillDomainProofChallenge(client, payload) {
593
+ const normalizedName = requireTrimmedString(payload.name, "name");
594
+ const raw = await client.requestJson(
595
+ "/skills/verification/domain/challenge",
596
+ {
597
+ method: "POST",
598
+ body: {
599
+ name: normalizedName,
600
+ version: payload.version,
601
+ domain: payload.domain
602
+ },
603
+ headers: { "content-type": "application/json" }
604
+ }
605
+ );
606
+ return client.parseWithSchema(
607
+ raw,
608
+ skillVerificationDomainProofChallengeResponseSchema,
609
+ "skill domain proof challenge response"
610
+ );
611
+ }
612
+ async function verifySkillDomainProof(client, payload) {
613
+ const normalizedName = requireTrimmedString(payload.name, "name");
614
+ const challengeToken = requireTrimmedString(
615
+ payload.challengeToken,
616
+ "challengeToken"
617
+ );
618
+ const raw = await client.requestJson(
619
+ "/skills/verification/domain/verify",
620
+ {
621
+ method: "POST",
622
+ body: {
623
+ name: normalizedName,
624
+ version: payload.version,
625
+ domain: payload.domain,
626
+ challengeToken
627
+ },
628
+ headers: { "content-type": "application/json" }
629
+ }
630
+ );
631
+ return client.parseWithSchema(
632
+ raw,
633
+ skillVerificationDomainProofVerifyResponseSchema,
634
+ "skill domain proof verify response"
635
+ );
345
636
  }
346
637
  export {
347
- CryptoParser
638
+ createSkillDomainProofChallenge,
639
+ getMySkillsList,
640
+ getRecommendedSkillVersion,
641
+ getSkillBadge,
642
+ getSkillConversionSignalsByRepo,
643
+ getSkillDeprecations,
644
+ getSkillInstall,
645
+ getSkillOwnership,
646
+ getSkillPreview,
647
+ getSkillPreviewById,
648
+ getSkillPreviewByRepo,
649
+ getSkillPublishJob,
650
+ getSkillSecurityBreakdown,
651
+ getSkillStatus,
652
+ getSkillStatusByRepo,
653
+ getSkillVerificationStatus,
654
+ getSkillVoteStatus,
655
+ getSkillsCatalog,
656
+ listMySkills,
657
+ listSkillCategories,
658
+ listSkillTags,
659
+ listSkillVersions,
660
+ listSkills,
661
+ publishSkill,
662
+ quoteSkillPublish,
663
+ quoteSkillPublishPreview,
664
+ recordSkillInstallCopy,
665
+ requestSkillVerification,
666
+ resolveSkillManifest,
667
+ resolveSkillMarkdown,
668
+ setRecommendedSkillVersion,
669
+ setSkillDeprecation,
670
+ setSkillVote,
671
+ skillsConfig,
672
+ uploadSkillPreviewFromGithubOidc,
673
+ verifySkillDomainProof
348
674
  };
349
675
  //# sourceMappingURL=standards-sdk.es171.js.map