@xyo-network/xl1-rpc 1.24.16 → 1.24.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/neutral/engine/rpcMethodHandlersFromBlockViewer.d.ts.map +1 -1
- package/dist/neutral/engine/rpcMethodHandlersFromViewer.d.ts.map +1 -1
- package/dist/neutral/index.mjs +18 -103
- package/dist/neutral/index.mjs.map +1 -1
- package/dist/neutral/provider/viewer/JsonRpcBlockViewer/JsonRpcBlockViewer.d.ts +4 -1
- package/dist/neutral/provider/viewer/JsonRpcBlockViewer/JsonRpcBlockViewer.d.ts.map +1 -1
- package/dist/neutral/provider/viewer/JsonRpcBlockViewer/JsonRpcBlockViewerMethods.d.ts +1 -178
- package/dist/neutral/provider/viewer/JsonRpcBlockViewer/JsonRpcBlockViewerMethods.d.ts.map +1 -1
- package/dist/neutral/provider/viewer/JsonRpcXyoViewer.d.ts +0 -174
- package/dist/neutral/provider/viewer/JsonRpcXyoViewer.d.ts.map +1 -1
- package/dist/neutral/types/schema/AllRpcSchemas.d.ts +0 -348
- package/dist/neutral/types/schema/AllRpcSchemas.d.ts.map +1 -1
- package/dist/neutral/types/schema/BlockViewerRpcSchemas.d.ts +0 -174
- package/dist/neutral/types/schema/BlockViewerRpcSchemas.d.ts.map +1 -1
- package/dist/neutral/types/schema/XyoViewerRpcSchemas.d.ts +0 -174
- package/dist/neutral/types/schema/XyoViewerRpcSchemas.d.ts.map +1 -1
- package/dist/node/engine/rpcMethodHandlersFromBlockViewer.d.ts.map +1 -1
- package/dist/node/engine/rpcMethodHandlersFromViewer.d.ts.map +1 -1
- package/dist/node/index-node.mjs +18 -103
- package/dist/node/index-node.mjs.map +1 -1
- package/dist/node/provider/viewer/JsonRpcBlockViewer/JsonRpcBlockViewer.d.ts +4 -1
- package/dist/node/provider/viewer/JsonRpcBlockViewer/JsonRpcBlockViewer.d.ts.map +1 -1
- package/dist/node/provider/viewer/JsonRpcBlockViewer/JsonRpcBlockViewerMethods.d.ts +1 -178
- package/dist/node/provider/viewer/JsonRpcBlockViewer/JsonRpcBlockViewerMethods.d.ts.map +1 -1
- package/dist/node/provider/viewer/JsonRpcXyoViewer.d.ts +0 -174
- package/dist/node/provider/viewer/JsonRpcXyoViewer.d.ts.map +1 -1
- package/dist/node/types/schema/AllRpcSchemas.d.ts +0 -348
- package/dist/node/types/schema/AllRpcSchemas.d.ts.map +1 -1
- package/dist/node/types/schema/BlockViewerRpcSchemas.d.ts +0 -174
- package/dist/node/types/schema/BlockViewerRpcSchemas.d.ts.map +1 -1
- package/dist/node/types/schema/XyoViewerRpcSchemas.d.ts +0 -174
- package/dist/node/types/schema/XyoViewerRpcSchemas.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/engine/rpcMethodHandlersFromBlockViewer.ts +0 -3
- package/src/engine/rpcMethodHandlersFromViewer.ts +0 -3
- package/src/provider/viewer/JsonRpcBlockViewer/JsonRpcBlockViewer.ts +26 -1
- package/src/provider/viewer/JsonRpcBlockViewer/JsonRpcBlockViewerMethods.ts +1 -29
- package/src/types/schema/BlockViewerRpcSchemas.ts +1 -34
- package/src/types/schema/XyoViewerRpcSchemas.ts +2 -36
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rpcMethodHandlersFromBlockViewer.d.ts","sourceRoot":"","sources":["../../../src/engine/rpcMethodHandlersFromBlockViewer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAEnE,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,mBAAmB,CAAA;AAErE,eAAO,MAAM,gCAAgC,GAAI,QAAQ,kBAAkB,KAAG,
|
|
1
|
+
{"version":3,"file":"rpcMethodHandlersFromBlockViewer.d.ts","sourceRoot":"","sources":["../../../src/engine/rpcMethodHandlersFromBlockViewer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAEnE,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,mBAAmB,CAAA;AAErE,eAAO,MAAM,gCAAgC,GAAI,QAAQ,kBAAkB,KAAG,4BAO7E,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rpcMethodHandlersFromViewer.d.ts","sourceRoot":"","sources":["../../../src/engine/rpcMethodHandlersFromViewer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AAE1D,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAA;AAEnE,eAAO,MAAM,2BAA2B,GAAI,QAAQ,SAAS,KAAG,
|
|
1
|
+
{"version":3,"file":"rpcMethodHandlersFromViewer.d.ts","sourceRoot":"","sources":["../../../src/engine/rpcMethodHandlersFromViewer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AAE1D,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAA;AAEnE,eAAO,MAAM,2BAA2B,GAAI,QAAQ,SAAS,KAAG,0BAmC/D,CAAA"}
|
package/dist/neutral/index.mjs
CHANGED
|
@@ -28,10 +28,7 @@ var rpcMethodHandlersFromBlockViewer = (viewer) => {
|
|
|
28
28
|
blockViewer_blocksByHash: (params) => viewer.blocksByHash(...params ?? []),
|
|
29
29
|
blockViewer_blocksByNumber: (params) => viewer.blocksByNumber(...params ?? []),
|
|
30
30
|
blockViewer_currentBlock: (params) => viewer.currentBlock(...params ?? []),
|
|
31
|
-
blockViewer_payloadsByHash: (params) => viewer.payloadsByHash(...params ?? [])
|
|
32
|
-
blockViewer_rate: (params) => viewer.rate(...params ?? []),
|
|
33
|
-
blockViewer_stepSizeRate: (params) => viewer.stepSizeRate(...params ?? []),
|
|
34
|
-
blockViewer_timeDurationRate: (params) => viewer.timeDurationRate(...params ?? [])
|
|
31
|
+
blockViewer_payloadsByHash: (params) => viewer.payloadsByHash(...params ?? [])
|
|
35
32
|
};
|
|
36
33
|
};
|
|
37
34
|
|
|
@@ -111,10 +108,7 @@ var rpcMethodHandlersFromViewer = (viewer) => {
|
|
|
111
108
|
xyoViewer_transactionByBlockHashAndIndex: (params) => viewer.transactionByBlockHashAndIndex(...params ?? []),
|
|
112
109
|
xyoViewer_transactionByBlockNumberAndIndex: (params) => viewer.transactionByBlockNumberAndIndex(...params ?? []),
|
|
113
110
|
xyoViewer_transactionByHash: (params) => viewer.transactionByHash(...params ?? []),
|
|
114
|
-
xyoViewer_payloadsByHash: (params) => viewer.payloadsByHash(...params ?? [])
|
|
115
|
-
xyoViewer_rate: (params) => viewer.rate(...params ?? []),
|
|
116
|
-
xyoViewer_stepSizeRate: (params) => viewer.stepSizeRate(...params ?? []),
|
|
117
|
-
xyoViewer_timeDurationRate: (params) => viewer.timeDurationRate(...params ?? [])
|
|
111
|
+
xyoViewer_payloadsByHash: (params) => viewer.payloadsByHash(...params ?? [])
|
|
118
112
|
};
|
|
119
113
|
};
|
|
120
114
|
|
|
@@ -276,16 +270,7 @@ var AccountBalanceViewerRpcSchemas = {
|
|
|
276
270
|
// src/types/schema/BlockViewerRpcSchemas.ts
|
|
277
271
|
import { HashZod } from "@xylabs/sdk-js";
|
|
278
272
|
import { PayloadZodLoose } from "@xyo-network/payload-model";
|
|
279
|
-
import {
|
|
280
|
-
BlockRangeZod,
|
|
281
|
-
BlockRateZod,
|
|
282
|
-
CountZod,
|
|
283
|
-
SignedHydratedBlockWithHashMetaZod,
|
|
284
|
-
SingleTimeConfigZod,
|
|
285
|
-
StepIndexZod,
|
|
286
|
-
TimeDurationsZod,
|
|
287
|
-
XL1BlockNumberZod
|
|
288
|
-
} from "@xyo-network/xl1-protocol";
|
|
273
|
+
import { SignedHydratedBlockWithHashMetaZod, XL1BlockNumberZod } from "@xyo-network/xl1-protocol";
|
|
289
274
|
import { z as z2 } from "zod";
|
|
290
275
|
var BlockViewerRpcSchemas = {
|
|
291
276
|
blockViewer_blocksByNumber: {
|
|
@@ -327,36 +312,6 @@ var BlockViewerRpcSchemas = {
|
|
|
327
312
|
to: z2.array(PayloadZodLoose),
|
|
328
313
|
from: z2.array(PayloadZodLoose)
|
|
329
314
|
}
|
|
330
|
-
},
|
|
331
|
-
blockViewer_rate: {
|
|
332
|
-
params: {
|
|
333
|
-
to: z2.tuple([BlockRangeZod, TimeDurationsZod.keyof().optional()]),
|
|
334
|
-
from: z2.tuple([BlockRangeZod, TimeDurationsZod.keyof().optional()])
|
|
335
|
-
},
|
|
336
|
-
result: {
|
|
337
|
-
to: BlockRateZod,
|
|
338
|
-
from: BlockRateZod
|
|
339
|
-
}
|
|
340
|
-
},
|
|
341
|
-
blockViewer_stepSizeRate: {
|
|
342
|
-
params: {
|
|
343
|
-
to: z2.tuple([XL1BlockNumberZod, StepIndexZod, CountZod.optional(), TimeDurationsZod.keyof().optional()]),
|
|
344
|
-
from: z2.tuple([XL1BlockNumberZod, StepIndexZod, CountZod.optional(), TimeDurationsZod.keyof().optional()])
|
|
345
|
-
},
|
|
346
|
-
result: {
|
|
347
|
-
to: BlockRateZod,
|
|
348
|
-
from: BlockRateZod
|
|
349
|
-
}
|
|
350
|
-
},
|
|
351
|
-
blockViewer_timeDurationRate: {
|
|
352
|
-
params: {
|
|
353
|
-
to: z2.tuple([SingleTimeConfigZod, XL1BlockNumberZod.optional(), TimeDurationsZod.keyof().optional(), z2.number().optional(), z2.number().optional()]),
|
|
354
|
-
from: z2.tuple([SingleTimeConfigZod, XL1BlockNumberZod.optional(), TimeDurationsZod.keyof().optional(), z2.number().optional(), z2.number().optional()])
|
|
355
|
-
},
|
|
356
|
-
result: {
|
|
357
|
-
to: BlockRateZod,
|
|
358
|
-
from: BlockRateZod
|
|
359
|
-
}
|
|
360
315
|
}
|
|
361
316
|
};
|
|
362
317
|
|
|
@@ -1089,17 +1044,11 @@ import { PayloadZodLoose as PayloadZodLoose2 } from "@xyo-network/payload-model"
|
|
|
1089
1044
|
import {
|
|
1090
1045
|
AccountBalanceHistoryItemZod as AccountBalanceHistoryItemZod2,
|
|
1091
1046
|
asAttoXL1 as asAttoXL16,
|
|
1092
|
-
BlockRangeZod as BlockRangeZod2,
|
|
1093
|
-
BlockRateZod as BlockRateZod2,
|
|
1094
|
-
CountZod as CountZod2,
|
|
1095
1047
|
JsonToStakeZod as JsonToStakeZod3,
|
|
1096
1048
|
SignedHydratedBlockWithHashMetaZod as SignedHydratedBlockWithHashMetaZod3,
|
|
1097
1049
|
SignedHydratedTransactionZod as SignedHydratedTransactionZod3,
|
|
1098
|
-
SingleTimeConfigZod as SingleTimeConfigZod2,
|
|
1099
1050
|
StakeToJsonZod as StakeToJsonZod3,
|
|
1100
1051
|
StepIdentityZod as StepIdentityZod2,
|
|
1101
|
-
StepIndexZod as StepIndexZod2,
|
|
1102
|
-
TimeDurationsZod as TimeDurationsZod2,
|
|
1103
1052
|
XL1BlockNumberZod as XL1BlockNumberZod2,
|
|
1104
1053
|
XL1BlockRangeZod
|
|
1105
1054
|
} from "@xyo-network/xl1-protocol";
|
|
@@ -1424,36 +1373,6 @@ var XyoViewerRpcSchemas = {
|
|
|
1424
1373
|
to: z19.array(PayloadZodLoose2),
|
|
1425
1374
|
from: z19.array(PayloadZodLoose2)
|
|
1426
1375
|
}
|
|
1427
|
-
},
|
|
1428
|
-
xyoViewer_rate: {
|
|
1429
|
-
params: {
|
|
1430
|
-
to: z19.tuple([BlockRangeZod2, TimeDurationsZod2.keyof().optional()]),
|
|
1431
|
-
from: z19.tuple([BlockRangeZod2, TimeDurationsZod2.keyof().optional()])
|
|
1432
|
-
},
|
|
1433
|
-
result: {
|
|
1434
|
-
to: BlockRateZod2,
|
|
1435
|
-
from: BlockRateZod2
|
|
1436
|
-
}
|
|
1437
|
-
},
|
|
1438
|
-
xyoViewer_stepSizeRate: {
|
|
1439
|
-
params: {
|
|
1440
|
-
to: z19.tuple([XL1BlockNumberZod2, StepIndexZod2, CountZod2.optional(), TimeDurationsZod2.keyof().optional()]),
|
|
1441
|
-
from: z19.tuple([BlockRateZod2])
|
|
1442
|
-
},
|
|
1443
|
-
result: {
|
|
1444
|
-
to: BlockRateZod2,
|
|
1445
|
-
from: BlockRateZod2
|
|
1446
|
-
}
|
|
1447
|
-
},
|
|
1448
|
-
xyoViewer_timeDurationRate: {
|
|
1449
|
-
params: {
|
|
1450
|
-
to: z19.tuple([SingleTimeConfigZod2, XL1BlockNumberZod2.optional(), TimeDurationsZod2.keyof().optional(), z19.number().optional(), z19.number().optional()]),
|
|
1451
|
-
from: z19.tuple([BlockRateZod2])
|
|
1452
|
-
},
|
|
1453
|
-
result: {
|
|
1454
|
-
to: BlockRateZod2,
|
|
1455
|
-
from: BlockRateZod2
|
|
1456
|
-
}
|
|
1457
1376
|
}
|
|
1458
1377
|
};
|
|
1459
1378
|
|
|
@@ -1690,7 +1609,12 @@ JsonRpcAccountBalanceViewer = __decorateClass([
|
|
|
1690
1609
|
import {
|
|
1691
1610
|
BlockViewerMoniker as BlockViewerMoniker2
|
|
1692
1611
|
} from "@xyo-network/xl1-protocol";
|
|
1693
|
-
import {
|
|
1612
|
+
import {
|
|
1613
|
+
calculateBlockRate,
|
|
1614
|
+
calculateStepSizeRate,
|
|
1615
|
+
calculateTimeRate,
|
|
1616
|
+
creatableProvider as creatableProvider2
|
|
1617
|
+
} from "@xyo-network/xl1-protocol-sdk";
|
|
1694
1618
|
|
|
1695
1619
|
// src/provider/viewer/JsonRpcBlockViewer/JsonRpcBlockViewerMethods.ts
|
|
1696
1620
|
import { isDefined as isDefined3 } from "@xylabs/sdk-js";
|
|
@@ -1740,24 +1664,6 @@ var JsonRpcBlockViewerMethods = class extends AbstractJsonRpcViewer {
|
|
|
1740
1664
|
);
|
|
1741
1665
|
return await this.addDataLakePayloadsToPayloads(hashes, result.map((p) => asHashMeta(p, true)).map((p) => asAnyPayload(p, { required: true })));
|
|
1742
1666
|
}
|
|
1743
|
-
async rate(range, timeUnit) {
|
|
1744
|
-
return await this.transport.sendRequest(
|
|
1745
|
-
"blockViewer_rate",
|
|
1746
|
-
[range, timeUnit]
|
|
1747
|
-
);
|
|
1748
|
-
}
|
|
1749
|
-
async stepSizeRate(start, stepSizeIndex, count, timeUnit) {
|
|
1750
|
-
return await this.transport.sendRequest(
|
|
1751
|
-
"blockViewer_stepSizeRate",
|
|
1752
|
-
[start, stepSizeIndex, count, timeUnit]
|
|
1753
|
-
);
|
|
1754
|
-
}
|
|
1755
|
-
async timeDurationRate(timeConfig, startBlockNumber, timeUnit, toleranceMs, maxAttempts) {
|
|
1756
|
-
return await this.transport.sendRequest(
|
|
1757
|
-
"blockViewer_timeDurationRate",
|
|
1758
|
-
[timeConfig, startBlockNumber, timeUnit, toleranceMs, maxAttempts]
|
|
1759
|
-
);
|
|
1760
|
-
}
|
|
1761
1667
|
async addDataLakePayloadsToBlock(block) {
|
|
1762
1668
|
const dataLakeViewer = this.dataLakeViewer;
|
|
1763
1669
|
if (!dataLakeViewer) return block;
|
|
@@ -1802,6 +1708,15 @@ var JsonRpcBlockViewer = class extends JsonRpcBlockViewerMethods {
|
|
|
1802
1708
|
async payloadByHash(hash) {
|
|
1803
1709
|
return (await this.payloadsByHash([hash]))[0] ?? null;
|
|
1804
1710
|
}
|
|
1711
|
+
async rate(range, timeUnit) {
|
|
1712
|
+
return await calculateBlockRate(this, range, timeUnit);
|
|
1713
|
+
}
|
|
1714
|
+
async stepSizeRate(start, stepSizeIndex, count, timeUnit) {
|
|
1715
|
+
return await calculateStepSizeRate(this, start, stepSizeIndex, count, timeUnit);
|
|
1716
|
+
}
|
|
1717
|
+
async timeDurationRate(timeConfig, startBlockNumber, timeUnit, toleranceMs, maxAttempts) {
|
|
1718
|
+
return await calculateTimeRate(this, timeConfig, startBlockNumber, timeUnit, toleranceMs, maxAttempts);
|
|
1719
|
+
}
|
|
1805
1720
|
};
|
|
1806
1721
|
__publicField(JsonRpcBlockViewer, "defaultMoniker", BlockViewerMoniker2);
|
|
1807
1722
|
__publicField(JsonRpcBlockViewer, "dependencies", []);
|