@xyo-network/xl1-rpc 1.18.2 → 1.18.4
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 +78 -3
- package/dist/neutral/index.mjs.map +1 -1
- package/dist/neutral/provider/viewer/JsonRpcBlockViewer/JsonRpcBlockViewer.d.ts.map +1 -1
- package/dist/neutral/provider/viewer/JsonRpcBlockViewer/JsonRpcBlockViewerMethods.d.ts +69 -1
- package/dist/neutral/provider/viewer/JsonRpcBlockViewer/JsonRpcBlockViewerMethods.d.ts.map +1 -1
- package/dist/neutral/provider/viewer/JsonRpcXyoViewer.d.ts +69 -1
- package/dist/neutral/provider/viewer/JsonRpcXyoViewer.d.ts.map +1 -1
- package/dist/neutral/types/schema/AllRpcSchemas.d.ts +132 -0
- package/dist/neutral/types/schema/AllRpcSchemas.d.ts.map +1 -1
- package/dist/neutral/types/schema/BlockViewerRpcSchemas.d.ts +66 -0
- package/dist/neutral/types/schema/BlockViewerRpcSchemas.d.ts.map +1 -1
- package/dist/neutral/types/schema/XyoViewerRpcSchemas.d.ts +66 -0
- 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 +78 -3
- package/dist/node/index-node.mjs.map +1 -1
- package/dist/node/provider/viewer/JsonRpcBlockViewer/JsonRpcBlockViewer.d.ts.map +1 -1
- package/dist/node/provider/viewer/JsonRpcBlockViewer/JsonRpcBlockViewerMethods.d.ts +69 -1
- package/dist/node/provider/viewer/JsonRpcBlockViewer/JsonRpcBlockViewerMethods.d.ts.map +1 -1
- package/dist/node/provider/viewer/JsonRpcXyoViewer.d.ts +69 -1
- package/dist/node/provider/viewer/JsonRpcXyoViewer.d.ts.map +1 -1
- package/dist/node/types/schema/AllRpcSchemas.d.ts +132 -0
- package/dist/node/types/schema/AllRpcSchemas.d.ts.map +1 -1
- package/dist/node/types/schema/BlockViewerRpcSchemas.d.ts +66 -0
- package/dist/node/types/schema/BlockViewerRpcSchemas.d.ts.map +1 -1
- package/dist/node/types/schema/XyoViewerRpcSchemas.d.ts +66 -0
- package/dist/node/types/schema/XyoViewerRpcSchemas.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/engine/rpcMethodHandlersFromBlockViewer.ts +2 -0
- package/src/engine/rpcMethodHandlersFromViewer.ts +2 -0
- package/src/provider/viewer/JsonRpcBlockViewer/JsonRpcBlockViewer.ts +3 -1
- package/src/provider/viewer/JsonRpcBlockViewer/JsonRpcBlockViewerMethods.ts +17 -1
- package/src/provider/viewer/JsonRpcXyoViewer.ts +14 -1
- package/src/types/schema/BlockViewerRpcSchemas.ts +24 -1
- package/src/types/schema/XyoViewerRpcSchemas.ts +25 -0
package/dist/node/index-node.mjs
CHANGED
|
@@ -28,7 +28,9 @@ 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 ?? [])
|
|
31
|
+
blockViewer_payloadsByHash: (params) => viewer.payloadsByHash(...params ?? []),
|
|
32
|
+
blockViewer_rate: (params) => viewer.rate(...params ?? []),
|
|
33
|
+
blockViewer_stepSizeRate: (params) => viewer.stepSizeRate(...params ?? [])
|
|
32
34
|
};
|
|
33
35
|
};
|
|
34
36
|
|
|
@@ -108,7 +110,9 @@ var rpcMethodHandlersFromViewer = (viewer) => {
|
|
|
108
110
|
xyoViewer_transactionByBlockHashAndIndex: (params) => viewer.transactionByBlockHashAndIndex(...params ?? []),
|
|
109
111
|
xyoViewer_transactionByBlockNumberAndIndex: (params) => viewer.transactionByBlockNumberAndIndex(...params ?? []),
|
|
110
112
|
xyoViewer_transactionByHash: (params) => viewer.transactionByHash(...params ?? []),
|
|
111
|
-
xyoViewer_payloadsByHash: (params) => viewer.payloadsByHash(...params ?? [])
|
|
113
|
+
xyoViewer_payloadsByHash: (params) => viewer.payloadsByHash(...params ?? []),
|
|
114
|
+
xyoViewer_rate: (params) => viewer.rate(...params ?? []),
|
|
115
|
+
xyoViewer_stepSizeRate: (params) => viewer.stepSizeRate(...params ?? [])
|
|
112
116
|
};
|
|
113
117
|
};
|
|
114
118
|
|
|
@@ -267,7 +271,15 @@ var AccountBalanceViewerRpcSchemas = {
|
|
|
267
271
|
// src/types/schema/BlockViewerRpcSchemas.ts
|
|
268
272
|
import { HashZod } from "@xylabs/sdk-js";
|
|
269
273
|
import { PayloadZodLoose } from "@xyo-network/payload-model";
|
|
270
|
-
import {
|
|
274
|
+
import {
|
|
275
|
+
BlockRangeZod,
|
|
276
|
+
BlockRateZod,
|
|
277
|
+
CountZod,
|
|
278
|
+
SignedHydratedBlockWithHashMetaZod,
|
|
279
|
+
StepIndexZod,
|
|
280
|
+
TimeDurationsZod,
|
|
281
|
+
XL1BlockNumberZod
|
|
282
|
+
} from "@xyo-network/xl1-protocol";
|
|
271
283
|
import { z as z2 } from "zod";
|
|
272
284
|
var BlockViewerRpcSchemas = {
|
|
273
285
|
blockViewer_blocksByNumber: {
|
|
@@ -309,6 +321,26 @@ var BlockViewerRpcSchemas = {
|
|
|
309
321
|
to: z2.array(PayloadZodLoose),
|
|
310
322
|
from: z2.array(PayloadZodLoose)
|
|
311
323
|
}
|
|
324
|
+
},
|
|
325
|
+
blockViewer_rate: {
|
|
326
|
+
params: {
|
|
327
|
+
to: z2.tuple([BlockRangeZod, TimeDurationsZod.keyof().optional()]),
|
|
328
|
+
from: z2.tuple([BlockRangeZod, TimeDurationsZod.keyof().optional()])
|
|
329
|
+
},
|
|
330
|
+
result: {
|
|
331
|
+
to: BlockRateZod,
|
|
332
|
+
from: BlockRateZod
|
|
333
|
+
}
|
|
334
|
+
},
|
|
335
|
+
blockViewer_stepSizeRate: {
|
|
336
|
+
params: {
|
|
337
|
+
to: z2.tuple([XL1BlockNumberZod, StepIndexZod, CountZod.optional(), TimeDurationsZod.keyof().optional()]),
|
|
338
|
+
from: z2.tuple([BlockRateZod])
|
|
339
|
+
},
|
|
340
|
+
result: {
|
|
341
|
+
to: BlockRateZod,
|
|
342
|
+
from: BlockRateZod
|
|
343
|
+
}
|
|
312
344
|
}
|
|
313
345
|
};
|
|
314
346
|
|
|
@@ -965,11 +997,16 @@ import {
|
|
|
965
997
|
} from "@xylabs/sdk-js";
|
|
966
998
|
import { PayloadZodLoose as PayloadZodLoose2 } from "@xyo-network/payload-model";
|
|
967
999
|
import {
|
|
1000
|
+
BlockRangeZod as BlockRangeZod2,
|
|
1001
|
+
BlockRateZod as BlockRateZod2,
|
|
1002
|
+
CountZod as CountZod2,
|
|
968
1003
|
JsonToStakeZod as JsonToStakeZod2,
|
|
969
1004
|
SignedHydratedBlockWithHashMetaZod as SignedHydratedBlockWithHashMetaZod3,
|
|
970
1005
|
SignedHydratedTransactionZod as SignedHydratedTransactionZod3,
|
|
971
1006
|
StakeToJsonZod as StakeToJsonZod2,
|
|
972
1007
|
StepIdentityZod as StepIdentityZod2,
|
|
1008
|
+
StepIndexZod as StepIndexZod2,
|
|
1009
|
+
TimeDurationsZod as TimeDurationsZod2,
|
|
973
1010
|
XL1BlockNumberZod as XL1BlockNumberZod2,
|
|
974
1011
|
XL1BlockRangeZod
|
|
975
1012
|
} from "@xyo-network/xl1-protocol";
|
|
@@ -1295,6 +1332,26 @@ var XyoViewerRpcSchemas = {
|
|
|
1295
1332
|
to: z17.array(PayloadZodLoose2),
|
|
1296
1333
|
from: z17.array(PayloadZodLoose2)
|
|
1297
1334
|
}
|
|
1335
|
+
},
|
|
1336
|
+
xyoViewer_rate: {
|
|
1337
|
+
params: {
|
|
1338
|
+
to: z17.tuple([BlockRangeZod2, TimeDurationsZod2.keyof().optional()]),
|
|
1339
|
+
from: z17.tuple([BlockRangeZod2, TimeDurationsZod2.keyof().optional()])
|
|
1340
|
+
},
|
|
1341
|
+
result: {
|
|
1342
|
+
to: BlockRateZod2,
|
|
1343
|
+
from: BlockRateZod2
|
|
1344
|
+
}
|
|
1345
|
+
},
|
|
1346
|
+
xyoViewer_stepSizeRate: {
|
|
1347
|
+
params: {
|
|
1348
|
+
to: z17.tuple([XL1BlockNumberZod2, StepIndexZod2, CountZod2.optional(), TimeDurationsZod2.keyof().optional()]),
|
|
1349
|
+
from: z17.tuple([BlockRateZod2])
|
|
1350
|
+
},
|
|
1351
|
+
result: {
|
|
1352
|
+
to: BlockRateZod2,
|
|
1353
|
+
from: BlockRateZod2
|
|
1354
|
+
}
|
|
1298
1355
|
}
|
|
1299
1356
|
};
|
|
1300
1357
|
|
|
@@ -1600,6 +1657,18 @@ var JsonRpcBlockViewerMethods = class extends AbstractJsonRpcViewer {
|
|
|
1600
1657
|
);
|
|
1601
1658
|
return result.map((p) => asHashMeta(p, true)).map((p) => asAnyPayload(p, { required: true }));
|
|
1602
1659
|
}
|
|
1660
|
+
async rate(range, timeUnit) {
|
|
1661
|
+
return await this.transport.sendRequest(
|
|
1662
|
+
"blockViewer_rate",
|
|
1663
|
+
[range, timeUnit]
|
|
1664
|
+
);
|
|
1665
|
+
}
|
|
1666
|
+
async stepSizeRate(start, stepSizeIndex, count, timeUnit) {
|
|
1667
|
+
return await this.transport.sendRequest(
|
|
1668
|
+
"blockViewer_stepSizeRate",
|
|
1669
|
+
[start, stepSizeIndex, count, timeUnit]
|
|
1670
|
+
);
|
|
1671
|
+
}
|
|
1603
1672
|
schemas() {
|
|
1604
1673
|
return BlockViewerRpcSchemas;
|
|
1605
1674
|
}
|
|
@@ -2002,6 +2071,9 @@ var JsonRpcXyoViewer = class extends AbstractJsonRpcViewer {
|
|
|
2002
2071
|
[hashes]
|
|
2003
2072
|
)).map((p) => toWithHashMeta(p, true)));
|
|
2004
2073
|
}
|
|
2074
|
+
async rate(range, timeUnit) {
|
|
2075
|
+
return await this.block.rate(range, timeUnit);
|
|
2076
|
+
}
|
|
2005
2077
|
async stakeById(id) {
|
|
2006
2078
|
return await this.transport.sendRequest("xyoViewer_stakeById", [id]);
|
|
2007
2079
|
}
|
|
@@ -2014,6 +2086,9 @@ var JsonRpcXyoViewer = class extends AbstractJsonRpcViewer {
|
|
|
2014
2086
|
async stakesByStaker(staker) {
|
|
2015
2087
|
return await this.transport.sendRequest("xyoViewer_stakesByStaker", [staker]);
|
|
2016
2088
|
}
|
|
2089
|
+
async stepSizeRate(start, stepIndex, count, timeUnit) {
|
|
2090
|
+
return await this.block.stepSizeRate(start, stepIndex, count, timeUnit);
|
|
2091
|
+
}
|
|
2017
2092
|
async transactionByBlockHashAndIndex(blockHash, transactionIndex) {
|
|
2018
2093
|
return await this.transport.sendRequest("xyoViewer_transactionByBlockHashAndIndex", [blockHash, transactionIndex]);
|
|
2019
2094
|
}
|