@hashgraphonline/standards-sdk 0.1.141 → 0.1.143
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 +24 -1
- package/dist/cjs/hcs-11/client.d.ts.map +1 -1
- package/dist/cjs/hcs-11/types.d.ts +1 -0
- package/dist/cjs/hcs-11/types.d.ts.map +1 -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 +14 -12
- package/dist/cjs/hcs-21/base-client.d.ts.map +1 -1
- package/dist/cjs/hcs-21/browser.d.ts +17 -7
- package/dist/cjs/hcs-21/browser.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 +70 -6
- package/dist/cjs/hcs-21/sdk.d.ts.map +1 -1
- package/dist/cjs/hcs-21/tx.d.ts +6 -2
- package/dist/cjs/hcs-21/tx.d.ts.map +1 -1
- package/dist/cjs/hcs-21/types.d.ts +751 -66
- 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 +3 -1
- package/dist/cjs/inscribe/inscriber.d.ts.map +1 -1
- package/dist/cjs/inscribe/quote-cache.d.ts.map +1 -1
- package/dist/cjs/inscribe/types.d.ts +7 -0
- package/dist/cjs/inscribe/types.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 +49 -25
- package/dist/cjs/services/registry-broker/schemas.d.ts.map +1 -1
- package/dist/cjs/services/registry-broker/types.d.ts +1 -2
- package/dist/cjs/services/registry-broker/types.d.ts.map +1 -1
- package/dist/cjs/services/types.d.ts +1 -0
- 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/dynamic-import.d.ts +1 -0
- package/dist/cjs/utils/dynamic-import.d.ts.map +1 -1
- package/dist/es/hcs-11/client.d.ts.map +1 -1
- package/dist/es/hcs-11/types.d.ts +1 -0
- package/dist/es/hcs-11/types.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 +14 -12
- package/dist/es/hcs-21/base-client.d.ts.map +1 -1
- package/dist/es/hcs-21/browser.d.ts +17 -7
- package/dist/es/hcs-21/browser.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 +70 -6
- package/dist/es/hcs-21/sdk.d.ts.map +1 -1
- package/dist/es/hcs-21/tx.d.ts +6 -2
- package/dist/es/hcs-21/tx.d.ts.map +1 -1
- package/dist/es/hcs-21/types.d.ts +751 -66
- 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 +3 -1
- package/dist/es/inscribe/inscriber.d.ts.map +1 -1
- package/dist/es/inscribe/quote-cache.d.ts.map +1 -1
- package/dist/es/inscribe/types.d.ts +7 -0
- package/dist/es/inscribe/types.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 +49 -25
- package/dist/es/services/registry-broker/schemas.d.ts.map +1 -1
- package/dist/es/services/registry-broker/types.d.ts +1 -2
- package/dist/es/services/registry-broker/types.d.ts.map +1 -1
- package/dist/es/services/types.d.ts +1 -0
- package/dist/es/services/types.d.ts.map +1 -1
- package/dist/es/standards-sdk.es.js +64 -51
- 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 -754
- package/dist/es/standards-sdk.es124.js.map +1 -1
- package/dist/es/standards-sdk.es125.js +854 -178
- 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 +28 -138
- package/dist/es/standards-sdk.es135.js.map +1 -1
- package/dist/es/standards-sdk.es136.js +133 -37
- package/dist/es/standards-sdk.es136.js.map +1 -1
- package/dist/es/standards-sdk.es137.js +42 -732
- package/dist/es/standards-sdk.es137.js.map +1 -1
- package/dist/es/standards-sdk.es138.js +746 -12254
- package/dist/es/standards-sdk.es138.js.map +1 -1
- package/dist/es/standards-sdk.es139.js +12269 -12
- 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 +20 -2
- package/dist/es/standards-sdk.es141.js.map +1 -1
- package/dist/es/standards-sdk.es142.js +13 -168
- package/dist/es/standards-sdk.es142.js.map +1 -1
- package/dist/es/standards-sdk.es143.js +139 -289
- package/dist/es/standards-sdk.es143.js.map +1 -1
- package/dist/es/standards-sdk.es144.js +274 -298
- package/dist/es/standards-sdk.es144.js.map +1 -1
- package/dist/es/standards-sdk.es145.js +262 -369
- package/dist/es/standards-sdk.es145.js.map +1 -1
- package/dist/es/standards-sdk.es146.js +316 -194
- package/dist/es/standards-sdk.es146.js.map +1 -1
- package/dist/es/standards-sdk.es147.js +319 -64
- 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 +12 -16
- package/dist/es/standards-sdk.es19.js.map +1 -1
- package/dist/es/standards-sdk.es20.js +9 -13
- 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 +16 -18
- package/dist/es/standards-sdk.es28.js.map +1 -1
- package/dist/es/standards-sdk.es29.js.map +1 -1
- package/dist/es/standards-sdk.es3.js +2 -2
- package/dist/es/standards-sdk.es31.js +2 -2
- package/dist/es/standards-sdk.es32.js +4 -4
- package/dist/es/standards-sdk.es33.js +1 -1
- package/dist/es/standards-sdk.es36.js +8 -12
- package/dist/es/standards-sdk.es36.js.map +1 -1
- package/dist/es/standards-sdk.es37.js +4 -4
- package/dist/es/standards-sdk.es38.js +2 -2
- 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 -11
- package/dist/es/standards-sdk.es61.js.map +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 +113 -29
- package/dist/es/standards-sdk.es80.js.map +1 -1
- package/dist/es/standards-sdk.es82.js +23 -4
- package/dist/es/standards-sdk.es82.js.map +1 -1
- package/dist/es/standards-sdk.es83.js +39 -14
- package/dist/es/standards-sdk.es83.js.map +1 -1
- package/dist/es/standards-sdk.es84.js +198 -17
- package/dist/es/standards-sdk.es84.js.map +1 -1
- package/dist/es/standards-sdk.es85.js +256 -9
- package/dist/es/standards-sdk.es85.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 +3 -3
|
@@ -1,764 +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
|
-
|
|
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
|
-
const startResult = await sdk.startInscription({
|
|
334
|
-
...request,
|
|
335
|
-
holderId: accountId,
|
|
336
|
-
network: options.network || "mainnet"
|
|
337
|
-
});
|
|
338
|
-
logger.info("about to start inscription", {
|
|
339
|
-
type: input.type,
|
|
340
|
-
mode: options.mode || "file",
|
|
341
|
-
jobId: startResult.id || startResult.tx_id,
|
|
342
|
-
...startResult
|
|
343
|
-
});
|
|
344
|
-
if (typeof startResult?.transactionBytes === "string") {
|
|
345
|
-
logger.debug("Executing inscription transaction with signer from bytes");
|
|
346
|
-
await sdk.executeTransactionWithSigner(
|
|
347
|
-
startResult.transactionBytes,
|
|
348
|
-
signer
|
|
349
|
-
);
|
|
350
|
-
} else if (startResult?.transactionBytes?.type === "Buffer") {
|
|
351
|
-
logger.debug("Executing inscription transaction with signer from buffer");
|
|
352
|
-
await sdk.executeTransactionWithSigner(
|
|
353
|
-
Buffer.from(startResult.transactionBytes.data).toString("base64"),
|
|
354
|
-
signer
|
|
355
|
-
);
|
|
356
|
-
}
|
|
357
|
-
if (options.waitForConfirmation) {
|
|
358
|
-
logger.debug("Waiting for inscription confirmation (websocket)", {
|
|
359
|
-
jobId: startResult.id || startResult.tx_id,
|
|
360
|
-
maxAttempts: options.waitMaxAttempts,
|
|
361
|
-
intervalMs: options.waitIntervalMs
|
|
362
|
-
});
|
|
363
|
-
const trackingId = startResult.tx_id || startResult.id;
|
|
364
|
-
const inscription = await waitForInscriptionConfirmation(
|
|
365
|
-
sdk,
|
|
366
|
-
trackingId,
|
|
367
|
-
options.waitMaxAttempts,
|
|
368
|
-
options.waitIntervalMs,
|
|
369
|
-
options.progressCallback
|
|
370
|
-
);
|
|
371
|
-
logger.info("Inscription confirmation received", {
|
|
372
|
-
jobId: trackingId
|
|
373
|
-
});
|
|
374
|
-
return {
|
|
375
|
-
confirmed: true,
|
|
376
|
-
result: {
|
|
377
|
-
jobId: startResult.id || startResult.tx_id,
|
|
378
|
-
transactionId: startResult.tx_id || "",
|
|
379
|
-
topic_id: startResult.topic_id,
|
|
380
|
-
status: startResult.status,
|
|
381
|
-
completed: startResult.completed
|
|
382
|
-
},
|
|
383
|
-
inscription,
|
|
384
|
-
sdk
|
|
385
|
-
};
|
|
386
|
-
}
|
|
387
|
-
return {
|
|
388
|
-
confirmed: false,
|
|
389
|
-
result: {
|
|
390
|
-
jobId: startResult.id || startResult.tx_id,
|
|
391
|
-
transactionId: startResult.tx_id || "",
|
|
392
|
-
topic_id: startResult.topic_id,
|
|
393
|
-
status: startResult.status,
|
|
394
|
-
completed: startResult.completed
|
|
395
|
-
},
|
|
396
|
-
sdk
|
|
397
|
-
};
|
|
398
|
-
} catch (error) {
|
|
399
|
-
logger.error("Error during inscription process", error);
|
|
400
|
-
throw error;
|
|
401
|
-
}
|
|
402
|
-
}
|
|
403
|
-
async function retrieveInscription(transactionId, options) {
|
|
404
|
-
const logger = Logger.getInstance({
|
|
405
|
-
module: "Inscriber",
|
|
406
|
-
...options?.logging || {}
|
|
407
|
-
});
|
|
408
|
-
const formattedTransactionId = transactionId.includes("@") ? `${transactionId.split("@")[0]}-${transactionId.split("@")[1].replace(/\./g, "-")}` : transactionId;
|
|
409
|
-
logger.info("Retrieving inscription", {
|
|
410
|
-
originalTransactionId: transactionId,
|
|
411
|
-
formattedTransactionId
|
|
412
|
-
});
|
|
413
|
-
try {
|
|
414
|
-
let sdk;
|
|
415
|
-
if (options?.apiKey) {
|
|
416
|
-
logger.debug("Initializing InscriptionSDK with API key");
|
|
417
|
-
sdk = new InscriptionSDK({
|
|
418
|
-
apiKey: options.apiKey,
|
|
419
|
-
network: options.network || "mainnet"
|
|
420
|
-
});
|
|
421
|
-
} else if (options?.accountId && options?.privateKey) {
|
|
422
|
-
logger.debug("Initializing InscriptionSDK with server auth");
|
|
423
|
-
sdk = await InscriptionSDK.createWithAuth({
|
|
424
|
-
type: "server",
|
|
425
|
-
accountId: options.accountId,
|
|
426
|
-
privateKey: options.privateKey,
|
|
427
|
-
network: options.network || "mainnet"
|
|
428
|
-
});
|
|
429
|
-
} else {
|
|
430
|
-
const error = new Error(
|
|
431
|
-
"Either API key or account ID and private key are required for retrieving inscriptions"
|
|
432
|
-
);
|
|
433
|
-
logger.error("Missing authentication credentials", {
|
|
434
|
-
hasApiKey: Boolean(options?.apiKey),
|
|
435
|
-
hasAccountId: Boolean(options?.accountId),
|
|
436
|
-
hasPrivateKey: Boolean(options?.privateKey)
|
|
437
|
-
});
|
|
438
|
-
throw error;
|
|
439
|
-
}
|
|
440
|
-
logger.debug("Initialized SDK for inscription retrieval", {
|
|
441
|
-
formattedTransactionId,
|
|
442
|
-
network: options.network || "mainnet"
|
|
443
|
-
});
|
|
444
|
-
const result = await sdk.retrieveInscription(formattedTransactionId);
|
|
445
|
-
logger.info("Successfully retrieved inscription", {
|
|
446
|
-
formattedTransactionId
|
|
447
|
-
});
|
|
448
|
-
return result;
|
|
449
|
-
} catch (error) {
|
|
450
|
-
logger.error("Error retrieving inscription", {
|
|
451
|
-
formattedTransactionId,
|
|
452
|
-
error
|
|
453
|
-
});
|
|
454
|
-
throw error;
|
|
455
|
-
}
|
|
456
|
-
}
|
|
457
|
-
function validateHashinalMetadata(metadata, logger) {
|
|
458
|
-
const requiredFields = ["name", "creator", "description", "type"];
|
|
459
|
-
const missingFields = requiredFields.filter((field) => !metadata[field]);
|
|
460
|
-
if (missingFields.length > 0) {
|
|
461
|
-
const error = new Error(
|
|
462
|
-
`Missing required Hashinal metadata fields: ${missingFields.join(", ")}`
|
|
463
|
-
);
|
|
464
|
-
logger.error("Hashinal metadata validation failed", { missingFields });
|
|
465
|
-
throw error;
|
|
466
|
-
}
|
|
467
|
-
logger.debug("Hashinal metadata validation passed", {
|
|
468
|
-
name: metadata.name,
|
|
469
|
-
creator: metadata.creator,
|
|
470
|
-
description: metadata.description,
|
|
471
|
-
type: metadata.type,
|
|
472
|
-
hasAttributes: !!metadata.attributes,
|
|
473
|
-
hasProperties: !!metadata.properties
|
|
474
|
-
});
|
|
475
|
-
}
|
|
476
|
-
async function generateQuote(input, clientConfig, options, existingSDK) {
|
|
477
|
-
const logger = Logger.getInstance({
|
|
478
|
-
module: "Inscriber",
|
|
479
|
-
...options.logging
|
|
480
|
-
});
|
|
481
|
-
logger.info("Generating inscription quote", {
|
|
482
|
-
type: input.type,
|
|
483
|
-
mode: options.mode || "file",
|
|
484
|
-
...input.type === "url" ? { url: input.url } : {},
|
|
485
|
-
...input.type === "file" ? { path: input.path } : {},
|
|
486
|
-
...input.type === "buffer" ? { fileName: input.fileName, bufferSize: input.buffer.byteLength } : {}
|
|
487
|
-
});
|
|
488
|
-
try {
|
|
489
|
-
validateQuoteParameters(input, clientConfig, options);
|
|
490
|
-
const cachedQuote = getCachedQuote(input, clientConfig, options);
|
|
491
|
-
if (cachedQuote) {
|
|
492
|
-
logger.debug("Returning cached quote");
|
|
493
|
-
return {
|
|
494
|
-
confirmed: false,
|
|
495
|
-
quote: true,
|
|
496
|
-
result: cachedQuote
|
|
497
|
-
};
|
|
498
|
-
}
|
|
499
|
-
if (options.mode === "hashinal" && options.metadata) {
|
|
500
|
-
validateHashinalMetadata(options.metadata, logger);
|
|
501
|
-
}
|
|
502
|
-
const sdk = await getOrCreateSDK(clientConfig, options, existingSDK);
|
|
503
|
-
const baseRequest = {
|
|
504
|
-
holderId: clientConfig.accountId,
|
|
505
|
-
metadata: options.metadata || {},
|
|
506
|
-
tags: options.tags || [],
|
|
507
|
-
mode: options.mode || "file",
|
|
508
|
-
fileStandard: options.fileStandard,
|
|
509
|
-
chunkSize: options.chunkSize
|
|
510
|
-
};
|
|
511
|
-
let request;
|
|
512
|
-
switch (input.type) {
|
|
513
|
-
case "url":
|
|
514
|
-
request = {
|
|
515
|
-
...baseRequest,
|
|
516
|
-
file: {
|
|
517
|
-
type: "url",
|
|
518
|
-
url: input.url
|
|
519
|
-
}
|
|
520
|
-
};
|
|
521
|
-
break;
|
|
522
|
-
case "file": {
|
|
523
|
-
const fileData = await convertFileToBase64(input.path);
|
|
524
|
-
request = {
|
|
525
|
-
...baseRequest,
|
|
526
|
-
file: {
|
|
527
|
-
type: "base64",
|
|
528
|
-
base64: fileData.base64,
|
|
529
|
-
fileName: fileData.fileName,
|
|
530
|
-
mimeType: fileData.mimeType
|
|
531
|
-
}
|
|
532
|
-
};
|
|
533
|
-
break;
|
|
534
|
-
}
|
|
535
|
-
case "buffer":
|
|
536
|
-
request = {
|
|
537
|
-
...baseRequest,
|
|
538
|
-
file: {
|
|
539
|
-
type: "base64",
|
|
540
|
-
base64: Buffer.from(
|
|
541
|
-
input.buffer instanceof ArrayBuffer ? new Uint8Array(input.buffer) : input.buffer
|
|
542
|
-
).toString("base64"),
|
|
543
|
-
fileName: input.fileName,
|
|
544
|
-
mimeType: input.mimeType
|
|
545
|
-
}
|
|
546
|
-
};
|
|
547
|
-
break;
|
|
548
|
-
}
|
|
549
|
-
if (options.mode === "hashinal") {
|
|
550
|
-
request.metadataObject = options.metadata;
|
|
551
|
-
request.creator = options.metadata?.creator || clientConfig.accountId;
|
|
552
|
-
request.description = options.metadata?.description;
|
|
553
|
-
if (options.jsonFileURL) {
|
|
554
|
-
request.jsonFileURL = options.jsonFileURL;
|
|
555
|
-
}
|
|
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;
|
|
556
333
|
}
|
|
557
|
-
logger.debug("Calling inscription SDK startInscription for quote", {
|
|
558
|
-
type: input.type,
|
|
559
|
-
mode: options.mode || "file",
|
|
560
|
-
holderId: clientConfig.accountId
|
|
561
|
-
});
|
|
562
|
-
const inscriptionResponse = await sdk.startInscription(request);
|
|
563
|
-
logger.debug("Received inscription response for quote parsing", {
|
|
564
|
-
hasTransactionBytes: !!inscriptionResponse.transactionBytes,
|
|
565
|
-
bytesLength: inscriptionResponse.transactionBytes?.length || 0,
|
|
566
|
-
transactionBytesType: typeof inscriptionResponse.transactionBytes,
|
|
567
|
-
totalCost: inscriptionResponse.totalCost
|
|
568
|
-
});
|
|
569
|
-
const quote = await parseTransactionForQuote(
|
|
570
|
-
inscriptionResponse,
|
|
571
|
-
logger
|
|
572
|
-
);
|
|
573
|
-
cacheQuote(input, clientConfig, options, quote);
|
|
574
|
-
logger.info("Successfully generated inscription quote", {
|
|
575
|
-
totalCostHbar: quote.totalCostHbar
|
|
576
|
-
});
|
|
577
|
-
return {
|
|
578
|
-
confirmed: false,
|
|
579
|
-
quote: true,
|
|
580
|
-
result: quote
|
|
581
|
-
};
|
|
582
|
-
} catch (error) {
|
|
583
|
-
logger.error("Error generating inscription quote", error);
|
|
584
|
-
throw error;
|
|
585
334
|
}
|
|
335
|
+
return { type: "UNKNOWN", humanReadableType: "Unknown Transaction" };
|
|
586
336
|
}
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
logger.debug("Using totalCost from inscription response", {
|
|
594
|
-
totalCostTinybars: inscriptionResponse.totalCost,
|
|
595
|
-
totalCostHbar
|
|
596
|
-
});
|
|
597
|
-
} else if (inscriptionResponse.transactionBytes) {
|
|
598
|
-
logger.debug("Parsing transaction bytes for cost information");
|
|
599
|
-
try {
|
|
600
|
-
let transactionBytesString;
|
|
601
|
-
if (typeof inscriptionResponse.transactionBytes === "string") {
|
|
602
|
-
transactionBytesString = inscriptionResponse.transactionBytes;
|
|
603
|
-
} else if (inscriptionResponse.transactionBytes && typeof inscriptionResponse.transactionBytes === "object" && "data" in inscriptionResponse.transactionBytes) {
|
|
604
|
-
const buffer = Buffer.from(inscriptionResponse.transactionBytes.data);
|
|
605
|
-
transactionBytesString = buffer.toString("base64");
|
|
606
|
-
} else {
|
|
607
|
-
throw new Error("Invalid transactionBytes format");
|
|
608
|
-
}
|
|
609
|
-
logger.debug("About to parse transaction bytes", {
|
|
610
|
-
bytesLength: transactionBytesString.length,
|
|
611
|
-
bytesPreview: transactionBytesString.slice(0, 100)
|
|
612
|
-
});
|
|
613
|
-
const parsedTransaction = await TransactionParser.parseTransactionBytes(
|
|
614
|
-
transactionBytesString,
|
|
615
|
-
{ includeRaw: false }
|
|
616
|
-
);
|
|
617
|
-
logger.debug("Parsed transaction for quote", {
|
|
618
|
-
type: parsedTransaction.type,
|
|
619
|
-
hasTransfers: !!parsedTransaction.transfers,
|
|
620
|
-
transferCount: parsedTransaction.transfers?.length || 0,
|
|
621
|
-
transfers: parsedTransaction.transfers
|
|
622
|
-
});
|
|
623
|
-
let totalTransferAmount = 0;
|
|
624
|
-
if (parsedTransaction.transfers && parsedTransaction.transfers.length > 0) {
|
|
625
|
-
for (const transfer of parsedTransaction.transfers) {
|
|
626
|
-
const transferAmount = typeof transfer.amount === "string" ? parseFloat(transfer.amount) : transfer.amount;
|
|
627
|
-
if (transferAmount < 0) {
|
|
628
|
-
const amountHbar = Math.abs(transferAmount);
|
|
629
|
-
totalTransferAmount += amountHbar;
|
|
630
|
-
logger.debug("Found HBAR transfer", {
|
|
631
|
-
from: transfer.accountId,
|
|
632
|
-
to: "service",
|
|
633
|
-
amount: amountHbar
|
|
634
|
-
});
|
|
635
|
-
}
|
|
636
|
-
}
|
|
637
|
-
}
|
|
638
|
-
if (totalTransferAmount > 0) {
|
|
639
|
-
totalCostHbar = totalTransferAmount.toString();
|
|
640
|
-
logger.debug("Using parsed transaction transfer amount", {
|
|
641
|
-
totalTransferAmount,
|
|
642
|
-
totalCostHbar
|
|
643
|
-
});
|
|
644
|
-
}
|
|
645
|
-
} catch (parseError) {
|
|
646
|
-
logger.warn(
|
|
647
|
-
"Could not parse transaction bytes, using totalCost fallback",
|
|
648
|
-
{
|
|
649
|
-
error: parseError,
|
|
650
|
-
errorMessage: parseError instanceof Error ? parseError.message : String(parseError)
|
|
651
|
-
}
|
|
652
|
-
);
|
|
653
|
-
}
|
|
337
|
+
function getSchedulableTransactionType(txBody) {
|
|
338
|
+
for (const [field, type] of Object.entries(
|
|
339
|
+
schedulableTransactionTypeRegistry
|
|
340
|
+
)) {
|
|
341
|
+
if (txBody[field]) {
|
|
342
|
+
return type;
|
|
654
343
|
}
|
|
655
|
-
const transfers = [
|
|
656
|
-
{
|
|
657
|
-
to: "Inscription Service",
|
|
658
|
-
amount: totalCostHbar,
|
|
659
|
-
description: `Inscription fee (${totalCostHbar} HBAR)`
|
|
660
|
-
}
|
|
661
|
-
];
|
|
662
|
-
const validUntil = new Date(Date.now() + 15 * 60 * 1e3).toISOString();
|
|
663
|
-
const quote = {
|
|
664
|
-
totalCostHbar,
|
|
665
|
-
validUntil,
|
|
666
|
-
breakdown: {
|
|
667
|
-
transfers
|
|
668
|
-
}
|
|
669
|
-
};
|
|
670
|
-
logger.debug("Successfully parsed transaction for quote", {
|
|
671
|
-
totalCostHbar: quote.totalCostHbar,
|
|
672
|
-
transferCount: transfers.length,
|
|
673
|
-
hasTransactionBytes: !!inscriptionResponse.transactionBytes,
|
|
674
|
-
hasTotalCost: !!inscriptionResponse.totalCost
|
|
675
|
-
});
|
|
676
|
-
return quote;
|
|
677
|
-
} catch (error) {
|
|
678
|
-
logger.error("Error parsing transaction for quote", error);
|
|
679
|
-
throw error;
|
|
680
344
|
}
|
|
345
|
+
return "unknown";
|
|
681
346
|
}
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
const progressReporter = new ProgressReporter({
|
|
685
|
-
module: "Inscriber",
|
|
686
|
-
logger,
|
|
687
|
-
callback: progressCallback
|
|
688
|
-
});
|
|
689
|
-
try {
|
|
690
|
-
logger.debug("Waiting for inscription confirmation", {
|
|
691
|
-
transactionId,
|
|
692
|
-
maxAttempts,
|
|
693
|
-
intervalMs
|
|
694
|
-
});
|
|
695
|
-
progressReporter.preparing("Preparing for inscription confirmation", 5, {
|
|
696
|
-
transactionId,
|
|
697
|
-
maxAttempts,
|
|
698
|
-
intervalMs
|
|
699
|
-
});
|
|
700
|
-
try {
|
|
701
|
-
const waitMethod = sdk.waitForInscription.bind(sdk);
|
|
702
|
-
const wrappedCallback = (data) => {
|
|
703
|
-
const stageRaw = data.stage || "confirming";
|
|
704
|
-
const allowedStages = [
|
|
705
|
-
"preparing",
|
|
706
|
-
"submitting",
|
|
707
|
-
"confirming",
|
|
708
|
-
"verifying",
|
|
709
|
-
"completed",
|
|
710
|
-
"failed"
|
|
711
|
-
];
|
|
712
|
-
const stage = allowedStages.includes(stageRaw) ? stageRaw : "confirming";
|
|
713
|
-
const message = data.message || "Processing inscription";
|
|
714
|
-
const percent = data.progressPercent || 50;
|
|
715
|
-
progressReporter.report({
|
|
716
|
-
stage,
|
|
717
|
-
message,
|
|
718
|
-
progressPercent: percent,
|
|
719
|
-
details: data.details
|
|
720
|
-
});
|
|
721
|
-
};
|
|
722
|
-
return await waitMethod(
|
|
723
|
-
transactionId,
|
|
724
|
-
maxAttempts,
|
|
725
|
-
intervalMs,
|
|
726
|
-
true,
|
|
727
|
-
wrappedCallback
|
|
728
|
-
);
|
|
729
|
-
} catch (e) {
|
|
730
|
-
logger.debug("Falling back to standard waitForInscription method", {
|
|
731
|
-
error: e
|
|
732
|
-
});
|
|
733
|
-
progressReporter.verifying("Verifying inscription status", 50, {
|
|
734
|
-
error: e
|
|
735
|
-
});
|
|
736
|
-
return await sdk.waitForInscription(
|
|
737
|
-
transactionId,
|
|
738
|
-
maxAttempts,
|
|
739
|
-
intervalMs,
|
|
740
|
-
true
|
|
741
|
-
);
|
|
742
|
-
}
|
|
743
|
-
} catch (error) {
|
|
744
|
-
logger.error("Error waiting for inscription confirmation", {
|
|
745
|
-
transactionId,
|
|
746
|
-
maxAttempts,
|
|
747
|
-
intervalMs,
|
|
748
|
-
error
|
|
749
|
-
});
|
|
750
|
-
progressReporter.failed("Inscription confirmation failed", {
|
|
751
|
-
transactionId,
|
|
752
|
-
error
|
|
753
|
-
});
|
|
754
|
-
throw error;
|
|
755
|
-
}
|
|
347
|
+
function getHumanReadableTransactionType(type) {
|
|
348
|
+
return humanReadableTypeRegistry[type] || "Unknown Transaction";
|
|
756
349
|
}
|
|
757
350
|
export {
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
351
|
+
getHumanReadableTransactionType,
|
|
352
|
+
getSchedulableTransactionType,
|
|
353
|
+
getTransactionTypeFromBody,
|
|
354
|
+
humanReadableTypeRegistry,
|
|
355
|
+
protoFieldToTypeRegistry,
|
|
356
|
+
schedulableTransactionTypeRegistry
|
|
763
357
|
};
|
|
764
358
|
//# sourceMappingURL=standards-sdk.es124.js.map
|