@hashgraphonline/standards-sdk 0.1.177 → 0.1.179
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/hcs-11/client.d.ts +30 -30
- package/dist/browser/hcs-21/types.d.ts +23 -23
- package/dist/browser/inscribe/inscriber.d.ts.map +1 -1
- package/dist/browser/services/registry-broker/client/base-client.d.ts +30 -1
- package/dist/browser/services/registry-broker/client/base-client.d.ts.map +1 -1
- package/dist/browser/services/registry-broker/client/credits.d.ts +6 -1
- package/dist/browser/services/registry-broker/client/credits.d.ts.map +1 -1
- package/dist/browser/services/registry-broker/client/guard.d.ts +27 -0
- package/dist/browser/services/registry-broker/client/guard.d.ts.map +1 -0
- package/dist/browser/services/registry-broker/client/skills.d.ts.map +1 -1
- package/dist/browser/services/registry-broker/schemas.d.ts +2079 -260
- package/dist/browser/services/registry-broker/schemas.d.ts.map +1 -1
- package/dist/browser/services/registry-broker/types.d.ts +89 -1
- package/dist/browser/services/registry-broker/types.d.ts.map +1 -1
- package/dist/browser/standards-sdk.browser.js +351 -6
- package/dist/browser/standards-sdk.browser.js.map +1 -1
- package/dist/browser/utils/dynamic-import.d.ts.map +1 -1
- package/dist/browser-root/hcs-11/client.d.ts +30 -30
- package/dist/browser-root/hcs-21/types.d.ts +23 -23
- package/dist/browser-root/inscribe/inscriber.d.ts.map +1 -1
- package/dist/browser-root/services/registry-broker/client/base-client.d.ts +30 -1
- package/dist/browser-root/services/registry-broker/client/base-client.d.ts.map +1 -1
- package/dist/browser-root/services/registry-broker/client/credits.d.ts +6 -1
- package/dist/browser-root/services/registry-broker/client/credits.d.ts.map +1 -1
- package/dist/browser-root/services/registry-broker/client/guard.d.ts +27 -0
- package/dist/browser-root/services/registry-broker/client/guard.d.ts.map +1 -0
- package/dist/browser-root/services/registry-broker/client/skills.d.ts.map +1 -1
- package/dist/browser-root/services/registry-broker/schemas.d.ts +2079 -260
- package/dist/browser-root/services/registry-broker/schemas.d.ts.map +1 -1
- package/dist/browser-root/services/registry-broker/types.d.ts +89 -1
- package/dist/browser-root/services/registry-broker/types.d.ts.map +1 -1
- package/dist/browser-root/standards-sdk.root-browser.js +800 -131
- package/dist/browser-root/standards-sdk.root-browser.js.map +1 -1
- package/dist/browser-root/utils/dynamic-import.d.ts.map +1 -1
- package/dist/cjs/hcs-11/client.d.ts +30 -30
- package/dist/cjs/inscribe/inscriber.d.ts.map +1 -1
- package/dist/cjs/services/registry-broker/client/base-client.d.ts +30 -1
- package/dist/cjs/services/registry-broker/client/base-client.d.ts.map +1 -1
- package/dist/cjs/services/registry-broker/client/credits.d.ts +6 -1
- package/dist/cjs/services/registry-broker/client/credits.d.ts.map +1 -1
- package/dist/cjs/services/registry-broker/client/guard.d.ts +27 -0
- package/dist/cjs/services/registry-broker/client/guard.d.ts.map +1 -0
- package/dist/cjs/services/registry-broker/client/skills.d.ts.map +1 -1
- package/dist/cjs/services/registry-broker/schemas.d.ts +1827 -8
- package/dist/cjs/services/registry-broker/schemas.d.ts.map +1 -1
- package/dist/cjs/services/registry-broker/types.d.ts +89 -1
- package/dist/cjs/services/registry-broker/types.d.ts.map +1 -1
- package/dist/cjs/standards-sdk.cjs +2 -2
- package/dist/cjs/standards-sdk.cjs.map +1 -1
- package/dist/cjs/utils/dynamic-import.d.ts.map +1 -1
- package/dist/es/hcs-11/client.d.ts +30 -30
- package/dist/es/inscribe/inscriber.d.ts.map +1 -1
- package/dist/es/services/registry-broker/client/base-client.d.ts +30 -1
- package/dist/es/services/registry-broker/client/base-client.d.ts.map +1 -1
- package/dist/es/services/registry-broker/client/credits.d.ts +6 -1
- package/dist/es/services/registry-broker/client/credits.d.ts.map +1 -1
- package/dist/es/services/registry-broker/client/guard.d.ts +27 -0
- package/dist/es/services/registry-broker/client/guard.d.ts.map +1 -0
- package/dist/es/services/registry-broker/client/skills.d.ts.map +1 -1
- package/dist/es/services/registry-broker/schemas.d.ts +1827 -8
- package/dist/es/services/registry-broker/schemas.d.ts.map +1 -1
- package/dist/es/services/registry-broker/types.d.ts +89 -1
- package/dist/es/services/registry-broker/types.d.ts.map +1 -1
- package/dist/es/standards-sdk.es116.js +1 -1
- package/dist/es/standards-sdk.es121.js +1 -1
- package/dist/es/standards-sdk.es127.js +1 -1
- package/dist/es/standards-sdk.es128.js +5 -5
- package/dist/es/standards-sdk.es138.js +1 -1
- package/dist/es/standards-sdk.es139.js +1 -1
- package/dist/es/standards-sdk.es140.js +5 -5
- package/dist/es/standards-sdk.es142.js +9 -6
- package/dist/es/standards-sdk.es142.js.map +1 -1
- package/dist/es/standards-sdk.es143.js +1 -1
- package/dist/es/standards-sdk.es145.js +89 -7
- package/dist/es/standards-sdk.es145.js.map +1 -1
- package/dist/es/standards-sdk.es147.js +2 -2
- package/dist/es/standards-sdk.es148.js +1 -1
- package/dist/es/standards-sdk.es16.js +1 -1
- package/dist/es/standards-sdk.es160.js +2147 -12461
- package/dist/es/standards-sdk.es160.js.map +1 -1
- package/dist/es/standards-sdk.es161.js +12461 -1773
- package/dist/es/standards-sdk.es161.js.map +1 -1
- package/dist/es/standards-sdk.es162.js +670 -15
- package/dist/es/standards-sdk.es162.js.map +1 -1
- package/dist/es/standards-sdk.es163.js +97 -158
- package/dist/es/standards-sdk.es163.js.map +1 -1
- package/dist/es/standards-sdk.es164.js +65 -314
- package/dist/es/standards-sdk.es164.js.map +1 -1
- package/dist/es/standards-sdk.es165.js +120 -294
- package/dist/es/standards-sdk.es165.js.map +1 -1
- package/dist/es/standards-sdk.es166.js +191 -322
- package/dist/es/standards-sdk.es166.js.map +1 -1
- package/dist/es/standards-sdk.es167.js +294 -279
- package/dist/es/standards-sdk.es167.js.map +1 -1
- package/dist/es/standards-sdk.es168.js +440 -63
- package/dist/es/standards-sdk.es168.js.map +1 -1
- package/dist/es/standards-sdk.es169.js +315 -742
- package/dist/es/standards-sdk.es169.js.map +1 -1
- package/dist/es/standards-sdk.es170.js +69 -49
- package/dist/es/standards-sdk.es170.js.map +1 -1
- package/dist/es/standards-sdk.es171.js +47 -95
- package/dist/es/standards-sdk.es171.js.map +1 -1
- package/dist/es/standards-sdk.es174.js +15 -71
- package/dist/es/standards-sdk.es174.js.map +1 -1
- package/dist/es/standards-sdk.es175.js +1 -1
- package/dist/es/standards-sdk.es176.js +2 -2
- package/dist/es/standards-sdk.es178.js +2 -2
- package/dist/es/standards-sdk.es179.js +2 -2
- package/dist/es/standards-sdk.es18.js +2 -2
- package/dist/es/standards-sdk.es180.js +1 -1
- package/dist/es/standards-sdk.es181.js +61 -3
- package/dist/es/standards-sdk.es181.js.map +1 -1
- package/dist/es/standards-sdk.es182.js +284 -167
- package/dist/es/standards-sdk.es182.js.map +1 -1
- package/dist/es/standards-sdk.es183.js +156 -206
- package/dist/es/standards-sdk.es183.js.map +1 -1
- package/dist/es/standards-sdk.es184.js +219 -223
- package/dist/es/standards-sdk.es184.js.map +1 -1
- package/dist/es/standards-sdk.es185.js +242 -0
- package/dist/es/standards-sdk.es185.js.map +1 -0
- package/dist/es/standards-sdk.es19.js +2 -2
- package/dist/es/standards-sdk.es27.js +2 -2
- package/dist/es/standards-sdk.es30.js +1 -1
- package/dist/es/standards-sdk.es31.js +1 -1
- package/dist/es/standards-sdk.es35.js +2 -2
- package/dist/es/standards-sdk.es36.js +1 -1
- package/dist/es/standards-sdk.es37.js +1 -1
- package/dist/es/standards-sdk.es56.js +1 -1
- package/dist/es/standards-sdk.es59.js +1 -1
- package/dist/es/standards-sdk.es60.js +1 -1
- package/dist/es/standards-sdk.es65.js +1 -1
- package/dist/es/standards-sdk.es66.js +1 -1
- package/dist/es/standards-sdk.es67.js +1 -1
- package/dist/es/standards-sdk.es69.js +1 -1
- package/dist/es/standards-sdk.es71.js +1 -1
- package/dist/es/standards-sdk.es72.js +1 -1
- package/dist/es/standards-sdk.es75.js +1 -1
- package/dist/es/standards-sdk.es84.js +1 -1
- package/dist/es/utils/dynamic-import.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,761 +1,334 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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());
|
|
1
|
+
import { proto } from "@hashgraph/proto";
|
|
2
|
+
import { Long, FileId, ContractId } from "@hashgraph/sdk";
|
|
3
|
+
import { hasTransactionType } from "./standards-sdk.es170.js";
|
|
4
|
+
class UtilParser {
|
|
5
|
+
/**
|
|
6
|
+
* Parse Utility/System Service transaction using unified dual-branch approach
|
|
7
|
+
* This handles both regular transactions and signed transaction variants
|
|
8
|
+
*/
|
|
9
|
+
static parseUtilTransaction(transaction, originalBytes) {
|
|
10
|
+
try {
|
|
11
|
+
if (originalBytes || transaction.toBytes) {
|
|
12
|
+
try {
|
|
13
|
+
const bytesToParse = originalBytes || transaction.toBytes();
|
|
14
|
+
const decoded = proto.TransactionList.decode(bytesToParse);
|
|
15
|
+
if (decoded.transactionList && decoded.transactionList.length > 0) {
|
|
16
|
+
const tx = decoded.transactionList[0];
|
|
17
|
+
let txBody = null;
|
|
18
|
+
if (tx.bodyBytes && tx.bodyBytes.length > 0) {
|
|
19
|
+
txBody = proto.TransactionBody.decode(tx.bodyBytes);
|
|
20
|
+
} else if (tx.signedTransactionBytes && tx.signedTransactionBytes.length > 0) {
|
|
21
|
+
const signedTx = proto.SignedTransaction.decode(
|
|
22
|
+
tx.signedTransactionBytes
|
|
23
|
+
);
|
|
24
|
+
if (signedTx.bodyBytes) {
|
|
25
|
+
txBody = proto.TransactionBody.decode(signedTx.bodyBytes);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
if (txBody) {
|
|
29
|
+
const protoResult = this.parseFromProtobufTxBody(txBody);
|
|
30
|
+
if (protoResult.type && protoResult.type !== "UNKNOWN") {
|
|
31
|
+
return protoResult;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
} catch (protoError) {
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return this.parseFromTransactionInternals(transaction);
|
|
39
|
+
} catch (error) {
|
|
40
|
+
return {
|
|
41
|
+
type: "UNKNOWN",
|
|
42
|
+
humanReadableType: "Unknown Utility Transaction"
|
|
43
|
+
};
|
|
86
44
|
}
|
|
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
45
|
}
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
}
|
|
169
|
-
|
|
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 quoteSkillPublishPreview(client, payload) {
|
|
182
|
-
const raw = await client.requestJson("/skills/quote-preview", {
|
|
183
|
-
method: "POST",
|
|
184
|
-
body: payload,
|
|
185
|
-
headers: { "content-type": "application/json" }
|
|
186
|
-
});
|
|
187
|
-
return client.parseWithSchema(
|
|
188
|
-
raw,
|
|
189
|
-
skillQuotePreviewResponseSchema,
|
|
190
|
-
"skill quote preview response"
|
|
191
|
-
);
|
|
192
|
-
}
|
|
193
|
-
async function publishSkill(client, payload) {
|
|
194
|
-
const raw = await client.requestJson("/skills/publish", {
|
|
195
|
-
method: "POST",
|
|
196
|
-
body: payload,
|
|
197
|
-
headers: { "content-type": "application/json" }
|
|
198
|
-
});
|
|
199
|
-
return client.parseWithSchema(
|
|
200
|
-
raw,
|
|
201
|
-
skillRegistryPublishResponseSchema,
|
|
202
|
-
"skill registry publish response"
|
|
203
|
-
);
|
|
204
|
-
}
|
|
205
|
-
async function getSkillPublishJob(client, jobId, params = {}) {
|
|
206
|
-
const normalized = jobId.trim();
|
|
207
|
-
if (!normalized) {
|
|
208
|
-
throw new Error("jobId is required");
|
|
209
|
-
}
|
|
210
|
-
const query = new URLSearchParams();
|
|
211
|
-
if (params.accountId) {
|
|
212
|
-
query.set("accountId", params.accountId);
|
|
213
|
-
}
|
|
214
|
-
const suffix = query.size > 0 ? `?${query.toString()}` : "";
|
|
215
|
-
const raw = await client.requestJson(
|
|
216
|
-
`/skills/jobs/${encodeURIComponent(normalized)}${suffix}`,
|
|
217
|
-
{ method: "GET" }
|
|
218
|
-
);
|
|
219
|
-
return client.parseWithSchema(
|
|
220
|
-
raw,
|
|
221
|
-
skillRegistryJobStatusResponseSchema,
|
|
222
|
-
"skill registry job status response"
|
|
223
|
-
);
|
|
224
|
-
}
|
|
225
|
-
async function getSkillOwnership(client, params) {
|
|
226
|
-
const normalizedName = params.name.trim();
|
|
227
|
-
if (!normalizedName) {
|
|
228
|
-
throw new Error("name is required");
|
|
229
|
-
}
|
|
230
|
-
const query = new URLSearchParams();
|
|
231
|
-
query.set("name", normalizedName);
|
|
232
|
-
if (params.accountId) {
|
|
233
|
-
query.set("accountId", params.accountId);
|
|
234
|
-
}
|
|
235
|
-
const raw = await client.requestJson(
|
|
236
|
-
`/skills/ownership?${query.toString()}`,
|
|
237
|
-
{
|
|
238
|
-
method: "GET"
|
|
46
|
+
/**
|
|
47
|
+
* Parse utility transaction from protobuf TransactionBody
|
|
48
|
+
* Handles all utility operations from decoded protobuf data
|
|
49
|
+
*/
|
|
50
|
+
static parseFromProtobufTxBody(txBody) {
|
|
51
|
+
if (txBody.utilPrng) {
|
|
52
|
+
const utilPrng = this.parseUtilPrng(txBody.utilPrng);
|
|
53
|
+
if (utilPrng) {
|
|
54
|
+
return {
|
|
55
|
+
type: "PRNG",
|
|
56
|
+
humanReadableType: "Pseudo Random Number",
|
|
57
|
+
utilPrng
|
|
58
|
+
};
|
|
59
|
+
}
|
|
239
60
|
}
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
const normalizedName = params.name.trim();
|
|
249
|
-
if (!normalizedName) {
|
|
250
|
-
throw new Error("name is required");
|
|
251
|
-
}
|
|
252
|
-
const query = new URLSearchParams();
|
|
253
|
-
query.set("name", normalizedName);
|
|
254
|
-
const raw = await client.requestJson(
|
|
255
|
-
`/skills/recommended?${query.toString()}`,
|
|
256
|
-
{ method: "GET" }
|
|
257
|
-
);
|
|
258
|
-
return client.parseWithSchema(
|
|
259
|
-
raw,
|
|
260
|
-
skillRecommendedVersionResponseSchema,
|
|
261
|
-
"skill recommended version response"
|
|
262
|
-
);
|
|
263
|
-
}
|
|
264
|
-
async function setRecommendedSkillVersion(client, payload) {
|
|
265
|
-
const normalizedName = payload.name.trim();
|
|
266
|
-
const normalizedVersion = payload.version.trim();
|
|
267
|
-
if (!normalizedName) {
|
|
268
|
-
throw new Error("name is required");
|
|
269
|
-
}
|
|
270
|
-
if (!normalizedVersion) {
|
|
271
|
-
throw new Error("version is required");
|
|
272
|
-
}
|
|
273
|
-
const raw = await client.requestJson("/skills/recommended", {
|
|
274
|
-
method: "POST",
|
|
275
|
-
body: {
|
|
276
|
-
name: normalizedName,
|
|
277
|
-
version: normalizedVersion
|
|
278
|
-
},
|
|
279
|
-
headers: { "content-type": "application/json" }
|
|
280
|
-
});
|
|
281
|
-
return client.parseWithSchema(
|
|
282
|
-
raw,
|
|
283
|
-
skillRecommendedVersionResponseSchema,
|
|
284
|
-
"skill recommended version response"
|
|
285
|
-
);
|
|
286
|
-
}
|
|
287
|
-
async function getSkillDeprecations(client, params) {
|
|
288
|
-
const normalizedName = params.name.trim();
|
|
289
|
-
if (!normalizedName) {
|
|
290
|
-
throw new Error("name is required");
|
|
291
|
-
}
|
|
292
|
-
const query = new URLSearchParams();
|
|
293
|
-
query.set("name", normalizedName);
|
|
294
|
-
const raw = await client.requestJson(
|
|
295
|
-
`/skills/deprecations?${query.toString()}`,
|
|
296
|
-
{ method: "GET" }
|
|
297
|
-
);
|
|
298
|
-
return client.parseWithSchema(
|
|
299
|
-
raw,
|
|
300
|
-
skillDeprecationsResponseSchema,
|
|
301
|
-
"skill deprecations response"
|
|
302
|
-
);
|
|
303
|
-
}
|
|
304
|
-
async function setSkillDeprecation(client, payload) {
|
|
305
|
-
const normalizedName = payload.name.trim();
|
|
306
|
-
if (!normalizedName) {
|
|
307
|
-
throw new Error("name is required");
|
|
308
|
-
}
|
|
309
|
-
const version = payload.version?.trim();
|
|
310
|
-
const reason = payload.reason.trim();
|
|
311
|
-
if (!reason) {
|
|
312
|
-
throw new Error("reason is required");
|
|
313
|
-
}
|
|
314
|
-
const replacementRef = payload.replacementRef?.trim();
|
|
315
|
-
const raw = await client.requestJson("/skills/deprecate", {
|
|
316
|
-
method: "POST",
|
|
317
|
-
body: {
|
|
318
|
-
name: normalizedName,
|
|
319
|
-
version,
|
|
320
|
-
reason,
|
|
321
|
-
replacementRef
|
|
322
|
-
},
|
|
323
|
-
headers: { "content-type": "application/json" }
|
|
324
|
-
});
|
|
325
|
-
return client.parseWithSchema(
|
|
326
|
-
raw,
|
|
327
|
-
skillDeprecationRecordSchema,
|
|
328
|
-
"skill deprecation response"
|
|
329
|
-
);
|
|
330
|
-
}
|
|
331
|
-
async function getSkillBadge(client, params) {
|
|
332
|
-
const normalizedName = params.name.trim();
|
|
333
|
-
if (!normalizedName) {
|
|
334
|
-
throw new Error("name is required");
|
|
335
|
-
}
|
|
336
|
-
const query = new URLSearchParams();
|
|
337
|
-
query.set("name", normalizedName);
|
|
338
|
-
if (params.metric) {
|
|
339
|
-
query.set("metric", params.metric);
|
|
340
|
-
}
|
|
341
|
-
if (params.label?.trim()) {
|
|
342
|
-
query.set("label", params.label.trim());
|
|
343
|
-
}
|
|
344
|
-
if (params.style) {
|
|
345
|
-
query.set("style", params.style);
|
|
346
|
-
}
|
|
347
|
-
const raw = await client.requestJson(
|
|
348
|
-
`/skills/badge?${query.toString()}`,
|
|
349
|
-
{ method: "GET" }
|
|
350
|
-
);
|
|
351
|
-
return client.parseWithSchema(
|
|
352
|
-
raw,
|
|
353
|
-
skillBadgeResponseSchema,
|
|
354
|
-
"skill badge response"
|
|
355
|
-
);
|
|
356
|
-
}
|
|
357
|
-
async function getSkillStatus(client, params) {
|
|
358
|
-
const normalizedName = params.name.trim();
|
|
359
|
-
if (!normalizedName) {
|
|
360
|
-
throw new Error("name is required");
|
|
361
|
-
}
|
|
362
|
-
const query = new URLSearchParams();
|
|
363
|
-
query.set("name", normalizedName);
|
|
364
|
-
if (params.version?.trim()) {
|
|
365
|
-
query.set("version", params.version.trim());
|
|
366
|
-
}
|
|
367
|
-
const raw = await client.requestJson(
|
|
368
|
-
`/skills/status?${query.toString()}`,
|
|
369
|
-
{ method: "GET" }
|
|
370
|
-
);
|
|
371
|
-
return client.parseWithSchema(
|
|
372
|
-
raw,
|
|
373
|
-
skillStatusResponseSchema,
|
|
374
|
-
"skill status response"
|
|
375
|
-
);
|
|
376
|
-
}
|
|
377
|
-
async function getSkillStatusByRepo(client, params) {
|
|
378
|
-
const repo = params.repo.trim();
|
|
379
|
-
const skillDir = params.skillDir.trim();
|
|
380
|
-
if (!repo) {
|
|
381
|
-
throw new Error("repo is required");
|
|
382
|
-
}
|
|
383
|
-
if (!skillDir) {
|
|
384
|
-
throw new Error("skillDir is required");
|
|
385
|
-
}
|
|
386
|
-
const query = new URLSearchParams();
|
|
387
|
-
query.set("repo", repo);
|
|
388
|
-
query.set("skillDir", skillDir);
|
|
389
|
-
if (params.ref?.trim()) {
|
|
390
|
-
query.set("ref", params.ref.trim());
|
|
391
|
-
}
|
|
392
|
-
const raw = await client.requestJson(
|
|
393
|
-
`/skills/status/by-repo?${query.toString()}`,
|
|
394
|
-
{ method: "GET" }
|
|
395
|
-
);
|
|
396
|
-
return client.parseWithSchema(
|
|
397
|
-
raw,
|
|
398
|
-
skillStatusResponseSchema,
|
|
399
|
-
"skill status response"
|
|
400
|
-
);
|
|
401
|
-
}
|
|
402
|
-
async function getSkillConversionSignalsByRepo(client, params) {
|
|
403
|
-
const repo = params.repo.trim();
|
|
404
|
-
const skillDir = params.skillDir.trim();
|
|
405
|
-
if (!repo) {
|
|
406
|
-
throw new Error("repo is required");
|
|
407
|
-
}
|
|
408
|
-
if (!skillDir) {
|
|
409
|
-
throw new Error("skillDir is required");
|
|
410
|
-
}
|
|
411
|
-
const query = new URLSearchParams();
|
|
412
|
-
query.set("repo", repo);
|
|
413
|
-
query.set("skillDir", skillDir);
|
|
414
|
-
if (params.ref?.trim()) {
|
|
415
|
-
query.set("ref", params.ref.trim());
|
|
416
|
-
}
|
|
417
|
-
const raw = await client.requestJson(
|
|
418
|
-
`/skills/conversion-signals/by-repo?${query.toString()}`,
|
|
419
|
-
{ method: "GET" }
|
|
420
|
-
);
|
|
421
|
-
return client.parseWithSchema(
|
|
422
|
-
raw,
|
|
423
|
-
skillConversionSignalsResponseSchema,
|
|
424
|
-
"skill conversion signals response"
|
|
425
|
-
);
|
|
426
|
-
}
|
|
427
|
-
async function uploadSkillPreviewFromGithubOidc(client, payload) {
|
|
428
|
-
const token = payload.token.trim();
|
|
429
|
-
if (!token) {
|
|
430
|
-
throw new Error("token is required");
|
|
431
|
-
}
|
|
432
|
-
const raw = await client.requestJson(
|
|
433
|
-
"/skills/preview/github-oidc",
|
|
434
|
-
{
|
|
435
|
-
method: "POST",
|
|
436
|
-
body: payload.report,
|
|
437
|
-
headers: {
|
|
438
|
-
"content-type": "application/json",
|
|
439
|
-
authorization: `Bearer ${token}`
|
|
61
|
+
if (txBody.freeze) {
|
|
62
|
+
const networkFreeze = this.parseNetworkFreezeFromProto(txBody.freeze);
|
|
63
|
+
if (networkFreeze) {
|
|
64
|
+
return {
|
|
65
|
+
type: "FREEZE",
|
|
66
|
+
humanReadableType: "Network Freeze",
|
|
67
|
+
freeze: networkFreeze
|
|
68
|
+
};
|
|
440
69
|
}
|
|
441
70
|
}
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
if (!normalizedName) {
|
|
452
|
-
throw new Error("name is required");
|
|
453
|
-
}
|
|
454
|
-
const query = new URLSearchParams();
|
|
455
|
-
query.set("name", normalizedName);
|
|
456
|
-
if (params.version?.trim()) {
|
|
457
|
-
query.set("version", params.version.trim());
|
|
458
|
-
}
|
|
459
|
-
const raw = await client.requestJson(
|
|
460
|
-
`/skills/preview?${query.toString()}`,
|
|
461
|
-
{ method: "GET" }
|
|
462
|
-
);
|
|
463
|
-
return client.parseWithSchema(
|
|
464
|
-
raw,
|
|
465
|
-
skillPreviewLookupResponseSchema,
|
|
466
|
-
"skill preview response"
|
|
467
|
-
);
|
|
468
|
-
}
|
|
469
|
-
async function getSkillPreviewByRepo(client, params) {
|
|
470
|
-
const repo = params.repo.trim();
|
|
471
|
-
const skillDir = params.skillDir.trim();
|
|
472
|
-
if (!repo) {
|
|
473
|
-
throw new Error("repo is required");
|
|
474
|
-
}
|
|
475
|
-
if (!skillDir) {
|
|
476
|
-
throw new Error("skillDir is required");
|
|
477
|
-
}
|
|
478
|
-
const query = new URLSearchParams();
|
|
479
|
-
query.set("repo", repo);
|
|
480
|
-
query.set("skillDir", skillDir);
|
|
481
|
-
if (params.ref?.trim()) {
|
|
482
|
-
query.set("ref", params.ref.trim());
|
|
483
|
-
}
|
|
484
|
-
const raw = await client.requestJson(
|
|
485
|
-
`/skills/preview/by-repo?${query.toString()}`,
|
|
486
|
-
{ method: "GET" }
|
|
487
|
-
);
|
|
488
|
-
return client.parseWithSchema(
|
|
489
|
-
raw,
|
|
490
|
-
skillPreviewLookupResponseSchema,
|
|
491
|
-
"skill preview by repo response"
|
|
492
|
-
);
|
|
493
|
-
}
|
|
494
|
-
async function getSkillPreviewById(client, previewId) {
|
|
495
|
-
const normalizedPreviewId = previewId.trim();
|
|
496
|
-
if (!normalizedPreviewId) {
|
|
497
|
-
throw new Error("previewId is required");
|
|
498
|
-
}
|
|
499
|
-
const raw = await client.requestJson(
|
|
500
|
-
`/skills/preview/${encodeURIComponent(normalizedPreviewId)}`,
|
|
501
|
-
{ method: "GET" }
|
|
502
|
-
);
|
|
503
|
-
return client.parseWithSchema(
|
|
504
|
-
raw,
|
|
505
|
-
skillPreviewLookupResponseSchema,
|
|
506
|
-
"skill preview by id response"
|
|
507
|
-
);
|
|
508
|
-
}
|
|
509
|
-
async function getSkillInstall(client, skillRef) {
|
|
510
|
-
const normalizedSkillRef = skillRef.trim();
|
|
511
|
-
if (!normalizedSkillRef) {
|
|
512
|
-
throw new Error("skillRef is required");
|
|
513
|
-
}
|
|
514
|
-
const raw = await client.requestJson(
|
|
515
|
-
`/skills/${encodeURIComponent(normalizedSkillRef)}/install`,
|
|
516
|
-
{ method: "GET" }
|
|
517
|
-
);
|
|
518
|
-
return client.parseWithSchema(
|
|
519
|
-
raw,
|
|
520
|
-
skillInstallResponseSchema,
|
|
521
|
-
"skill install response"
|
|
522
|
-
);
|
|
523
|
-
}
|
|
524
|
-
async function recordSkillInstallCopy(client, skillRef, payload = {}) {
|
|
525
|
-
const normalizedSkillRef = skillRef.trim();
|
|
526
|
-
if (!normalizedSkillRef) {
|
|
527
|
-
throw new Error("skillRef is required");
|
|
528
|
-
}
|
|
529
|
-
const raw = await client.requestJson(
|
|
530
|
-
`/skills/${encodeURIComponent(normalizedSkillRef)}/telemetry/install-copy`,
|
|
531
|
-
{
|
|
532
|
-
method: "POST",
|
|
533
|
-
body: payload,
|
|
534
|
-
headers: { "content-type": "application/json" }
|
|
71
|
+
if (txBody.systemDelete) {
|
|
72
|
+
const systemDelete = this.parseSystemDeleteFromProto(txBody.systemDelete);
|
|
73
|
+
if (systemDelete) {
|
|
74
|
+
return {
|
|
75
|
+
type: "SYSTEMDELETE",
|
|
76
|
+
humanReadableType: "System Delete",
|
|
77
|
+
systemDelete
|
|
78
|
+
};
|
|
79
|
+
}
|
|
535
80
|
}
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
});
|
|
547
|
-
return client.parseWithSchema(
|
|
548
|
-
raw,
|
|
549
|
-
skillRegistryTagsResponseSchema,
|
|
550
|
-
"skill tags response"
|
|
551
|
-
);
|
|
552
|
-
}
|
|
553
|
-
async function listSkillCategories(client) {
|
|
554
|
-
const raw = await client.requestJson("/skills/categories", {
|
|
555
|
-
method: "GET"
|
|
556
|
-
});
|
|
557
|
-
return client.parseWithSchema(
|
|
558
|
-
raw,
|
|
559
|
-
skillRegistryCategoriesResponseSchema,
|
|
560
|
-
"skill categories response"
|
|
561
|
-
);
|
|
562
|
-
}
|
|
563
|
-
async function resolveSkillMarkdown(client, skillRef) {
|
|
564
|
-
const normalizedSkillRef = skillRef.trim();
|
|
565
|
-
if (!normalizedSkillRef) {
|
|
566
|
-
throw new Error("skillRef is required");
|
|
567
|
-
}
|
|
568
|
-
const response = await client.request(
|
|
569
|
-
`/skills/${encodeURIComponent(normalizedSkillRef)}/SKILL.md`,
|
|
570
|
-
{
|
|
571
|
-
method: "GET",
|
|
572
|
-
headers: {
|
|
573
|
-
accept: "text/markdown, text/plain;q=0.9, */*;q=0.8"
|
|
81
|
+
if (txBody.systemUndelete) {
|
|
82
|
+
const systemUndelete = this.parseSystemUndeleteFromProto(
|
|
83
|
+
txBody.systemUndelete
|
|
84
|
+
);
|
|
85
|
+
if (systemUndelete) {
|
|
86
|
+
return {
|
|
87
|
+
type: "SYSTEMUNDELETE",
|
|
88
|
+
humanReadableType: "System Undelete",
|
|
89
|
+
systemUndelete
|
|
90
|
+
};
|
|
574
91
|
}
|
|
575
92
|
}
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
`/skills/${encodeURIComponent(normalizedSkillRef)}/manifest`,
|
|
586
|
-
{
|
|
587
|
-
method: "GET"
|
|
93
|
+
if (txBody.nodeCreate) {
|
|
94
|
+
const nodeCreate = this.parseNodeCreateFromProto(txBody.nodeCreate);
|
|
95
|
+
if (nodeCreate) {
|
|
96
|
+
return {
|
|
97
|
+
type: "NODECREATE",
|
|
98
|
+
humanReadableType: "Node Create",
|
|
99
|
+
nodeCreate
|
|
100
|
+
};
|
|
101
|
+
}
|
|
588
102
|
}
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
}
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
103
|
+
if (txBody.nodeUpdate) {
|
|
104
|
+
const nodeUpdate = this.parseNodeUpdateFromProto(txBody.nodeUpdate);
|
|
105
|
+
if (nodeUpdate) {
|
|
106
|
+
return {
|
|
107
|
+
type: "NODEUPDATE",
|
|
108
|
+
humanReadableType: "Node Update",
|
|
109
|
+
nodeUpdate
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
if (txBody.nodeDelete) {
|
|
114
|
+
const nodeDelete = this.parseNodeDeleteFromProto(txBody.nodeDelete);
|
|
115
|
+
if (nodeDelete) {
|
|
116
|
+
return {
|
|
117
|
+
type: "NODEDELETE",
|
|
118
|
+
humanReadableType: "Node Delete",
|
|
119
|
+
nodeDelete
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
return {};
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Extract utility data from Transaction internal fields
|
|
127
|
+
* This handles cases where data is stored in Transaction object internals
|
|
128
|
+
*/
|
|
129
|
+
static parseFromTransactionInternals(transaction) {
|
|
130
|
+
try {
|
|
131
|
+
const tx = transaction;
|
|
132
|
+
if (hasTransactionType(transaction, "utilPrng")) {
|
|
133
|
+
const utilPrng = {};
|
|
134
|
+
if (tx._range && tx._range !== 0) {
|
|
135
|
+
utilPrng.range = tx._range;
|
|
136
|
+
}
|
|
137
|
+
return {
|
|
138
|
+
type: "PRNG",
|
|
139
|
+
humanReadableType: "Pseudo Random Number",
|
|
140
|
+
utilPrng
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
if (hasTransactionType(transaction, "freeze")) {
|
|
144
|
+
const networkFreeze = {};
|
|
145
|
+
if (tx._startTime) {
|
|
146
|
+
networkFreeze.startTime = tx._startTime.toString();
|
|
147
|
+
}
|
|
148
|
+
if (tx._endTime) {
|
|
149
|
+
networkFreeze.endTime = tx._endTime.toString();
|
|
150
|
+
}
|
|
151
|
+
if (tx._updateFile) {
|
|
152
|
+
networkFreeze.updateFile = tx._updateFile.toString();
|
|
153
|
+
}
|
|
154
|
+
if (tx._fileHash) {
|
|
155
|
+
networkFreeze.fileHash = Buffer.from(tx._fileHash).toString("hex");
|
|
156
|
+
}
|
|
157
|
+
if (tx._freezeType) {
|
|
158
|
+
networkFreeze.freezeType = tx._freezeType;
|
|
159
|
+
}
|
|
160
|
+
return {
|
|
161
|
+
type: "FREEZE",
|
|
162
|
+
humanReadableType: "Network Freeze",
|
|
163
|
+
freeze: networkFreeze
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
if (hasTransactionType(transaction, "systemDelete")) {
|
|
167
|
+
const systemDelete = {};
|
|
168
|
+
if (tx._fileId) {
|
|
169
|
+
systemDelete.fileId = tx._fileId.toString();
|
|
170
|
+
} else if (tx._contractId) {
|
|
171
|
+
systemDelete.contractId = tx._contractId.toString();
|
|
172
|
+
}
|
|
173
|
+
if (tx._expirationTime) {
|
|
174
|
+
systemDelete.expirationTime = tx._expirationTime.toString();
|
|
175
|
+
}
|
|
176
|
+
return {
|
|
177
|
+
type: "SYSTEMDELETE",
|
|
178
|
+
humanReadableType: "System Delete",
|
|
179
|
+
systemDelete
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
if (hasTransactionType(transaction, "systemUndelete")) {
|
|
183
|
+
const systemUndelete = {};
|
|
184
|
+
if (tx._fileId) {
|
|
185
|
+
systemUndelete.fileId = tx._fileId.toString();
|
|
186
|
+
} else if (tx._contractId) {
|
|
187
|
+
systemUndelete.contractId = tx._contractId.toString();
|
|
188
|
+
}
|
|
189
|
+
return {
|
|
190
|
+
type: "SYSTEMUNDELETE",
|
|
191
|
+
humanReadableType: "System Undelete",
|
|
192
|
+
systemUndelete
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
return {};
|
|
196
|
+
} catch (error) {
|
|
197
|
+
return {};
|
|
644
198
|
}
|
|
645
|
-
);
|
|
646
|
-
return client.parseWithSchema(
|
|
647
|
-
raw,
|
|
648
|
-
skillVerificationRequestCreateResponseSchema,
|
|
649
|
-
"skill verification request create response"
|
|
650
|
-
);
|
|
651
|
-
}
|
|
652
|
-
async function getSkillVerificationStatus(client, params) {
|
|
653
|
-
const normalizedName = params.name.trim();
|
|
654
|
-
if (!normalizedName) {
|
|
655
|
-
throw new Error("name is required");
|
|
656
|
-
}
|
|
657
|
-
const query = new URLSearchParams();
|
|
658
|
-
query.set("name", normalizedName);
|
|
659
|
-
if (params.version) {
|
|
660
|
-
query.set("version", params.version);
|
|
661
199
|
}
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
)
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
}
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
200
|
+
/**
|
|
201
|
+
* Parse Network Freeze from protobuf data
|
|
202
|
+
*/
|
|
203
|
+
static parseNetworkFreezeFromProto(body) {
|
|
204
|
+
if (!body) return void 0;
|
|
205
|
+
const data = {};
|
|
206
|
+
if (body.startTime?.seconds) {
|
|
207
|
+
data.startTime = `${Long.fromValue(
|
|
208
|
+
body.startTime.seconds
|
|
209
|
+
).toString()}.${body.startTime.nanos ?? 0}`;
|
|
210
|
+
}
|
|
211
|
+
if (body.updateFile) {
|
|
212
|
+
data.updateFile = new FileId(
|
|
213
|
+
body.updateFile.shardNum ?? 0,
|
|
214
|
+
body.updateFile.realmNum ?? 0,
|
|
215
|
+
body.updateFile.fileNum ?? 0
|
|
216
|
+
).toString();
|
|
217
|
+
}
|
|
218
|
+
if (body.fileHash && body.fileHash.length > 0) {
|
|
219
|
+
data.fileHash = Buffer.from(body.fileHash).toString("hex");
|
|
220
|
+
}
|
|
221
|
+
if (body.freezeType !== void 0) {
|
|
222
|
+
const freezeTypes = [
|
|
223
|
+
"FREEZE_ONLY",
|
|
224
|
+
"PREPARE_UPGRADE",
|
|
225
|
+
"FREEZE_UPGRADE",
|
|
226
|
+
"FREEZE_ABORT"
|
|
227
|
+
];
|
|
228
|
+
data.freezeType = freezeTypes[body.freezeType] || "FREEZE_ONLY";
|
|
229
|
+
}
|
|
230
|
+
return data;
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Parse System Delete from protobuf data
|
|
234
|
+
*/
|
|
235
|
+
static parseSystemDeleteFromProto(body) {
|
|
236
|
+
if (!body) return void 0;
|
|
237
|
+
const data = {};
|
|
238
|
+
if (body.fileID) {
|
|
239
|
+
data.fileId = new FileId(
|
|
240
|
+
body.fileID.shardNum ?? 0,
|
|
241
|
+
body.fileID.realmNum ?? 0,
|
|
242
|
+
body.fileID.fileNum ?? 0
|
|
243
|
+
).toString();
|
|
244
|
+
} else if (body.contractID) {
|
|
245
|
+
data.contractId = new ContractId(
|
|
246
|
+
body.contractID.shardNum ?? 0,
|
|
247
|
+
body.contractID.realmNum ?? 0,
|
|
248
|
+
body.contractID.contractNum ?? 0
|
|
249
|
+
).toString();
|
|
250
|
+
}
|
|
251
|
+
if (body.expirationTime?.seconds) {
|
|
252
|
+
data.expirationTime = Long.fromValue(
|
|
253
|
+
body.expirationTime.seconds
|
|
254
|
+
).toString();
|
|
255
|
+
}
|
|
256
|
+
return data;
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* Parse System Undelete from protobuf data
|
|
260
|
+
*/
|
|
261
|
+
static parseSystemUndeleteFromProto(body) {
|
|
262
|
+
if (!body) return void 0;
|
|
263
|
+
const data = {};
|
|
264
|
+
if (body.fileID) {
|
|
265
|
+
data.fileId = new FileId(
|
|
266
|
+
body.fileID.shardNum ?? 0,
|
|
267
|
+
body.fileID.realmNum ?? 0,
|
|
268
|
+
body.fileID.fileNum ?? 0
|
|
269
|
+
).toString();
|
|
270
|
+
} else if (body.contractID) {
|
|
271
|
+
data.contractId = new ContractId(
|
|
272
|
+
body.contractID.shardNum ?? 0,
|
|
273
|
+
body.contractID.realmNum ?? 0,
|
|
274
|
+
body.contractID.contractNum ?? 0
|
|
275
|
+
).toString();
|
|
276
|
+
}
|
|
277
|
+
return data;
|
|
278
|
+
}
|
|
279
|
+
/**
|
|
280
|
+
* Parse Node Create from protobuf data
|
|
281
|
+
*/
|
|
282
|
+
static parseNodeCreateFromProto(body) {
|
|
283
|
+
if (!body) return void 0;
|
|
284
|
+
const data = {};
|
|
285
|
+
if (body.nodeId !== void 0) {
|
|
286
|
+
data.nodeId = Long.fromValue(body.nodeId).toNumber();
|
|
287
|
+
}
|
|
288
|
+
return data;
|
|
289
|
+
}
|
|
290
|
+
/**
|
|
291
|
+
* Parse Node Update from protobuf data
|
|
292
|
+
*/
|
|
293
|
+
static parseNodeUpdateFromProto(body) {
|
|
294
|
+
if (!body) return void 0;
|
|
295
|
+
const data = {};
|
|
296
|
+
if (body.nodeId !== void 0) {
|
|
297
|
+
data.nodeId = Long.fromValue(body.nodeId).toNumber();
|
|
298
|
+
}
|
|
299
|
+
return data;
|
|
300
|
+
}
|
|
301
|
+
/**
|
|
302
|
+
* Parse Node Delete from protobuf data
|
|
303
|
+
*/
|
|
304
|
+
static parseNodeDeleteFromProto(body) {
|
|
305
|
+
if (!body) return void 0;
|
|
306
|
+
const data = {};
|
|
307
|
+
if (body.nodeId !== void 0) {
|
|
308
|
+
data.nodeId = Long.fromValue(body.nodeId).toNumber();
|
|
309
|
+
}
|
|
310
|
+
return data;
|
|
676
311
|
}
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
{
|
|
680
|
-
|
|
681
|
-
body
|
|
682
|
-
name: normalizedName,
|
|
683
|
-
version: payload.version,
|
|
684
|
-
domain: payload.domain
|
|
685
|
-
},
|
|
686
|
-
headers: { "content-type": "application/json" }
|
|
312
|
+
static parseUtilPrng(body) {
|
|
313
|
+
if (!body) return void 0;
|
|
314
|
+
const data = {};
|
|
315
|
+
if (body.range && body.range !== 0) {
|
|
316
|
+
data.range = body.range;
|
|
687
317
|
}
|
|
688
|
-
|
|
689
|
-
return client.parseWithSchema(
|
|
690
|
-
raw,
|
|
691
|
-
skillVerificationDomainProofChallengeResponseSchema,
|
|
692
|
-
"skill domain proof challenge response"
|
|
693
|
-
);
|
|
694
|
-
}
|
|
695
|
-
async function verifySkillDomainProof(client, payload) {
|
|
696
|
-
const normalizedName = payload.name.trim();
|
|
697
|
-
const challengeToken = payload.challengeToken.trim();
|
|
698
|
-
if (!normalizedName) {
|
|
699
|
-
throw new Error("name is required");
|
|
318
|
+
return data;
|
|
700
319
|
}
|
|
701
|
-
|
|
702
|
-
|
|
320
|
+
static parseFreeze(body) {
|
|
321
|
+
return this.parseNetworkFreezeFromProto(body);
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
* Parse Utility/System Service transaction from Transaction object
|
|
325
|
+
* This is the unified entry point that delegates to the comprehensive parsing logic
|
|
326
|
+
*/
|
|
327
|
+
static parseFromTransactionObject(transaction) {
|
|
328
|
+
return this.parseUtilTransaction(transaction);
|
|
703
329
|
}
|
|
704
|
-
const raw = await client.requestJson(
|
|
705
|
-
"/skills/verification/domain/verify",
|
|
706
|
-
{
|
|
707
|
-
method: "POST",
|
|
708
|
-
body: {
|
|
709
|
-
name: normalizedName,
|
|
710
|
-
version: payload.version,
|
|
711
|
-
domain: payload.domain,
|
|
712
|
-
challengeToken
|
|
713
|
-
},
|
|
714
|
-
headers: { "content-type": "application/json" }
|
|
715
|
-
}
|
|
716
|
-
);
|
|
717
|
-
return client.parseWithSchema(
|
|
718
|
-
raw,
|
|
719
|
-
skillVerificationDomainProofVerifyResponseSchema,
|
|
720
|
-
"skill domain proof verify response"
|
|
721
|
-
);
|
|
722
330
|
}
|
|
723
331
|
export {
|
|
724
|
-
|
|
725
|
-
getMySkillsList,
|
|
726
|
-
getRecommendedSkillVersion,
|
|
727
|
-
getSkillBadge,
|
|
728
|
-
getSkillConversionSignalsByRepo,
|
|
729
|
-
getSkillDeprecations,
|
|
730
|
-
getSkillInstall,
|
|
731
|
-
getSkillOwnership,
|
|
732
|
-
getSkillPreview,
|
|
733
|
-
getSkillPreviewById,
|
|
734
|
-
getSkillPreviewByRepo,
|
|
735
|
-
getSkillPublishJob,
|
|
736
|
-
getSkillSecurityBreakdown,
|
|
737
|
-
getSkillStatus,
|
|
738
|
-
getSkillStatusByRepo,
|
|
739
|
-
getSkillVerificationStatus,
|
|
740
|
-
getSkillVoteStatus,
|
|
741
|
-
getSkillsCatalog,
|
|
742
|
-
listMySkills,
|
|
743
|
-
listSkillCategories,
|
|
744
|
-
listSkillTags,
|
|
745
|
-
listSkillVersions,
|
|
746
|
-
listSkills,
|
|
747
|
-
publishSkill,
|
|
748
|
-
quoteSkillPublish,
|
|
749
|
-
quoteSkillPublishPreview,
|
|
750
|
-
recordSkillInstallCopy,
|
|
751
|
-
requestSkillVerification,
|
|
752
|
-
resolveSkillManifest,
|
|
753
|
-
resolveSkillMarkdown,
|
|
754
|
-
setRecommendedSkillVersion,
|
|
755
|
-
setSkillDeprecation,
|
|
756
|
-
setSkillVote,
|
|
757
|
-
skillsConfig,
|
|
758
|
-
uploadSkillPreviewFromGithubOidc,
|
|
759
|
-
verifySkillDomainProof
|
|
332
|
+
UtilParser
|
|
760
333
|
};
|
|
761
334
|
//# sourceMappingURL=standards-sdk.es169.js.map
|