@hashgraphonline/standards-sdk 0.1.157 → 0.1.159
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/cjs/hcs-12/validation/schemas.d.ts +2 -2
- package/dist/cjs/hcs-17/types.d.ts +4 -4
- package/dist/cjs/hcs-2/types.d.ts +20 -20
- package/dist/cjs/hcs-20/types.d.ts +8 -8
- package/dist/cjs/hcs-26/base-client.d.ts +83 -0
- package/dist/cjs/hcs-26/base-client.d.ts.map +1 -0
- package/dist/cjs/hcs-26/browser.d.ts +11 -0
- package/dist/cjs/hcs-26/browser.d.ts.map +1 -0
- package/dist/cjs/hcs-26/index.d.ts +7 -0
- package/dist/cjs/hcs-26/index.d.ts.map +1 -0
- package/dist/cjs/hcs-26/memos.d.ts +28 -0
- package/dist/cjs/hcs-26/memos.d.ts.map +1 -0
- package/dist/cjs/hcs-26/resolver.d.ts +60 -0
- package/dist/cjs/hcs-26/resolver.d.ts.map +1 -0
- package/dist/cjs/hcs-26/sdk.d.ts +10 -0
- package/dist/cjs/hcs-26/sdk.d.ts.map +1 -0
- package/dist/cjs/hcs-26/types.d.ts +2752 -0
- package/dist/cjs/hcs-26/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/inscribe/inscriber.d.ts +1 -1
- package/dist/cjs/inscribe/inscriber.d.ts.map +1 -1
- package/dist/cjs/inscribe/inscription-cost.d.ts +12 -0
- package/dist/cjs/inscribe/inscription-cost.d.ts.map +1 -0
- package/dist/cjs/inscribe/types.d.ts +5 -1
- package/dist/cjs/inscribe/types.d.ts.map +1 -1
- package/dist/cjs/services/registry-broker/client/base-client.d.ts +19 -1
- package/dist/cjs/services/registry-broker/client/base-client.d.ts.map +1 -1
- package/dist/cjs/services/registry-broker/client/skills.d.ts +20 -1
- package/dist/cjs/services/registry-broker/client/skills.d.ts.map +1 -1
- package/dist/cjs/services/registry-broker/schemas.d.ts +2515 -86
- package/dist/cjs/services/registry-broker/schemas.d.ts.map +1 -1
- package/dist/cjs/services/registry-broker/types.d.ts +21 -3
- package/dist/cjs/services/registry-broker/types.d.ts.map +1 -1
- package/dist/cjs/services/types.d.ts +2 -1
- package/dist/cjs/services/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/crypto-abstraction.d.ts.map +1 -1
- package/dist/es/hcs-12/validation/schemas.d.ts +2 -2
- package/dist/es/hcs-17/types.d.ts +4 -4
- package/dist/es/hcs-2/types.d.ts +20 -20
- package/dist/es/hcs-20/types.d.ts +8 -8
- package/dist/es/hcs-26/base-client.d.ts +83 -0
- package/dist/es/hcs-26/base-client.d.ts.map +1 -0
- package/dist/es/hcs-26/browser.d.ts +11 -0
- package/dist/es/hcs-26/browser.d.ts.map +1 -0
- package/dist/es/hcs-26/index.d.ts +7 -0
- package/dist/es/hcs-26/index.d.ts.map +1 -0
- package/dist/es/hcs-26/memos.d.ts +28 -0
- package/dist/es/hcs-26/memos.d.ts.map +1 -0
- package/dist/es/hcs-26/resolver.d.ts +60 -0
- package/dist/es/hcs-26/resolver.d.ts.map +1 -0
- package/dist/es/hcs-26/sdk.d.ts +10 -0
- package/dist/es/hcs-26/sdk.d.ts.map +1 -0
- package/dist/es/hcs-26/types.d.ts +2752 -0
- package/dist/es/hcs-26/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/inscribe/inscriber.d.ts +1 -1
- package/dist/es/inscribe/inscriber.d.ts.map +1 -1
- package/dist/es/inscribe/inscription-cost.d.ts +12 -0
- package/dist/es/inscribe/inscription-cost.d.ts.map +1 -0
- package/dist/es/inscribe/types.d.ts +5 -1
- package/dist/es/inscribe/types.d.ts.map +1 -1
- package/dist/es/services/registry-broker/client/base-client.d.ts +19 -1
- package/dist/es/services/registry-broker/client/base-client.d.ts.map +1 -1
- package/dist/es/services/registry-broker/client/skills.d.ts +20 -1
- package/dist/es/services/registry-broker/client/skills.d.ts.map +1 -1
- package/dist/es/services/registry-broker/schemas.d.ts +2515 -86
- package/dist/es/services/registry-broker/schemas.d.ts.map +1 -1
- package/dist/es/services/registry-broker/types.d.ts +21 -3
- package/dist/es/services/registry-broker/types.d.ts.map +1 -1
- package/dist/es/services/types.d.ts +2 -1
- package/dist/es/services/types.d.ts.map +1 -1
- package/dist/es/standards-sdk.es.js +70 -32
- 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 +1 -1
- package/dist/es/standards-sdk.es104.js +2 -2
- package/dist/es/standards-sdk.es105.js +247 -137
- package/dist/es/standards-sdk.es105.js.map +1 -1
- package/dist/es/standards-sdk.es106.js +477 -28
- package/dist/es/standards-sdk.es106.js.map +1 -1
- package/dist/es/standards-sdk.es107.js +103 -20
- package/dist/es/standards-sdk.es107.js.map +1 -1
- package/dist/es/standards-sdk.es108.js +141 -141
- package/dist/es/standards-sdk.es108.js.map +1 -1
- package/dist/es/standards-sdk.es109.js +31 -200
- package/dist/es/standards-sdk.es109.js.map +1 -1
- package/dist/es/standards-sdk.es11.js +1 -1
- package/dist/es/standards-sdk.es110.js +9 -787
- package/dist/es/standards-sdk.es110.js.map +1 -1
- package/dist/es/standards-sdk.es111.js +140 -11
- package/dist/es/standards-sdk.es111.js.map +1 -1
- package/dist/es/standards-sdk.es112.js +29 -567
- package/dist/es/standards-sdk.es112.js.map +1 -1
- package/dist/es/standards-sdk.es113.js +17 -597
- package/dist/es/standards-sdk.es113.js.map +1 -1
- package/dist/es/standards-sdk.es114.js +159 -12
- package/dist/es/standards-sdk.es114.js.map +1 -1
- package/dist/es/standards-sdk.es115.js +203 -2
- package/dist/es/standards-sdk.es115.js.map +1 -1
- package/dist/es/standards-sdk.es116.js +774 -71
- package/dist/es/standards-sdk.es116.js.map +1 -1
- package/dist/es/standards-sdk.es117.js +11 -38
- package/dist/es/standards-sdk.es117.js.map +1 -1
- package/dist/es/standards-sdk.es118.js +567 -2
- package/dist/es/standards-sdk.es118.js.map +1 -1
- package/dist/es/standards-sdk.es119.js +576 -205
- 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 +12 -1139
- package/dist/es/standards-sdk.es120.js.map +1 -1
- package/dist/es/standards-sdk.es121.js +2 -306
- package/dist/es/standards-sdk.es121.js.map +1 -1
- package/dist/es/standards-sdk.es122.js +83 -418
- package/dist/es/standards-sdk.es122.js.map +1 -1
- package/dist/es/standards-sdk.es123.js +36 -351
- package/dist/es/standards-sdk.es123.js.map +1 -1
- package/dist/es/standards-sdk.es124.js +2 -1117
- package/dist/es/standards-sdk.es124.js.map +1 -1
- package/dist/es/standards-sdk.es125.js +215 -188
- package/dist/es/standards-sdk.es125.js.map +1 -1
- package/dist/es/standards-sdk.es126.js +1055 -1482
- package/dist/es/standards-sdk.es126.js.map +1 -1
- package/dist/es/standards-sdk.es127.js +306 -1138
- package/dist/es/standards-sdk.es127.js.map +1 -1
- package/dist/es/standards-sdk.es128.js +419 -14
- package/dist/es/standards-sdk.es128.js.map +1 -1
- package/dist/es/standards-sdk.es129.js +350 -82
- 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 +1107 -72
- package/dist/es/standards-sdk.es130.js.map +1 -1
- package/dist/es/standards-sdk.es131.js +181 -845
- package/dist/es/standards-sdk.es131.js.map +1 -1
- package/dist/es/standards-sdk.es132.js +1558 -51
- package/dist/es/standards-sdk.es132.js.map +1 -1
- package/dist/es/standards-sdk.es133.js +1236 -159
- package/dist/es/standards-sdk.es133.js.map +1 -1
- package/dist/es/standards-sdk.es134.js +17 -7
- package/dist/es/standards-sdk.es134.js.map +1 -1
- package/dist/es/standards-sdk.es135.js +79 -78
- package/dist/es/standards-sdk.es135.js.map +1 -1
- package/dist/es/standards-sdk.es136.js +75 -59
- package/dist/es/standards-sdk.es136.js.map +1 -1
- package/dist/es/standards-sdk.es137.js +893 -30
- package/dist/es/standards-sdk.es137.js.map +1 -1
- package/dist/es/standards-sdk.es138.js +60 -34
- package/dist/es/standards-sdk.es138.js.map +1 -1
- package/dist/es/standards-sdk.es139.js +159 -28
- 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 +7 -138
- package/dist/es/standards-sdk.es140.js.map +1 -1
- package/dist/es/standards-sdk.es141.js +80 -36
- package/dist/es/standards-sdk.es141.js.map +1 -1
- package/dist/es/standards-sdk.es142.js +58 -49
- package/dist/es/standards-sdk.es142.js.map +1 -1
- package/dist/es/standards-sdk.es143.js +30 -84
- package/dist/es/standards-sdk.es143.js.map +1 -1
- package/dist/es/standards-sdk.es144.js +34 -12320
- package/dist/es/standards-sdk.es144.js.map +1 -1
- package/dist/es/standards-sdk.es145.js +28 -17
- package/dist/es/standards-sdk.es145.js.map +1 -1
- package/dist/es/standards-sdk.es146.js +118 -152
- package/dist/es/standards-sdk.es146.js.map +1 -1
- package/dist/es/standards-sdk.es147.js +34 -314
- package/dist/es/standards-sdk.es147.js.map +1 -1
- package/dist/es/standards-sdk.es148.js +12426 -290
- package/dist/es/standards-sdk.es148.js.map +1 -1
- package/dist/es/standards-sdk.es149.js +231 -442
- 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 +142 -301
- package/dist/es/standards-sdk.es150.js.map +1 -1
- package/dist/es/standards-sdk.es151.js +310 -64
- package/dist/es/standards-sdk.es151.js.map +1 -1
- package/dist/es/standards-sdk.es152.js +332 -158
- package/dist/es/standards-sdk.es152.js.map +1 -1
- package/dist/es/standards-sdk.es153.js +441 -210
- package/dist/es/standards-sdk.es153.js.map +1 -1
- package/dist/es/standards-sdk.es154.js +314 -222
- package/dist/es/standards-sdk.es154.js.map +1 -1
- package/dist/es/standards-sdk.es155.js +65 -108
- package/dist/es/standards-sdk.es155.js.map +1 -1
- package/dist/es/standards-sdk.es156.js +14 -123
- package/dist/es/standards-sdk.es156.js.map +1 -1
- package/dist/es/standards-sdk.es157.js +60 -148
- package/dist/es/standards-sdk.es157.js.map +1 -1
- package/dist/es/standards-sdk.es158.js +47 -176
- package/dist/es/standards-sdk.es158.js.map +1 -1
- package/dist/es/standards-sdk.es159.js +65 -120
- 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 +147 -306
- package/dist/es/standards-sdk.es160.js.map +1 -1
- package/dist/es/standards-sdk.es161.js +205 -242
- package/dist/es/standards-sdk.es161.js.map +1 -1
- package/dist/es/standards-sdk.es162.js +233 -110
- package/dist/es/standards-sdk.es162.js.map +1 -1
- package/dist/es/standards-sdk.es163.js +84 -78
- package/dist/es/standards-sdk.es163.js.map +1 -1
- package/dist/es/standards-sdk.es164.js +129 -0
- package/dist/es/standards-sdk.es164.js.map +1 -0
- package/dist/es/standards-sdk.es165.js +164 -0
- package/dist/es/standards-sdk.es165.js.map +1 -0
- package/dist/es/standards-sdk.es166.js +188 -0
- package/dist/es/standards-sdk.es166.js.map +1 -0
- package/dist/es/standards-sdk.es167.js +142 -0
- package/dist/es/standards-sdk.es167.js.map +1 -0
- package/dist/es/standards-sdk.es168.js +334 -0
- package/dist/es/standards-sdk.es168.js.map +1 -0
- package/dist/es/standards-sdk.es169.js +262 -0
- package/dist/es/standards-sdk.es169.js.map +1 -0
- package/dist/es/standards-sdk.es170.js +119 -0
- package/dist/es/standards-sdk.es170.js.map +1 -0
- package/dist/es/standards-sdk.es18.js +12 -12
- 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.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.es58.js +1 -1
- 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 +7 -7
- package/dist/es/standards-sdk.es62.js +1 -1
- package/dist/es/standards-sdk.es64.js +2 -2
- package/dist/es/standards-sdk.es65.js +3 -3
- package/dist/es/standards-sdk.es68.js +2 -2
- package/dist/es/standards-sdk.es69.js +3 -3
- package/dist/es/standards-sdk.es7.js +1 -1
- package/dist/es/standards-sdk.es70.js +2 -2
- package/dist/es/standards-sdk.es71.js +1 -1
- package/dist/es/standards-sdk.es74.js +2 -2
- package/dist/es/standards-sdk.es76.js +2 -2
- package/dist/es/standards-sdk.es77.js +4 -4
- package/dist/es/standards-sdk.es78.js +1 -1
- package/dist/es/standards-sdk.es81.js +1 -1
- package/dist/es/standards-sdk.es82.js +2 -2
- package/dist/es/standards-sdk.es83.js +4 -4
- package/dist/es/standards-sdk.es87.js +3 -3
- package/dist/es/standards-sdk.es89.js +2 -2
- package/dist/es/standards-sdk.es9.js +2 -2
- package/dist/es/standards-sdk.es91.js +1 -1
- package/dist/es/standards-sdk.es92.js +3 -3
- package/dist/es/standards-sdk.es94.js +2 -2
- package/dist/es/standards-sdk.es96.js +2 -2
- package/dist/es/standards-sdk.es97.js +1 -1
- package/dist/es/standards-sdk.es99.js +1 -1
- package/dist/es/utils/crypto-abstraction.d.ts.map +1 -1
- package/package.json +5 -4
|
@@ -1,456 +1,245 @@
|
|
|
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 { skillVerificationStatusResponseSchema, skillRegistryConfigResponseSchema, skillRegistryListResponseSchema, skillRegistryVersionsResponseSchema, skillRegistryMineResponseSchema, skillRegistryMyListResponseSchema, skillRegistryQuoteResponseSchema, skillRegistryPublishResponseSchema, skillRegistryJobStatusResponseSchema, skillRegistryOwnershipResponseSchema, skillRegistryVoteStatusResponseSchema, skillVerificationRequestCreateResponseSchema } from "./standards-sdk.es133.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 {};
|
|
17
|
+
if (params.version) {
|
|
18
|
+
query.set("version", params.version);
|
|
111
19
|
}
|
|
112
|
-
|
|
113
|
-
|
|
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
|
-
}
|
|
20
|
+
if (typeof params.limit === "number" && Number.isFinite(params.limit)) {
|
|
21
|
+
query.set("limit", String(Math.trunc(params.limit)));
|
|
222
22
|
}
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
* Attempts to decode function selector and map to known function names
|
|
226
|
-
*/
|
|
227
|
-
static extractFunctionName(functionParameters) {
|
|
228
|
-
if (functionParameters.length < 8) return "unknown";
|
|
229
|
-
const selector = functionParameters.substring(0, 8);
|
|
230
|
-
const commonSelectors = {
|
|
231
|
-
a9059cbb: "transfer",
|
|
232
|
-
"095ea7b3": "approve",
|
|
233
|
-
"23b872dd": "transferFrom",
|
|
234
|
-
"70a08231": "balanceOf",
|
|
235
|
-
dd62ed3e: "allowance",
|
|
236
|
-
"18160ddd": "totalSupply",
|
|
237
|
-
"06fdde03": "name",
|
|
238
|
-
"95d89b41": "symbol",
|
|
239
|
-
"313ce567": "decimals",
|
|
240
|
-
"42842e0e": "safeTransferFrom",
|
|
241
|
-
b88d4fde: "safeTransferFrom",
|
|
242
|
-
e985e9c5: "isApprovedForAll",
|
|
243
|
-
a22cb465: "setApprovalForAll",
|
|
244
|
-
"6352211e": "ownerOf",
|
|
245
|
-
c87b56dd: "tokenURI",
|
|
246
|
-
"01ffc9a7": "supportsInterface",
|
|
247
|
-
"40c10f19": "mint",
|
|
248
|
-
"42966c68": "burn",
|
|
249
|
-
f2fde38b: "transferOwnership",
|
|
250
|
-
"715018a6": "renounceOwnership",
|
|
251
|
-
"8da5cb5b": "owner"
|
|
252
|
-
};
|
|
253
|
-
return commonSelectors[selector] || selector;
|
|
23
|
+
if (params.cursor) {
|
|
24
|
+
query.set("cursor", params.cursor);
|
|
254
25
|
}
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
*/
|
|
258
|
-
static parseEthereumTransaction(body) {
|
|
259
|
-
if (!body) return void 0;
|
|
260
|
-
const data = {
|
|
261
|
-
contractId: "EVM",
|
|
262
|
-
gas: body.maxGasAllowance ? Long.fromValue(body.maxGasAllowance).toNumber() : 0,
|
|
263
|
-
amount: 0
|
|
264
|
-
};
|
|
265
|
-
if (body.ethereumData && body.ethereumData.length > 0) {
|
|
266
|
-
const ethData = Buffer.from(body.ethereumData).toString("hex");
|
|
267
|
-
data.functionParameters = ethData;
|
|
268
|
-
if (ethData.length >= 8) {
|
|
269
|
-
data.functionName = this.extractFunctionName(ethData);
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
return data;
|
|
26
|
+
if (typeof params.includeFiles === "boolean") {
|
|
27
|
+
query.set("includeFiles", params.includeFiles ? "true" : "false");
|
|
273
28
|
}
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
const hbarAmount = Hbar.fromTinybars(Long.fromValue(body.amount ?? 0));
|
|
277
|
-
const data = {
|
|
278
|
-
contractId: new ContractId(
|
|
279
|
-
body.contractID.shardNum ?? 0,
|
|
280
|
-
body.contractID.realmNum ?? 0,
|
|
281
|
-
body.contractID.contractNum ?? 0
|
|
282
|
-
).toString(),
|
|
283
|
-
gas: Long.fromValue(body.gas ?? 0).toNumber(),
|
|
284
|
-
amount: parseFloat(hbarAmount.toString(HbarUnit.Hbar))
|
|
285
|
-
};
|
|
286
|
-
if (body.functionParameters) {
|
|
287
|
-
data.functionParameters = Buffer.from(body.functionParameters).toString(
|
|
288
|
-
"hex"
|
|
289
|
-
);
|
|
290
|
-
if (data.functionParameters.length >= 8) {
|
|
291
|
-
data.functionName = this.extractFunctionName(data.functionParameters);
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
|
-
return data;
|
|
29
|
+
if (params.accountId) {
|
|
30
|
+
query.set("accountId", params.accountId);
|
|
295
31
|
}
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
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;
|
|
32
|
+
const suffix = query.size > 0 ? `?${query.toString()}` : "";
|
|
33
|
+
const raw = await client.requestJson(`/skills${suffix}`, {
|
|
34
|
+
method: "GET"
|
|
35
|
+
});
|
|
36
|
+
return client.parseWithSchema(
|
|
37
|
+
raw,
|
|
38
|
+
skillRegistryListResponseSchema,
|
|
39
|
+
"skill registry list response"
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
async function listSkillVersions(client, params) {
|
|
43
|
+
const normalizedName = params.name.trim();
|
|
44
|
+
if (!normalizedName) {
|
|
45
|
+
throw new Error("name is required");
|
|
350
46
|
}
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
).toString()}.${body.expirationTime.nanos}`;
|
|
368
|
-
}
|
|
369
|
-
if (body.autoRenewPeriod?.seconds) {
|
|
370
|
-
data.autoRenewPeriod = Long.fromValue(
|
|
371
|
-
body.autoRenewPeriod.seconds
|
|
372
|
-
).toString();
|
|
373
|
-
}
|
|
374
|
-
if (body.memo) {
|
|
375
|
-
const memoUnion = body.memo;
|
|
376
|
-
if (memoUnion && typeof memoUnion === "object" && Object.prototype.hasOwnProperty.call(memoUnion, "value")) {
|
|
377
|
-
const value = memoUnion.value;
|
|
378
|
-
if (value === null || value === void 0) {
|
|
379
|
-
data.memo = void 0;
|
|
380
|
-
} else {
|
|
381
|
-
data.memo = String(value);
|
|
382
|
-
}
|
|
383
|
-
} else if (typeof memoUnion === "string") {
|
|
384
|
-
data.memo = memoUnion;
|
|
385
|
-
} else {
|
|
386
|
-
data.memo = void 0;
|
|
387
|
-
}
|
|
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
|
-
}
|
|
408
|
-
if (body.maxAutomaticTokenAssociations?.value !== void 0) {
|
|
409
|
-
data.maxAutomaticTokenAssociations = body.maxAutomaticTokenAssociations.value;
|
|
410
|
-
}
|
|
411
|
-
if (body.autoRenewAccountId) {
|
|
412
|
-
data.autoRenewAccountId = new AccountId(
|
|
413
|
-
body.autoRenewAccountId.shardNum ?? 0,
|
|
414
|
-
body.autoRenewAccountId.realmNum ?? 0,
|
|
415
|
-
body.autoRenewAccountId.accountNum ?? 0
|
|
416
|
-
).toString();
|
|
417
|
-
}
|
|
418
|
-
return data;
|
|
47
|
+
const query = new URLSearchParams();
|
|
48
|
+
query.set("name", normalizedName);
|
|
49
|
+
const raw = await client.requestJson(
|
|
50
|
+
`/skills/versions?${query.toString()}`,
|
|
51
|
+
{ method: "GET" }
|
|
52
|
+
);
|
|
53
|
+
return client.parseWithSchema(
|
|
54
|
+
raw,
|
|
55
|
+
skillRegistryVersionsResponseSchema,
|
|
56
|
+
"skill registry versions response"
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
async function listMySkills(client, params = {}) {
|
|
60
|
+
const query = new URLSearchParams();
|
|
61
|
+
if (typeof params.limit === "number" && Number.isFinite(params.limit)) {
|
|
62
|
+
query.set("limit", String(Math.trunc(params.limit)));
|
|
419
63
|
}
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
body.transferContractID.contractNum ?? 0
|
|
441
|
-
).toString();
|
|
442
|
-
}
|
|
443
|
-
return data;
|
|
64
|
+
const suffix = query.size > 0 ? `?${query.toString()}` : "";
|
|
65
|
+
const raw = await client.requestJson(`/skills/mine${suffix}`, {
|
|
66
|
+
method: "GET"
|
|
67
|
+
});
|
|
68
|
+
return client.parseWithSchema(
|
|
69
|
+
raw,
|
|
70
|
+
skillRegistryMineResponseSchema,
|
|
71
|
+
"skill registry mine response"
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
async function getMySkillsList(client, params = {}) {
|
|
75
|
+
const query = new URLSearchParams();
|
|
76
|
+
if (typeof params.limit === "number" && Number.isFinite(params.limit)) {
|
|
77
|
+
query.set("limit", String(Math.trunc(params.limit)));
|
|
78
|
+
}
|
|
79
|
+
if (params.cursor) {
|
|
80
|
+
query.set("cursor", params.cursor);
|
|
81
|
+
}
|
|
82
|
+
if (params.accountId) {
|
|
83
|
+
query.set("accountId", params.accountId);
|
|
444
84
|
}
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
85
|
+
const suffix = query.size > 0 ? `?${query.toString()}` : "";
|
|
86
|
+
const raw = await client.requestJson(`/skills/my-list${suffix}`, {
|
|
87
|
+
method: "GET"
|
|
88
|
+
});
|
|
89
|
+
return client.parseWithSchema(
|
|
90
|
+
raw,
|
|
91
|
+
skillRegistryMyListResponseSchema,
|
|
92
|
+
"skill registry my list response"
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
async function quoteSkillPublish(client, payload) {
|
|
96
|
+
const raw = await client.requestJson("/skills/quote", {
|
|
97
|
+
method: "POST",
|
|
98
|
+
body: payload,
|
|
99
|
+
headers: { "content-type": "application/json" }
|
|
100
|
+
});
|
|
101
|
+
return client.parseWithSchema(
|
|
102
|
+
raw,
|
|
103
|
+
skillRegistryQuoteResponseSchema,
|
|
104
|
+
"skill registry quote response"
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
async function publishSkill(client, payload) {
|
|
108
|
+
const raw = await client.requestJson("/skills/publish", {
|
|
109
|
+
method: "POST",
|
|
110
|
+
body: payload,
|
|
111
|
+
headers: { "content-type": "application/json" }
|
|
112
|
+
});
|
|
113
|
+
return client.parseWithSchema(
|
|
114
|
+
raw,
|
|
115
|
+
skillRegistryPublishResponseSchema,
|
|
116
|
+
"skill registry publish response"
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
async function getSkillPublishJob(client, jobId, params = {}) {
|
|
120
|
+
const normalized = jobId.trim();
|
|
121
|
+
if (!normalized) {
|
|
122
|
+
throw new Error("jobId is required");
|
|
123
|
+
}
|
|
124
|
+
const query = new URLSearchParams();
|
|
125
|
+
if (params.accountId) {
|
|
126
|
+
query.set("accountId", params.accountId);
|
|
127
|
+
}
|
|
128
|
+
const suffix = query.size > 0 ? `?${query.toString()}` : "";
|
|
129
|
+
const raw = await client.requestJson(
|
|
130
|
+
`/skills/jobs/${encodeURIComponent(normalized)}${suffix}`,
|
|
131
|
+
{ method: "GET" }
|
|
132
|
+
);
|
|
133
|
+
return client.parseWithSchema(
|
|
134
|
+
raw,
|
|
135
|
+
skillRegistryJobStatusResponseSchema,
|
|
136
|
+
"skill registry job status response"
|
|
137
|
+
);
|
|
138
|
+
}
|
|
139
|
+
async function getSkillOwnership(client, params) {
|
|
140
|
+
const normalizedName = params.name.trim();
|
|
141
|
+
if (!normalizedName) {
|
|
142
|
+
throw new Error("name is required");
|
|
143
|
+
}
|
|
144
|
+
const query = new URLSearchParams();
|
|
145
|
+
query.set("name", normalizedName);
|
|
146
|
+
if (params.accountId) {
|
|
147
|
+
query.set("accountId", params.accountId);
|
|
148
|
+
}
|
|
149
|
+
const raw = await client.requestJson(
|
|
150
|
+
`/skills/ownership?${query.toString()}`,
|
|
151
|
+
{
|
|
152
|
+
method: "GET"
|
|
153
|
+
}
|
|
154
|
+
);
|
|
155
|
+
return client.parseWithSchema(
|
|
156
|
+
raw,
|
|
157
|
+
skillRegistryOwnershipResponseSchema,
|
|
158
|
+
"skill registry ownership response"
|
|
159
|
+
);
|
|
160
|
+
}
|
|
161
|
+
async function getSkillVoteStatus(client, params) {
|
|
162
|
+
const normalizedName = params.name.trim();
|
|
163
|
+
if (!normalizedName) {
|
|
164
|
+
throw new Error("name is required");
|
|
165
|
+
}
|
|
166
|
+
const query = new URLSearchParams();
|
|
167
|
+
query.set("name", normalizedName);
|
|
168
|
+
const raw = await client.requestJson(
|
|
169
|
+
`/skills/vote?${query.toString()}`,
|
|
170
|
+
{ method: "GET" }
|
|
171
|
+
);
|
|
172
|
+
return client.parseWithSchema(
|
|
173
|
+
raw,
|
|
174
|
+
skillRegistryVoteStatusResponseSchema,
|
|
175
|
+
"skill registry vote status response"
|
|
176
|
+
);
|
|
177
|
+
}
|
|
178
|
+
async function setSkillVote(client, payload) {
|
|
179
|
+
const normalizedName = payload.name.trim();
|
|
180
|
+
if (!normalizedName) {
|
|
181
|
+
throw new Error("name is required");
|
|
182
|
+
}
|
|
183
|
+
const raw = await client.requestJson("/skills/vote", {
|
|
184
|
+
method: "POST",
|
|
185
|
+
body: { name: normalizedName, upvoted: payload.upvoted },
|
|
186
|
+
headers: { "content-type": "application/json" }
|
|
187
|
+
});
|
|
188
|
+
return client.parseWithSchema(
|
|
189
|
+
raw,
|
|
190
|
+
skillRegistryVoteStatusResponseSchema,
|
|
191
|
+
"skill registry vote status response"
|
|
192
|
+
);
|
|
193
|
+
}
|
|
194
|
+
async function requestSkillVerification(client, payload) {
|
|
195
|
+
const normalizedName = payload.name.trim();
|
|
196
|
+
if (!normalizedName) {
|
|
197
|
+
throw new Error("name is required");
|
|
198
|
+
}
|
|
199
|
+
const raw = await client.requestJson(
|
|
200
|
+
"/skills/verification/request",
|
|
201
|
+
{
|
|
202
|
+
method: "POST",
|
|
203
|
+
body: { name: normalizedName, tier: payload.tier },
|
|
204
|
+
headers: { "content-type": "application/json" }
|
|
205
|
+
}
|
|
206
|
+
);
|
|
207
|
+
return client.parseWithSchema(
|
|
208
|
+
raw,
|
|
209
|
+
skillVerificationRequestCreateResponseSchema,
|
|
210
|
+
"skill verification request create response"
|
|
211
|
+
);
|
|
212
|
+
}
|
|
213
|
+
async function getSkillVerificationStatus(client, params) {
|
|
214
|
+
const normalizedName = params.name.trim();
|
|
215
|
+
if (!normalizedName) {
|
|
216
|
+
throw new Error("name is required");
|
|
451
217
|
}
|
|
218
|
+
const query = new URLSearchParams();
|
|
219
|
+
query.set("name", normalizedName);
|
|
220
|
+
const raw = await client.requestJson(
|
|
221
|
+
`/skills/verification/status?${query.toString()}`,
|
|
222
|
+
{ method: "GET" }
|
|
223
|
+
);
|
|
224
|
+
return client.parseWithSchema(
|
|
225
|
+
raw,
|
|
226
|
+
skillVerificationStatusResponseSchema,
|
|
227
|
+
"skill verification status response"
|
|
228
|
+
);
|
|
452
229
|
}
|
|
453
230
|
export {
|
|
454
|
-
|
|
231
|
+
getMySkillsList,
|
|
232
|
+
getSkillOwnership,
|
|
233
|
+
getSkillPublishJob,
|
|
234
|
+
getSkillVerificationStatus,
|
|
235
|
+
getSkillVoteStatus,
|
|
236
|
+
listMySkills,
|
|
237
|
+
listSkillVersions,
|
|
238
|
+
listSkills,
|
|
239
|
+
publishSkill,
|
|
240
|
+
quoteSkillPublish,
|
|
241
|
+
requestSkillVerification,
|
|
242
|
+
setSkillVote,
|
|
243
|
+
skillsConfig
|
|
455
244
|
};
|
|
456
245
|
//# sourceMappingURL=standards-sdk.es149.js.map
|