@xyo-network/xl1-rpc 1.15.23 → 1.15.25
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/index.mjs +21 -0
- package/dist/neutral/index.mjs.map +1 -1
- package/dist/neutral/provider/viewer/JsonRpcXyoViewer.d.ts +2 -2
- package/dist/neutral/provider/viewer/JsonRpcXyoViewer.d.ts.map +1 -1
- package/dist/neutral/types/NetworkStakeViewerRpc.d.ts +7 -0
- package/dist/neutral/types/NetworkStakeViewerRpc.d.ts.map +1 -0
- package/dist/neutral/types/StepViewerRpc.d.ts +7 -0
- package/dist/neutral/types/StepViewerRpc.d.ts.map +1 -0
- package/dist/neutral/types/index.d.ts +1 -0
- package/dist/neutral/types/index.d.ts.map +1 -1
- package/dist/neutral/types/schema/AllRpcSchemas.d.ts +4 -4
- package/dist/neutral/types/schema/NetworkStakeViewerRpcSchemas.d.ts +20 -0
- package/dist/neutral/types/schema/NetworkStakeViewerRpcSchemas.d.ts.map +1 -0
- package/dist/neutral/types/schema/StepViewerRpcSchemas.d.ts +254 -0
- package/dist/neutral/types/schema/StepViewerRpcSchemas.d.ts.map +1 -0
- package/dist/neutral/types/schema/XyoViewerRpcSchemas.d.ts +4 -4
- package/dist/neutral/types/schema/common/Stake.d.ts +2 -1
- package/dist/neutral/types/schema/common/Stake.d.ts.map +1 -1
- package/dist/neutral/types/schema/index.d.ts +1 -0
- package/dist/neutral/types/schema/index.d.ts.map +1 -1
- package/dist/node/index-node.mjs +21 -0
- package/dist/node/index-node.mjs.map +1 -1
- package/dist/node/provider/viewer/JsonRpcXyoViewer.d.ts +2 -2
- package/dist/node/provider/viewer/JsonRpcXyoViewer.d.ts.map +1 -1
- package/dist/node/types/NetworkStakeViewerRpc.d.ts +7 -0
- package/dist/node/types/NetworkStakeViewerRpc.d.ts.map +1 -0
- package/dist/node/types/StepViewerRpc.d.ts +7 -0
- package/dist/node/types/StepViewerRpc.d.ts.map +1 -0
- package/dist/node/types/index.d.ts +1 -0
- package/dist/node/types/index.d.ts.map +1 -1
- package/dist/node/types/schema/AllRpcSchemas.d.ts +4 -4
- package/dist/node/types/schema/NetworkStakeViewerRpcSchemas.d.ts +20 -0
- package/dist/node/types/schema/NetworkStakeViewerRpcSchemas.d.ts.map +1 -0
- package/dist/node/types/schema/StepViewerRpcSchemas.d.ts +254 -0
- package/dist/node/types/schema/StepViewerRpcSchemas.d.ts.map +1 -0
- package/dist/node/types/schema/XyoViewerRpcSchemas.d.ts +4 -4
- package/dist/node/types/schema/common/Stake.d.ts +2 -1
- package/dist/node/types/schema/common/Stake.d.ts.map +1 -1
- package/dist/node/types/schema/index.d.ts +1 -0
- package/dist/node/types/schema/index.d.ts.map +1 -1
- package/package.json +6 -6
- package/src/provider/gateway/spec/MemoryXyoGateway.spec.ts +12 -3
- package/src/provider/viewer/JsonRpcXyoViewer.ts +2 -2
- package/src/types/NetworkStakeViewerRpc.ts +12 -0
- package/src/types/StepViewerRpc.ts +12 -0
- package/src/types/index.ts +1 -0
- package/src/types/schema/NetworkStakeViewerRpcSchemas.ts +19 -0
- package/src/types/schema/StepViewerRpcSchemas.ts +83 -0
- package/src/types/schema/common/Stake.ts +2 -1
- package/src/types/schema/index.ts +1 -0
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AddressZod, BigIntToJsonZod, JsonToBigIntZod,
|
|
3
|
+
} from '@xylabs/hex'
|
|
4
|
+
import z from 'zod'
|
|
5
|
+
|
|
6
|
+
import type { StepViewerMethodName } from '../StepViewerRpc.ts'
|
|
7
|
+
import {
|
|
8
|
+
JsonToStakeZod, StakeToJsonZod, StepIdentityZod,
|
|
9
|
+
} from './common/index.ts'
|
|
10
|
+
import type { RpcSchemaMap } from './RpcSchemaMap.ts'
|
|
11
|
+
|
|
12
|
+
export const StepViewerRpcSchemas = {
|
|
13
|
+
randomizer: {
|
|
14
|
+
params: {
|
|
15
|
+
from: z.tuple([StepIdentityZod]),
|
|
16
|
+
to: z.tuple([StepIdentityZod]),
|
|
17
|
+
},
|
|
18
|
+
result: {
|
|
19
|
+
from: BigIntToJsonZod,
|
|
20
|
+
to: JsonToBigIntZod,
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
stake: {
|
|
24
|
+
params: {
|
|
25
|
+
from: z.tuple([StepIdentityZod]),
|
|
26
|
+
to: z.tuple([StepIdentityZod]),
|
|
27
|
+
},
|
|
28
|
+
result: {
|
|
29
|
+
from: BigIntToJsonZod,
|
|
30
|
+
to: JsonToBigIntZod,
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
stakers: {
|
|
34
|
+
params: {
|
|
35
|
+
from: z.tuple([StepIdentityZod]),
|
|
36
|
+
to: z.tuple([StepIdentityZod]),
|
|
37
|
+
},
|
|
38
|
+
result: {
|
|
39
|
+
from: z.array(AddressZod),
|
|
40
|
+
to: z.array(AddressZod),
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
weight: {
|
|
44
|
+
params: {
|
|
45
|
+
from: z.tuple([StepIdentityZod]),
|
|
46
|
+
to: z.tuple([StepIdentityZod]),
|
|
47
|
+
},
|
|
48
|
+
result: {
|
|
49
|
+
from: BigIntToJsonZod,
|
|
50
|
+
to: JsonToBigIntZod,
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
positionCount: {
|
|
54
|
+
params: {
|
|
55
|
+
from: z.tuple([StepIdentityZod]),
|
|
56
|
+
to: z.tuple([StepIdentityZod]),
|
|
57
|
+
},
|
|
58
|
+
result: {
|
|
59
|
+
from: z.number(),
|
|
60
|
+
to: z.number(),
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
positions: {
|
|
64
|
+
params: {
|
|
65
|
+
from: z.tuple([StepIdentityZod]),
|
|
66
|
+
to: z.tuple([StepIdentityZod]),
|
|
67
|
+
},
|
|
68
|
+
result: {
|
|
69
|
+
from: z.array(StakeToJsonZod),
|
|
70
|
+
to: z.array(JsonToStakeZod),
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
stakerCount: {
|
|
74
|
+
params: {
|
|
75
|
+
from: z.tuple([StepIdentityZod]),
|
|
76
|
+
to: z.tuple([StepIdentityZod]),
|
|
77
|
+
},
|
|
78
|
+
result: {
|
|
79
|
+
from: z.number(),
|
|
80
|
+
to: z.number(),
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
} satisfies RpcSchemaMap<StepViewerMethodName>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { HexZod } from '@xylabs/hex'
|
|
2
|
+
import type { PositionId } from '@xyo-network/xl1-protocol'
|
|
2
3
|
import * as z from 'zod'
|
|
3
4
|
|
|
4
5
|
import { AddressZod } from './Address.ts'
|
|
@@ -35,7 +36,7 @@ export const StakeToJsonZod = StakeZod.transform(val => ({
|
|
|
35
36
|
export const JsonToStakeZod = StakeZod.extend({ amount: HexZod }).transform(val => ({
|
|
36
37
|
addBlock: val.addBlock,
|
|
37
38
|
amount: JsonToAttoZod.parse(val.amount),
|
|
38
|
-
id: val.id,
|
|
39
|
+
id: val.id as PositionId,
|
|
39
40
|
removeBlock: val.removeBlock,
|
|
40
41
|
staked: val.staked,
|
|
41
42
|
staker: val.staker,
|
|
@@ -2,6 +2,7 @@ export * from './AllRpcSchemas.ts'
|
|
|
2
2
|
export * from './common/index.ts'
|
|
3
3
|
export * from './createRequestSchema.ts'
|
|
4
4
|
export * from './createResponseSchema.ts'
|
|
5
|
+
export * from './NetworkStakeViewerRpcSchemas.ts'
|
|
5
6
|
export * from './RpcSchemaMap.ts'
|
|
6
7
|
export * from './XyoPermissionsRpcSchemas.ts'
|
|
7
8
|
export * from './XyoProviderRpcSchemas.ts'
|