@hashgraphonline/standards-sdk 0.1.141-canary.3 → 0.1.141-canary.30
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 +13 -1
- package/dist/cjs/hcs-16/base-client.d.ts.map +1 -1
- package/dist/cjs/hcs-17/types.d.ts.map +1 -1
- package/dist/cjs/hcs-20/sdk.d.ts.map +1 -1
- package/dist/cjs/hcs-20/types.d.ts +9 -8
- package/dist/cjs/hcs-20/types.d.ts.map +1 -1
- package/dist/cjs/hcs-21/base-client.d.ts +4 -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/sdk.d.ts +34 -0
- package/dist/cjs/hcs-21/sdk.d.ts.map +1 -1
- package/dist/cjs/hcs-21/tx.d.ts.map +1 -1
- package/dist/cjs/hcs-21/types.d.ts +135 -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/inscribe/inscriber.d.ts +1 -0
- package/dist/cjs/inscribe/inscriber.d.ts.map +1 -1
- package/dist/cjs/inscribe/quote-cache.d.ts.map +1 -1
- package/dist/cjs/services/registry-broker/client.d.ts +4 -3
- package/dist/cjs/services/registry-broker/client.d.ts.map +1 -1
- package/dist/cjs/services/registry-broker/private-key-signer.d.ts.map +1 -1
- package/dist/cjs/services/registry-broker/schemas.d.ts +38 -38
- package/dist/cjs/services/registry-broker/schemas.d.ts.map +1 -1
- package/dist/cjs/standards-sdk.cjs +2 -2
- package/dist/cjs/standards-sdk.cjs.map +1 -1
- package/dist/cjs/utils/dynamic-import.d.ts +1 -0
- package/dist/cjs/utils/dynamic-import.d.ts.map +1 -1
- package/dist/es/hcs-16/base-client.d.ts.map +1 -1
- package/dist/es/hcs-17/types.d.ts.map +1 -1
- package/dist/es/hcs-20/sdk.d.ts.map +1 -1
- package/dist/es/hcs-20/types.d.ts +9 -8
- package/dist/es/hcs-20/types.d.ts.map +1 -1
- package/dist/es/hcs-21/base-client.d.ts +4 -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/sdk.d.ts +34 -0
- package/dist/es/hcs-21/sdk.d.ts.map +1 -1
- package/dist/es/hcs-21/tx.d.ts.map +1 -1
- package/dist/es/hcs-21/types.d.ts +135 -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/inscribe/inscriber.d.ts +1 -0
- package/dist/es/inscribe/inscriber.d.ts.map +1 -1
- package/dist/es/inscribe/quote-cache.d.ts.map +1 -1
- package/dist/es/services/registry-broker/client.d.ts +4 -3
- package/dist/es/services/registry-broker/client.d.ts.map +1 -1
- package/dist/es/services/registry-broker/private-key-signer.d.ts.map +1 -1
- package/dist/es/services/registry-broker/schemas.d.ts +38 -38
- package/dist/es/services/registry-broker/schemas.d.ts.map +1 -1
- package/dist/es/standards-sdk.es.js +58 -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 +160 -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 -785
- package/dist/es/standards-sdk.es124.js.map +1 -1
- package/dist/es/standards-sdk.es125.js +766 -182
- 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 -1977
- package/dist/es/standards-sdk.es127.js.map +1 -1
- package/dist/es/standards-sdk.es128.js +2211 -50
- package/dist/es/standards-sdk.es128.js.map +1 -1
- package/dist/es/standards-sdk.es129.js +59 -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 +69 -125
- package/dist/es/standards-sdk.es135.js.map +1 -1
- package/dist/es/standards-sdk.es136.js +28 -42
- package/dist/es/standards-sdk.es136.js.map +1 -1
- package/dist/es/standards-sdk.es137.js +138 -760
- package/dist/es/standards-sdk.es137.js.map +1 -1
- package/dist/es/standards-sdk.es138.js +36 -50
- package/dist/es/standards-sdk.es138.js.map +1 -1
- package/dist/es/standards-sdk.es139.js +766 -64
- 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 +13 -168
- package/dist/es/standards-sdk.es141.js.map +1 -1
- package/dist/es/standards-sdk.es142.js +55 -321
- package/dist/es/standards-sdk.es142.js.map +1 -1
- package/dist/es/standards-sdk.es143.js +120 -294
- package/dist/es/standards-sdk.es143.js.map +1 -1
- package/dist/es/standards-sdk.es144.js +191 -322
- package/dist/es/standards-sdk.es144.js.map +1 -1
- package/dist/es/standards-sdk.es145.js +294 -279
- package/dist/es/standards-sdk.es145.js.map +1 -1
- package/dist/es/standards-sdk.es146.js +440 -63
- package/dist/es/standards-sdk.es146.js.map +1 -1
- package/dist/es/standards-sdk.es147.js +327 -13
- package/dist/es/standards-sdk.es147.js.map +1 -1
- package/dist/es/standards-sdk.es148.js +79 -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 -10
- package/dist/es/standards-sdk.es17.js.map +1 -1
- package/dist/es/standards-sdk.es19.js +11 -15
- package/dist/es/standards-sdk.es19.js.map +1 -1
- package/dist/es/standards-sdk.es2.js +26 -72
- package/dist/es/standards-sdk.es2.js.map +1 -1
- package/dist/es/standards-sdk.es20.js +8 -12
- package/dist/es/standards-sdk.es20.js.map +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 +1 -1
- package/dist/es/standards-sdk.es28.js +11 -15
- package/dist/es/standards-sdk.es28.js.map +1 -1
- 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 +6 -11
- package/dist/es/standards-sdk.es36.js.map +1 -1
- 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 +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.es61.js +7 -11
- package/dist/es/standards-sdk.es61.js.map +1 -1
- package/dist/es/standards-sdk.es63.js +1 -1
- 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.es73.js.map +1 -1
- package/dist/es/standards-sdk.es75.js +2 -2
- package/dist/es/standards-sdk.es77.js +5 -3
- package/dist/es/standards-sdk.es77.js.map +1 -1
- package/dist/es/standards-sdk.es78.js +4 -10
- package/dist/es/standards-sdk.es78.js.map +1 -1
- 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 +26 -15
- 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 +7 -6
- package/dist/es/standards-sdk.es83.js.map +1 -1
- package/dist/es/standards-sdk.es84.js +106 -5
- package/dist/es/standards-sdk.es84.js.map +1 -1
- 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 +139 -39
- package/dist/es/standards-sdk.es95.js.map +1 -1
- package/dist/es/standards-sdk.es96.js +42 -257
- 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/dist/es/utils/dynamic-import.d.ts +1 -0
- package/dist/es/utils/dynamic-import.d.ts.map +1 -1
- package/package.json +65 -63
|
@@ -1,795 +1,358 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
type:
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
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
|
-
input.buffer instanceof ArrayBuffer ? new Uint8Array(input.buffer) : input.buffer
|
|
334
|
-
).toString("base64"),
|
|
335
|
-
fileName: input.fileName,
|
|
336
|
-
mimeType: input.mimeType
|
|
337
|
-
}
|
|
338
|
-
};
|
|
339
|
-
break;
|
|
340
|
-
}
|
|
341
|
-
if (options.mode === "hashinal") {
|
|
342
|
-
request.metadataObject = options.metadata;
|
|
343
|
-
request.creator = options.metadata?.creator || accountId;
|
|
344
|
-
request.description = options.metadata?.description;
|
|
345
|
-
if (options.jsonFileURL) {
|
|
346
|
-
request.jsonFileURL = options.jsonFileURL;
|
|
347
|
-
}
|
|
348
|
-
}
|
|
349
|
-
logger.debug("Starting inscription via startInscription (websocket)", {
|
|
350
|
-
type: input.type,
|
|
351
|
-
mode: options.mode || "file",
|
|
352
|
-
holderId: accountId,
|
|
353
|
-
usesStartInscription: true
|
|
354
|
-
});
|
|
355
|
-
const startResult = await sdk.startInscription({
|
|
356
|
-
...request,
|
|
357
|
-
holderId: accountId,
|
|
358
|
-
network: options.network || "mainnet"
|
|
359
|
-
});
|
|
360
|
-
logger.info("about to start inscription", {
|
|
361
|
-
type: input.type,
|
|
362
|
-
mode: options.mode || "file",
|
|
363
|
-
jobId: startResult.id || startResult.tx_id,
|
|
364
|
-
...startResult
|
|
365
|
-
});
|
|
366
|
-
if (typeof startResult?.transactionBytes === "string") {
|
|
367
|
-
logger.debug("Executing inscription transaction with signer from bytes");
|
|
368
|
-
await sdk.executeTransactionWithSigner(
|
|
369
|
-
startResult.transactionBytes,
|
|
370
|
-
signer
|
|
371
|
-
);
|
|
372
|
-
} else if (startResult?.transactionBytes?.type === "Buffer") {
|
|
373
|
-
logger.debug("Executing inscription transaction with signer from buffer");
|
|
374
|
-
await sdk.executeTransactionWithSigner(
|
|
375
|
-
Buffer.from(startResult.transactionBytes.data).toString("base64"),
|
|
376
|
-
signer
|
|
377
|
-
);
|
|
378
|
-
}
|
|
379
|
-
if (options.waitForConfirmation) {
|
|
380
|
-
logger.debug("Waiting for inscription confirmation (websocket)", {
|
|
381
|
-
jobId: startResult.id || startResult.tx_id,
|
|
382
|
-
maxAttempts: options.waitMaxAttempts,
|
|
383
|
-
intervalMs: options.waitIntervalMs
|
|
384
|
-
});
|
|
385
|
-
const trackingId = startResult.tx_id || startResult.id;
|
|
386
|
-
const inscription = await waitForInscriptionConfirmation(
|
|
387
|
-
sdk,
|
|
388
|
-
trackingId,
|
|
389
|
-
options.waitMaxAttempts,
|
|
390
|
-
options.waitIntervalMs,
|
|
391
|
-
options.progressCallback
|
|
392
|
-
);
|
|
393
|
-
logger.info("Inscription confirmation received", {
|
|
394
|
-
jobId: trackingId
|
|
395
|
-
});
|
|
396
|
-
return {
|
|
397
|
-
confirmed: true,
|
|
398
|
-
result: {
|
|
399
|
-
jobId: startResult.id || startResult.tx_id,
|
|
400
|
-
transactionId: startResult.tx_id || "",
|
|
401
|
-
topic_id: startResult.topic_id,
|
|
402
|
-
status: startResult.status,
|
|
403
|
-
completed: startResult.completed
|
|
404
|
-
},
|
|
405
|
-
inscription,
|
|
406
|
-
sdk
|
|
407
|
-
};
|
|
408
|
-
}
|
|
409
|
-
return {
|
|
410
|
-
confirmed: false,
|
|
411
|
-
result: {
|
|
412
|
-
jobId: startResult.id || startResult.tx_id,
|
|
413
|
-
transactionId: startResult.tx_id || "",
|
|
414
|
-
topic_id: startResult.topic_id,
|
|
415
|
-
status: startResult.status,
|
|
416
|
-
completed: startResult.completed
|
|
417
|
-
},
|
|
418
|
-
sdk
|
|
419
|
-
};
|
|
420
|
-
} catch (error) {
|
|
421
|
-
logger.error("Error during inscription process", error);
|
|
422
|
-
throw error;
|
|
423
|
-
}
|
|
424
|
-
}
|
|
425
|
-
async function retrieveInscription(transactionId, options) {
|
|
426
|
-
const logger = Logger.getInstance({
|
|
427
|
-
module: "Inscriber",
|
|
428
|
-
...options?.logging || {}
|
|
429
|
-
});
|
|
430
|
-
const formattedTransactionId = transactionId.includes("@") ? `${transactionId.split("@")[0]}-${transactionId.split("@")[1].replace(/\./g, "-")}` : transactionId;
|
|
431
|
-
logger.info("Retrieving inscription", {
|
|
432
|
-
originalTransactionId: transactionId,
|
|
433
|
-
formattedTransactionId
|
|
434
|
-
});
|
|
435
|
-
try {
|
|
436
|
-
let sdk;
|
|
437
|
-
if (options?.apiKey) {
|
|
438
|
-
logger.debug("Initializing InscriptionSDK with API key");
|
|
439
|
-
sdk = new InscriptionSDK({
|
|
440
|
-
apiKey: options.apiKey,
|
|
441
|
-
network: options.network || "mainnet"
|
|
442
|
-
});
|
|
443
|
-
} else if (options?.accountId && options?.privateKey) {
|
|
444
|
-
logger.debug("Initializing InscriptionSDK with server auth");
|
|
445
|
-
sdk = await InscriptionSDK.createWithAuth({
|
|
446
|
-
type: "server",
|
|
447
|
-
accountId: options.accountId,
|
|
448
|
-
privateKey: options.privateKey,
|
|
449
|
-
network: options.network || "mainnet"
|
|
450
|
-
});
|
|
451
|
-
} else {
|
|
452
|
-
const error = new Error(
|
|
453
|
-
"Either API key or account ID and private key are required for retrieving inscriptions"
|
|
454
|
-
);
|
|
455
|
-
logger.error("Missing authentication credentials", {
|
|
456
|
-
hasApiKey: Boolean(options?.apiKey),
|
|
457
|
-
hasAccountId: Boolean(options?.accountId),
|
|
458
|
-
hasPrivateKey: Boolean(options?.privateKey)
|
|
459
|
-
});
|
|
460
|
-
throw error;
|
|
461
|
-
}
|
|
462
|
-
logger.debug("Initialized SDK for inscription retrieval", {
|
|
463
|
-
formattedTransactionId,
|
|
464
|
-
network: options.network || "mainnet"
|
|
465
|
-
});
|
|
466
|
-
const result = await sdk.retrieveInscription(formattedTransactionId);
|
|
467
|
-
logger.info("Successfully retrieved inscription", {
|
|
468
|
-
formattedTransactionId
|
|
469
|
-
});
|
|
470
|
-
return result;
|
|
471
|
-
} catch (error) {
|
|
472
|
-
logger.error("Error retrieving inscription", {
|
|
473
|
-
formattedTransactionId,
|
|
474
|
-
error
|
|
475
|
-
});
|
|
476
|
-
throw error;
|
|
477
|
-
}
|
|
478
|
-
}
|
|
479
|
-
function validateHashinalMetadata(metadata, logger) {
|
|
480
|
-
const requiredFields = ["name", "creator", "description", "type"];
|
|
481
|
-
const missingFields = requiredFields.filter((field) => !metadata[field]);
|
|
482
|
-
if (missingFields.length > 0) {
|
|
483
|
-
const error = new Error(
|
|
484
|
-
`Missing required Hashinal metadata fields: ${missingFields.join(", ")}`
|
|
485
|
-
);
|
|
486
|
-
logger.error("Hashinal metadata validation failed", { missingFields });
|
|
487
|
-
throw error;
|
|
488
|
-
}
|
|
489
|
-
logger.debug("Hashinal metadata validation passed", {
|
|
490
|
-
name: metadata.name,
|
|
491
|
-
creator: metadata.creator,
|
|
492
|
-
description: metadata.description,
|
|
493
|
-
type: metadata.type,
|
|
494
|
-
hasAttributes: !!metadata.attributes,
|
|
495
|
-
hasProperties: !!metadata.properties
|
|
496
|
-
});
|
|
497
|
-
}
|
|
498
|
-
async function generateQuote(input, clientConfig, options, existingSDK) {
|
|
499
|
-
const logger = Logger.getInstance({
|
|
500
|
-
module: "Inscriber",
|
|
501
|
-
...options.logging
|
|
502
|
-
});
|
|
503
|
-
logger.info("Generating inscription quote", {
|
|
504
|
-
type: input.type,
|
|
505
|
-
mode: options.mode || "file",
|
|
506
|
-
...input.type === "url" ? { url: input.url } : {},
|
|
507
|
-
...input.type === "file" ? { path: input.path } : {},
|
|
508
|
-
...input.type === "buffer" ? { fileName: input.fileName, bufferSize: input.buffer.byteLength } : {}
|
|
509
|
-
});
|
|
510
|
-
try {
|
|
511
|
-
validateQuoteParameters(input, clientConfig, options);
|
|
512
|
-
const cachedQuote = getCachedQuote(input, clientConfig, options);
|
|
513
|
-
if (cachedQuote) {
|
|
514
|
-
logger.debug("Returning cached quote");
|
|
515
|
-
return {
|
|
516
|
-
confirmed: false,
|
|
517
|
-
quote: true,
|
|
518
|
-
result: cachedQuote
|
|
519
|
-
};
|
|
520
|
-
}
|
|
521
|
-
if (options.mode === "hashinal" && options.metadata) {
|
|
522
|
-
validateHashinalMetadata(options.metadata, logger);
|
|
523
|
-
}
|
|
524
|
-
const sdk = await getOrCreateSDK(clientConfig, options, existingSDK);
|
|
525
|
-
const baseRequest = {
|
|
526
|
-
holderId: clientConfig.accountId,
|
|
527
|
-
metadata: options.metadata || {},
|
|
528
|
-
tags: options.tags || [],
|
|
529
|
-
mode: options.mode || "file",
|
|
530
|
-
fileStandard: options.fileStandard,
|
|
531
|
-
chunkSize: options.chunkSize
|
|
532
|
-
};
|
|
533
|
-
let request;
|
|
534
|
-
switch (input.type) {
|
|
535
|
-
case "url":
|
|
536
|
-
request = {
|
|
537
|
-
...baseRequest,
|
|
538
|
-
file: {
|
|
539
|
-
type: "url",
|
|
540
|
-
url: input.url
|
|
541
|
-
}
|
|
542
|
-
};
|
|
543
|
-
break;
|
|
544
|
-
case "file": {
|
|
545
|
-
const fileData = await convertFileToBase64(input.path);
|
|
546
|
-
request = {
|
|
547
|
-
...baseRequest,
|
|
548
|
-
file: {
|
|
549
|
-
type: "base64",
|
|
550
|
-
base64: fileData.base64,
|
|
551
|
-
fileName: fileData.fileName,
|
|
552
|
-
mimeType: fileData.mimeType
|
|
553
|
-
}
|
|
554
|
-
};
|
|
555
|
-
break;
|
|
556
|
-
}
|
|
557
|
-
case "buffer":
|
|
558
|
-
request = {
|
|
559
|
-
...baseRequest,
|
|
560
|
-
file: {
|
|
561
|
-
type: "base64",
|
|
562
|
-
base64: Buffer.from(
|
|
563
|
-
input.buffer instanceof ArrayBuffer ? new Uint8Array(input.buffer) : input.buffer
|
|
564
|
-
).toString("base64"),
|
|
565
|
-
fileName: input.fileName,
|
|
566
|
-
mimeType: input.mimeType
|
|
567
|
-
}
|
|
568
|
-
};
|
|
569
|
-
break;
|
|
570
|
-
}
|
|
571
|
-
if (options.mode === "hashinal") {
|
|
572
|
-
request.metadataObject = options.metadata;
|
|
573
|
-
request.creator = options.metadata?.creator || clientConfig.accountId;
|
|
574
|
-
request.description = options.metadata?.description;
|
|
575
|
-
if (options.jsonFileURL) {
|
|
576
|
-
request.jsonFileURL = options.jsonFileURL;
|
|
577
|
-
}
|
|
1
|
+
const protoFieldToTypeRegistry = {
|
|
2
|
+
tokenCreation: { type: "TOKENCREATE", humanReadableType: "Token Creation" },
|
|
3
|
+
tokenAirdrop: { type: "TOKENAIRDROP", humanReadableType: "Token Airdrop" },
|
|
4
|
+
tokenMint: { type: "TOKENMINT", humanReadableType: "Token Mint" },
|
|
5
|
+
tokenBurn: { type: "TOKENBURN", humanReadableType: "Token Burn" },
|
|
6
|
+
tokenUpdate: { type: "TOKENUPDATE", humanReadableType: "Token Update" },
|
|
7
|
+
tokenDeletion: { type: "TOKENDELETE", humanReadableType: "Token Deletion" },
|
|
8
|
+
tokenAssociate: {
|
|
9
|
+
type: "TOKENASSOCIATE",
|
|
10
|
+
humanReadableType: "Token Association"
|
|
11
|
+
},
|
|
12
|
+
tokenDissociate: {
|
|
13
|
+
type: "TOKENDISSOCIATE",
|
|
14
|
+
humanReadableType: "Token Dissociation"
|
|
15
|
+
},
|
|
16
|
+
tokenFreeze: { type: "TOKENFREEZE", humanReadableType: "Token Freeze" },
|
|
17
|
+
tokenUnfreeze: { type: "TOKENUNFREEZE", humanReadableType: "Token Unfreeze" },
|
|
18
|
+
tokenGrantKyc: {
|
|
19
|
+
type: "TOKENGRANTKYC",
|
|
20
|
+
humanReadableType: "Token Grant KYC"
|
|
21
|
+
},
|
|
22
|
+
tokenRevokeKyc: {
|
|
23
|
+
type: "TOKENREVOKEKYC",
|
|
24
|
+
humanReadableType: "Token Revoke KYC"
|
|
25
|
+
},
|
|
26
|
+
tokenPause: { type: "TOKENPAUSE", humanReadableType: "Token Pause" },
|
|
27
|
+
tokenUnpause: { type: "TOKENUNPAUSE", humanReadableType: "Token Unpause" },
|
|
28
|
+
tokenWipe: { type: "TOKENWIPE", humanReadableType: "Token Wipe" },
|
|
29
|
+
tokenFeeScheduleUpdate: {
|
|
30
|
+
type: "TOKENFEESCHEDULEUPDATE",
|
|
31
|
+
humanReadableType: "Token Fee Schedule Update"
|
|
32
|
+
},
|
|
33
|
+
tokenCancelAirdrop: {
|
|
34
|
+
type: "TOKENCANCELAIRDROP",
|
|
35
|
+
humanReadableType: "Cancel Token Airdrop"
|
|
36
|
+
},
|
|
37
|
+
tokenClaimAirdrop: {
|
|
38
|
+
type: "TOKENCLAIMAIRDROP",
|
|
39
|
+
humanReadableType: "Claim Token Airdrop"
|
|
40
|
+
},
|
|
41
|
+
tokenReject: { type: "TOKENREJECT", humanReadableType: "Token Reject" },
|
|
42
|
+
tokenUpdateNfts: {
|
|
43
|
+
type: "TOKENUPDATENFTS",
|
|
44
|
+
humanReadableType: "Update NFT Metadata"
|
|
45
|
+
},
|
|
46
|
+
cryptoTransfer: {
|
|
47
|
+
type: "CRYPTOTRANSFER",
|
|
48
|
+
humanReadableType: "Crypto Transfer"
|
|
49
|
+
},
|
|
50
|
+
cryptoCreateAccount: {
|
|
51
|
+
type: "ACCOUNTCREATE",
|
|
52
|
+
humanReadableType: "Account Creation"
|
|
53
|
+
},
|
|
54
|
+
cryptoUpdateAccount: {
|
|
55
|
+
type: "ACCOUNTUPDATE",
|
|
56
|
+
humanReadableType: "Account Update"
|
|
57
|
+
},
|
|
58
|
+
cryptoDelete: {
|
|
59
|
+
type: "ACCOUNTDELETE",
|
|
60
|
+
humanReadableType: "Account Deletion"
|
|
61
|
+
},
|
|
62
|
+
cryptoApproveAllowance: {
|
|
63
|
+
type: "APPROVEALLOWANCE",
|
|
64
|
+
humanReadableType: "Approve Allowance"
|
|
65
|
+
},
|
|
66
|
+
cryptoDeleteAllowance: {
|
|
67
|
+
type: "DELETEALLOWANCE",
|
|
68
|
+
humanReadableType: "Delete Allowance"
|
|
69
|
+
},
|
|
70
|
+
cryptoAddLiveHash: {
|
|
71
|
+
type: "CRYPTOADDLIVEHASH",
|
|
72
|
+
humanReadableType: "Add Live Hash"
|
|
73
|
+
},
|
|
74
|
+
cryptoDeleteLiveHash: {
|
|
75
|
+
type: "CRYPTODELETELIVEHASH",
|
|
76
|
+
humanReadableType: "Delete Live Hash"
|
|
77
|
+
},
|
|
78
|
+
consensusCreateTopic: {
|
|
79
|
+
type: "TOPICCREATE",
|
|
80
|
+
humanReadableType: "Topic Creation"
|
|
81
|
+
},
|
|
82
|
+
consensusSubmitMessage: {
|
|
83
|
+
type: "CONSENSUSSUBMITMESSAGE",
|
|
84
|
+
humanReadableType: "Submit Message"
|
|
85
|
+
},
|
|
86
|
+
consensusUpdateTopic: {
|
|
87
|
+
type: "TOPICUPDATE",
|
|
88
|
+
humanReadableType: "Topic Update"
|
|
89
|
+
},
|
|
90
|
+
consensusDeleteTopic: {
|
|
91
|
+
type: "TOPICDELETE",
|
|
92
|
+
humanReadableType: "Topic Deletion"
|
|
93
|
+
},
|
|
94
|
+
uncheckedSubmit: {
|
|
95
|
+
type: "UNCHECKEDSUBMIT",
|
|
96
|
+
humanReadableType: "Unchecked Submit"
|
|
97
|
+
},
|
|
98
|
+
contractCall: { type: "CONTRACTCALL", humanReadableType: "Contract Call" },
|
|
99
|
+
contractCreateInstance: {
|
|
100
|
+
type: "CONTRACTCREATE",
|
|
101
|
+
humanReadableType: "Contract Creation"
|
|
102
|
+
},
|
|
103
|
+
contractUpdateInstance: {
|
|
104
|
+
type: "CONTRACTUPDATE",
|
|
105
|
+
humanReadableType: "Contract Update"
|
|
106
|
+
},
|
|
107
|
+
contractDeleteInstance: {
|
|
108
|
+
type: "CONTRACTDELETE",
|
|
109
|
+
humanReadableType: "Contract Deletion"
|
|
110
|
+
},
|
|
111
|
+
ethereumTransaction: {
|
|
112
|
+
type: "ETHEREUMTRANSACTION",
|
|
113
|
+
humanReadableType: "Ethereum Transaction"
|
|
114
|
+
},
|
|
115
|
+
fileCreate: { type: "FILECREATE", humanReadableType: "File Creation" },
|
|
116
|
+
fileUpdate: { type: "FILEUPDATE", humanReadableType: "File Update" },
|
|
117
|
+
fileDelete: { type: "FILEDELETE", humanReadableType: "File Deletion" },
|
|
118
|
+
fileAppend: { type: "FILEAPPEND", humanReadableType: "File Append" },
|
|
119
|
+
scheduleCreate: {
|
|
120
|
+
type: "SCHEDULECREATE",
|
|
121
|
+
humanReadableType: "Schedule Creation"
|
|
122
|
+
},
|
|
123
|
+
scheduleSign: { type: "SCHEDULESIGN", humanReadableType: "Schedule Sign" },
|
|
124
|
+
scheduleDelete: {
|
|
125
|
+
type: "SCHEDULEDELETE",
|
|
126
|
+
humanReadableType: "Schedule Deletion"
|
|
127
|
+
},
|
|
128
|
+
freeze: { type: "FREEZE", humanReadableType: "Network Freeze" },
|
|
129
|
+
systemDelete: { type: "SYSTEMDELETE", humanReadableType: "System Delete" },
|
|
130
|
+
systemUndelete: {
|
|
131
|
+
type: "SYSTEMUNDELETE",
|
|
132
|
+
humanReadableType: "System Undelete"
|
|
133
|
+
},
|
|
134
|
+
nodeCreate: { type: "NODECREATE", humanReadableType: "Node Creation" },
|
|
135
|
+
nodeUpdate: { type: "NODEUPDATE", humanReadableType: "Node Update" },
|
|
136
|
+
nodeDelete: { type: "NODEDELETE", humanReadableType: "Node Deletion" },
|
|
137
|
+
nodeStakeUpdate: {
|
|
138
|
+
type: "NODESTAKEUPDATE",
|
|
139
|
+
humanReadableType: "Node Stake Update"
|
|
140
|
+
},
|
|
141
|
+
utilPrng: { type: "PRNG", humanReadableType: "Pseudo Random Number" },
|
|
142
|
+
atomicBatch: { type: "ATOMICBATCH", humanReadableType: "Atomic Batch" },
|
|
143
|
+
stateSignatureTransaction: {
|
|
144
|
+
type: "STATESIGNATURETRANSACTION",
|
|
145
|
+
humanReadableType: "State Signature"
|
|
146
|
+
},
|
|
147
|
+
historyProofSignature: {
|
|
148
|
+
type: "HISTORYPROOFSIGNATURE",
|
|
149
|
+
humanReadableType: "History Proof Signature"
|
|
150
|
+
},
|
|
151
|
+
historyProofKeyPublication: {
|
|
152
|
+
type: "HISTORYPROOFKEYPUBLICATION",
|
|
153
|
+
humanReadableType: "History Proof Key Publication"
|
|
154
|
+
},
|
|
155
|
+
historyProofVote: {
|
|
156
|
+
type: "HISTORYPROOFVOTE",
|
|
157
|
+
humanReadableType: "History Proof Vote"
|
|
158
|
+
},
|
|
159
|
+
hintsPreprocessingVote: {
|
|
160
|
+
type: "HINTSPREPROCESSINGVOTE",
|
|
161
|
+
humanReadableType: "Hints Preprocessing Vote"
|
|
162
|
+
},
|
|
163
|
+
hintsKeyPublication: {
|
|
164
|
+
type: "HINTSKEYPUBLICATION",
|
|
165
|
+
humanReadableType: "Hints Key Publication"
|
|
166
|
+
},
|
|
167
|
+
hintsPartialSignature: {
|
|
168
|
+
type: "HINTSPARTIALSIGNATURE",
|
|
169
|
+
humanReadableType: "Hints Partial Signature"
|
|
170
|
+
},
|
|
171
|
+
crsPublication: {
|
|
172
|
+
type: "CRSPUBLICATION",
|
|
173
|
+
humanReadableType: "CRS Publication"
|
|
174
|
+
},
|
|
175
|
+
transactionID: { type: "UNKNOWN", humanReadableType: "Unknown Transaction" },
|
|
176
|
+
nodeAccountID: { type: "UNKNOWN", humanReadableType: "Unknown Transaction" },
|
|
177
|
+
transactionFee: { type: "UNKNOWN", humanReadableType: "Unknown Transaction" },
|
|
178
|
+
transactionValidDuration: {
|
|
179
|
+
type: "UNKNOWN",
|
|
180
|
+
humanReadableType: "Unknown Transaction"
|
|
181
|
+
},
|
|
182
|
+
generateRecord: { type: "UNKNOWN", humanReadableType: "Unknown Transaction" },
|
|
183
|
+
memo: { type: "UNKNOWN", humanReadableType: "Unknown Transaction" },
|
|
184
|
+
batchKey: { type: "UNKNOWN", humanReadableType: "Unknown Transaction" },
|
|
185
|
+
maxCustomFees: { type: "UNKNOWN", humanReadableType: "Unknown Transaction" }
|
|
186
|
+
};
|
|
187
|
+
const humanReadableTypeRegistry = {
|
|
188
|
+
cryptoTransfer: "HBAR Transfer",
|
|
189
|
+
CRYPTOTRANSFER: "HBAR Transfer",
|
|
190
|
+
cryptoCreateAccount: "Create Account",
|
|
191
|
+
ACCOUNTCREATE: "Create Account",
|
|
192
|
+
cryptoUpdateAccount: "Update Account",
|
|
193
|
+
ACCOUNTUPDATE: "Update Account",
|
|
194
|
+
cryptoDeleteAccount: "Delete Account",
|
|
195
|
+
cryptoDelete: "Delete Account",
|
|
196
|
+
ACCOUNTDELETE: "Delete Account",
|
|
197
|
+
cryptoApproveAllowance: "Approve Allowance",
|
|
198
|
+
APPROVEALLOWANCE: "Approve Allowance",
|
|
199
|
+
cryptoDeleteAllowance: "Delete Allowance",
|
|
200
|
+
DELETEALLOWANCE: "Delete Allowance",
|
|
201
|
+
CRYPTOADDLIVEHASH: "Add Live Hash",
|
|
202
|
+
CRYPTODELETELIVEHASH: "Delete Live Hash",
|
|
203
|
+
consensusCreateTopic: "Create Topic",
|
|
204
|
+
TOPICCREATE: "Create Topic",
|
|
205
|
+
consensusUpdateTopic: "Update Topic",
|
|
206
|
+
TOPICUPDATE: "Update Topic",
|
|
207
|
+
consensusSubmitMessage: "Submit Message",
|
|
208
|
+
CONSENSUSSUBMITMESSAGE: "Submit Message",
|
|
209
|
+
consensusDeleteTopic: "Delete Topic",
|
|
210
|
+
TOPICDELETE: "Delete Topic",
|
|
211
|
+
UNCHECKEDSUBMIT: "Unchecked Submit",
|
|
212
|
+
fileCreate: "Create File",
|
|
213
|
+
FILECREATE: "Create File",
|
|
214
|
+
fileAppend: "Append File",
|
|
215
|
+
FILEAPPEND: "Append File",
|
|
216
|
+
fileUpdate: "Update File",
|
|
217
|
+
FILEUPDATE: "Update File",
|
|
218
|
+
fileDelete: "Delete File",
|
|
219
|
+
FILEDELETE: "Delete File",
|
|
220
|
+
contractCall: "Contract Call",
|
|
221
|
+
CONTRACTCALL: "Contract Call",
|
|
222
|
+
contractCreate: "Create Contract",
|
|
223
|
+
CONTRACTCREATE: "Create Contract",
|
|
224
|
+
contractUpdate: "Update Contract",
|
|
225
|
+
CONTRACTUPDATE: "Update Contract",
|
|
226
|
+
contractDelete: "Delete Contract",
|
|
227
|
+
CONTRACTDELETE: "Delete Contract",
|
|
228
|
+
ethereumTransaction: "Ethereum Transaction",
|
|
229
|
+
ETHEREUMTRANSACTION: "Ethereum Transaction",
|
|
230
|
+
tokenCreate: "Create Token",
|
|
231
|
+
TOKENCREATE: "Create Token",
|
|
232
|
+
tokenUpdate: "Update Token",
|
|
233
|
+
TOKENUPDATE: "Update Token",
|
|
234
|
+
tokenDelete: "Delete Token",
|
|
235
|
+
TOKENDELETE: "Delete Token",
|
|
236
|
+
tokenAssociate: "Associate Token",
|
|
237
|
+
TOKENASSOCIATE: "Associate Token",
|
|
238
|
+
tokenDissociate: "Dissociate Token",
|
|
239
|
+
TOKENDISSOCIATE: "Dissociate Token",
|
|
240
|
+
tokenMint: "Mint Token",
|
|
241
|
+
TOKENMINT: "Mint Token",
|
|
242
|
+
tokenBurn: "Burn Token",
|
|
243
|
+
TOKENBURN: "Burn Token",
|
|
244
|
+
tokenFeeScheduleUpdate: "Update Token Fee Schedule",
|
|
245
|
+
TOKENFEESCHEDULEUPDATE: "Update Token Fee Schedule",
|
|
246
|
+
tokenFreeze: "Freeze Token",
|
|
247
|
+
TOKENFREEZE: "Freeze Token",
|
|
248
|
+
tokenUnfreeze: "Unfreeze Token",
|
|
249
|
+
TOKENUNFREEZE: "Unfreeze Token",
|
|
250
|
+
tokenGrantKyc: "Grant KYC",
|
|
251
|
+
TOKENGRANTKYC: "Grant KYC",
|
|
252
|
+
tokenRevokeKyc: "Revoke KYC",
|
|
253
|
+
TOKENREVOKEKYC: "Revoke KYC",
|
|
254
|
+
tokenPause: "Pause Token",
|
|
255
|
+
TOKENPAUSE: "Pause Token",
|
|
256
|
+
tokenUnpause: "Unpause Token",
|
|
257
|
+
TOKENUNPAUSE: "Unpause Token",
|
|
258
|
+
tokenWipe: "Wipe Token",
|
|
259
|
+
TOKENWIPE: "Wipe Token",
|
|
260
|
+
tokenAirdrop: "Token Airdrop",
|
|
261
|
+
TOKENAIRDROP: "Token Airdrop",
|
|
262
|
+
TOKENCANCELAIRDROP: "Cancel Token Airdrop",
|
|
263
|
+
TOKENCLAIMAIRDROP: "Claim Token Airdrop",
|
|
264
|
+
TOKENREJECT: "Token Reject",
|
|
265
|
+
TOKENUPDATENFTS: "Update NFT Metadata",
|
|
266
|
+
scheduleCreate: "Create Schedule",
|
|
267
|
+
SCHEDULECREATE: "Create Schedule",
|
|
268
|
+
scheduleSign: "Sign Schedule",
|
|
269
|
+
SCHEDULESIGN: "Sign Schedule",
|
|
270
|
+
SCHEDULEDELETE: "Delete Schedule",
|
|
271
|
+
FREEZE: "Network Freeze",
|
|
272
|
+
SYSTEMDELETE: "System Delete",
|
|
273
|
+
SYSTEMUNDELETE: "System Undelete",
|
|
274
|
+
NODECREATE: "Create Node",
|
|
275
|
+
NODEUPDATE: "Update Node",
|
|
276
|
+
NODEDELETE: "Delete Node",
|
|
277
|
+
NODESTAKEUPDATE: "Update Node Stake",
|
|
278
|
+
utilPrng: "Generate Random Number",
|
|
279
|
+
PRNG: "Generate Random Number",
|
|
280
|
+
ATOMICBATCH: "Atomic Batch",
|
|
281
|
+
STATESIGNATURETRANSACTION: "State Signature",
|
|
282
|
+
HISTORYPROOFSIGNATURE: "History Proof Signature",
|
|
283
|
+
HISTORYPROOFKEYPUBLICATION: "History Proof Key Publication",
|
|
284
|
+
HISTORYPROOFVOTE: "History Proof Vote",
|
|
285
|
+
HINTSPREPROCESSINGVOTE: "Hints Preprocessing Vote",
|
|
286
|
+
HINTSKEYPUBLICATION: "Hints Key Publication",
|
|
287
|
+
HINTSPARTIALSIGNATURE: "Hints Partial Signature",
|
|
288
|
+
CRSPUBLICATION: "CRS Publication",
|
|
289
|
+
unknown: "Unknown Transaction",
|
|
290
|
+
UNKNOWN: "Unknown Transaction"
|
|
291
|
+
};
|
|
292
|
+
const schedulableTransactionTypeRegistry = {
|
|
293
|
+
tokenCreation: "tokenCreate",
|
|
294
|
+
tokenAirdrop: "tokenAirdrop",
|
|
295
|
+
cryptoTransfer: "cryptoTransfer",
|
|
296
|
+
consensusSubmitMessage: "consensusSubmitMessage",
|
|
297
|
+
contractCall: "contractCall",
|
|
298
|
+
cryptoCreateAccount: "cryptoCreateAccount",
|
|
299
|
+
cryptoUpdateAccount: "cryptoUpdateAccount",
|
|
300
|
+
cryptoApproveAllowance: "cryptoApproveAllowance",
|
|
301
|
+
cryptoDeleteAllowance: "cryptoDeleteAllowance",
|
|
302
|
+
cryptoDelete: "cryptoDelete",
|
|
303
|
+
consensusCreateTopic: "consensusCreateTopic",
|
|
304
|
+
consensusUpdateTopic: "consensusUpdateTopic",
|
|
305
|
+
consensusDeleteTopic: "consensusDeleteTopic",
|
|
306
|
+
fileCreate: "fileCreate",
|
|
307
|
+
fileAppend: "fileAppend",
|
|
308
|
+
fileUpdate: "fileUpdate",
|
|
309
|
+
fileDelete: "fileDelete",
|
|
310
|
+
contractCreateInstance: "contractCreate",
|
|
311
|
+
contractUpdateInstance: "contractUpdate",
|
|
312
|
+
contractDeleteInstance: "contractDelete",
|
|
313
|
+
tokenUpdate: "tokenUpdate",
|
|
314
|
+
tokenDeletion: "tokenDelete",
|
|
315
|
+
tokenAssociate: "tokenAssociate",
|
|
316
|
+
tokenDissociate: "tokenDissociate",
|
|
317
|
+
tokenMint: "tokenMint",
|
|
318
|
+
tokenBurn: "tokenBurn",
|
|
319
|
+
tokenFeeScheduleUpdate: "tokenFeeScheduleUpdate",
|
|
320
|
+
tokenFreeze: "tokenFreeze",
|
|
321
|
+
tokenUnfreeze: "tokenUnfreeze",
|
|
322
|
+
tokenGrantKyc: "tokenGrantKyc",
|
|
323
|
+
tokenRevokeKyc: "tokenRevokeKyc",
|
|
324
|
+
tokenPause: "tokenPause",
|
|
325
|
+
tokenUnpause: "tokenUnpause",
|
|
326
|
+
tokenWipe: "tokenWipe",
|
|
327
|
+
utilPrng: "utilPrng"
|
|
328
|
+
};
|
|
329
|
+
function getTransactionTypeFromBody(txBody) {
|
|
330
|
+
for (const [field, typeInfo] of Object.entries(protoFieldToTypeRegistry)) {
|
|
331
|
+
if (txBody[field]) {
|
|
332
|
+
return typeInfo;
|
|
578
333
|
}
|
|
579
|
-
logger.debug("Calling inscription SDK startInscription for quote", {
|
|
580
|
-
type: input.type,
|
|
581
|
-
mode: options.mode || "file",
|
|
582
|
-
holderId: clientConfig.accountId
|
|
583
|
-
});
|
|
584
|
-
const inscriptionResponse = await sdk.startInscription(request);
|
|
585
|
-
logger.debug("Received inscription response for quote parsing", {
|
|
586
|
-
hasTransactionBytes: !!inscriptionResponse.transactionBytes,
|
|
587
|
-
bytesLength: inscriptionResponse.transactionBytes?.length || 0,
|
|
588
|
-
transactionBytesType: typeof inscriptionResponse.transactionBytes,
|
|
589
|
-
totalCost: inscriptionResponse.totalCost
|
|
590
|
-
});
|
|
591
|
-
const quote = await parseTransactionForQuote(
|
|
592
|
-
inscriptionResponse,
|
|
593
|
-
logger
|
|
594
|
-
);
|
|
595
|
-
cacheQuote(input, clientConfig, options, quote);
|
|
596
|
-
logger.info("Successfully generated inscription quote", {
|
|
597
|
-
totalCostHbar: quote.totalCostHbar
|
|
598
|
-
});
|
|
599
|
-
return {
|
|
600
|
-
confirmed: false,
|
|
601
|
-
quote: true,
|
|
602
|
-
result: quote
|
|
603
|
-
};
|
|
604
|
-
} catch (error) {
|
|
605
|
-
logger.error("Error generating inscription quote", error);
|
|
606
|
-
throw error;
|
|
607
334
|
}
|
|
335
|
+
return { type: "UNKNOWN", humanReadableType: "Unknown Transaction" };
|
|
608
336
|
}
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
logger.debug("Using totalCost from inscription response", {
|
|
616
|
-
totalCostTinybars: inscriptionResponse.totalCost,
|
|
617
|
-
totalCostHbar
|
|
618
|
-
});
|
|
619
|
-
} else if (inscriptionResponse.transactionBytes) {
|
|
620
|
-
logger.debug("Parsing transaction bytes for cost information");
|
|
621
|
-
try {
|
|
622
|
-
let transactionBytesString;
|
|
623
|
-
if (typeof inscriptionResponse.transactionBytes === "string") {
|
|
624
|
-
transactionBytesString = inscriptionResponse.transactionBytes;
|
|
625
|
-
} else if (inscriptionResponse.transactionBytes && typeof inscriptionResponse.transactionBytes === "object" && "data" in inscriptionResponse.transactionBytes) {
|
|
626
|
-
const buffer = Buffer.from(inscriptionResponse.transactionBytes.data);
|
|
627
|
-
transactionBytesString = buffer.toString("base64");
|
|
628
|
-
} else {
|
|
629
|
-
throw new Error("Invalid transactionBytes format");
|
|
630
|
-
}
|
|
631
|
-
logger.debug("About to parse transaction bytes", {
|
|
632
|
-
bytesLength: transactionBytesString.length,
|
|
633
|
-
bytesPreview: transactionBytesString.slice(0, 100)
|
|
634
|
-
});
|
|
635
|
-
const parsedTransaction = await TransactionParser.parseTransactionBytes(
|
|
636
|
-
transactionBytesString,
|
|
637
|
-
{ includeRaw: false }
|
|
638
|
-
);
|
|
639
|
-
logger.debug("Parsed transaction for quote", {
|
|
640
|
-
type: parsedTransaction.type,
|
|
641
|
-
hasTransfers: !!parsedTransaction.transfers,
|
|
642
|
-
transferCount: parsedTransaction.transfers?.length || 0,
|
|
643
|
-
transfers: parsedTransaction.transfers
|
|
644
|
-
});
|
|
645
|
-
let totalTransferAmount = 0;
|
|
646
|
-
if (parsedTransaction.transfers && parsedTransaction.transfers.length > 0) {
|
|
647
|
-
for (const transfer of parsedTransaction.transfers) {
|
|
648
|
-
const transferAmount = typeof transfer.amount === "string" ? parseFloat(transfer.amount) : transfer.amount;
|
|
649
|
-
if (transferAmount < 0) {
|
|
650
|
-
const amountHbar = Math.abs(transferAmount);
|
|
651
|
-
totalTransferAmount += amountHbar;
|
|
652
|
-
logger.debug("Found HBAR transfer", {
|
|
653
|
-
from: transfer.accountId,
|
|
654
|
-
to: "service",
|
|
655
|
-
amount: amountHbar
|
|
656
|
-
});
|
|
657
|
-
}
|
|
658
|
-
}
|
|
659
|
-
}
|
|
660
|
-
if (totalTransferAmount > 0) {
|
|
661
|
-
totalCostHbar = totalTransferAmount.toString();
|
|
662
|
-
logger.debug("Using parsed transaction transfer amount", {
|
|
663
|
-
totalTransferAmount,
|
|
664
|
-
totalCostHbar
|
|
665
|
-
});
|
|
666
|
-
}
|
|
667
|
-
} catch (parseError) {
|
|
668
|
-
logger.warn(
|
|
669
|
-
"Could not parse transaction bytes, using totalCost fallback",
|
|
670
|
-
{
|
|
671
|
-
error: parseError,
|
|
672
|
-
errorMessage: parseError instanceof Error ? parseError.message : String(parseError)
|
|
673
|
-
}
|
|
674
|
-
);
|
|
675
|
-
}
|
|
337
|
+
function getSchedulableTransactionType(txBody) {
|
|
338
|
+
for (const [field, type] of Object.entries(
|
|
339
|
+
schedulableTransactionTypeRegistry
|
|
340
|
+
)) {
|
|
341
|
+
if (txBody[field]) {
|
|
342
|
+
return type;
|
|
676
343
|
}
|
|
677
|
-
const transfers = [
|
|
678
|
-
{
|
|
679
|
-
to: "Inscription Service",
|
|
680
|
-
amount: totalCostHbar,
|
|
681
|
-
description: `Inscription fee (${totalCostHbar} HBAR)`
|
|
682
|
-
}
|
|
683
|
-
];
|
|
684
|
-
const validUntil = new Date(Date.now() + 15 * 60 * 1e3).toISOString();
|
|
685
|
-
const quote = {
|
|
686
|
-
totalCostHbar,
|
|
687
|
-
validUntil,
|
|
688
|
-
breakdown: {
|
|
689
|
-
transfers
|
|
690
|
-
}
|
|
691
|
-
};
|
|
692
|
-
logger.debug("Successfully parsed transaction for quote", {
|
|
693
|
-
totalCostHbar: quote.totalCostHbar,
|
|
694
|
-
transferCount: transfers.length,
|
|
695
|
-
hasTransactionBytes: !!inscriptionResponse.transactionBytes,
|
|
696
|
-
hasTotalCost: !!inscriptionResponse.totalCost
|
|
697
|
-
});
|
|
698
|
-
return quote;
|
|
699
|
-
} catch (error) {
|
|
700
|
-
logger.error("Error parsing transaction for quote", error);
|
|
701
|
-
throw error;
|
|
702
344
|
}
|
|
345
|
+
return "unknown";
|
|
703
346
|
}
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
const progressReporter = new ProgressReporter({
|
|
707
|
-
module: "Inscriber",
|
|
708
|
-
logger,
|
|
709
|
-
callback: progressCallback
|
|
710
|
-
});
|
|
711
|
-
try {
|
|
712
|
-
logger.debug("Waiting for inscription confirmation", {
|
|
713
|
-
transactionId,
|
|
714
|
-
maxAttempts,
|
|
715
|
-
intervalMs
|
|
716
|
-
});
|
|
717
|
-
progressReporter.preparing("Preparing for inscription confirmation", 5, {
|
|
718
|
-
transactionId,
|
|
719
|
-
maxAttempts,
|
|
720
|
-
intervalMs
|
|
721
|
-
});
|
|
722
|
-
for (let attempt = 1; attempt <= maxAttempts; attempt++) {
|
|
723
|
-
progressReporter.verifying("Checking inscription status", void 0, {
|
|
724
|
-
attempt,
|
|
725
|
-
maxAttempts
|
|
726
|
-
});
|
|
727
|
-
try {
|
|
728
|
-
const result = await sdk.retrieveInscription(transactionId);
|
|
729
|
-
if (result.status === "completed" || result.completed) {
|
|
730
|
-
progressReporter.completed("Inscription confirmed", { transactionId });
|
|
731
|
-
return result;
|
|
732
|
-
}
|
|
733
|
-
progressReporter.verifying("Inscription still processing", void 0, {
|
|
734
|
-
transactionId,
|
|
735
|
-
status: result.status
|
|
736
|
-
});
|
|
737
|
-
} catch (error) {
|
|
738
|
-
const notFound = typeof error.response?.status === "number" && error.response?.status === 404;
|
|
739
|
-
if (!notFound) {
|
|
740
|
-
logger.error("Error waiting for inscription confirmation", {
|
|
741
|
-
transactionId,
|
|
742
|
-
attempt,
|
|
743
|
-
error
|
|
744
|
-
});
|
|
745
|
-
progressReporter.failed("Inscription confirmation failed", {
|
|
746
|
-
transactionId,
|
|
747
|
-
error
|
|
748
|
-
});
|
|
749
|
-
throw error;
|
|
750
|
-
}
|
|
751
|
-
logger.debug("Inscription not found yet, retrying", {
|
|
752
|
-
transactionId,
|
|
753
|
-
attempt
|
|
754
|
-
});
|
|
755
|
-
}
|
|
756
|
-
if (attempt < maxAttempts) {
|
|
757
|
-
await sleep(intervalMs);
|
|
758
|
-
}
|
|
759
|
-
}
|
|
760
|
-
const timeoutError = new Error(
|
|
761
|
-
`Inscription confirmation timed out after ${maxAttempts} attempts`
|
|
762
|
-
);
|
|
763
|
-
logger.error("Error waiting for inscription confirmation", {
|
|
764
|
-
transactionId,
|
|
765
|
-
maxAttempts,
|
|
766
|
-
intervalMs,
|
|
767
|
-
error: timeoutError
|
|
768
|
-
});
|
|
769
|
-
progressReporter.failed("Inscription confirmation failed", {
|
|
770
|
-
transactionId,
|
|
771
|
-
error: timeoutError
|
|
772
|
-
});
|
|
773
|
-
throw timeoutError;
|
|
774
|
-
} catch (error) {
|
|
775
|
-
logger.error("Error waiting for inscription confirmation", {
|
|
776
|
-
transactionId,
|
|
777
|
-
maxAttempts,
|
|
778
|
-
intervalMs,
|
|
779
|
-
error
|
|
780
|
-
});
|
|
781
|
-
progressReporter.failed("Inscription confirmation failed", {
|
|
782
|
-
transactionId,
|
|
783
|
-
error
|
|
784
|
-
});
|
|
785
|
-
throw error;
|
|
786
|
-
}
|
|
347
|
+
function getHumanReadableTransactionType(type) {
|
|
348
|
+
return humanReadableTypeRegistry[type] || "Unknown Transaction";
|
|
787
349
|
}
|
|
788
350
|
export {
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
351
|
+
getHumanReadableTransactionType,
|
|
352
|
+
getSchedulableTransactionType,
|
|
353
|
+
getTransactionTypeFromBody,
|
|
354
|
+
humanReadableTypeRegistry,
|
|
355
|
+
protoFieldToTypeRegistry,
|
|
356
|
+
schedulableTransactionTypeRegistry
|
|
794
357
|
};
|
|
795
358
|
//# sourceMappingURL=standards-sdk.es124.js.map
|