@hashgraphonline/standards-sdk 0.0.69 → 0.0.72
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 -0
- package/dist/es/fees/fee-config-builder.d.ts +93 -45
- package/dist/es/fees/fee-config-builder.d.ts.map +1 -1
- package/dist/es/fees/types.d.ts +14 -12
- package/dist/es/fees/types.d.ts.map +1 -1
- package/dist/es/hcs-10/base-client.d.ts +53 -1
- package/dist/es/hcs-10/base-client.d.ts.map +1 -1
- package/dist/es/hcs-10/browser.d.ts +0 -1
- package/dist/es/hcs-10/browser.d.ts.map +1 -1
- package/dist/es/hcs-10/sdk.d.ts +9 -2
- package/dist/es/hcs-10/sdk.d.ts.map +1 -1
- package/dist/es/services/mirror-node.d.ts +74 -1
- package/dist/es/services/mirror-node.d.ts.map +1 -1
- package/dist/es/services/types.d.ts +29 -0
- package/dist/es/services/types.d.ts.map +1 -1
- package/dist/es/standards-sdk.es.js +2 -0
- package/dist/es/standards-sdk.es.js.map +1 -1
- package/dist/es/standards-sdk.es100.js +13 -4
- package/dist/es/standards-sdk.es100.js.map +1 -1
- package/dist/es/standards-sdk.es101.js +13 -4
- package/dist/es/standards-sdk.es101.js.map +1 -1
- package/dist/es/standards-sdk.es102.js +1 -1
- package/dist/es/standards-sdk.es104.js +3 -3
- package/dist/es/standards-sdk.es105.js +8 -8
- package/dist/es/standards-sdk.es106.js +3 -3
- package/dist/es/standards-sdk.es108.js +2282 -3
- package/dist/es/standards-sdk.es108.js.map +1 -1
- package/dist/es/standards-sdk.es109.js +34 -2
- package/dist/es/standards-sdk.es109.js.map +1 -1
- package/dist/es/standards-sdk.es110.js +33 -2
- package/dist/es/standards-sdk.es110.js.map +1 -1
- package/dist/es/standards-sdk.es111.js +9 -34
- package/dist/es/standards-sdk.es111.js.map +1 -1
- package/dist/es/standards-sdk.es112.js +32 -31
- package/dist/es/standards-sdk.es112.js.map +1 -1
- package/dist/es/standards-sdk.es113.js +3 -9
- package/dist/es/standards-sdk.es113.js.map +1 -1
- package/dist/es/standards-sdk.es114.js +2 -34
- package/dist/es/standards-sdk.es114.js.map +1 -1
- package/dist/es/standards-sdk.es115.js +5 -0
- package/dist/es/standards-sdk.es115.js.map +1 -0
- package/dist/es/standards-sdk.es12.js +1 -1
- package/dist/es/standards-sdk.es14.js +1 -1
- package/dist/es/standards-sdk.es17.js +1 -1
- package/dist/es/standards-sdk.es18.js +93 -5
- package/dist/es/standards-sdk.es18.js.map +1 -1
- package/dist/es/standards-sdk.es19.js +127 -67
- package/dist/es/standards-sdk.es19.js.map +1 -1
- package/dist/es/standards-sdk.es20.js +7 -1041
- package/dist/es/standards-sdk.es20.js.map +1 -1
- package/dist/es/standards-sdk.es22.js +6627 -36
- package/dist/es/standards-sdk.es22.js.map +1 -1
- package/dist/es/standards-sdk.es23.js +1039 -46
- package/dist/es/standards-sdk.es23.js.map +1 -1
- package/dist/es/standards-sdk.es24.js +36 -6627
- package/dist/es/standards-sdk.es24.js.map +1 -1
- package/dist/es/standards-sdk.es25.js +48 -3
- package/dist/es/standards-sdk.es25.js.map +1 -1
- package/dist/es/standards-sdk.es26.js +3 -2
- package/dist/es/standards-sdk.es26.js.map +1 -1
- package/dist/es/standards-sdk.es27.js +2 -5
- package/dist/es/standards-sdk.es27.js.map +1 -1
- package/dist/es/standards-sdk.es29.js +5 -419
- package/dist/es/standards-sdk.es29.js.map +1 -1
- package/dist/es/standards-sdk.es30.js +419 -2
- package/dist/es/standards-sdk.es30.js.map +1 -1
- package/dist/es/standards-sdk.es31.js +2 -120
- package/dist/es/standards-sdk.es31.js.map +1 -1
- package/dist/es/standards-sdk.es32.js +120 -3
- package/dist/es/standards-sdk.es32.js.map +1 -1
- package/dist/es/standards-sdk.es33.js +3 -164
- package/dist/es/standards-sdk.es33.js.map +1 -1
- package/dist/es/standards-sdk.es34.js +164 -2
- package/dist/es/standards-sdk.es34.js.map +1 -1
- package/dist/es/standards-sdk.es35.js +3 -194
- package/dist/es/standards-sdk.es35.js.map +1 -1
- package/dist/es/standards-sdk.es36.js +2 -438
- package/dist/es/standards-sdk.es36.js.map +1 -1
- package/dist/es/standards-sdk.es37.js +358 -19
- package/dist/es/standards-sdk.es37.js.map +1 -1
- package/dist/es/standards-sdk.es38.js +5 -138
- package/dist/es/standards-sdk.es38.js.map +1 -1
- package/dist/es/standards-sdk.es39.js +174 -13
- package/dist/es/standards-sdk.es39.js.map +1 -1
- package/dist/es/standards-sdk.es4.js +1 -1
- package/dist/es/standards-sdk.es40.js +75 -23
- package/dist/es/standards-sdk.es40.js.map +1 -1
- package/dist/es/standards-sdk.es41.js +111 -26
- package/dist/es/standards-sdk.es41.js.map +1 -1
- package/dist/es/standards-sdk.es42.js +47 -16
- package/dist/es/standards-sdk.es42.js.map +1 -1
- package/dist/es/standards-sdk.es43.js +9 -43
- package/dist/es/standards-sdk.es43.js.map +1 -1
- package/dist/es/standards-sdk.es44.js +92 -13
- package/dist/es/standards-sdk.es44.js.map +1 -1
- package/dist/es/standards-sdk.es45.js +3 -60
- package/dist/es/standards-sdk.es45.js.map +1 -1
- package/dist/es/standards-sdk.es46.js +2 -1289
- package/dist/es/standards-sdk.es46.js.map +1 -1
- package/dist/es/standards-sdk.es47.js +98 -133
- package/dist/es/standards-sdk.es47.js.map +1 -1
- package/dist/es/standards-sdk.es48.js +69 -86
- package/dist/es/standards-sdk.es48.js.map +1 -1
- package/dist/es/standards-sdk.es49.js +5 -83
- package/dist/es/standards-sdk.es49.js.map +1 -1
- package/dist/es/standards-sdk.es5.js +128 -2
- package/dist/es/standards-sdk.es5.js.map +1 -1
- package/dist/es/standards-sdk.es50.js +4 -31
- package/dist/es/standards-sdk.es50.js.map +1 -1
- package/dist/es/standards-sdk.es51.js +220 -5
- package/dist/es/standards-sdk.es51.js.map +1 -1
- package/dist/es/standards-sdk.es52.js +53 -154
- package/dist/es/standards-sdk.es52.js.map +1 -1
- package/dist/es/standards-sdk.es53.js +68 -22
- package/dist/es/standards-sdk.es53.js.map +1 -1
- package/dist/es/standards-sdk.es54.js +19 -789
- package/dist/es/standards-sdk.es54.js.map +1 -1
- package/dist/es/standards-sdk.es55.js +3 -3
- package/dist/es/standards-sdk.es56.js +78 -130
- package/dist/es/standards-sdk.es56.js.map +1 -1
- package/dist/es/standards-sdk.es57.js +194 -3
- package/dist/es/standards-sdk.es57.js.map +1 -1
- package/dist/es/standards-sdk.es58.js +430 -13
- package/dist/es/standards-sdk.es58.js.map +1 -1
- package/dist/es/standards-sdk.es59.js +23 -25
- package/dist/es/standards-sdk.es59.js.map +1 -1
- package/dist/es/standards-sdk.es60.js +136 -23
- package/dist/es/standards-sdk.es60.js.map +1 -1
- package/dist/es/standards-sdk.es61.js +16 -36
- package/dist/es/standards-sdk.es61.js.map +1 -1
- package/dist/es/standards-sdk.es62.js +21 -356
- package/dist/es/standards-sdk.es62.js.map +1 -1
- package/dist/es/standards-sdk.es63.js +28 -5
- package/dist/es/standards-sdk.es63.js.map +1 -1
- package/dist/es/standards-sdk.es64.js +15 -173
- package/dist/es/standards-sdk.es64.js.map +1 -1
- package/dist/es/standards-sdk.es65.js +37 -74
- package/dist/es/standards-sdk.es65.js.map +1 -1
- package/dist/es/standards-sdk.es66.js +16 -112
- package/dist/es/standards-sdk.es66.js.map +1 -1
- package/dist/es/standards-sdk.es67.js +56 -47
- package/dist/es/standards-sdk.es67.js.map +1 -1
- package/dist/es/standards-sdk.es68.js +1288 -9
- package/dist/es/standards-sdk.es68.js.map +1 -1
- package/dist/es/standards-sdk.es69.js +134 -83
- package/dist/es/standards-sdk.es69.js.map +1 -1
- package/dist/es/standards-sdk.es7.js +95 -81
- package/dist/es/standards-sdk.es7.js.map +1 -1
- package/dist/es/standards-sdk.es70.js +83 -3
- package/dist/es/standards-sdk.es70.js.map +1 -1
- package/dist/es/standards-sdk.es71.js +32 -2
- package/dist/es/standards-sdk.es71.js.map +1 -1
- package/dist/es/standards-sdk.es72.js +5 -112
- package/dist/es/standards-sdk.es72.js.map +1 -1
- package/dist/es/standards-sdk.es73.js +154 -69
- package/dist/es/standards-sdk.es73.js.map +1 -1
- package/dist/es/standards-sdk.es74.js +792 -5
- package/dist/es/standards-sdk.es74.js.map +1 -1
- package/dist/es/standards-sdk.es75.js +142 -4
- package/dist/es/standards-sdk.es75.js.map +1 -1
- package/dist/es/standards-sdk.es76.js +26 -215
- package/dist/es/standards-sdk.es76.js.map +1 -1
- package/dist/es/standards-sdk.es77.js +60 -55
- package/dist/es/standards-sdk.es77.js.map +1 -1
- package/dist/es/standards-sdk.es78.js +50 -69
- package/dist/es/standards-sdk.es78.js.map +1 -1
- package/dist/es/standards-sdk.es79.js +9 -100
- package/dist/es/standards-sdk.es79.js.map +1 -1
- package/dist/es/standards-sdk.es8.js +2 -47
- package/dist/es/standards-sdk.es8.js.map +1 -1
- package/dist/es/standards-sdk.es80.js +65 -2
- package/dist/es/standards-sdk.es80.js.map +1 -1
- package/dist/es/standards-sdk.es81.js +6 -16
- package/dist/es/standards-sdk.es81.js.map +1 -1
- package/dist/es/standards-sdk.es82.js +13 -407
- package/dist/es/standards-sdk.es82.js.map +1 -1
- package/dist/es/standards-sdk.es83.js +7 -32
- package/dist/es/standards-sdk.es83.js.map +1 -1
- package/dist/es/standards-sdk.es84.js +43 -61
- package/dist/es/standards-sdk.es84.js.map +1 -1
- package/dist/es/standards-sdk.es85.js +2 -50
- package/dist/es/standards-sdk.es85.js.map +1 -1
- package/dist/es/standards-sdk.es86.js +136 -10
- package/dist/es/standards-sdk.es86.js.map +1 -1
- package/dist/es/standards-sdk.es87.js +164 -57
- package/dist/es/standards-sdk.es87.js.map +1 -1
- package/dist/es/standards-sdk.es88.js +27 -6
- package/dist/es/standards-sdk.es88.js.map +1 -1
- package/dist/es/standards-sdk.es89.js +25 -14
- package/dist/es/standards-sdk.es89.js.map +1 -1
- package/dist/es/standards-sdk.es9.js +1 -1
- package/dist/es/standards-sdk.es90.js +38 -7
- package/dist/es/standards-sdk.es90.js.map +1 -1
- package/dist/es/standards-sdk.es91.js +21 -45
- package/dist/es/standards-sdk.es91.js.map +1 -1
- package/dist/es/standards-sdk.es92.js +101 -2
- package/dist/es/standards-sdk.es92.js.map +1 -1
- package/dist/es/standards-sdk.es93.js +2 -136
- package/dist/es/standards-sdk.es93.js.map +1 -1
- package/dist/es/standards-sdk.es94.js +16 -172
- package/dist/es/standards-sdk.es94.js.map +1 -1
- package/dist/es/standards-sdk.es95.js +409 -2282
- package/dist/es/standards-sdk.es95.js.map +1 -1
- package/dist/es/standards-sdk.es96.js +31 -12
- package/dist/es/standards-sdk.es96.js.map +1 -1
- package/dist/es/standards-sdk.es97.js +15 -13
- package/dist/es/standards-sdk.es97.js.map +1 -1
- package/dist/es/standards-sdk.es98.js +3 -31
- package/dist/es/standards-sdk.es98.js.map +1 -1
- package/dist/es/standards-sdk.es99.js +3 -14
- package/dist/es/standards-sdk.es99.js.map +1 -1
- package/dist/es/utils/index.d.ts +1 -0
- package/dist/es/utils/index.d.ts.map +1 -1
- package/dist/es/utils/types.d.ts +3 -0
- package/dist/es/utils/types.d.ts.map +1 -1
- package/dist/umd/fees/fee-config-builder.d.ts +93 -45
- package/dist/umd/fees/fee-config-builder.d.ts.map +1 -1
- package/dist/umd/fees/types.d.ts +14 -12
- package/dist/umd/fees/types.d.ts.map +1 -1
- package/dist/umd/hcs-10/base-client.d.ts +53 -1
- package/dist/umd/hcs-10/base-client.d.ts.map +1 -1
- package/dist/umd/hcs-10/browser.d.ts +0 -1
- package/dist/umd/hcs-10/browser.d.ts.map +1 -1
- package/dist/umd/hcs-10/sdk.d.ts +9 -2
- package/dist/umd/hcs-10/sdk.d.ts.map +1 -1
- package/dist/umd/services/mirror-node.d.ts +74 -1
- package/dist/umd/services/mirror-node.d.ts.map +1 -1
- package/dist/umd/services/types.d.ts +29 -0
- package/dist/umd/services/types.d.ts.map +1 -1
- package/dist/umd/standards-sdk.umd.js +1 -1
- package/dist/umd/standards-sdk.umd.js.map +1 -1
- package/dist/umd/utils/index.d.ts +1 -0
- package/dist/umd/utils/index.d.ts.map +1 -1
- package/dist/umd/utils/types.d.ts +3 -0
- package/dist/umd/utils/types.d.ts.map +1 -1
- package/package.json +2 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standards-sdk.es108.js","sources":[
|
|
1
|
+
{"version":3,"file":"standards-sdk.es108.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,5 +1,37 @@
|
|
|
1
|
-
|
|
1
|
+
function speedometer(samplesCount, min) {
|
|
2
|
+
samplesCount = samplesCount || 10;
|
|
3
|
+
const bytes = new Array(samplesCount);
|
|
4
|
+
const timestamps = new Array(samplesCount);
|
|
5
|
+
let head = 0;
|
|
6
|
+
let tail = 0;
|
|
7
|
+
let firstSampleTS;
|
|
8
|
+
min = min !== void 0 ? min : 1e3;
|
|
9
|
+
return function push(chunkLength) {
|
|
10
|
+
const now = Date.now();
|
|
11
|
+
const startedAt = timestamps[tail];
|
|
12
|
+
if (!firstSampleTS) {
|
|
13
|
+
firstSampleTS = now;
|
|
14
|
+
}
|
|
15
|
+
bytes[head] = chunkLength;
|
|
16
|
+
timestamps[head] = now;
|
|
17
|
+
let i = tail;
|
|
18
|
+
let bytesCount = 0;
|
|
19
|
+
while (i !== head) {
|
|
20
|
+
bytesCount += bytes[i++];
|
|
21
|
+
i = i % samplesCount;
|
|
22
|
+
}
|
|
23
|
+
head = (head + 1) % samplesCount;
|
|
24
|
+
if (head === tail) {
|
|
25
|
+
tail = (tail + 1) % samplesCount;
|
|
26
|
+
}
|
|
27
|
+
if (now - firstSampleTS < min) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
const passed = startedAt && now - startedAt;
|
|
31
|
+
return passed ? Math.round(bytesCount * 1e3 / passed) : void 0;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
2
34
|
export {
|
|
3
|
-
|
|
35
|
+
speedometer as default
|
|
4
36
|
};
|
|
5
37
|
//# sourceMappingURL=standards-sdk.es109.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standards-sdk.es109.js","sources":["../../node_modules/axios/lib/
|
|
1
|
+
{"version":3,"file":"standards-sdk.es109.js","sources":["../../node_modules/axios/lib/helpers/speedometer.js"],"sourcesContent":["'use strict';\n\n/**\n * Calculate data maxRate\n * @param {Number} [samplesCount= 10]\n * @param {Number} [min= 1000]\n * @returns {Function}\n */\nfunction speedometer(samplesCount, min) {\n samplesCount = samplesCount || 10;\n const bytes = new Array(samplesCount);\n const timestamps = new Array(samplesCount);\n let head = 0;\n let tail = 0;\n let firstSampleTS;\n\n min = min !== undefined ? min : 1000;\n\n return function push(chunkLength) {\n const now = Date.now();\n\n const startedAt = timestamps[tail];\n\n if (!firstSampleTS) {\n firstSampleTS = now;\n }\n\n bytes[head] = chunkLength;\n timestamps[head] = now;\n\n let i = tail;\n let bytesCount = 0;\n\n while (i !== head) {\n bytesCount += bytes[i++];\n i = i % samplesCount;\n }\n\n head = (head + 1) % samplesCount;\n\n if (head === tail) {\n tail = (tail + 1) % samplesCount;\n }\n\n if (now - firstSampleTS < min) {\n return;\n }\n\n const passed = startedAt && now - startedAt;\n\n return passed ? Math.round(bytesCount * 1000 / passed) : undefined;\n };\n}\n\nexport default speedometer;\n"],"names":[],"mappings":"AAQA,SAAS,YAAY,cAAc,KAAK;AACtC,iBAAe,gBAAgB;AAC/B,QAAM,QAAQ,IAAI,MAAM,YAAY;AACpC,QAAM,aAAa,IAAI,MAAM,YAAY;AACzC,MAAI,OAAO;AACX,MAAI,OAAO;AACX,MAAI;AAEJ,QAAM,QAAQ,SAAY,MAAM;AAEhC,SAAO,SAAS,KAAK,aAAa;AAChC,UAAM,MAAM,KAAK,IAAK;AAEtB,UAAM,YAAY,WAAW,IAAI;AAEjC,QAAI,CAAC,eAAe;AAClB,sBAAgB;AAAA,IACtB;AAEI,UAAM,IAAI,IAAI;AACd,eAAW,IAAI,IAAI;AAEnB,QAAI,IAAI;AACR,QAAI,aAAa;AAEjB,WAAO,MAAM,MAAM;AACjB,oBAAc,MAAM,GAAG;AACvB,UAAI,IAAI;AAAA,IACd;AAEI,YAAQ,OAAO,KAAK;AAEpB,QAAI,SAAS,MAAM;AACjB,cAAQ,OAAO,KAAK;AAAA,IAC1B;AAEI,QAAI,MAAM,gBAAgB,KAAK;AAC7B;AAAA,IACN;AAEI,UAAM,SAAS,aAAa,MAAM;AAElC,WAAO,SAAS,KAAK,MAAM,aAAa,MAAO,MAAM,IAAI;AAAA,EAC1D;AACH;","x_google_ignoreList":[0]}
|
|
@@ -1,5 +1,36 @@
|
|
|
1
|
-
|
|
1
|
+
function throttle(fn, freq) {
|
|
2
|
+
let timestamp = 0;
|
|
3
|
+
let threshold = 1e3 / freq;
|
|
4
|
+
let lastArgs;
|
|
5
|
+
let timer;
|
|
6
|
+
const invoke = (args, now = Date.now()) => {
|
|
7
|
+
timestamp = now;
|
|
8
|
+
lastArgs = null;
|
|
9
|
+
if (timer) {
|
|
10
|
+
clearTimeout(timer);
|
|
11
|
+
timer = null;
|
|
12
|
+
}
|
|
13
|
+
fn.apply(null, args);
|
|
14
|
+
};
|
|
15
|
+
const throttled = (...args) => {
|
|
16
|
+
const now = Date.now();
|
|
17
|
+
const passed = now - timestamp;
|
|
18
|
+
if (passed >= threshold) {
|
|
19
|
+
invoke(args, now);
|
|
20
|
+
} else {
|
|
21
|
+
lastArgs = args;
|
|
22
|
+
if (!timer) {
|
|
23
|
+
timer = setTimeout(() => {
|
|
24
|
+
timer = null;
|
|
25
|
+
invoke(lastArgs);
|
|
26
|
+
}, threshold - passed);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
const flush = () => lastArgs && invoke(lastArgs);
|
|
31
|
+
return [throttled, flush];
|
|
32
|
+
}
|
|
2
33
|
export {
|
|
3
|
-
|
|
34
|
+
throttle as default
|
|
4
35
|
};
|
|
5
36
|
//# sourceMappingURL=standards-sdk.es110.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standards-sdk.es110.js","sources":["../../node_modules/axios/lib/
|
|
1
|
+
{"version":3,"file":"standards-sdk.es110.js","sources":["../../node_modules/axios/lib/helpers/throttle.js"],"sourcesContent":["/**\n * Throttle decorator\n * @param {Function} fn\n * @param {Number} freq\n * @return {Function}\n */\nfunction throttle(fn, freq) {\n let timestamp = 0;\n let threshold = 1000 / freq;\n let lastArgs;\n let timer;\n\n const invoke = (args, now = Date.now()) => {\n timestamp = now;\n lastArgs = null;\n if (timer) {\n clearTimeout(timer);\n timer = null;\n }\n fn.apply(null, args);\n }\n\n const throttled = (...args) => {\n const now = Date.now();\n const passed = now - timestamp;\n if ( passed >= threshold) {\n invoke(args, now);\n } else {\n lastArgs = args;\n if (!timer) {\n timer = setTimeout(() => {\n timer = null;\n invoke(lastArgs)\n }, threshold - passed);\n }\n }\n }\n\n const flush = () => lastArgs && invoke(lastArgs);\n\n return [throttled, flush];\n}\n\nexport default throttle;\n"],"names":[],"mappings":"AAMA,SAAS,SAAS,IAAI,MAAM;AAC1B,MAAI,YAAY;AAChB,MAAI,YAAY,MAAO;AACvB,MAAI;AACJ,MAAI;AAEJ,QAAM,SAAS,CAAC,MAAM,MAAM,KAAK,IAAG,MAAO;AACzC,gBAAY;AACZ,eAAW;AACX,QAAI,OAAO;AACT,mBAAa,KAAK;AAClB,cAAQ;AAAA,IACd;AACI,OAAG,MAAM,MAAM,IAAI;AAAA,EACvB;AAEE,QAAM,YAAY,IAAI,SAAS;AAC7B,UAAM,MAAM,KAAK,IAAK;AACtB,UAAM,SAAS,MAAM;AACrB,QAAK,UAAU,WAAW;AACxB,aAAO,MAAM,GAAG;AAAA,IACtB,OAAW;AACL,iBAAW;AACX,UAAI,CAAC,OAAO;AACV,gBAAQ,WAAW,MAAM;AACvB,kBAAQ;AACR,iBAAO,QAAQ;AAAA,QACzB,GAAW,YAAY,MAAM;AAAA,MAC7B;AAAA,IACA;AAAA,EACA;AAEE,QAAM,QAAQ,MAAM,YAAY,OAAO,QAAQ;AAE/C,SAAO,CAAC,WAAW,KAAK;AAC1B;","x_google_ignoreList":[0]}
|
|
@@ -1,37 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
return function push(chunkLength) {
|
|
10
|
-
const now = Date.now();
|
|
11
|
-
const startedAt = timestamps[tail];
|
|
12
|
-
if (!firstSampleTS) {
|
|
13
|
-
firstSampleTS = now;
|
|
14
|
-
}
|
|
15
|
-
bytes[head] = chunkLength;
|
|
16
|
-
timestamps[head] = now;
|
|
17
|
-
let i = tail;
|
|
18
|
-
let bytesCount = 0;
|
|
19
|
-
while (i !== head) {
|
|
20
|
-
bytesCount += bytes[i++];
|
|
21
|
-
i = i % samplesCount;
|
|
22
|
-
}
|
|
23
|
-
head = (head + 1) % samplesCount;
|
|
24
|
-
if (head === tail) {
|
|
25
|
-
tail = (tail + 1) % samplesCount;
|
|
26
|
-
}
|
|
27
|
-
if (now - firstSampleTS < min) {
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
const passed = startedAt && now - startedAt;
|
|
31
|
-
return passed ? Math.round(bytesCount * 1e3 / passed) : void 0;
|
|
32
|
-
};
|
|
33
|
-
}
|
|
1
|
+
import platform from "./standards-sdk.es83.js";
|
|
2
|
+
const isURLSameOrigin = platform.hasStandardBrowserEnv ? /* @__PURE__ */ ((origin, isMSIE) => (url) => {
|
|
3
|
+
url = new URL(url, platform.origin);
|
|
4
|
+
return origin.protocol === url.protocol && origin.host === url.host && (isMSIE || origin.port === url.port);
|
|
5
|
+
})(
|
|
6
|
+
new URL(platform.origin),
|
|
7
|
+
platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent)
|
|
8
|
+
) : () => true;
|
|
34
9
|
export {
|
|
35
|
-
|
|
10
|
+
isURLSameOrigin as default
|
|
36
11
|
};
|
|
37
12
|
//# sourceMappingURL=standards-sdk.es111.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standards-sdk.es111.js","sources":["../../node_modules/axios/lib/helpers/
|
|
1
|
+
{"version":3,"file":"standards-sdk.es111.js","sources":["../../node_modules/axios/lib/helpers/isURLSameOrigin.js"],"sourcesContent":["import platform from '../platform/index.js';\n\nexport default platform.hasStandardBrowserEnv ? ((origin, isMSIE) => (url) => {\n url = new URL(url, platform.origin);\n\n return (\n origin.protocol === url.protocol &&\n origin.host === url.host &&\n (isMSIE || origin.port === url.port)\n );\n})(\n new URL(platform.origin),\n platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent)\n) : () => true;\n"],"names":[],"mappings":";AAEA,MAAA,kBAAe,SAAS,wBAAyB,kBAAC,QAAQ,WAAW,CAAC,QAAQ;AAC5E,QAAM,IAAI,IAAI,KAAK,SAAS,MAAM;AAElC,SACE,OAAO,aAAa,IAAI,YACxB,OAAO,SAAS,IAAI,SACnB,UAAU,OAAO,SAAS,IAAI;AAEnC;AAAA,EACE,IAAI,IAAI,SAAS,MAAM;AAAA,EACvB,SAAS,aAAa,kBAAkB,KAAK,SAAS,UAAU,SAAS;AAC3E,IAAI,MAAM;","x_google_ignoreList":[0]}
|
|
@@ -1,36 +1,37 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import utils from "./standards-sdk.es37.js";
|
|
2
|
+
import platform from "./standards-sdk.es83.js";
|
|
3
|
+
const cookies = platform.hasStandardBrowserEnv ? (
|
|
4
|
+
// Standard browser envs support document.cookie
|
|
5
|
+
{
|
|
6
|
+
write(name, value, expires, path, domain, secure) {
|
|
7
|
+
const cookie = [name + "=" + encodeURIComponent(value)];
|
|
8
|
+
utils.isNumber(expires) && cookie.push("expires=" + new Date(expires).toGMTString());
|
|
9
|
+
utils.isString(path) && cookie.push("path=" + path);
|
|
10
|
+
utils.isString(domain) && cookie.push("domain=" + domain);
|
|
11
|
+
secure === true && cookie.push("secure");
|
|
12
|
+
document.cookie = cookie.join("; ");
|
|
13
|
+
},
|
|
14
|
+
read(name) {
|
|
15
|
+
const match = document.cookie.match(new RegExp("(^|;\\s*)(" + name + ")=([^;]*)"));
|
|
16
|
+
return match ? decodeURIComponent(match[3]) : null;
|
|
17
|
+
},
|
|
18
|
+
remove(name) {
|
|
19
|
+
this.write(name, "", Date.now() - 864e5);
|
|
12
20
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
timer = setTimeout(() => {
|
|
24
|
-
timer = null;
|
|
25
|
-
invoke(lastArgs);
|
|
26
|
-
}, threshold - passed);
|
|
27
|
-
}
|
|
21
|
+
}
|
|
22
|
+
) : (
|
|
23
|
+
// Non-standard browser env (web workers, react-native) lack needed support.
|
|
24
|
+
{
|
|
25
|
+
write() {
|
|
26
|
+
},
|
|
27
|
+
read() {
|
|
28
|
+
return null;
|
|
29
|
+
},
|
|
30
|
+
remove() {
|
|
28
31
|
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
return [throttled, flush];
|
|
32
|
-
}
|
|
32
|
+
}
|
|
33
|
+
);
|
|
33
34
|
export {
|
|
34
|
-
|
|
35
|
+
cookies as default
|
|
35
36
|
};
|
|
36
37
|
//# sourceMappingURL=standards-sdk.es112.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standards-sdk.es112.js","sources":["../../node_modules/axios/lib/helpers/
|
|
1
|
+
{"version":3,"file":"standards-sdk.es112.js","sources":["../../node_modules/axios/lib/helpers/cookies.js"],"sourcesContent":["import utils from './../utils.js';\nimport platform from '../platform/index.js';\n\nexport default platform.hasStandardBrowserEnv ?\n\n // Standard browser envs support document.cookie\n {\n write(name, value, expires, path, domain, secure) {\n const cookie = [name + '=' + encodeURIComponent(value)];\n\n utils.isNumber(expires) && cookie.push('expires=' + new Date(expires).toGMTString());\n\n utils.isString(path) && cookie.push('path=' + path);\n\n utils.isString(domain) && cookie.push('domain=' + domain);\n\n secure === true && cookie.push('secure');\n\n document.cookie = cookie.join('; ');\n },\n\n read(name) {\n const match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n }\n\n :\n\n // Non-standard browser env (web workers, react-native) lack needed support.\n {\n write() {},\n read() {\n return null;\n },\n remove() {}\n };\n\n"],"names":[],"mappings":";;AAGA,MAAe,UAAA,SAAS;AAAA;AAAA,EAGtB;AAAA,IACE,MAAM,MAAM,OAAO,SAAS,MAAM,QAAQ,QAAQ;AAChD,YAAM,SAAS,CAAC,OAAO,MAAM,mBAAmB,KAAK,CAAC;AAEtD,YAAM,SAAS,OAAO,KAAK,OAAO,KAAK,aAAa,IAAI,KAAK,OAAO,EAAE,YAAW,CAAE;AAEnF,YAAM,SAAS,IAAI,KAAK,OAAO,KAAK,UAAU,IAAI;AAElD,YAAM,SAAS,MAAM,KAAK,OAAO,KAAK,YAAY,MAAM;AAExD,iBAAW,QAAQ,OAAO,KAAK,QAAQ;AAEvC,eAAS,SAAS,OAAO,KAAK,IAAI;AAAA,IACnC;AAAA,IAED,KAAK,MAAM;AACT,YAAM,QAAQ,SAAS,OAAO,MAAM,IAAI,OAAO,eAAe,OAAO,WAAW,CAAC;AACjF,aAAQ,QAAQ,mBAAmB,MAAM,CAAC,CAAC,IAAI;AAAA,IAChD;AAAA,IAED,OAAO,MAAM;AACX,WAAK,MAAM,MAAM,IAAI,KAAK,IAAK,IAAG,KAAQ;AAAA,IAChD;AAAA,EACA;AAAA;AAAA;AAAA,EAKE;AAAA,IACE,QAAQ;AAAA,IAAE;AAAA,IACV,OAAO;AACL,aAAO;AAAA,IACR;AAAA,IACD,SAAS;AAAA,IAAA;AAAA,EACV;AAAA;","x_google_ignoreList":[0]}
|
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
const
|
|
3
|
-
url = new URL(url, platform.origin);
|
|
4
|
-
return origin.protocol === url.protocol && origin.host === url.host && (isMSIE || origin.port === url.port);
|
|
5
|
-
})(
|
|
6
|
-
new URL(platform.origin),
|
|
7
|
-
platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent)
|
|
8
|
-
) : () => true;
|
|
1
|
+
import AxiosURLSearchParams from "./standards-sdk.es96.js";
|
|
2
|
+
const URLSearchParams$1 = typeof URLSearchParams !== "undefined" ? URLSearchParams : AxiosURLSearchParams;
|
|
9
3
|
export {
|
|
10
|
-
|
|
4
|
+
URLSearchParams$1 as default
|
|
11
5
|
};
|
|
12
6
|
//# sourceMappingURL=standards-sdk.es113.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standards-sdk.es113.js","sources":["../../node_modules/axios/lib/
|
|
1
|
+
{"version":3,"file":"standards-sdk.es113.js","sources":["../../node_modules/axios/lib/platform/browser/classes/URLSearchParams.js"],"sourcesContent":["'use strict';\n\nimport AxiosURLSearchParams from '../../../helpers/AxiosURLSearchParams.js';\nexport default typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams;\n"],"names":[],"mappings":";AAGA,MAAA,oBAAe,OAAO,oBAAoB,cAAc,kBAAkB;","x_google_ignoreList":[0]}
|
|
@@ -1,37 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import platform from "./standards-sdk.es90.js";
|
|
3
|
-
const cookies = platform.hasStandardBrowserEnv ? (
|
|
4
|
-
// Standard browser envs support document.cookie
|
|
5
|
-
{
|
|
6
|
-
write(name, value, expires, path, domain, secure) {
|
|
7
|
-
const cookie = [name + "=" + encodeURIComponent(value)];
|
|
8
|
-
utils.isNumber(expires) && cookie.push("expires=" + new Date(expires).toGMTString());
|
|
9
|
-
utils.isString(path) && cookie.push("path=" + path);
|
|
10
|
-
utils.isString(domain) && cookie.push("domain=" + domain);
|
|
11
|
-
secure === true && cookie.push("secure");
|
|
12
|
-
document.cookie = cookie.join("; ");
|
|
13
|
-
},
|
|
14
|
-
read(name) {
|
|
15
|
-
const match = document.cookie.match(new RegExp("(^|;\\s*)(" + name + ")=([^;]*)"));
|
|
16
|
-
return match ? decodeURIComponent(match[3]) : null;
|
|
17
|
-
},
|
|
18
|
-
remove(name) {
|
|
19
|
-
this.write(name, "", Date.now() - 864e5);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
) : (
|
|
23
|
-
// Non-standard browser env (web workers, react-native) lack needed support.
|
|
24
|
-
{
|
|
25
|
-
write() {
|
|
26
|
-
},
|
|
27
|
-
read() {
|
|
28
|
-
return null;
|
|
29
|
-
},
|
|
30
|
-
remove() {
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
);
|
|
1
|
+
const FormData$1 = typeof FormData !== "undefined" ? FormData : null;
|
|
34
2
|
export {
|
|
35
|
-
|
|
3
|
+
FormData$1 as default
|
|
36
4
|
};
|
|
37
5
|
//# sourceMappingURL=standards-sdk.es114.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standards-sdk.es114.js","sources":["../../node_modules/axios/lib/
|
|
1
|
+
{"version":3,"file":"standards-sdk.es114.js","sources":["../../node_modules/axios/lib/platform/browser/classes/FormData.js"],"sourcesContent":["'use strict';\n\nexport default typeof FormData !== 'undefined' ? FormData : null;\n"],"names":[],"mappings":"AAEA,MAAA,aAAe,OAAO,aAAa,cAAc,WAAW;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"standards-sdk.es115.js","sources":["../../node_modules/axios/lib/platform/browser/classes/Blob.js"],"sourcesContent":["'use strict'\n\nexport default typeof Blob !== 'undefined' ? Blob : null\n"],"names":[],"mappings":"AAEA,MAAA,SAAe,OAAO,SAAS,cAAc,OAAO;","x_google_ignoreList":[0]}
|
|
@@ -2,7 +2,7 @@ import Buffer from "./standards-sdk.es21.js";
|
|
|
2
2
|
import { Client, PrivateKey, Status, AccountUpdateTransaction } from "@hashgraph/sdk";
|
|
3
3
|
import { inscribeWithSigner, inscribe } from "./standards-sdk.es17.js";
|
|
4
4
|
import { Logger } from "./standards-sdk.es14.js";
|
|
5
|
-
import { m as mimeTypesExports } from "./standards-sdk.
|
|
5
|
+
import { m as mimeTypesExports } from "./standards-sdk.es26.js";
|
|
6
6
|
import z from "./standards-sdk.es28.js";
|
|
7
7
|
import { ProgressReporter } from "./standards-sdk.es16.js";
|
|
8
8
|
import { HederaMirrorNode } from "./standards-sdk.es18.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Buffer from "./standards-sdk.es21.js";
|
|
2
|
-
import { InscriptionSDK } from "./standards-sdk.
|
|
2
|
+
import { InscriptionSDK } from "./standards-sdk.es22.js";
|
|
3
3
|
import { Logger } from "./standards-sdk.es14.js";
|
|
4
4
|
import { ProgressReporter } from "./standards-sdk.es16.js";
|
|
5
5
|
async function inscribe(input, clientConfig, options, existingSDK) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import Buffer from "./standards-sdk.es21.js";
|
|
2
2
|
import { PublicKey, Timestamp } from "@hashgraph/sdk";
|
|
3
|
-
import "./standards-sdk.
|
|
3
|
+
import "./standards-sdk.es24.js";
|
|
4
4
|
import { proto } from "@hashgraph/proto";
|
|
5
|
-
import axios from "./standards-sdk.
|
|
5
|
+
import axios from "./standards-sdk.es25.js";
|
|
6
6
|
class HederaMirrorNode {
|
|
7
7
|
constructor(network, logger) {
|
|
8
8
|
this.network = network;
|
|
@@ -16,6 +16,12 @@ class HederaMirrorNode {
|
|
|
16
16
|
getBaseUrl() {
|
|
17
17
|
return this.baseUrl;
|
|
18
18
|
}
|
|
19
|
+
/**
|
|
20
|
+
* Retrieves the public key for a given account ID from the mirror node.
|
|
21
|
+
* @param accountId The ID of the account to retrieve the public key for.
|
|
22
|
+
* @returns A promise that resolves to the public key for the given account.
|
|
23
|
+
* @throws An error if the account ID is invalid or the public key cannot be retrieved.
|
|
24
|
+
*/
|
|
19
25
|
async getPublicKey(accountId) {
|
|
20
26
|
this.logger.info(`Getting public key for account ${accountId}`);
|
|
21
27
|
const accountInfo = await this.requestAccount(accountId);
|
|
@@ -32,6 +38,12 @@ class HederaMirrorNode {
|
|
|
32
38
|
);
|
|
33
39
|
}
|
|
34
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* Retrieves the memo for a given account ID from the mirror node.
|
|
43
|
+
* @param accountId The ID of the account to retrieve the memo for.
|
|
44
|
+
* @returns A promise that resolves to the memo for the given account.
|
|
45
|
+
* @throws An error if the account ID is invalid or the memo cannot be retrieved.
|
|
46
|
+
*/
|
|
35
47
|
async getAccountMemo(accountId) {
|
|
36
48
|
const maxRetries = 3;
|
|
37
49
|
for (let attempt = 0; attempt < maxRetries; attempt++) {
|
|
@@ -57,6 +69,12 @@ class HederaMirrorNode {
|
|
|
57
69
|
}
|
|
58
70
|
return null;
|
|
59
71
|
}
|
|
72
|
+
/**
|
|
73
|
+
* Retrieves topic information for a given topic ID from the mirror node.
|
|
74
|
+
* @param topicId The ID of the topic to retrieve information for.
|
|
75
|
+
* @returns A promise that resolves to the topic information.
|
|
76
|
+
* @throws An error if the topic ID is invalid or the information cannot be retrieved.
|
|
77
|
+
*/
|
|
60
78
|
async getTopicInfo(topicId) {
|
|
61
79
|
try {
|
|
62
80
|
const topicInfoUrl = `${this.baseUrl}/api/v1/topics/${topicId}`;
|
|
@@ -67,6 +85,12 @@ class HederaMirrorNode {
|
|
|
67
85
|
throw new Error(`Failed to retrieve topic information: ${error.message}`);
|
|
68
86
|
}
|
|
69
87
|
}
|
|
88
|
+
/**
|
|
89
|
+
* Retrieves custom fees for a given topic ID from the mirror node.
|
|
90
|
+
* @param topicId The ID of the topic to retrieve custom fees for.
|
|
91
|
+
* @returns A promise that resolves to the custom fees for the given topic.
|
|
92
|
+
* @throws An error if the topic ID is invalid or the custom fees cannot be retrieved.
|
|
93
|
+
*/
|
|
70
94
|
async getTopicFees(topicId) {
|
|
71
95
|
try {
|
|
72
96
|
const topicInfo = await this.getTopicInfo(topicId);
|
|
@@ -76,6 +100,12 @@ class HederaMirrorNode {
|
|
|
76
100
|
return null;
|
|
77
101
|
}
|
|
78
102
|
}
|
|
103
|
+
/**
|
|
104
|
+
* Retrieves the current HBAR price from the mirror node.
|
|
105
|
+
* @param date The date to retrieve the HBAR price for.
|
|
106
|
+
* @returns A promise that resolves to the HBAR price for the given date.
|
|
107
|
+
* @throws An error if the date is invalid or the price cannot be retrieved.
|
|
108
|
+
*/
|
|
79
109
|
async getHBARPrice(date) {
|
|
80
110
|
try {
|
|
81
111
|
const timestamp = Timestamp.fromDate(date).toString();
|
|
@@ -89,6 +119,36 @@ class HederaMirrorNode {
|
|
|
89
119
|
return null;
|
|
90
120
|
}
|
|
91
121
|
}
|
|
122
|
+
/**
|
|
123
|
+
* Retrieves token information for a given token ID from the mirror node.
|
|
124
|
+
* @param tokenId The ID of the token to retrieve information for.
|
|
125
|
+
* @returns A promise that resolves to the token information.
|
|
126
|
+
* @throws An error if the token ID is invalid or the information cannot be retrieved.
|
|
127
|
+
*/
|
|
128
|
+
async getTokenInfo(tokenId) {
|
|
129
|
+
this.logger.debug(`Fetching token info for ${tokenId}`);
|
|
130
|
+
try {
|
|
131
|
+
const tokenInfoUrl = `${this.baseUrl}/api/v1/tokens/${tokenId}`;
|
|
132
|
+
const response = await axios.get(tokenInfoUrl);
|
|
133
|
+
if (response.data) {
|
|
134
|
+
this.logger.trace(`Token info found for ${tokenId}:`, response.data);
|
|
135
|
+
return response.data;
|
|
136
|
+
}
|
|
137
|
+
this.logger.warn(`No token info found for ${tokenId}`);
|
|
138
|
+
return null;
|
|
139
|
+
} catch (error) {
|
|
140
|
+
this.logger.error(
|
|
141
|
+
`Error fetching token info for ${tokenId}: ${error.message}`
|
|
142
|
+
);
|
|
143
|
+
return null;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Retrieves messages for a given topic ID from the mirror node.
|
|
148
|
+
* @param topicId The ID of the topic to retrieve messages for.
|
|
149
|
+
* @returns A promise that resolves to the messages for the given topic.
|
|
150
|
+
* @throws An error if the topic ID is invalid or the messages cannot be retrieved.
|
|
151
|
+
*/
|
|
92
152
|
async getTopicMessages(topicId) {
|
|
93
153
|
this.logger.trace(`Querying messages for topic ${topicId}`);
|
|
94
154
|
let nextUrl = `${this.baseUrl}/api/v1/topics/${topicId}/messages`;
|
|
@@ -136,9 +196,7 @@ class HederaMirrorNode {
|
|
|
136
196
|
...messageJson,
|
|
137
197
|
consensus_timestamp: message.consensus_timestamp,
|
|
138
198
|
sequence_number: message.sequence_number,
|
|
139
|
-
created: new Date(
|
|
140
|
-
Number(message.consensus_timestamp) * 1e3
|
|
141
|
-
)
|
|
199
|
+
created: new Date(Number(message.consensus_timestamp) * 1e3)
|
|
142
200
|
});
|
|
143
201
|
} catch (error) {
|
|
144
202
|
this.logger.error(`Error processing message: ${error.message}`);
|
|
@@ -153,6 +211,12 @@ class HederaMirrorNode {
|
|
|
153
211
|
}
|
|
154
212
|
return messages;
|
|
155
213
|
}
|
|
214
|
+
/**
|
|
215
|
+
* Requests account information for a given account ID from the mirror node.
|
|
216
|
+
* @param accountId The ID of the account to retrieve information for.
|
|
217
|
+
* @returns A promise that resolves to the account information.
|
|
218
|
+
* @throws An error if the account ID is invalid or the information cannot be retrieved.
|
|
219
|
+
*/
|
|
156
220
|
async requestAccount(accountId) {
|
|
157
221
|
try {
|
|
158
222
|
const accountInfoUrl = `${this.baseUrl}/api/v1/accounts/${accountId}`;
|
|
@@ -168,6 +232,12 @@ class HederaMirrorNode {
|
|
|
168
232
|
throw new Error(`Failed to fetch account: ${error.message}`);
|
|
169
233
|
}
|
|
170
234
|
}
|
|
235
|
+
/**
|
|
236
|
+
* Checks if a user has access to a given key list.
|
|
237
|
+
* @param keyBytes The key list to check access for.
|
|
238
|
+
* @param userPublicKey The public key of the user to check access for.
|
|
239
|
+
* @returns A promise that resolves to true if the user has access, false otherwise.
|
|
240
|
+
*/
|
|
171
241
|
async checkKeyListAccess(keyBytes, userPublicKey) {
|
|
172
242
|
try {
|
|
173
243
|
const key = proto.Key.decode(keyBytes);
|
|
@@ -179,6 +249,12 @@ class HederaMirrorNode {
|
|
|
179
249
|
return false;
|
|
180
250
|
}
|
|
181
251
|
}
|
|
252
|
+
/**
|
|
253
|
+
* Evaluates the access of a given key to a user's public key.
|
|
254
|
+
* @param key The key to evaluate access for.
|
|
255
|
+
* @param userPublicKey The public key of the user to evaluate access for.
|
|
256
|
+
* @returns A promise that resolves to true if the key has access, false otherwise.
|
|
257
|
+
*/
|
|
182
258
|
async evaluateKeyAccess(key, userPublicKey) {
|
|
183
259
|
if (key.ed25519) {
|
|
184
260
|
return this.compareEd25519Key(key.ed25519, userPublicKey);
|
|
@@ -191,6 +267,12 @@ class HederaMirrorNode {
|
|
|
191
267
|
}
|
|
192
268
|
return false;
|
|
193
269
|
}
|
|
270
|
+
/**
|
|
271
|
+
* Evaluates the access of a given key list to a user's public key.
|
|
272
|
+
* @param keyList The key list to evaluate access for.
|
|
273
|
+
* @param userPublicKey The public key of the user to evaluate access for.
|
|
274
|
+
* @returns A promise that resolves to true if the key list has access, false otherwise.
|
|
275
|
+
*/
|
|
194
276
|
async evaluateKeyList(keyList, userPublicKey) {
|
|
195
277
|
const keys = keyList.keys || [];
|
|
196
278
|
for (const listKey of keys) {
|
|
@@ -221,6 +303,12 @@ class HederaMirrorNode {
|
|
|
221
303
|
}
|
|
222
304
|
return false;
|
|
223
305
|
}
|
|
306
|
+
/**
|
|
307
|
+
* Compares an Ed25519 key with a user's public key.
|
|
308
|
+
* @param keyData The Ed25519 key data to compare.
|
|
309
|
+
* @param userPublicKey The public key of the user to compare with.
|
|
310
|
+
* @returns A boolean indicating whether the key matches the user's public key.
|
|
311
|
+
*/
|
|
224
312
|
compareEd25519Key(keyData, userPublicKey) {
|
|
225
313
|
try {
|
|
226
314
|
const decodedKey = PublicKey.fromBytes(Buffer.from(keyData));
|