@hashgraphonline/standards-sdk 0.1.141-canary.11 → 0.1.141-canary.13
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-21/base-client.d.ts +3 -3
- package/dist/cjs/hcs-21/base-client.d.ts.map +1 -1
- package/dist/cjs/hcs-21/index.d.ts +1 -0
- package/dist/cjs/hcs-21/index.d.ts.map +1 -1
- package/dist/cjs/hcs-21/tx.d.ts.map +1 -1
- package/dist/cjs/hcs-21/types.d.ts +100 -64
- package/dist/cjs/hcs-21/types.d.ts.map +1 -1
- package/dist/cjs/hcs-21/verify.d.ts +6 -0
- package/dist/cjs/hcs-21/verify.d.ts.map +1 -0
- package/dist/cjs/standards-sdk.cjs +1 -1
- package/dist/cjs/standards-sdk.cjs.map +1 -1
- package/dist/es/hcs-21/base-client.d.ts +3 -3
- package/dist/es/hcs-21/base-client.d.ts.map +1 -1
- package/dist/es/hcs-21/index.d.ts +1 -0
- package/dist/es/hcs-21/index.d.ts.map +1 -1
- package/dist/es/hcs-21/tx.d.ts.map +1 -1
- package/dist/es/hcs-21/types.d.ts +100 -64
- package/dist/es/hcs-21/types.d.ts.map +1 -1
- package/dist/es/hcs-21/verify.d.ts +6 -0
- package/dist/es/hcs-21/verify.d.ts.map +1 -0
- package/dist/es/standards-sdk.es.js +57 -50
- package/dist/es/standards-sdk.es.js.map +1 -1
- package/dist/es/standards-sdk.es10.js +2 -2
- package/dist/es/standards-sdk.es100.js +26 -229
- package/dist/es/standards-sdk.es100.js.map +1 -1
- package/dist/es/standards-sdk.es101.js +228 -109
- package/dist/es/standards-sdk.es101.js.map +1 -1
- package/dist/es/standards-sdk.es102.js +94 -15
- package/dist/es/standards-sdk.es102.js.map +1 -1
- package/dist/es/standards-sdk.es103.js +30 -80
- package/dist/es/standards-sdk.es103.js.map +1 -1
- package/dist/es/standards-sdk.es104.js +80 -27
- package/dist/es/standards-sdk.es104.js.map +1 -1
- package/dist/es/standards-sdk.es105.js +25 -136
- package/dist/es/standards-sdk.es105.js.map +1 -1
- package/dist/es/standards-sdk.es106.js +140 -27
- package/dist/es/standards-sdk.es106.js.map +1 -1
- package/dist/es/standards-sdk.es107.js +27 -20
- package/dist/es/standards-sdk.es107.js.map +1 -1
- package/dist/es/standards-sdk.es108.js +18 -156
- package/dist/es/standards-sdk.es108.js.map +1 -1
- package/dist/es/standards-sdk.es109.js +148 -196
- package/dist/es/standards-sdk.es109.js.map +1 -1
- package/dist/es/standards-sdk.es110.js +165 -747
- package/dist/es/standards-sdk.es110.js.map +1 -1
- package/dist/es/standards-sdk.es111.js +786 -9
- package/dist/es/standards-sdk.es111.js.map +1 -1
- package/dist/es/standards-sdk.es112.js +13 -567
- package/dist/es/standards-sdk.es112.js.map +1 -1
- package/dist/es/standards-sdk.es113.js +541 -576
- package/dist/es/standards-sdk.es113.js.map +1 -1
- package/dist/es/standards-sdk.es114.js +601 -12
- package/dist/es/standards-sdk.es114.js.map +1 -1
- package/dist/es/standards-sdk.es115.js +13 -2
- package/dist/es/standards-sdk.es115.js.map +1 -1
- package/dist/es/standards-sdk.es116.js +2 -83
- package/dist/es/standards-sdk.es116.js.map +1 -1
- package/dist/es/standards-sdk.es117.js +80 -36
- package/dist/es/standards-sdk.es117.js.map +1 -1
- package/dist/es/standards-sdk.es118.js +39 -2
- package/dist/es/standards-sdk.es118.js.map +1 -1
- package/dist/es/standards-sdk.es119.js +2 -223
- 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 +193 -1110
- package/dist/es/standards-sdk.es120.js.map +1 -1
- package/dist/es/standards-sdk.es121.js +1059 -225
- package/dist/es/standards-sdk.es121.js.map +1 -1
- package/dist/es/standards-sdk.es122.js +303 -419
- package/dist/es/standards-sdk.es122.js.map +1 -1
- package/dist/es/standards-sdk.es123.js +418 -351
- package/dist/es/standards-sdk.es123.js.map +1 -1
- package/dist/es/standards-sdk.es124.js +348 -818
- package/dist/es/standards-sdk.es124.js.map +1 -1
- package/dist/es/standards-sdk.es125.js +804 -187
- package/dist/es/standards-sdk.es125.js.map +1 -1
- package/dist/es/standards-sdk.es126.js +153 -1512
- package/dist/es/standards-sdk.es126.js.map +1 -1
- package/dist/es/standards-sdk.es127.js +1373 -1987
- package/dist/es/standards-sdk.es127.js.map +1 -1
- package/dist/es/standards-sdk.es128.js +2174 -65
- package/dist/es/standards-sdk.es128.js.map +1 -1
- package/dist/es/standards-sdk.es129.js +64 -79
- 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 +80 -152
- package/dist/es/standards-sdk.es130.js.map +1 -1
- package/dist/es/standards-sdk.es131.js +159 -7
- package/dist/es/standards-sdk.es131.js.map +1 -1
- package/dist/es/standards-sdk.es132.js +7 -86
- package/dist/es/standards-sdk.es132.js.map +1 -1
- package/dist/es/standards-sdk.es133.js +65 -44
- package/dist/es/standards-sdk.es133.js.map +1 -1
- package/dist/es/standards-sdk.es134.js +65 -28
- package/dist/es/standards-sdk.es134.js.map +1 -1
- package/dist/es/standards-sdk.es135.js +28 -766
- package/dist/es/standards-sdk.es135.js.map +1 -1
- package/dist/es/standards-sdk.es137.js +766 -138
- package/dist/es/standards-sdk.es137.js.map +1 -1
- package/dist/es/standards-sdk.es138.js +133 -37
- package/dist/es/standards-sdk.es138.js.map +1 -1
- package/dist/es/standards-sdk.es139.js +40 -15
- package/dist/es/standards-sdk.es139.js.map +1 -1
- package/dist/es/standards-sdk.es14.js +1 -1
- package/dist/es/standards-sdk.es141.js +1 -1
- package/dist/es/standards-sdk.es148.js +20 -0
- package/dist/es/standards-sdk.es148.js.map +1 -0
- package/dist/es/standards-sdk.es15.js +1 -1
- package/dist/es/standards-sdk.es16.js +1 -1
- package/dist/es/standards-sdk.es17.js +5 -5
- package/dist/es/standards-sdk.es19.js +11 -11
- package/dist/es/standards-sdk.es20.js +8 -8
- 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 +1 -1
- package/dist/es/standards-sdk.es28.js +11 -11
- package/dist/es/standards-sdk.es3.js +2 -2
- package/dist/es/standards-sdk.es31.js +1 -1
- package/dist/es/standards-sdk.es32.js +3 -3
- package/dist/es/standards-sdk.es33.js +1 -1
- package/dist/es/standards-sdk.es36.js +5 -5
- package/dist/es/standards-sdk.es37.js +3 -3
- package/dist/es/standards-sdk.es38.js +1 -1
- package/dist/es/standards-sdk.es39.js +2 -2
- package/dist/es/standards-sdk.es40.js +1 -1
- package/dist/es/standards-sdk.es41.js +1 -1
- package/dist/es/standards-sdk.es42.js +2 -2
- package/dist/es/standards-sdk.es47.js +1 -1
- package/dist/es/standards-sdk.es5.js +2 -2
- package/dist/es/standards-sdk.es52.js +1 -1
- package/dist/es/standards-sdk.es54.js +1 -1
- package/dist/es/standards-sdk.es57.js +1 -1
- package/dist/es/standards-sdk.es6.js +2 -2
- package/dist/es/standards-sdk.es61.js +7 -7
- package/dist/es/standards-sdk.es65.js +2 -2
- package/dist/es/standards-sdk.es66.js +3 -3
- package/dist/es/standards-sdk.es69.js +2 -2
- package/dist/es/standards-sdk.es7.js +2 -2
- package/dist/es/standards-sdk.es70.js +3 -3
- package/dist/es/standards-sdk.es71.js +2 -2
- package/dist/es/standards-sdk.es72.js +1 -1
- package/dist/es/standards-sdk.es75.js +2 -2
- package/dist/es/standards-sdk.es77.js +2 -2
- package/dist/es/standards-sdk.es78.js +4 -4
- package/dist/es/standards-sdk.es79.js +1 -1
- package/dist/es/standards-sdk.es8.js +1 -1
- package/dist/es/standards-sdk.es80.js +21 -14
- package/dist/es/standards-sdk.es80.js.map +1 -1
- package/dist/es/standards-sdk.es82.js +12 -4
- package/dist/es/standards-sdk.es82.js.map +1 -1
- package/dist/es/standards-sdk.es83.js +6 -6
- package/dist/es/standards-sdk.es83.js.map +1 -1
- package/dist/es/standards-sdk.es84.js +4 -4
- package/dist/es/standards-sdk.es86.js +55 -21
- package/dist/es/standards-sdk.es86.js.map +1 -1
- package/dist/es/standards-sdk.es87.js +22 -75
- package/dist/es/standards-sdk.es87.js.map +1 -1
- package/dist/es/standards-sdk.es88.js +45 -30
- package/dist/es/standards-sdk.es88.js.map +1 -1
- package/dist/es/standards-sdk.es89.js +57 -22
- package/dist/es/standards-sdk.es89.js.map +1 -1
- package/dist/es/standards-sdk.es90.js +28 -23
- package/dist/es/standards-sdk.es90.js.map +1 -1
- package/dist/es/standards-sdk.es91.js +23 -167
- package/dist/es/standards-sdk.es91.js.map +1 -1
- package/dist/es/standards-sdk.es92.js +158 -119
- package/dist/es/standards-sdk.es92.js.map +1 -1
- package/dist/es/standards-sdk.es93.js +68 -95
- package/dist/es/standards-sdk.es93.js.map +1 -1
- package/dist/es/standards-sdk.es94.js +136 -119
- package/dist/es/standards-sdk.es94.js.map +1 -1
- package/dist/es/standards-sdk.es95.js +134 -39
- package/dist/es/standards-sdk.es95.js.map +1 -1
- package/dist/es/standards-sdk.es96.js +40 -258
- package/dist/es/standards-sdk.es96.js.map +1 -1
- package/dist/es/standards-sdk.es97.js +243 -80
- package/dist/es/standards-sdk.es97.js.map +1 -1
- package/dist/es/standards-sdk.es98.js +47 -48
- package/dist/es/standards-sdk.es98.js.map +1 -1
- package/dist/es/standards-sdk.es99.js +100 -28
- package/dist/es/standards-sdk.es99.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,425 +1,309 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
},
|
|
44
|
-
TOKENFREEZE: {
|
|
45
|
-
bodyField: "tokenFreeze",
|
|
46
|
-
parser: HTSParser.parseTokenFreeze,
|
|
47
|
-
resultField: "tokenFreeze"
|
|
48
|
-
},
|
|
49
|
-
TOKENUNFREEZE: {
|
|
50
|
-
bodyField: "tokenUnfreeze",
|
|
51
|
-
parser: HTSParser.parseTokenUnfreeze,
|
|
52
|
-
resultField: "tokenUnfreeze"
|
|
53
|
-
},
|
|
54
|
-
TOKENGRANTKYC: {
|
|
55
|
-
bodyField: "tokenGrantKyc",
|
|
56
|
-
parser: HTSParser.parseTokenGrantKyc,
|
|
57
|
-
resultField: "tokenGrantKyc"
|
|
58
|
-
},
|
|
59
|
-
TOKENREVOKEKYC: {
|
|
60
|
-
bodyField: "tokenRevokeKyc",
|
|
61
|
-
parser: HTSParser.parseTokenRevokeKyc,
|
|
62
|
-
resultField: "tokenRevokeKyc"
|
|
63
|
-
},
|
|
64
|
-
TOKENPAUSE: {
|
|
65
|
-
bodyField: "tokenPause",
|
|
66
|
-
parser: HTSParser.parseTokenPause,
|
|
67
|
-
resultField: "tokenPause"
|
|
68
|
-
},
|
|
69
|
-
TOKENUNPAUSE: {
|
|
70
|
-
bodyField: "tokenUnpause",
|
|
71
|
-
parser: HTSParser.parseTokenUnpause,
|
|
72
|
-
resultField: "tokenUnpause"
|
|
73
|
-
},
|
|
74
|
-
TOKENWIPEACCOUNT: {
|
|
75
|
-
bodyField: "tokenWipe",
|
|
76
|
-
parser: HTSParser.parseTokenWipeAccount,
|
|
77
|
-
resultField: "tokenWipeAccount"
|
|
78
|
-
},
|
|
79
|
-
TOKENFEESCHEDULEUPDATE: {
|
|
80
|
-
bodyField: "tokenFeeScheduleUpdate",
|
|
81
|
-
parser: HTSParser.parseTokenFeeScheduleUpdate,
|
|
82
|
-
resultField: "tokenFeeScheduleUpdate"
|
|
83
|
-
},
|
|
84
|
-
TOKENAIRDROP: {
|
|
85
|
-
bodyField: "tokenAirdrop",
|
|
86
|
-
parser: HTSParser.parseTokenAirdropFromProto,
|
|
87
|
-
resultField: "tokenAirdrop"
|
|
88
|
-
},
|
|
89
|
-
TOPICCREATE: {
|
|
90
|
-
bodyField: "consensusCreateTopic",
|
|
91
|
-
parser: HCSParser.parseConsensusCreateTopic,
|
|
92
|
-
resultField: "consensusCreateTopic"
|
|
93
|
-
},
|
|
94
|
-
CONSENSUSSUBMITMESSAGE: {
|
|
95
|
-
bodyField: "consensusSubmitMessage",
|
|
96
|
-
parser: HCSParser.parseConsensusSubmitMessage,
|
|
97
|
-
resultField: "consensusSubmitMessage"
|
|
98
|
-
},
|
|
99
|
-
TOPICUPDATE: {
|
|
100
|
-
bodyField: "consensusUpdateTopic",
|
|
101
|
-
parser: HCSParser.parseConsensusUpdateTopic,
|
|
102
|
-
resultField: "consensusUpdateTopic"
|
|
103
|
-
},
|
|
104
|
-
TOPICDELETE: {
|
|
105
|
-
bodyField: "consensusDeleteTopic",
|
|
106
|
-
parser: HCSParser.parseConsensusDeleteTopic,
|
|
107
|
-
resultField: "consensusDeleteTopic"
|
|
108
|
-
},
|
|
109
|
-
ACCOUNTCREATE: {
|
|
110
|
-
bodyField: "cryptoCreateAccount",
|
|
111
|
-
parser: CryptoParser.parseCryptoCreateAccount,
|
|
112
|
-
resultField: "cryptoCreateAccount"
|
|
113
|
-
},
|
|
114
|
-
ACCOUNTUPDATE: {
|
|
115
|
-
bodyField: "cryptoUpdateAccount",
|
|
116
|
-
parser: CryptoParser.parseCryptoUpdateAccount,
|
|
117
|
-
resultField: "cryptoUpdateAccount"
|
|
118
|
-
},
|
|
119
|
-
ACCOUNTDELETE: {
|
|
120
|
-
bodyField: "cryptoDelete",
|
|
121
|
-
parser: CryptoParser.parseCryptoDelete,
|
|
122
|
-
resultField: "cryptoDelete"
|
|
123
|
-
},
|
|
124
|
-
CRYPTOTRANSFER: {
|
|
125
|
-
bodyField: "cryptoTransfer",
|
|
126
|
-
parser: (body) => {
|
|
127
|
-
const result = {
|
|
128
|
-
transfers: [],
|
|
129
|
-
tokenTransfers: []
|
|
1
|
+
import { proto } from "@hashgraph/proto";
|
|
2
|
+
import { hasTransactionType, parseKey } from "./standards-sdk.es147.js";
|
|
3
|
+
import { AccountId, Long, ScheduleId } from "@hashgraph/sdk";
|
|
4
|
+
class ScheduleParser {
|
|
5
|
+
/**
|
|
6
|
+
* Parse Schedule Service transaction using unified dual-branch approach
|
|
7
|
+
* This handles both regular transactions and signed transaction variants
|
|
8
|
+
*/
|
|
9
|
+
static parseScheduleTransaction(transaction, originalBytes) {
|
|
10
|
+
try {
|
|
11
|
+
if (originalBytes || transaction.toBytes) {
|
|
12
|
+
try {
|
|
13
|
+
const bytesToParse = originalBytes || transaction.toBytes();
|
|
14
|
+
const decoded = proto.TransactionList.decode(bytesToParse);
|
|
15
|
+
if (decoded.transactionList && decoded.transactionList.length > 0) {
|
|
16
|
+
const tx = decoded.transactionList[0];
|
|
17
|
+
let txBody = null;
|
|
18
|
+
if (tx.bodyBytes && tx.bodyBytes.length > 0) {
|
|
19
|
+
txBody = proto.TransactionBody.decode(tx.bodyBytes);
|
|
20
|
+
} else if (tx.signedTransactionBytes && tx.signedTransactionBytes.length > 0) {
|
|
21
|
+
const signedTx = proto.SignedTransaction.decode(
|
|
22
|
+
tx.signedTransactionBytes
|
|
23
|
+
);
|
|
24
|
+
if (signedTx.bodyBytes) {
|
|
25
|
+
txBody = proto.TransactionBody.decode(signedTx.bodyBytes);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
if (txBody) {
|
|
29
|
+
const protoResult = this.parseFromProtobufTxBody(txBody);
|
|
30
|
+
if (protoResult.type && protoResult.type !== "UNKNOWN") {
|
|
31
|
+
return protoResult;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
} catch (protoError) {
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return this.parseFromTransactionInternals(transaction);
|
|
39
|
+
} catch (error) {
|
|
40
|
+
return {
|
|
41
|
+
type: "UNKNOWN",
|
|
42
|
+
humanReadableType: "Unknown Schedule Transaction"
|
|
130
43
|
};
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
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
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
resultField: "hintsKeyPublication"
|
|
392
|
-
},
|
|
393
|
-
HINTSPARTIALSIGNATURE: {
|
|
394
|
-
bodyField: "hintsPartialSignature",
|
|
395
|
-
parser: (body) => ({
|
|
396
|
-
signature: body.signature,
|
|
397
|
-
round: body.round?.toString()
|
|
398
|
-
}),
|
|
399
|
-
resultField: "hintsPartialSignature"
|
|
400
|
-
},
|
|
401
|
-
CRSPUBLICATION: {
|
|
402
|
-
bodyField: "crsPublication",
|
|
403
|
-
parser: (body) => ({
|
|
404
|
-
crs: body.crs,
|
|
405
|
-
round: body.round?.toString()
|
|
406
|
-
}),
|
|
407
|
-
resultField: "crsPublication"
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Parse schedule transaction from protobuf TransactionBody
|
|
48
|
+
* Handles all schedule operations from decoded protobuf data
|
|
49
|
+
*/
|
|
50
|
+
static parseFromProtobufTxBody(txBody) {
|
|
51
|
+
if (txBody.scheduleCreate) {
|
|
52
|
+
const scheduleCreate = this.parseScheduleCreateFromProto(
|
|
53
|
+
txBody.scheduleCreate
|
|
54
|
+
);
|
|
55
|
+
if (scheduleCreate) {
|
|
56
|
+
return {
|
|
57
|
+
type: "SCHEDULECREATE",
|
|
58
|
+
humanReadableType: "Schedule Create",
|
|
59
|
+
scheduleCreate
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
if (txBody.scheduleSign) {
|
|
64
|
+
const scheduleSign = this.parseScheduleSignFromProto(txBody.scheduleSign);
|
|
65
|
+
if (scheduleSign) {
|
|
66
|
+
return {
|
|
67
|
+
type: "SCHEDULESIGN",
|
|
68
|
+
humanReadableType: "Schedule Sign",
|
|
69
|
+
scheduleSign
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
if (txBody.scheduleDelete) {
|
|
74
|
+
const scheduleDelete = this.parseScheduleDeleteFromProto(
|
|
75
|
+
txBody.scheduleDelete
|
|
76
|
+
);
|
|
77
|
+
if (scheduleDelete) {
|
|
78
|
+
return {
|
|
79
|
+
type: "SCHEDULEDELETE",
|
|
80
|
+
humanReadableType: "Schedule Delete",
|
|
81
|
+
scheduleDelete
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return {};
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Extract schedule data from Transaction internal fields
|
|
89
|
+
* This handles cases where data is stored in Transaction object internals
|
|
90
|
+
*/
|
|
91
|
+
static parseFromTransactionInternals(transaction) {
|
|
92
|
+
try {
|
|
93
|
+
const tx = transaction;
|
|
94
|
+
if (hasTransactionType(transaction, "scheduleCreate")) {
|
|
95
|
+
const scheduleCreate = {
|
|
96
|
+
scheduledTransactionBody: Buffer.from(
|
|
97
|
+
tx._scheduledTransaction
|
|
98
|
+
).toString("base64"),
|
|
99
|
+
memo: tx._scheduleMemo,
|
|
100
|
+
adminKey: tx._adminKey ? parseKey(tx._adminKey) : void 0,
|
|
101
|
+
payerAccountId: tx._payerAccountId?.toString(),
|
|
102
|
+
expirationTime: tx._expirationTime?.toString(),
|
|
103
|
+
waitForExpiry: tx._waitForExpiry || false
|
|
104
|
+
};
|
|
105
|
+
return {
|
|
106
|
+
type: "SCHEDULECREATE",
|
|
107
|
+
humanReadableType: "Schedule Create",
|
|
108
|
+
scheduleCreate
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
if (hasTransactionType(transaction, "scheduleSign")) {
|
|
112
|
+
const scheduleSign = {
|
|
113
|
+
scheduleId: tx._scheduleId.toString()
|
|
114
|
+
};
|
|
115
|
+
return {
|
|
116
|
+
type: "SCHEDULESIGN",
|
|
117
|
+
humanReadableType: "Schedule Sign",
|
|
118
|
+
scheduleSign
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
if (hasTransactionType(transaction, "scheduleDelete")) {
|
|
122
|
+
const scheduleDelete = {
|
|
123
|
+
scheduleId: tx._scheduleId.toString()
|
|
124
|
+
};
|
|
125
|
+
return {
|
|
126
|
+
type: "SCHEDULEDELETE",
|
|
127
|
+
humanReadableType: "Schedule Delete",
|
|
128
|
+
scheduleDelete
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
return {};
|
|
132
|
+
} catch (error) {
|
|
133
|
+
return {};
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Parse Schedule Create from protobuf data
|
|
138
|
+
*/
|
|
139
|
+
static parseScheduleCreateFromProto(body) {
|
|
140
|
+
if (!body) return void 0;
|
|
141
|
+
const data = {};
|
|
142
|
+
if (body.scheduledTransactionBody) {
|
|
143
|
+
const schedBytes = proto.SchedulableTransactionBody.encode(
|
|
144
|
+
proto.SchedulableTransactionBody.create(body.scheduledTransactionBody)
|
|
145
|
+
).finish();
|
|
146
|
+
data.scheduledTransactionBody = Buffer.from(schedBytes).toString("base64");
|
|
147
|
+
}
|
|
148
|
+
if (body.memo) {
|
|
149
|
+
data.memo = body.memo;
|
|
150
|
+
}
|
|
151
|
+
if (body.adminKey) {
|
|
152
|
+
data.adminKey = parseKey(body.adminKey);
|
|
153
|
+
}
|
|
154
|
+
if (body.payerAccountID) {
|
|
155
|
+
data.payerAccountId = new AccountId(
|
|
156
|
+
body.payerAccountID.shardNum ?? 0,
|
|
157
|
+
body.payerAccountID.realmNum ?? 0,
|
|
158
|
+
body.payerAccountID.accountNum ?? 0
|
|
159
|
+
).toString();
|
|
160
|
+
}
|
|
161
|
+
if (body.expirationTime?.seconds) {
|
|
162
|
+
data.expirationTime = `${Long.fromValue(
|
|
163
|
+
body.expirationTime.seconds
|
|
164
|
+
).toString()}.${body.expirationTime.nanos ?? 0}`;
|
|
165
|
+
}
|
|
166
|
+
if (body.waitForExpiry !== void 0) {
|
|
167
|
+
data.waitForExpiry = body.waitForExpiry;
|
|
168
|
+
}
|
|
169
|
+
return data;
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Parse Schedule Sign from protobuf data
|
|
173
|
+
*/
|
|
174
|
+
static parseScheduleSignFromProto(body) {
|
|
175
|
+
if (!body) return void 0;
|
|
176
|
+
const data = {};
|
|
177
|
+
if (body.scheduleID) {
|
|
178
|
+
data.scheduleId = new ScheduleId(
|
|
179
|
+
body.scheduleID.shardNum ?? 0,
|
|
180
|
+
body.scheduleID.realmNum ?? 0,
|
|
181
|
+
body.scheduleID.scheduleNum ?? 0
|
|
182
|
+
).toString();
|
|
183
|
+
}
|
|
184
|
+
return data;
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Parse Schedule Delete from protobuf data
|
|
188
|
+
*/
|
|
189
|
+
static parseScheduleDeleteFromProto(body) {
|
|
190
|
+
if (!body) return void 0;
|
|
191
|
+
const data = {};
|
|
192
|
+
if (body.scheduleID) {
|
|
193
|
+
data.scheduleId = new ScheduleId(
|
|
194
|
+
body.scheduleID.shardNum ?? 0,
|
|
195
|
+
body.scheduleID.realmNum ?? 0,
|
|
196
|
+
body.scheduleID.scheduleNum ?? 0
|
|
197
|
+
).toString();
|
|
198
|
+
}
|
|
199
|
+
return data;
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Legacy method: Parse schedule create transaction
|
|
203
|
+
* @deprecated Use parseScheduleTransaction instead
|
|
204
|
+
*/
|
|
205
|
+
static parseScheduleCreate(transaction) {
|
|
206
|
+
try {
|
|
207
|
+
const result = this.parseScheduleTransaction(transaction);
|
|
208
|
+
return result.scheduleCreate || null;
|
|
209
|
+
} catch (error) {
|
|
210
|
+
console.warn("[ScheduleParser] Failed to parse schedule create:", error);
|
|
211
|
+
return null;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Legacy method: Parse schedule sign transaction
|
|
216
|
+
* @deprecated Use parseScheduleTransaction instead
|
|
217
|
+
*/
|
|
218
|
+
static parseScheduleSign(transaction) {
|
|
219
|
+
try {
|
|
220
|
+
const result = this.parseScheduleTransaction(transaction);
|
|
221
|
+
return result.scheduleSign || null;
|
|
222
|
+
} catch (error) {
|
|
223
|
+
console.warn("[ScheduleParser] Failed to parse schedule sign:", error);
|
|
224
|
+
return null;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* Legacy method: Parse schedule delete transaction
|
|
229
|
+
* @deprecated Use parseScheduleTransaction instead
|
|
230
|
+
*/
|
|
231
|
+
static parseScheduleDelete(transaction) {
|
|
232
|
+
try {
|
|
233
|
+
const result = this.parseScheduleTransaction(transaction);
|
|
234
|
+
return result.scheduleDelete || null;
|
|
235
|
+
} catch (error) {
|
|
236
|
+
console.warn("[ScheduleParser] Failed to parse schedule delete:", error);
|
|
237
|
+
return null;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* Parse schedule info from transaction body (for scheduled transactions)
|
|
242
|
+
*/
|
|
243
|
+
static extractScheduleInfo(transaction) {
|
|
244
|
+
try {
|
|
245
|
+
const transactionBody = transaction._transactionBody;
|
|
246
|
+
if (transactionBody?.scheduleRef) {
|
|
247
|
+
return {
|
|
248
|
+
isScheduled: true,
|
|
249
|
+
scheduleRef: transactionBody.scheduleRef.toString()
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
const tx = transaction;
|
|
253
|
+
if (tx._scheduleId || tx.scheduleId) {
|
|
254
|
+
return {
|
|
255
|
+
isScheduled: true,
|
|
256
|
+
scheduleRef: (tx._scheduleId || tx.scheduleId)?.toString()
|
|
257
|
+
};
|
|
258
|
+
}
|
|
259
|
+
return { isScheduled: false };
|
|
260
|
+
} catch (error) {
|
|
261
|
+
return { isScheduled: false };
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* Parse a scheduled transaction body to extract the inner transaction
|
|
266
|
+
* This is used when a schedule contains another transaction to be executed
|
|
267
|
+
*/
|
|
268
|
+
static parseScheduledTransactionBody(scheduledTxBytes) {
|
|
269
|
+
try {
|
|
270
|
+
let bytes;
|
|
271
|
+
if (scheduledTxBytes.startsWith("0x")) {
|
|
272
|
+
const hexString = scheduledTxBytes.slice(2);
|
|
273
|
+
bytes = new Uint8Array(Buffer.from(hexString, "hex"));
|
|
274
|
+
} else {
|
|
275
|
+
bytes = new Uint8Array(Buffer.from(scheduledTxBytes, "base64"));
|
|
276
|
+
}
|
|
277
|
+
const schedulableBody = proto.SchedulableTransactionBody.decode(bytes);
|
|
278
|
+
const txType = Object.keys(schedulableBody).find(
|
|
279
|
+
(key) => schedulableBody[key] !== null && key !== "transactionFee" && key !== "memo"
|
|
280
|
+
);
|
|
281
|
+
if (txType) {
|
|
282
|
+
return {
|
|
283
|
+
type: txType.toUpperCase(),
|
|
284
|
+
body: schedulableBody[txType],
|
|
285
|
+
memo: schedulableBody.memo,
|
|
286
|
+
transactionFee: schedulableBody.transactionFee?.toString()
|
|
287
|
+
};
|
|
288
|
+
}
|
|
289
|
+
return null;
|
|
290
|
+
} catch (error) {
|
|
291
|
+
console.warn(
|
|
292
|
+
"[ScheduleParser] Failed to parse scheduled transaction body:",
|
|
293
|
+
error
|
|
294
|
+
);
|
|
295
|
+
return null;
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
/**
|
|
299
|
+
* Parse Schedule Service transaction from Transaction object
|
|
300
|
+
* This is the unified entry point that delegates to the comprehensive parsing logic
|
|
301
|
+
*/
|
|
302
|
+
static parseFromTransactionObject(transaction) {
|
|
303
|
+
return this.parseScheduleTransaction(transaction);
|
|
408
304
|
}
|
|
409
|
-
};
|
|
410
|
-
function getParserConfig(transactionType) {
|
|
411
|
-
return transactionParserRegistry[transactionType];
|
|
412
|
-
}
|
|
413
|
-
function isTransactionTypeSupported(transactionType) {
|
|
414
|
-
return transactionType in transactionParserRegistry;
|
|
415
|
-
}
|
|
416
|
-
function getSupportedTransactionTypes() {
|
|
417
|
-
return Object.keys(transactionParserRegistry);
|
|
418
305
|
}
|
|
419
306
|
export {
|
|
420
|
-
|
|
421
|
-
getSupportedTransactionTypes,
|
|
422
|
-
isTransactionTypeSupported,
|
|
423
|
-
transactionParserRegistry
|
|
307
|
+
ScheduleParser
|
|
424
308
|
};
|
|
425
309
|
//# sourceMappingURL=standards-sdk.es122.js.map
|