@hashgraphonline/standards-sdk 0.1.175 → 0.1.176
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -0
- package/dist/browser/services/registry-broker/client/base-client.d.ts +9 -5
- package/dist/browser/services/registry-broker/client/base-client.d.ts.map +1 -1
- package/dist/browser/services/registry-broker/client/skills.d.ts +9 -5
- package/dist/browser/services/registry-broker/client/skills.d.ts.map +1 -1
- package/dist/browser/services/registry-broker/schemas.d.ts +2870 -8
- package/dist/browser/services/registry-broker/schemas.d.ts.map +1 -1
- package/dist/browser/services/registry-broker/types.d.ts +36 -1
- package/dist/browser/services/registry-broker/types.d.ts.map +1 -1
- package/dist/browser/standards-sdk.browser.js +155 -1
- package/dist/browser/standards-sdk.browser.js.map +1 -1
- package/dist/browser-root/services/registry-broker/client/base-client.d.ts +9 -5
- package/dist/browser-root/services/registry-broker/client/base-client.d.ts.map +1 -1
- package/dist/browser-root/services/registry-broker/client/skills.d.ts +9 -5
- package/dist/browser-root/services/registry-broker/client/skills.d.ts.map +1 -1
- package/dist/browser-root/services/registry-broker/schemas.d.ts +2870 -8
- package/dist/browser-root/services/registry-broker/schemas.d.ts.map +1 -1
- package/dist/browser-root/services/registry-broker/types.d.ts +36 -1
- package/dist/browser-root/services/registry-broker/types.d.ts.map +1 -1
- package/dist/browser-root/standards-sdk.root-browser.js +308 -1
- package/dist/browser-root/standards-sdk.root-browser.js.map +1 -1
- package/dist/cjs/services/registry-broker/client/base-client.d.ts +9 -5
- package/dist/cjs/services/registry-broker/client/base-client.d.ts.map +1 -1
- package/dist/cjs/services/registry-broker/client/skills.d.ts +9 -5
- package/dist/cjs/services/registry-broker/client/skills.d.ts.map +1 -1
- package/dist/cjs/services/registry-broker/schemas.d.ts +2870 -8
- package/dist/cjs/services/registry-broker/schemas.d.ts.map +1 -1
- package/dist/cjs/services/registry-broker/types.d.ts +36 -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/es/services/registry-broker/client/base-client.d.ts +9 -5
- package/dist/es/services/registry-broker/client/base-client.d.ts.map +1 -1
- package/dist/es/services/registry-broker/client/skills.d.ts +9 -5
- package/dist/es/services/registry-broker/client/skills.d.ts.map +1 -1
- package/dist/es/services/registry-broker/schemas.d.ts +2870 -8
- package/dist/es/services/registry-broker/schemas.d.ts.map +1 -1
- package/dist/es/services/registry-broker/types.d.ts +36 -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 +3 -3
- package/dist/es/standards-sdk.es143.js +1 -1
- package/dist/es/standards-sdk.es145.js +24 -3
- package/dist/es/standards-sdk.es145.js.map +1 -1
- package/dist/es/standards-sdk.es147.js +1 -1
- 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 +1778 -12461
- package/dist/es/standards-sdk.es160.js.map +1 -1
- package/dist/es/standards-sdk.es161.js +12461 -1608
- package/dist/es/standards-sdk.es161.js.map +1 -1
- package/dist/es/standards-sdk.es163.js +51 -167
- package/dist/es/standards-sdk.es163.js.map +1 -1
- package/dist/es/standards-sdk.es164.js +88 -306
- package/dist/es/standards-sdk.es164.js.map +1 -1
- package/dist/es/standards-sdk.es165.js +71 -336
- package/dist/es/standards-sdk.es165.js.map +1 -1
- package/dist/es/standards-sdk.es166.js +186 -439
- package/dist/es/standards-sdk.es166.js.map +1 -1
- package/dist/es/standards-sdk.es167.js +695 -314
- package/dist/es/standards-sdk.es167.js.map +1 -1
- package/dist/es/standards-sdk.es168.js +63 -66
- package/dist/es/standards-sdk.es168.js.map +1 -1
- package/dist/es/standards-sdk.es169.js +158 -90
- package/dist/es/standards-sdk.es169.js.map +1 -1
- package/dist/es/standards-sdk.es170.js +314 -65
- package/dist/es/standards-sdk.es170.js.map +1 -1
- package/dist/es/standards-sdk.es171.js +345 -55
- package/dist/es/standards-sdk.es171.js.map +1 -1
- package/dist/es/standards-sdk.es172.js +443 -71
- package/dist/es/standards-sdk.es172.js.map +1 -1
- package/dist/es/standards-sdk.es173.js +315 -184
- package/dist/es/standards-sdk.es173.js.map +1 -1
- package/dist/es/standards-sdk.es174.js +68 -565
- 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 +1 -1
- package/dist/es/standards-sdk.es178.js +2 -2
- package/dist/es/standards-sdk.es179.js +1 -1
- 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 +2 -2
- package/dist/es/standards-sdk.es182.js +1 -1
- package/dist/es/standards-sdk.es183.js +1 -1
- 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.es62.js +1 -1
- package/dist/es/standards-sdk.es63.js +2 -2
- package/dist/es/standards-sdk.es64.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.es75.js +1 -1
- package/dist/es/standards-sdk.es84.js +1 -1
- package/package.json +2 -1
|
@@ -1,576 +1,79 @@
|
|
|
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
|
-
|
|
1
|
+
import { proto } from "@hashgraph/proto";
|
|
2
|
+
import { ContractId } from "@hashgraph/sdk";
|
|
3
|
+
import { Buffer } from "buffer";
|
|
4
|
+
function parseKey(key) {
|
|
5
|
+
if (!key) {
|
|
6
|
+
return void 0;
|
|
7
|
+
}
|
|
8
|
+
if (key.contractID) {
|
|
9
|
+
return `ContractID: ${new ContractId(
|
|
10
|
+
key.contractID.shardNum ?? 0,
|
|
11
|
+
key.contractID.realmNum ?? 0,
|
|
12
|
+
key.contractID.contractNum ?? 0
|
|
13
|
+
).toString()}`;
|
|
14
|
+
}
|
|
15
|
+
if (key.ed25519) {
|
|
16
|
+
return `ED25519: ${Buffer.from(key.ed25519).toString("hex")}`;
|
|
17
|
+
}
|
|
18
|
+
if (key.ECDSASecp256k1) {
|
|
19
|
+
return `ECDSA_secp256k1: ${Buffer.from(key.ECDSASecp256k1).toString(
|
|
20
|
+
"hex"
|
|
21
|
+
)}`;
|
|
22
|
+
}
|
|
23
|
+
if (key?.keyList?.keys?.length > 0) {
|
|
24
|
+
const keys = key.keyList.keys.map((k) => parseKey(k)).filter(Boolean);
|
|
25
|
+
return `KeyList (${keys.length} keys): [${keys.join(", ")}]`;
|
|
26
|
+
}
|
|
27
|
+
if (key?.thresholdKey?.keys?.keys?.length > 0) {
|
|
28
|
+
const keys = key.thresholdKey.keys.keys.map((k) => parseKey(k)).filter(Boolean);
|
|
29
|
+
return `ThresholdKey (${key.thresholdKey.threshold} of ${keys.length}): [${keys.join(", ")}]`;
|
|
30
|
+
}
|
|
31
|
+
if (key.delegatableContractId) {
|
|
32
|
+
return `DelegatableContractID: ${new ContractId(
|
|
33
|
+
key.delegatableContractId.shardNum ?? 0,
|
|
34
|
+
key.delegatableContractId.realmNum ?? 0,
|
|
35
|
+
key.delegatableContractId.contractNum ?? 0
|
|
36
|
+
).toString()}`;
|
|
37
|
+
}
|
|
38
|
+
if (Object.keys(key).length === 0) {
|
|
39
|
+
return "Empty Key Structure";
|
|
40
|
+
}
|
|
41
|
+
return "Unknown or Unset Key Type";
|
|
42
|
+
}
|
|
43
|
+
function extractTransactionBody(transaction) {
|
|
44
|
+
try {
|
|
45
|
+
const bytes = transaction.toBytes ? transaction.toBytes() : void 0;
|
|
46
|
+
if (!bytes) {
|
|
47
|
+
return null;
|
|
26
48
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
skillStatusResponseSchema,
|
|
31
|
-
"skill status response"
|
|
32
|
-
);
|
|
33
|
-
}
|
|
34
|
-
async function listSkills(client, params = {}) {
|
|
35
|
-
const query = new URLSearchParams();
|
|
36
|
-
if (params.name) {
|
|
37
|
-
query.set("name", params.name);
|
|
38
|
-
}
|
|
39
|
-
if (params.version) {
|
|
40
|
-
query.set("version", params.version);
|
|
41
|
-
}
|
|
42
|
-
if (typeof params.limit === "number" && Number.isFinite(params.limit)) {
|
|
43
|
-
query.set("limit", String(Math.trunc(params.limit)));
|
|
44
|
-
}
|
|
45
|
-
if (params.cursor) {
|
|
46
|
-
query.set("cursor", params.cursor);
|
|
47
|
-
}
|
|
48
|
-
if (typeof params.includeFiles === "boolean") {
|
|
49
|
-
query.set("includeFiles", params.includeFiles ? "true" : "false");
|
|
50
|
-
}
|
|
51
|
-
if (params.accountId) {
|
|
52
|
-
query.set("accountId", params.accountId);
|
|
53
|
-
}
|
|
54
|
-
if (params.q) {
|
|
55
|
-
query.set("q", params.q);
|
|
56
|
-
}
|
|
57
|
-
if (params.tag) {
|
|
58
|
-
query.set("tag", params.tag);
|
|
59
|
-
}
|
|
60
|
-
if (params.category) {
|
|
61
|
-
query.set("category", params.category);
|
|
62
|
-
}
|
|
63
|
-
if (typeof params.featured === "boolean") {
|
|
64
|
-
query.set("featured", params.featured ? "true" : "false");
|
|
65
|
-
}
|
|
66
|
-
if (typeof params.verified === "boolean") {
|
|
67
|
-
query.set("verified", params.verified ? "true" : "false");
|
|
68
|
-
}
|
|
69
|
-
if (params.view) {
|
|
70
|
-
query.set("view", params.view);
|
|
71
|
-
}
|
|
72
|
-
const suffix = query.size > 0 ? `?${query.toString()}` : "";
|
|
73
|
-
const raw = await client.requestJson(`/skills${suffix}`, {
|
|
74
|
-
method: "GET"
|
|
75
|
-
});
|
|
76
|
-
return client.parseWithSchema(
|
|
77
|
-
raw,
|
|
78
|
-
skillRegistryListResponseSchema,
|
|
79
|
-
"skill registry list response"
|
|
80
|
-
);
|
|
81
|
-
}
|
|
82
|
-
async function getSkillSecurityBreakdown(client, params) {
|
|
83
|
-
const normalizedJobId = params.jobId.trim();
|
|
84
|
-
if (!normalizedJobId) {
|
|
85
|
-
throw new Error("jobId is required");
|
|
86
|
-
}
|
|
87
|
-
const raw = await client.requestJson(
|
|
88
|
-
`/skills/${encodeURIComponent(normalizedJobId)}/security-breakdown`,
|
|
89
|
-
{ method: "GET" }
|
|
90
|
-
);
|
|
91
|
-
return client.parseWithSchema(
|
|
92
|
-
raw,
|
|
93
|
-
skillSecurityBreakdownResponseSchema,
|
|
94
|
-
"skill security breakdown response"
|
|
95
|
-
);
|
|
96
|
-
}
|
|
97
|
-
async function getSkillsCatalog(client, params = {}) {
|
|
98
|
-
const query = new URLSearchParams();
|
|
99
|
-
if (params.q) {
|
|
100
|
-
query.set("q", params.q);
|
|
101
|
-
}
|
|
102
|
-
if (params.category) {
|
|
103
|
-
query.set("category", params.category);
|
|
104
|
-
}
|
|
105
|
-
params.tags?.forEach((tag) => {
|
|
106
|
-
if (tag.trim()) {
|
|
107
|
-
query.append("tag", tag.trim());
|
|
49
|
+
const decoded = proto.TransactionList.decode(bytes);
|
|
50
|
+
if (!decoded.transactionList || decoded.transactionList.length === 0) {
|
|
51
|
+
return null;
|
|
108
52
|
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
}
|
|
113
|
-
if (typeof params.verified === "boolean") {
|
|
114
|
-
query.set("verified", params.verified ? "true" : "false");
|
|
115
|
-
}
|
|
116
|
-
if (params.channel) {
|
|
117
|
-
query.set("channel", params.channel);
|
|
118
|
-
}
|
|
119
|
-
if (params.sortBy) {
|
|
120
|
-
query.set("sortBy", params.sortBy);
|
|
121
|
-
}
|
|
122
|
-
if (typeof params.limit === "number" && Number.isFinite(params.limit)) {
|
|
123
|
-
query.set("limit", String(Math.trunc(params.limit)));
|
|
124
|
-
}
|
|
125
|
-
if (params.cursor) {
|
|
126
|
-
query.set("cursor", params.cursor);
|
|
127
|
-
}
|
|
128
|
-
const suffix = query.size > 0 ? `?${query.toString()}` : "";
|
|
129
|
-
const raw = await client.requestJson(`/skills/catalog${suffix}`, {
|
|
130
|
-
method: "GET"
|
|
131
|
-
});
|
|
132
|
-
return client.parseWithSchema(
|
|
133
|
-
raw,
|
|
134
|
-
skillCatalogResponseSchema,
|
|
135
|
-
"skill catalog response"
|
|
136
|
-
);
|
|
137
|
-
}
|
|
138
|
-
async function listSkillVersions(client, params) {
|
|
139
|
-
const normalizedName = params.name.trim();
|
|
140
|
-
if (!normalizedName) {
|
|
141
|
-
throw new Error("name is required");
|
|
142
|
-
}
|
|
143
|
-
const query = new URLSearchParams();
|
|
144
|
-
query.set("name", normalizedName);
|
|
145
|
-
const raw = await client.requestJson(
|
|
146
|
-
`/skills/versions?${query.toString()}`,
|
|
147
|
-
{ method: "GET" }
|
|
148
|
-
);
|
|
149
|
-
return client.parseWithSchema(
|
|
150
|
-
raw,
|
|
151
|
-
skillRegistryVersionsResponseSchema,
|
|
152
|
-
"skill registry versions response"
|
|
153
|
-
);
|
|
154
|
-
}
|
|
155
|
-
async function listMySkills(client, params = {}) {
|
|
156
|
-
const query = new URLSearchParams();
|
|
157
|
-
if (typeof params.limit === "number" && Number.isFinite(params.limit)) {
|
|
158
|
-
query.set("limit", String(Math.trunc(params.limit)));
|
|
159
|
-
}
|
|
160
|
-
const suffix = query.size > 0 ? `?${query.toString()}` : "";
|
|
161
|
-
const raw = await client.requestJson(`/skills/mine${suffix}`, {
|
|
162
|
-
method: "GET"
|
|
163
|
-
});
|
|
164
|
-
return client.parseWithSchema(
|
|
165
|
-
raw,
|
|
166
|
-
skillRegistryMineResponseSchema,
|
|
167
|
-
"skill registry mine response"
|
|
168
|
-
);
|
|
169
|
-
}
|
|
170
|
-
async function getMySkillsList(client, params = {}) {
|
|
171
|
-
const query = new URLSearchParams();
|
|
172
|
-
if (typeof params.limit === "number" && Number.isFinite(params.limit)) {
|
|
173
|
-
query.set("limit", String(Math.trunc(params.limit)));
|
|
174
|
-
}
|
|
175
|
-
if (params.cursor) {
|
|
176
|
-
query.set("cursor", params.cursor);
|
|
177
|
-
}
|
|
178
|
-
if (params.accountId) {
|
|
179
|
-
query.set("accountId", params.accountId);
|
|
180
|
-
}
|
|
181
|
-
const suffix = query.size > 0 ? `?${query.toString()}` : "";
|
|
182
|
-
const raw = await client.requestJson(`/skills/my-list${suffix}`, {
|
|
183
|
-
method: "GET"
|
|
184
|
-
});
|
|
185
|
-
return client.parseWithSchema(
|
|
186
|
-
raw,
|
|
187
|
-
skillRegistryMyListResponseSchema,
|
|
188
|
-
"skill registry my list response"
|
|
189
|
-
);
|
|
190
|
-
}
|
|
191
|
-
async function quoteSkillPublish(client, payload) {
|
|
192
|
-
const raw = await client.requestJson("/skills/quote", {
|
|
193
|
-
method: "POST",
|
|
194
|
-
body: payload,
|
|
195
|
-
headers: { "content-type": "application/json" }
|
|
196
|
-
});
|
|
197
|
-
return client.parseWithSchema(
|
|
198
|
-
raw,
|
|
199
|
-
skillRegistryQuoteResponseSchema,
|
|
200
|
-
"skill registry quote response"
|
|
201
|
-
);
|
|
202
|
-
}
|
|
203
|
-
async function publishSkill(client, payload) {
|
|
204
|
-
const raw = await client.requestJson("/skills/publish", {
|
|
205
|
-
method: "POST",
|
|
206
|
-
body: payload,
|
|
207
|
-
headers: { "content-type": "application/json" }
|
|
208
|
-
});
|
|
209
|
-
return client.parseWithSchema(
|
|
210
|
-
raw,
|
|
211
|
-
skillRegistryPublishResponseSchema,
|
|
212
|
-
"skill registry publish response"
|
|
213
|
-
);
|
|
214
|
-
}
|
|
215
|
-
async function getSkillPublishJob(client, jobId, params = {}) {
|
|
216
|
-
const normalized = jobId.trim();
|
|
217
|
-
if (!normalized) {
|
|
218
|
-
throw new Error("jobId is required");
|
|
219
|
-
}
|
|
220
|
-
const query = new URLSearchParams();
|
|
221
|
-
if (params.accountId) {
|
|
222
|
-
query.set("accountId", params.accountId);
|
|
223
|
-
}
|
|
224
|
-
const suffix = query.size > 0 ? `?${query.toString()}` : "";
|
|
225
|
-
const raw = await client.requestJson(
|
|
226
|
-
`/skills/jobs/${encodeURIComponent(normalized)}${suffix}`,
|
|
227
|
-
{ method: "GET" }
|
|
228
|
-
);
|
|
229
|
-
return client.parseWithSchema(
|
|
230
|
-
raw,
|
|
231
|
-
skillRegistryJobStatusResponseSchema,
|
|
232
|
-
"skill registry job status response"
|
|
233
|
-
);
|
|
234
|
-
}
|
|
235
|
-
async function getSkillOwnership(client, params) {
|
|
236
|
-
const normalizedName = params.name.trim();
|
|
237
|
-
if (!normalizedName) {
|
|
238
|
-
throw new Error("name is required");
|
|
239
|
-
}
|
|
240
|
-
const query = new URLSearchParams();
|
|
241
|
-
query.set("name", normalizedName);
|
|
242
|
-
if (params.accountId) {
|
|
243
|
-
query.set("accountId", params.accountId);
|
|
244
|
-
}
|
|
245
|
-
const raw = await client.requestJson(
|
|
246
|
-
`/skills/ownership?${query.toString()}`,
|
|
247
|
-
{
|
|
248
|
-
method: "GET"
|
|
53
|
+
const tx = decoded.transactionList[0];
|
|
54
|
+
if (tx.bodyBytes && tx.bodyBytes.length > 0) {
|
|
55
|
+
return proto.TransactionBody.decode(tx.bodyBytes);
|
|
249
56
|
}
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
}
|
|
257
|
-
async function getRecommendedSkillVersion(client, params) {
|
|
258
|
-
const normalizedName = params.name.trim();
|
|
259
|
-
if (!normalizedName) {
|
|
260
|
-
throw new Error("name is required");
|
|
261
|
-
}
|
|
262
|
-
const query = new URLSearchParams();
|
|
263
|
-
query.set("name", normalizedName);
|
|
264
|
-
const raw = await client.requestJson(
|
|
265
|
-
`/skills/recommended?${query.toString()}`,
|
|
266
|
-
{ method: "GET" }
|
|
267
|
-
);
|
|
268
|
-
return client.parseWithSchema(
|
|
269
|
-
raw,
|
|
270
|
-
skillRecommendedVersionResponseSchema,
|
|
271
|
-
"skill recommended version response"
|
|
272
|
-
);
|
|
273
|
-
}
|
|
274
|
-
async function setRecommendedSkillVersion(client, payload) {
|
|
275
|
-
const normalizedName = payload.name.trim();
|
|
276
|
-
const normalizedVersion = payload.version.trim();
|
|
277
|
-
if (!normalizedName) {
|
|
278
|
-
throw new Error("name is required");
|
|
279
|
-
}
|
|
280
|
-
if (!normalizedVersion) {
|
|
281
|
-
throw new Error("version is required");
|
|
282
|
-
}
|
|
283
|
-
const raw = await client.requestJson("/skills/recommended", {
|
|
284
|
-
method: "POST",
|
|
285
|
-
body: {
|
|
286
|
-
name: normalizedName,
|
|
287
|
-
version: normalizedVersion
|
|
288
|
-
},
|
|
289
|
-
headers: { "content-type": "application/json" }
|
|
290
|
-
});
|
|
291
|
-
return client.parseWithSchema(
|
|
292
|
-
raw,
|
|
293
|
-
skillRecommendedVersionResponseSchema,
|
|
294
|
-
"skill recommended version response"
|
|
295
|
-
);
|
|
296
|
-
}
|
|
297
|
-
async function getSkillDeprecations(client, params) {
|
|
298
|
-
const normalizedName = params.name.trim();
|
|
299
|
-
if (!normalizedName) {
|
|
300
|
-
throw new Error("name is required");
|
|
301
|
-
}
|
|
302
|
-
const query = new URLSearchParams();
|
|
303
|
-
query.set("name", normalizedName);
|
|
304
|
-
const raw = await client.requestJson(
|
|
305
|
-
`/skills/deprecations?${query.toString()}`,
|
|
306
|
-
{ method: "GET" }
|
|
307
|
-
);
|
|
308
|
-
return client.parseWithSchema(
|
|
309
|
-
raw,
|
|
310
|
-
skillDeprecationsResponseSchema,
|
|
311
|
-
"skill deprecations response"
|
|
312
|
-
);
|
|
313
|
-
}
|
|
314
|
-
async function setSkillDeprecation(client, payload) {
|
|
315
|
-
const normalizedName = payload.name.trim();
|
|
316
|
-
if (!normalizedName) {
|
|
317
|
-
throw new Error("name is required");
|
|
318
|
-
}
|
|
319
|
-
const version = payload.version?.trim();
|
|
320
|
-
const reason = payload.reason.trim();
|
|
321
|
-
if (!reason) {
|
|
322
|
-
throw new Error("reason is required");
|
|
323
|
-
}
|
|
324
|
-
const replacementRef = payload.replacementRef?.trim();
|
|
325
|
-
const raw = await client.requestJson("/skills/deprecate", {
|
|
326
|
-
method: "POST",
|
|
327
|
-
body: {
|
|
328
|
-
name: normalizedName,
|
|
329
|
-
version,
|
|
330
|
-
reason,
|
|
331
|
-
replacementRef
|
|
332
|
-
},
|
|
333
|
-
headers: { "content-type": "application/json" }
|
|
334
|
-
});
|
|
335
|
-
return client.parseWithSchema(
|
|
336
|
-
raw,
|
|
337
|
-
skillDeprecationRecordSchema,
|
|
338
|
-
"skill deprecation response"
|
|
339
|
-
);
|
|
340
|
-
}
|
|
341
|
-
async function getSkillBadge(client, params) {
|
|
342
|
-
const normalizedName = params.name.trim();
|
|
343
|
-
if (!normalizedName) {
|
|
344
|
-
throw new Error("name is required");
|
|
345
|
-
}
|
|
346
|
-
const query = new URLSearchParams();
|
|
347
|
-
query.set("name", normalizedName);
|
|
348
|
-
if (params.metric) {
|
|
349
|
-
query.set("metric", params.metric);
|
|
350
|
-
}
|
|
351
|
-
if (params.label?.trim()) {
|
|
352
|
-
query.set("label", params.label.trim());
|
|
353
|
-
}
|
|
354
|
-
if (params.style) {
|
|
355
|
-
query.set("style", params.style);
|
|
356
|
-
}
|
|
357
|
-
const raw = await client.requestJson(
|
|
358
|
-
`/skills/badge?${query.toString()}`,
|
|
359
|
-
{ method: "GET" }
|
|
360
|
-
);
|
|
361
|
-
return client.parseWithSchema(
|
|
362
|
-
raw,
|
|
363
|
-
skillBadgeResponseSchema,
|
|
364
|
-
"skill badge response"
|
|
365
|
-
);
|
|
366
|
-
}
|
|
367
|
-
async function listSkillTags(client) {
|
|
368
|
-
const raw = await client.requestJson("/skills/tags", {
|
|
369
|
-
method: "GET"
|
|
370
|
-
});
|
|
371
|
-
return client.parseWithSchema(
|
|
372
|
-
raw,
|
|
373
|
-
skillRegistryTagsResponseSchema,
|
|
374
|
-
"skill tags response"
|
|
375
|
-
);
|
|
376
|
-
}
|
|
377
|
-
async function listSkillCategories(client) {
|
|
378
|
-
const raw = await client.requestJson("/skills/categories", {
|
|
379
|
-
method: "GET"
|
|
380
|
-
});
|
|
381
|
-
return client.parseWithSchema(
|
|
382
|
-
raw,
|
|
383
|
-
skillRegistryCategoriesResponseSchema,
|
|
384
|
-
"skill categories response"
|
|
385
|
-
);
|
|
386
|
-
}
|
|
387
|
-
async function resolveSkillMarkdown(client, skillRef) {
|
|
388
|
-
const normalizedSkillRef = skillRef.trim();
|
|
389
|
-
if (!normalizedSkillRef) {
|
|
390
|
-
throw new Error("skillRef is required");
|
|
391
|
-
}
|
|
392
|
-
const response = await client.request(
|
|
393
|
-
`/skills/${encodeURIComponent(normalizedSkillRef)}/SKILL.md`,
|
|
394
|
-
{
|
|
395
|
-
method: "GET",
|
|
396
|
-
headers: {
|
|
397
|
-
accept: "text/markdown, text/plain;q=0.9, */*;q=0.8"
|
|
57
|
+
if (tx.signedTransactionBytes && tx.signedTransactionBytes.length > 0) {
|
|
58
|
+
const signedTx = proto.SignedTransaction.decode(
|
|
59
|
+
tx.signedTransactionBytes
|
|
60
|
+
);
|
|
61
|
+
if (signedTx.bodyBytes) {
|
|
62
|
+
return proto.TransactionBody.decode(signedTx.bodyBytes);
|
|
398
63
|
}
|
|
399
64
|
}
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
async function resolveSkillManifest(client, skillRef) {
|
|
404
|
-
const normalizedSkillRef = skillRef.trim();
|
|
405
|
-
if (!normalizedSkillRef) {
|
|
406
|
-
throw new Error("skillRef is required");
|
|
407
|
-
}
|
|
408
|
-
const raw = await client.requestJson(
|
|
409
|
-
`/skills/${encodeURIComponent(normalizedSkillRef)}/manifest`,
|
|
410
|
-
{
|
|
411
|
-
method: "GET"
|
|
412
|
-
}
|
|
413
|
-
);
|
|
414
|
-
return client.parseWithSchema(
|
|
415
|
-
raw,
|
|
416
|
-
skillResolverManifestResponseSchema,
|
|
417
|
-
"skill resolver manifest response"
|
|
418
|
-
);
|
|
419
|
-
}
|
|
420
|
-
async function getSkillVoteStatus(client, params) {
|
|
421
|
-
const normalizedName = params.name.trim();
|
|
422
|
-
if (!normalizedName) {
|
|
423
|
-
throw new Error("name is required");
|
|
424
|
-
}
|
|
425
|
-
const query = new URLSearchParams();
|
|
426
|
-
query.set("name", normalizedName);
|
|
427
|
-
const raw = await client.requestJson(
|
|
428
|
-
`/skills/vote?${query.toString()}`,
|
|
429
|
-
{ method: "GET" }
|
|
430
|
-
);
|
|
431
|
-
return client.parseWithSchema(
|
|
432
|
-
raw,
|
|
433
|
-
skillRegistryVoteStatusResponseSchema,
|
|
434
|
-
"skill registry vote status response"
|
|
435
|
-
);
|
|
436
|
-
}
|
|
437
|
-
async function setSkillVote(client, payload) {
|
|
438
|
-
const normalizedName = payload.name.trim();
|
|
439
|
-
if (!normalizedName) {
|
|
440
|
-
throw new Error("name is required");
|
|
441
|
-
}
|
|
442
|
-
const raw = await client.requestJson("/skills/vote", {
|
|
443
|
-
method: "POST",
|
|
444
|
-
body: { name: normalizedName, upvoted: payload.upvoted },
|
|
445
|
-
headers: { "content-type": "application/json" }
|
|
446
|
-
});
|
|
447
|
-
return client.parseWithSchema(
|
|
448
|
-
raw,
|
|
449
|
-
skillRegistryVoteStatusResponseSchema,
|
|
450
|
-
"skill registry vote status response"
|
|
451
|
-
);
|
|
452
|
-
}
|
|
453
|
-
async function requestSkillVerification(client, payload) {
|
|
454
|
-
const normalizedName = payload.name.trim();
|
|
455
|
-
if (!normalizedName) {
|
|
456
|
-
throw new Error("name is required");
|
|
457
|
-
}
|
|
458
|
-
const raw = await client.requestJson(
|
|
459
|
-
"/skills/verification/request",
|
|
460
|
-
{
|
|
461
|
-
method: "POST",
|
|
462
|
-
body: {
|
|
463
|
-
name: normalizedName,
|
|
464
|
-
version: payload.version,
|
|
465
|
-
tier: payload.tier
|
|
466
|
-
},
|
|
467
|
-
headers: { "content-type": "application/json" }
|
|
468
|
-
}
|
|
469
|
-
);
|
|
470
|
-
return client.parseWithSchema(
|
|
471
|
-
raw,
|
|
472
|
-
skillVerificationRequestCreateResponseSchema,
|
|
473
|
-
"skill verification request create response"
|
|
474
|
-
);
|
|
475
|
-
}
|
|
476
|
-
async function getSkillVerificationStatus(client, params) {
|
|
477
|
-
const normalizedName = params.name.trim();
|
|
478
|
-
if (!normalizedName) {
|
|
479
|
-
throw new Error("name is required");
|
|
480
|
-
}
|
|
481
|
-
const query = new URLSearchParams();
|
|
482
|
-
query.set("name", normalizedName);
|
|
483
|
-
if (params.version) {
|
|
484
|
-
query.set("version", params.version);
|
|
485
|
-
}
|
|
486
|
-
const raw = await client.requestJson(
|
|
487
|
-
`/skills/verification/status?${query.toString()}`,
|
|
488
|
-
{ method: "GET" }
|
|
489
|
-
);
|
|
490
|
-
return client.parseWithSchema(
|
|
491
|
-
raw,
|
|
492
|
-
skillVerificationStatusResponseSchema,
|
|
493
|
-
"skill verification status response"
|
|
494
|
-
);
|
|
495
|
-
}
|
|
496
|
-
async function createSkillDomainProofChallenge(client, payload) {
|
|
497
|
-
const normalizedName = payload.name.trim();
|
|
498
|
-
if (!normalizedName) {
|
|
499
|
-
throw new Error("name is required");
|
|
65
|
+
return null;
|
|
66
|
+
} catch (error) {
|
|
67
|
+
return null;
|
|
500
68
|
}
|
|
501
|
-
const raw = await client.requestJson(
|
|
502
|
-
"/skills/verification/domain/challenge",
|
|
503
|
-
{
|
|
504
|
-
method: "POST",
|
|
505
|
-
body: {
|
|
506
|
-
name: normalizedName,
|
|
507
|
-
version: payload.version,
|
|
508
|
-
domain: payload.domain
|
|
509
|
-
},
|
|
510
|
-
headers: { "content-type": "application/json" }
|
|
511
|
-
}
|
|
512
|
-
);
|
|
513
|
-
return client.parseWithSchema(
|
|
514
|
-
raw,
|
|
515
|
-
skillVerificationDomainProofChallengeResponseSchema,
|
|
516
|
-
"skill domain proof challenge response"
|
|
517
|
-
);
|
|
518
69
|
}
|
|
519
|
-
|
|
520
|
-
const
|
|
521
|
-
|
|
522
|
-
if (!normalizedName) {
|
|
523
|
-
throw new Error("name is required");
|
|
524
|
-
}
|
|
525
|
-
if (!challengeToken) {
|
|
526
|
-
throw new Error("challengeToken is required");
|
|
527
|
-
}
|
|
528
|
-
const raw = await client.requestJson(
|
|
529
|
-
"/skills/verification/domain/verify",
|
|
530
|
-
{
|
|
531
|
-
method: "POST",
|
|
532
|
-
body: {
|
|
533
|
-
name: normalizedName,
|
|
534
|
-
version: payload.version,
|
|
535
|
-
domain: payload.domain,
|
|
536
|
-
challengeToken
|
|
537
|
-
},
|
|
538
|
-
headers: { "content-type": "application/json" }
|
|
539
|
-
}
|
|
540
|
-
);
|
|
541
|
-
return client.parseWithSchema(
|
|
542
|
-
raw,
|
|
543
|
-
skillVerificationDomainProofVerifyResponseSchema,
|
|
544
|
-
"skill domain proof verify response"
|
|
545
|
-
);
|
|
70
|
+
function hasTransactionType(transaction, transactionField) {
|
|
71
|
+
const txBody = extractTransactionBody(transaction);
|
|
72
|
+
return !!(txBody && txBody[transactionField]);
|
|
546
73
|
}
|
|
547
74
|
export {
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
getSkillBadge,
|
|
552
|
-
getSkillDeprecations,
|
|
553
|
-
getSkillOwnership,
|
|
554
|
-
getSkillPublishJob,
|
|
555
|
-
getSkillSecurityBreakdown,
|
|
556
|
-
getSkillStatus,
|
|
557
|
-
getSkillVerificationStatus,
|
|
558
|
-
getSkillVoteStatus,
|
|
559
|
-
getSkillsCatalog,
|
|
560
|
-
listMySkills,
|
|
561
|
-
listSkillCategories,
|
|
562
|
-
listSkillTags,
|
|
563
|
-
listSkillVersions,
|
|
564
|
-
listSkills,
|
|
565
|
-
publishSkill,
|
|
566
|
-
quoteSkillPublish,
|
|
567
|
-
requestSkillVerification,
|
|
568
|
-
resolveSkillManifest,
|
|
569
|
-
resolveSkillMarkdown,
|
|
570
|
-
setRecommendedSkillVersion,
|
|
571
|
-
setSkillDeprecation,
|
|
572
|
-
setSkillVote,
|
|
573
|
-
skillsConfig,
|
|
574
|
-
verifySkillDomainProof
|
|
75
|
+
extractTransactionBody,
|
|
76
|
+
hasTransactionType,
|
|
77
|
+
parseKey
|
|
575
78
|
};
|
|
576
79
|
//# sourceMappingURL=standards-sdk.es174.js.map
|