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