@xyo-network/xl1-rpc 1.16.8 → 1.16.10
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/rpcMethodHandlersFromViewer.d.ts.map +1 -1
- package/dist/neutral/engine-node/rpcEngineFromConnection.d.ts.map +1 -1
- package/dist/neutral/index.mjs +603 -509
- package/dist/neutral/index.mjs.map +1 -1
- package/dist/neutral/provider/viewer/JsonRpcTimeSyncViewer/JsonRpcTimeSyncViewer.d.ts +8 -0
- package/dist/neutral/provider/viewer/JsonRpcTimeSyncViewer/JsonRpcTimeSyncViewer.d.ts.map +1 -0
- package/dist/neutral/provider/viewer/JsonRpcTimeSyncViewer/JsonRpcTimeSyncViewerMethods.d.ts +13 -0
- package/dist/neutral/provider/viewer/JsonRpcTimeSyncViewer/JsonRpcTimeSyncViewerMethods.d.ts.map +1 -0
- package/dist/neutral/provider/viewer/JsonRpcTimeSyncViewer/index.d.ts +3 -0
- package/dist/neutral/provider/viewer/JsonRpcTimeSyncViewer/index.d.ts.map +1 -0
- package/dist/neutral/provider/viewer/JsonRpcXyoViewer.d.ts +2 -3
- package/dist/neutral/provider/viewer/JsonRpcXyoViewer.d.ts.map +1 -1
- package/dist/neutral/provider/viewer/index.d.ts +1 -0
- package/dist/neutral/provider/viewer/index.d.ts.map +1 -1
- package/dist/neutral/types/{XyoDataLakeViewerRpc.d.ts → DataLakeViewerRpc.d.ts} +1 -1
- package/dist/neutral/types/DataLakeViewerRpc.d.ts.map +1 -0
- package/dist/neutral/types/TimeSyncViewerRpc.d.ts +10 -0
- package/dist/neutral/types/TimeSyncViewerRpc.d.ts.map +1 -0
- package/dist/neutral/types/index.d.ts +2 -0
- package/dist/neutral/types/index.d.ts.map +1 -1
- package/dist/neutral/types/schema/AllRpcSchemas.d.ts +196 -566
- package/dist/neutral/types/schema/AllRpcSchemas.d.ts.map +1 -1
- package/dist/neutral/types/schema/RewardsByPositionViewerRpcSchemas.d.ts +20 -40
- package/dist/neutral/types/schema/RewardsByPositionViewerRpcSchemas.d.ts.map +1 -1
- package/dist/neutral/types/schema/RewardsByStakerViewerRpcSchemas.d.ts +30 -70
- package/dist/neutral/types/schema/RewardsByStakerViewerRpcSchemas.d.ts.map +1 -1
- package/dist/neutral/types/schema/RewardsByStepViewerRpcSchemas.d.ts +30 -70
- package/dist/neutral/types/schema/RewardsByStepViewerRpcSchemas.d.ts.map +1 -1
- package/dist/neutral/types/schema/RewardsTotalViewerRpcSchemas.d.ts +20 -40
- package/dist/neutral/types/schema/RewardsTotalViewerRpcSchemas.d.ts.map +1 -1
- package/dist/neutral/types/schema/StepViewerRpcSchemas.d.ts +28 -60
- package/dist/neutral/types/schema/StepViewerRpcSchemas.d.ts.map +1 -1
- package/dist/neutral/types/schema/TimeSyncViewerRpcSchema.d.ts +58 -0
- package/dist/neutral/types/schema/TimeSyncViewerRpcSchema.d.ts.map +1 -0
- package/dist/neutral/types/schema/XyoRunnerRpcSchemas.d.ts +4 -12
- package/dist/neutral/types/schema/XyoRunnerRpcSchemas.d.ts.map +1 -1
- package/dist/neutral/types/schema/XyoSignerRpcSchemas.d.ts +12 -36
- package/dist/neutral/types/schema/XyoSignerRpcSchemas.d.ts.map +1 -1
- package/dist/neutral/types/schema/XyoViewerRpcSchemas.d.ts +180 -518
- package/dist/neutral/types/schema/XyoViewerRpcSchemas.d.ts.map +1 -1
- package/dist/neutral/types/schema/common/BlockBoundWitness.d.ts +4 -12
- package/dist/neutral/types/schema/common/BlockBoundWitness.d.ts.map +1 -1
- package/dist/neutral/types/schema/common/BoundWitness.d.ts +18 -54
- package/dist/neutral/types/schema/common/BoundWitness.d.ts.map +1 -1
- package/dist/neutral/types/schema/common/HydratedBlock.d.ts +10 -30
- package/dist/neutral/types/schema/common/HydratedBlock.d.ts.map +1 -1
- package/dist/neutral/types/schema/common/HydratedTransaction.d.ts +14 -42
- package/dist/neutral/types/schema/common/HydratedTransaction.d.ts.map +1 -1
- package/dist/neutral/types/schema/common/RewardsRangeOptions.d.ts +2 -4
- package/dist/neutral/types/schema/common/RewardsRangeOptions.d.ts.map +1 -1
- package/dist/neutral/types/schema/common/Stake.d.ts +14 -42
- package/dist/neutral/types/schema/common/Stake.d.ts.map +1 -1
- package/dist/neutral/types/schema/common/TimeDomain.d.ts +3 -0
- package/dist/neutral/types/schema/common/TimeDomain.d.ts.map +1 -0
- package/dist/neutral/types/schema/common/TransactionBoundWitness.d.ts +4 -12
- package/dist/neutral/types/schema/common/TransactionBoundWitness.d.ts.map +1 -1
- package/dist/neutral/types/schema/common/TransferPair.d.ts +1 -5
- package/dist/neutral/types/schema/common/TransferPair.d.ts.map +1 -1
- package/dist/neutral/types/schema/common/index.d.ts +1 -3
- package/dist/neutral/types/schema/common/index.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/engine/rpcMethodHandlersFromViewer.d.ts.map +1 -1
- package/dist/node/engine-node/rpcEngineFromConnection.d.ts.map +1 -1
- package/dist/node/index-node.mjs +611 -511
- package/dist/node/index-node.mjs.map +1 -1
- package/dist/node/provider/viewer/JsonRpcTimeSyncViewer/JsonRpcTimeSyncViewer.d.ts +8 -0
- package/dist/node/provider/viewer/JsonRpcTimeSyncViewer/JsonRpcTimeSyncViewer.d.ts.map +1 -0
- package/dist/node/provider/viewer/JsonRpcTimeSyncViewer/JsonRpcTimeSyncViewerMethods.d.ts +13 -0
- package/dist/node/provider/viewer/JsonRpcTimeSyncViewer/JsonRpcTimeSyncViewerMethods.d.ts.map +1 -0
- package/dist/node/provider/viewer/JsonRpcTimeSyncViewer/index.d.ts +3 -0
- package/dist/node/provider/viewer/JsonRpcTimeSyncViewer/index.d.ts.map +1 -0
- package/dist/node/provider/viewer/JsonRpcXyoViewer.d.ts +2 -3
- package/dist/node/provider/viewer/JsonRpcXyoViewer.d.ts.map +1 -1
- package/dist/node/provider/viewer/index.d.ts +1 -0
- package/dist/node/provider/viewer/index.d.ts.map +1 -1
- package/dist/node/types/{XyoDataLakeViewerRpc.d.ts → DataLakeViewerRpc.d.ts} +1 -1
- package/dist/node/types/DataLakeViewerRpc.d.ts.map +1 -0
- package/dist/node/types/TimeSyncViewerRpc.d.ts +10 -0
- package/dist/node/types/TimeSyncViewerRpc.d.ts.map +1 -0
- package/dist/node/types/index.d.ts +2 -0
- package/dist/node/types/index.d.ts.map +1 -1
- package/dist/node/types/schema/AllRpcSchemas.d.ts +196 -566
- package/dist/node/types/schema/AllRpcSchemas.d.ts.map +1 -1
- package/dist/node/types/schema/RewardsByPositionViewerRpcSchemas.d.ts +20 -40
- package/dist/node/types/schema/RewardsByPositionViewerRpcSchemas.d.ts.map +1 -1
- package/dist/node/types/schema/RewardsByStakerViewerRpcSchemas.d.ts +30 -70
- package/dist/node/types/schema/RewardsByStakerViewerRpcSchemas.d.ts.map +1 -1
- package/dist/node/types/schema/RewardsByStepViewerRpcSchemas.d.ts +30 -70
- package/dist/node/types/schema/RewardsByStepViewerRpcSchemas.d.ts.map +1 -1
- package/dist/node/types/schema/RewardsTotalViewerRpcSchemas.d.ts +20 -40
- package/dist/node/types/schema/RewardsTotalViewerRpcSchemas.d.ts.map +1 -1
- package/dist/node/types/schema/StepViewerRpcSchemas.d.ts +28 -60
- package/dist/node/types/schema/StepViewerRpcSchemas.d.ts.map +1 -1
- package/dist/node/types/schema/TimeSyncViewerRpcSchema.d.ts +58 -0
- package/dist/node/types/schema/TimeSyncViewerRpcSchema.d.ts.map +1 -0
- package/dist/node/types/schema/XyoRunnerRpcSchemas.d.ts +4 -12
- package/dist/node/types/schema/XyoRunnerRpcSchemas.d.ts.map +1 -1
- package/dist/node/types/schema/XyoSignerRpcSchemas.d.ts +12 -36
- package/dist/node/types/schema/XyoSignerRpcSchemas.d.ts.map +1 -1
- package/dist/node/types/schema/XyoViewerRpcSchemas.d.ts +180 -518
- package/dist/node/types/schema/XyoViewerRpcSchemas.d.ts.map +1 -1
- package/dist/node/types/schema/common/BlockBoundWitness.d.ts +4 -12
- package/dist/node/types/schema/common/BlockBoundWitness.d.ts.map +1 -1
- package/dist/node/types/schema/common/BoundWitness.d.ts +18 -54
- package/dist/node/types/schema/common/BoundWitness.d.ts.map +1 -1
- package/dist/node/types/schema/common/HydratedBlock.d.ts +10 -30
- package/dist/node/types/schema/common/HydratedBlock.d.ts.map +1 -1
- package/dist/node/types/schema/common/HydratedTransaction.d.ts +14 -42
- package/dist/node/types/schema/common/HydratedTransaction.d.ts.map +1 -1
- package/dist/node/types/schema/common/RewardsRangeOptions.d.ts +2 -4
- package/dist/node/types/schema/common/RewardsRangeOptions.d.ts.map +1 -1
- package/dist/node/types/schema/common/Stake.d.ts +14 -42
- package/dist/node/types/schema/common/Stake.d.ts.map +1 -1
- package/dist/node/types/schema/common/TimeDomain.d.ts +3 -0
- package/dist/node/types/schema/common/TimeDomain.d.ts.map +1 -0
- package/dist/node/types/schema/common/TransactionBoundWitness.d.ts +4 -12
- package/dist/node/types/schema/common/TransactionBoundWitness.d.ts.map +1 -1
- package/dist/node/types/schema/common/TransferPair.d.ts +1 -5
- package/dist/node/types/schema/common/TransferPair.d.ts.map +1 -1
- package/dist/node/types/schema/common/index.d.ts +1 -3
- package/dist/node/types/schema/common/index.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 +12 -12
- package/src/engine/rpcMethodHandlersFromViewer.ts +0 -1
- package/src/engine-node/rpcEngineFromConnection.ts +9 -3
- package/src/provider/runner/NodeXyoRunner.ts +2 -2
- package/src/provider/viewer/JsonRpcTimeSyncViewer/JsonRpcTimeSyncViewer.ts +11 -0
- package/src/provider/viewer/JsonRpcTimeSyncViewer/JsonRpcTimeSyncViewerMethods.ts +32 -0
- package/src/provider/viewer/JsonRpcTimeSyncViewer/index.ts +2 -0
- package/src/provider/viewer/JsonRpcXyoViewer.ts +12 -21
- package/src/provider/viewer/index.ts +1 -0
- package/src/types/TimeSyncViewerRpc.ts +16 -0
- package/src/types/index.ts +2 -0
- package/src/types/schema/DataLakeViewerRpcSchema.ts +1 -1
- package/src/types/schema/RewardsByStakerViewerRpcSchemas.ts +4 -2
- package/src/types/schema/RewardsByStepViewerRpcSchemas.ts +4 -2
- package/src/types/schema/StepViewerRpcSchemas.ts +2 -3
- package/src/types/schema/TimeSyncViewerRpcSchema.ts +49 -0
- package/src/types/schema/XyoSignerRpcSchemas.ts +1 -1
- package/src/types/schema/XyoViewerRpcSchemas.ts +6 -17
- package/src/types/schema/common/BoundWitness.ts +3 -3
- package/src/types/schema/common/RewardsRangeOptions.ts +2 -4
- package/src/types/schema/common/Stake.ts +1 -2
- package/src/types/schema/common/TimeDomain.ts +7 -0
- package/src/types/schema/common/TransferPair.ts +1 -2
- package/src/types/schema/common/index.ts +1 -3
- package/src/types/schema/index.ts +1 -0
- package/dist/neutral/types/XyoDataLakeViewerRpc.d.ts.map +0 -1
- package/dist/neutral/types/schema/common/Address.d.ts +0 -5
- package/dist/neutral/types/schema/common/Address.d.ts.map +0 -1
- package/dist/neutral/types/schema/common/StepIdentity.d.ts +0 -9
- package/dist/neutral/types/schema/common/StepIdentity.d.ts.map +0 -1
- package/dist/neutral/types/schema/common/Transfer.d.ts +0 -25
- package/dist/neutral/types/schema/common/Transfer.d.ts.map +0 -1
- package/dist/node/types/XyoDataLakeViewerRpc.d.ts.map +0 -1
- package/dist/node/types/schema/common/Address.d.ts +0 -5
- package/dist/node/types/schema/common/Address.d.ts.map +0 -1
- package/dist/node/types/schema/common/StepIdentity.d.ts +0 -9
- package/dist/node/types/schema/common/StepIdentity.d.ts.map +0 -1
- package/dist/node/types/schema/common/Transfer.d.ts +0 -25
- package/dist/node/types/schema/common/Transfer.d.ts.map +0 -1
- package/src/types/schema/common/Address.ts +0 -5
- package/src/types/schema/common/StepIdentity.ts +0 -9
- package/src/types/schema/common/Transfer.ts +0 -16
- /package/src/types/{XyoDataLakeViewerRpc.ts → DataLakeViewerRpc.ts} +0 -0
|
@@ -5,12 +5,8 @@ export declare const StakeZod: z.ZodObject<{
|
|
|
5
5
|
addBlock: z.ZodNumber;
|
|
6
6
|
id: z.ZodNumber;
|
|
7
7
|
removeBlock: z.ZodNumber;
|
|
8
|
-
staked: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/
|
|
9
|
-
|
|
10
|
-
}>, string>>;
|
|
11
|
-
staker: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/typeof").Brand<import("@xylabs/hex").Hex, {
|
|
12
|
-
readonly __address: true;
|
|
13
|
-
}>, string>>;
|
|
8
|
+
staked: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/hex").Address, string>>;
|
|
9
|
+
staker: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/hex").Address, string>>;
|
|
14
10
|
withdrawBlock: z.ZodNumber;
|
|
15
11
|
}, z.core.$strip>;
|
|
16
12
|
export declare const StakeToJsonZod: z.ZodPipe<z.ZodObject<{
|
|
@@ -18,48 +14,32 @@ export declare const StakeToJsonZod: z.ZodPipe<z.ZodObject<{
|
|
|
18
14
|
addBlock: z.ZodNumber;
|
|
19
15
|
id: z.ZodNumber;
|
|
20
16
|
removeBlock: z.ZodNumber;
|
|
21
|
-
staked: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/
|
|
22
|
-
|
|
23
|
-
}>, string>>;
|
|
24
|
-
staker: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/typeof").Brand<import("@xylabs/hex").Hex, {
|
|
25
|
-
readonly __address: true;
|
|
26
|
-
}>, string>>;
|
|
17
|
+
staked: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/hex").Address, string>>;
|
|
18
|
+
staker: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/hex").Address, string>>;
|
|
27
19
|
withdrawBlock: z.ZodNumber;
|
|
28
20
|
}, z.core.$strip>, z.ZodTransform<{
|
|
29
21
|
addBlock: number;
|
|
30
22
|
amount: import("@xylabs/hex").Hex;
|
|
31
23
|
id: number;
|
|
32
24
|
removeBlock: number;
|
|
33
|
-
staked: import("@xylabs/
|
|
34
|
-
|
|
35
|
-
}>;
|
|
36
|
-
staker: import("@xylabs/typeof").Brand<import("@xylabs/hex").Hex, {
|
|
37
|
-
readonly __address: true;
|
|
38
|
-
}>;
|
|
25
|
+
staked: import("@xylabs/hex").Address;
|
|
26
|
+
staker: import("@xylabs/hex").Address;
|
|
39
27
|
withdrawBlock: number;
|
|
40
28
|
}, {
|
|
41
29
|
amount: bigint;
|
|
42
30
|
addBlock: number;
|
|
43
31
|
id: number;
|
|
44
32
|
removeBlock: number;
|
|
45
|
-
staked: import("@xylabs/
|
|
46
|
-
|
|
47
|
-
}>;
|
|
48
|
-
staker: import("@xylabs/typeof").Brand<import("@xylabs/hex").Hex, {
|
|
49
|
-
readonly __address: true;
|
|
50
|
-
}>;
|
|
33
|
+
staked: import("@xylabs/hex").Address;
|
|
34
|
+
staker: import("@xylabs/hex").Address;
|
|
51
35
|
withdrawBlock: number;
|
|
52
36
|
}>>;
|
|
53
37
|
export declare const JsonToStakeZod: z.ZodPipe<z.ZodObject<{
|
|
54
38
|
addBlock: z.ZodNumber;
|
|
55
39
|
id: z.ZodNumber;
|
|
56
40
|
removeBlock: z.ZodNumber;
|
|
57
|
-
staked: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/
|
|
58
|
-
|
|
59
|
-
}>, string>>;
|
|
60
|
-
staker: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/typeof").Brand<import("@xylabs/hex").Hex, {
|
|
61
|
-
readonly __address: true;
|
|
62
|
-
}>, string>>;
|
|
41
|
+
staked: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/hex").Address, string>>;
|
|
42
|
+
staker: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/hex").Address, string>>;
|
|
63
43
|
withdrawBlock: z.ZodNumber;
|
|
64
44
|
amount: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/hex").Hex, string>>;
|
|
65
45
|
}, z.core.$strip>, z.ZodTransform<{
|
|
@@ -67,23 +47,15 @@ export declare const JsonToStakeZod: z.ZodPipe<z.ZodObject<{
|
|
|
67
47
|
amount: import("@xyo-network/xl1-protocol").AttoXL1;
|
|
68
48
|
id: PositionId;
|
|
69
49
|
removeBlock: number;
|
|
70
|
-
staked: import("@xylabs/
|
|
71
|
-
|
|
72
|
-
}>;
|
|
73
|
-
staker: import("@xylabs/typeof").Brand<import("@xylabs/hex").Hex, {
|
|
74
|
-
readonly __address: true;
|
|
75
|
-
}>;
|
|
50
|
+
staked: import("@xylabs/hex").Address;
|
|
51
|
+
staker: import("@xylabs/hex").Address;
|
|
76
52
|
withdrawBlock: number;
|
|
77
53
|
}, {
|
|
78
54
|
addBlock: number;
|
|
79
55
|
id: number;
|
|
80
56
|
removeBlock: number;
|
|
81
|
-
staked: import("@xylabs/
|
|
82
|
-
|
|
83
|
-
}>;
|
|
84
|
-
staker: import("@xylabs/typeof").Brand<import("@xylabs/hex").Hex, {
|
|
85
|
-
readonly __address: true;
|
|
86
|
-
}>;
|
|
57
|
+
staked: import("@xylabs/hex").Address;
|
|
58
|
+
staker: import("@xylabs/hex").Address;
|
|
87
59
|
withdrawBlock: number;
|
|
88
60
|
amount: import("@xylabs/hex").Hex;
|
|
89
61
|
}>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Stake.d.ts","sourceRoot":"","sources":["../../../../../src/types/schema/common/Stake.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAA;AAC3D,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;
|
|
1
|
+
{"version":3,"file":"Stake.d.ts","sourceRoot":"","sources":["../../../../../src/types/schema/common/Stake.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAA;AAC3D,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAMxB,eAAO,MAAM,QAAQ;;;;;;;;iBAcnB,CAAA;AAEF,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;GAQxB,CAAA;AAEH,eAAO,MAAM,cAAc;;;;;;;;;;;QAGX,UAAU;;;;;;;;;;;;;GAKvB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TimeDomain.d.ts","sourceRoot":"","sources":["../../../../../src/types/schema/common/TimeDomain.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAExB,eAAO,MAAM,aAAa,6FAIxB,CAAA"}
|
|
@@ -22,17 +22,13 @@ export declare const WithTransactionFeesZod: z.ZodObject<{
|
|
|
22
22
|
}, z.core.$strip>;
|
|
23
23
|
export declare const TransactionBoundWitnessZod: z.ZodObject<{
|
|
24
24
|
schema: z.ZodLiteral<"network.xyo.boundwitness">;
|
|
25
|
-
addresses: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/
|
|
26
|
-
readonly __address: true;
|
|
27
|
-
}>, string>>>;
|
|
25
|
+
addresses: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/hex").Address, string>>>;
|
|
28
26
|
payload_hashes: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/hex").Hash, string>>>;
|
|
29
27
|
payload_schemas: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<string & {
|
|
30
28
|
__schema: true;
|
|
31
29
|
}, string>>]>>;
|
|
32
30
|
previous_hashes: z.ZodArray<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/hex").Hash, string>>>>;
|
|
33
|
-
$destination: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/
|
|
34
|
-
readonly __address: true;
|
|
35
|
-
}>, string>>>;
|
|
31
|
+
$destination: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/hex").Address, string>>>;
|
|
36
32
|
$sourceQuery: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/hex").Hash, string>>>;
|
|
37
33
|
$signatures: z.ZodArray<z.ZodUnion<readonly [z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/hex").Hex, string>>, z.ZodNull]>>;
|
|
38
34
|
_hash: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/hex").Hash, string>>>;
|
|
@@ -52,17 +48,13 @@ export declare const TransactionBoundWitnessZod: z.ZodObject<{
|
|
|
52
48
|
}, z.core.$strip>;
|
|
53
49
|
export declare const SignedTransactionBoundWitnessZod: z.ZodObject<{
|
|
54
50
|
schema: z.ZodLiteral<"network.xyo.boundwitness">;
|
|
55
|
-
addresses: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/
|
|
56
|
-
readonly __address: true;
|
|
57
|
-
}>, string>>>;
|
|
51
|
+
addresses: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/hex").Address, string>>>;
|
|
58
52
|
payload_hashes: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/hex").Hash, string>>>;
|
|
59
53
|
payload_schemas: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<string & {
|
|
60
54
|
__schema: true;
|
|
61
55
|
}, string>>]>>;
|
|
62
56
|
previous_hashes: z.ZodArray<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/hex").Hash, string>>>>;
|
|
63
|
-
$destination: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/
|
|
64
|
-
readonly __address: true;
|
|
65
|
-
}>, string>>>;
|
|
57
|
+
$destination: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/hex").Address, string>>>;
|
|
66
58
|
$sourceQuery: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/hex").Hash, string>>>;
|
|
67
59
|
$signatures: z.ZodArray<z.ZodUnion<readonly [z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/hex").Hex, string>>, z.ZodNull]>>;
|
|
68
60
|
_hash: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/hex").Hash, string>>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TransactionBoundWitness.d.ts","sourceRoot":"","sources":["../../../../../src/types/schema/common/TransactionBoundWitness.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAMxB,eAAO,MAAM,aAAa;;iBAAoC,CAAA;AAC9D,eAAO,MAAM,WAAW;;iBAAoC,CAAA;AAC5D,eAAO,MAAM,gBAAgB;;;iBAAyD,CAAA;AACtF,eAAO,MAAM,eAAe;;iBAAuD,CAAA;AAEnF,eAAO,MAAM,sBAAsB;;;;;;;iBAA4C,CAAA;AAM/E,eAAO,MAAM,0BAA0B
|
|
1
|
+
{"version":3,"file":"TransactionBoundWitness.d.ts","sourceRoot":"","sources":["../../../../../src/types/schema/common/TransactionBoundWitness.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAMxB,eAAO,MAAM,aAAa;;iBAAoC,CAAA;AAC9D,eAAO,MAAM,WAAW;;iBAAoC,CAAA;AAC5D,eAAO,MAAM,gBAAgB;;;iBAAyD,CAAA;AACtF,eAAO,MAAM,eAAe;;iBAAuD,CAAA;AAEnF,eAAO,MAAM,sBAAsB;;;;;;;iBAA4C,CAAA;AAM/E,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;iBAUd,CAAA;AAEzB,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;iBAUV,CAAA"}
|
|
@@ -1,7 +1,3 @@
|
|
|
1
1
|
import z from 'zod';
|
|
2
|
-
export declare const TransferPairZod: z.ZodTuple<[z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/
|
|
3
|
-
readonly __address: true;
|
|
4
|
-
}>, string>>, z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/typeof").Brand<import("@xylabs/hex").Hex, {
|
|
5
|
-
readonly __address: true;
|
|
6
|
-
}>, string>>], null>;
|
|
2
|
+
export declare const TransferPairZod: z.ZodTuple<[z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/hex").Address, string>>, z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/hex").Address, string>>], null>;
|
|
7
3
|
//# sourceMappingURL=TransferPair.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TransferPair.d.ts","sourceRoot":"","sources":["../../../../../src/types/schema/common/TransferPair.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TransferPair.d.ts","sourceRoot":"","sources":["../../../../../src/types/schema/common/TransferPair.ts"],"names":[],"mappings":"AACA,OAAO,CAAC,MAAM,KAAK,CAAA;AAEnB,eAAO,MAAM,eAAe,kLAE1B,CAAA"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export * from './Address.ts';
|
|
2
1
|
export * from './ArrayBuffer.ts';
|
|
3
2
|
export * from './BlockBoundWitness.ts';
|
|
4
3
|
export * from './BoundWitness.ts';
|
|
@@ -10,9 +9,8 @@ export * from './Permission.ts';
|
|
|
10
9
|
export * from './RewardsRangeOptions.ts';
|
|
11
10
|
export * from './Sequence.ts';
|
|
12
11
|
export * from './Stake.ts';
|
|
13
|
-
export * from './
|
|
12
|
+
export * from './TimeDomain.ts';
|
|
14
13
|
export * from './TransactionBoundWitness.ts';
|
|
15
14
|
export * from './TransactionFees.ts';
|
|
16
|
-
export * from './Transfer.ts';
|
|
17
15
|
export * from './TransferPair.ts';
|
|
18
16
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/types/schema/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/types/schema/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA;AAChC,cAAc,wBAAwB,CAAA;AACtC,cAAc,mBAAmB,CAAA;AACjC,cAAc,YAAY,CAAA;AAC1B,cAAc,oBAAoB,CAAA;AAClC,cAAc,0BAA0B,CAAA;AACxC,cAAc,WAAW,CAAA;AACzB,cAAc,iBAAiB,CAAA;AAC/B,cAAc,0BAA0B,CAAA;AACxC,cAAc,eAAe,CAAA;AAC7B,cAAc,YAAY,CAAA;AAC1B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,8BAA8B,CAAA;AAC5C,cAAc,sBAAsB,CAAA;AACpC,cAAc,mBAAmB,CAAA"}
|
|
@@ -10,6 +10,7 @@ export * from './RewardsByStepViewerRpcSchemas.ts';
|
|
|
10
10
|
export * from './RewardsTotalViewerRpcSchemas.ts';
|
|
11
11
|
export * from './RpcSchemaMap.ts';
|
|
12
12
|
export * from './StepRewardsViewerRpcSchemas.ts';
|
|
13
|
+
export * from './TimeSyncViewerRpcSchema.ts';
|
|
13
14
|
export * from './XyoPermissionsRpcSchemas.ts';
|
|
14
15
|
export * from './XyoRunnerRpcSchemas.ts';
|
|
15
16
|
export * from './XyoSignerRpcSchemas.ts';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/types/schema/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA;AAClC,cAAc,mBAAmB,CAAA;AACjC,cAAc,0BAA0B,CAAA;AACxC,cAAc,2BAA2B,CAAA;AACzC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,mCAAmC,CAAA;AACjD,cAAc,wCAAwC,CAAA;AACtD,cAAc,sCAAsC,CAAA;AACpD,cAAc,oCAAoC,CAAA;AAClD,cAAc,mCAAmC,CAAA;AACjD,cAAc,mBAAmB,CAAA;AACjC,cAAc,kCAAkC,CAAA;AAChD,cAAc,+BAA+B,CAAA;AAC7C,cAAc,0BAA0B,CAAA;AACxC,cAAc,0BAA0B,CAAA;AACxC,cAAc,0BAA0B,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/types/schema/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA;AAClC,cAAc,mBAAmB,CAAA;AACjC,cAAc,0BAA0B,CAAA;AACxC,cAAc,2BAA2B,CAAA;AACzC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,mCAAmC,CAAA;AACjD,cAAc,wCAAwC,CAAA;AACtD,cAAc,sCAAsC,CAAA;AACpD,cAAc,oCAAoC,CAAA;AAClD,cAAc,mCAAmC,CAAA;AACjD,cAAc,mBAAmB,CAAA;AACjC,cAAc,kCAAkC,CAAA;AAChD,cAAc,8BAA8B,CAAA;AAC5C,cAAc,+BAA+B,CAAA;AAC7C,cAAc,0BAA0B,CAAA;AACxC,cAAc,0BAA0B,CAAA;AACxC,cAAc,0BAA0B,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "http://json.schemastore.org/package.json",
|
|
3
3
|
"name": "@xyo-network/xl1-rpc",
|
|
4
|
-
"version": "1.16.
|
|
4
|
+
"version": "1.16.10",
|
|
5
5
|
"description": "XYO Layer One API",
|
|
6
6
|
"homepage": "https://xylabs.com",
|
|
7
7
|
"bugs": {
|
|
@@ -56,18 +56,18 @@
|
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
58
|
"@metamask/json-rpc-engine": "~10.1.1",
|
|
59
|
-
"@xylabs/assert": "~5.0.
|
|
60
|
-
"@xylabs/axios": "~5.0.
|
|
61
|
-
"@xylabs/hex": "~5.0.
|
|
62
|
-
"@xylabs/typeof": "~5.0.
|
|
59
|
+
"@xylabs/assert": "~5.0.25",
|
|
60
|
+
"@xylabs/axios": "~5.0.25",
|
|
61
|
+
"@xylabs/hex": "~5.0.25",
|
|
62
|
+
"@xylabs/typeof": "~5.0.25",
|
|
63
63
|
"@xyo-network/archivist-model": "~5.1.21",
|
|
64
64
|
"@xyo-network/boundwitness-model": "~5.1.21",
|
|
65
65
|
"@xyo-network/module-model": "~5.1.21",
|
|
66
66
|
"@xyo-network/node-model": "~5.1.21",
|
|
67
67
|
"@xyo-network/payload-builder": "~5.1.21",
|
|
68
68
|
"@xyo-network/payload-model": "~5.1.21",
|
|
69
|
-
"@xyo-network/xl1-protocol": "~1.13.
|
|
70
|
-
"@xyo-network/xl1-protocol-sdk": "~1.16.
|
|
69
|
+
"@xyo-network/xl1-protocol": "~1.13.11",
|
|
70
|
+
"@xyo-network/xl1-protocol-sdk": "~1.16.10",
|
|
71
71
|
"axios": "~1.13.2",
|
|
72
72
|
"uuid": "~13.0.0",
|
|
73
73
|
"zod": "~4.1.12"
|
|
@@ -75,19 +75,19 @@
|
|
|
75
75
|
"devDependencies": {
|
|
76
76
|
"@metamask/utils": "~11.8.1",
|
|
77
77
|
"@types/node": "~24.10.1",
|
|
78
|
-
"@xylabs/logger": "~5.0.
|
|
79
|
-
"@xylabs/object": "~5.0.
|
|
78
|
+
"@xylabs/logger": "~5.0.25",
|
|
79
|
+
"@xylabs/object": "~5.0.25",
|
|
80
80
|
"@xylabs/ts-scripts-yarn3": "~7.2.8",
|
|
81
81
|
"@xylabs/tsconfig": "~7.2.8",
|
|
82
|
-
"@xylabs/vitest-extended": "~5.0.
|
|
82
|
+
"@xylabs/vitest-extended": "~5.0.25",
|
|
83
83
|
"@xyo-network/account": "~5.1.21",
|
|
84
84
|
"@xyo-network/account-model": "~5.1.21",
|
|
85
|
-
"@xyo-network/chain-protocol": "~1.16.
|
|
85
|
+
"@xyo-network/chain-protocol": "~1.16.10",
|
|
86
86
|
"@xyo-network/wallet": "~5.1.21",
|
|
87
87
|
"dotenv": "~17.2.3",
|
|
88
88
|
"eslint": "^9.39.1",
|
|
89
89
|
"typescript": "~5.9.3",
|
|
90
|
-
"vitest": "~4.0.
|
|
90
|
+
"vitest": "~4.0.9"
|
|
91
91
|
},
|
|
92
92
|
"packageManager": "yarn@4.6.0",
|
|
93
93
|
"engines": {
|
|
@@ -37,7 +37,6 @@ export const rpcMethodHandlersFromViewer = (viewer: XyoViewer): XyoViewerRpcMeth
|
|
|
37
37
|
xyoViewer_stakeByStaker: params => viewer.stakeByStaker(...(params ?? [])),
|
|
38
38
|
xyoViewer_stakesByStaked: params => viewer.stakesByStaked(...(params ?? [])),
|
|
39
39
|
xyoViewer_stakesByStaker: params => viewer.stakesByStaker(...(params ?? [])),
|
|
40
|
-
xyoViewer_stakedByStaker: params => viewer.stakedByStaker(...(params ?? [])),
|
|
41
40
|
xyoViewer_transactionByBlockHashAndIndex: params => viewer.transactionByBlockHashAndIndex(...(params ?? [])),
|
|
42
41
|
xyoViewer_transactionByBlockNumberAndIndex: params => viewer.transactionByBlockNumberAndIndex(...(params ?? [])),
|
|
43
42
|
xyoViewer_transactionByHash: params => viewer.transactionByHash(...(params ?? [])),
|
|
@@ -37,6 +37,7 @@ export const rpcEngineFromConnection = (connection: XyoConnection, networkStakeV
|
|
|
37
37
|
const parsed = requestSchema.safeParse(req)
|
|
38
38
|
// If validation fails
|
|
39
39
|
if (!parsed.success) {
|
|
40
|
+
console.error('RPC Request Validation Error:', parsed.error)
|
|
40
41
|
res.error = {
|
|
41
42
|
// Return invalid params error
|
|
42
43
|
...JsonRpcErrorCodes.InvalidParams,
|
|
@@ -48,9 +49,14 @@ export const rpcEngineFromConnection = (connection: XyoConnection, networkStakeV
|
|
|
48
49
|
|
|
49
50
|
// Call handler with validated params
|
|
50
51
|
const { params } = parsed.data
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
try {
|
|
53
|
+
const result = await handler(params as never)
|
|
54
|
+
// Parse handler result according to schema
|
|
55
|
+
res.result = schema.result.to.parse(result) as Json
|
|
56
|
+
} catch (error) {
|
|
57
|
+
console.error('RPC Response Handler Error:', error)
|
|
58
|
+
throw error
|
|
59
|
+
}
|
|
54
60
|
}),
|
|
55
61
|
)
|
|
56
62
|
return engine
|
|
@@ -39,12 +39,12 @@ export class NodeXyoRunner implements XyoRunner {
|
|
|
39
39
|
|
|
40
40
|
protected getArchivist = async (identifier: ModuleIdentifier) => {
|
|
41
41
|
const archivist = await this.node.resolve(identifier)
|
|
42
|
-
return assertEx(asArchivistInstance(archivist), () => `
|
|
42
|
+
return assertEx(asArchivistInstance(archivist), () => `Could not resolve ${identifier} to an archivist instance`)
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
protected getPendingArchivist = async () => {
|
|
46
46
|
if (this._pendingArchivist) return this._pendingArchivist
|
|
47
47
|
this._pendingArchivist = await this.getArchivist(this.pendingArchivistPath)
|
|
48
|
-
return assertEx(this._pendingArchivist, () => `
|
|
48
|
+
return assertEx(this._pendingArchivist, () => `Could not resolve pending archivist at ${this.pendingArchivistPath}`)
|
|
49
49
|
}
|
|
50
50
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { TimeSyncViewer } from '@xyo-network/xl1-protocol-sdk'
|
|
2
|
+
|
|
3
|
+
import type { RpcTransport } from '../../../transport/index.ts'
|
|
4
|
+
import type { TimeSyncViewerRpcSchemas } from '../../../types/index.ts'
|
|
5
|
+
import { JsonRpcTimeSyncViewerMethods } from './JsonRpcTimeSyncViewerMethods.ts'
|
|
6
|
+
|
|
7
|
+
export class JsonRpcTimeSyncViewer extends JsonRpcTimeSyncViewerMethods implements TimeSyncViewer {
|
|
8
|
+
constructor(transport: RpcTransport<typeof TimeSyncViewerRpcSchemas>) {
|
|
9
|
+
super(transport)
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
TimeDomain,
|
|
3
|
+
TimePayload,
|
|
4
|
+
} from '@xyo-network/xl1-protocol'
|
|
5
|
+
import type { TimeSyncViewerMethods } from '@xyo-network/xl1-protocol-sdk'
|
|
6
|
+
|
|
7
|
+
import type { RpcTransport } from '../../../transport/index.ts'
|
|
8
|
+
import type { TimeSyncViewerRpcSchemas } from '../../../types/index.ts'
|
|
9
|
+
|
|
10
|
+
export class JsonRpcTimeSyncViewerMethods implements TimeSyncViewerMethods {
|
|
11
|
+
protected readonly transport: RpcTransport<typeof TimeSyncViewerRpcSchemas>
|
|
12
|
+
|
|
13
|
+
constructor(transport: RpcTransport<typeof TimeSyncViewerRpcSchemas>) {
|
|
14
|
+
this.transport = transport
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
async convertTime(fromDomain: TimeDomain, toDomain: TimeDomain, from: number): Promise<number> {
|
|
18
|
+
return await this.transport.sendRequest('timeSyncViewer_convertTime', [fromDomain, toDomain, from])
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
async currentTime(domain: TimeDomain): Promise<[string, number]> {
|
|
22
|
+
return await this.transport.sendRequest('timeSyncViewer_currentTime', [domain])
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
async currentTimeAndHash(domain: TimeDomain): Promise<[number, string | null]> {
|
|
26
|
+
return await this.transport.sendRequest('timeSyncViewer_currentTimeAndHash', [domain])
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
async currentTimePayload(): Promise<TimePayload> {
|
|
30
|
+
return await this.transport.sendRequest('timeSyncViewer_currentTimePayload', [])
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
|
-
type Address,
|
|
3
|
-
isHash,
|
|
2
|
+
type Address, type Hash, isHash,
|
|
4
3
|
} from '@xylabs/hex'
|
|
4
|
+
import { isDefined } from '@xylabs/typeof'
|
|
5
5
|
import type {
|
|
6
6
|
AttoXL1,
|
|
7
7
|
BlockRange,
|
|
@@ -10,15 +10,12 @@ import type {
|
|
|
10
10
|
SignedHydratedTransaction,
|
|
11
11
|
StepIdentity,
|
|
12
12
|
StepIdentityString,
|
|
13
|
+
XL1BlockNumber,
|
|
13
14
|
XL1BlockRange,
|
|
14
15
|
} from '@xyo-network/xl1-protocol'
|
|
15
|
-
import {
|
|
16
|
-
asAttoXL1, asHydratedBlock, asXL1BlockRange,
|
|
17
|
-
isRange,
|
|
18
|
-
} from '@xyo-network/xl1-protocol'
|
|
16
|
+
import { asAttoXL1, asHydratedBlock } from '@xyo-network/xl1-protocol'
|
|
19
17
|
import type {
|
|
20
|
-
AccountBalanceHistoryItem,
|
|
21
|
-
ForkHistory, NetworkStakeViewer, Position, TransferBalanceHistoryItem, TransferPair, XyoViewer,
|
|
18
|
+
AccountBalanceHistoryItem, ForkHistory, NetworkStakeViewer, Position, TransferBalanceHistoryItem, TransferPair, XyoViewer,
|
|
22
19
|
} from '@xyo-network/xl1-protocol-sdk'
|
|
23
20
|
|
|
24
21
|
import type { RpcTransport } from '../../transport/index.ts'
|
|
@@ -49,15 +46,13 @@ export class JsonRpcXyoViewer implements XyoViewer {
|
|
|
49
46
|
async accountBalanceHistory(address: Address, head: Hash): Promise<AccountBalanceHistoryItem[]>
|
|
50
47
|
async accountBalanceHistory(address: Address, range: BlockRange): Promise<AccountBalanceHistoryItem[]>
|
|
51
48
|
async accountBalanceHistory(address: Address, headOrRange?: BlockRange | Hash): Promise<AccountBalanceHistoryItem[]> {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
if (isRange(range)) {
|
|
58
|
-
return (await this.transport.sendRequest('xyoViewer_accountBalanceHistory', [address, range])) as AccountBalanceHistoryItem[]
|
|
49
|
+
if (isDefined(headOrRange)) {
|
|
50
|
+
if (isHash(headOrRange)) {
|
|
51
|
+
return (await this.transport.sendRequest('xyoViewer_accountBalanceHistory', [address, headOrRange])) as AccountBalanceHistoryItem[]
|
|
52
|
+
}
|
|
53
|
+
return (await this.transport.sendRequest('xyoViewer_accountBalanceHistory', [address, headOrRange])) as AccountBalanceHistoryItem[]
|
|
59
54
|
}
|
|
60
|
-
return (await this.transport.sendRequest('xyoViewer_accountBalanceHistory', [address
|
|
55
|
+
return (await this.transport.sendRequest('xyoViewer_accountBalanceHistory', [address])) as AccountBalanceHistoryItem[]
|
|
61
56
|
}
|
|
62
57
|
|
|
63
58
|
async blockByHash(hash: Hash): Promise<HydratedBlock | null> {
|
|
@@ -88,7 +83,7 @@ export class JsonRpcXyoViewer implements XyoViewer {
|
|
|
88
83
|
return (await this.transport.sendRequest('xyoViewer_currentBlockHash'))
|
|
89
84
|
}
|
|
90
85
|
|
|
91
|
-
async currentBlockNumber(): Promise<
|
|
86
|
+
async currentBlockNumber(): Promise<XL1BlockNumber> {
|
|
92
87
|
return (await this.transport.sendRequest('xyoViewer_currentBlockNumber'))
|
|
93
88
|
}
|
|
94
89
|
|
|
@@ -176,10 +171,6 @@ export class JsonRpcXyoViewer implements XyoViewer {
|
|
|
176
171
|
return (await this.transport.sendRequest('xyoViewer_stakeByStaker', [staker, slot]))
|
|
177
172
|
}
|
|
178
173
|
|
|
179
|
-
async stakedByStaker(staker: Address): Promise<Address[]> {
|
|
180
|
-
return (await this.transport.sendRequest('xyoViewer_stakedByStaker', [staker]))
|
|
181
|
-
}
|
|
182
|
-
|
|
183
174
|
async stakesByStaked(staked: Address): Promise<Position[]> {
|
|
184
175
|
return (await this.transport.sendRequest('xyoViewer_stakesByStaked', [staked]))
|
|
185
176
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { TimeSyncViewerMethods } from '@xyo-network/xl1-protocol-sdk'
|
|
2
|
+
|
|
3
|
+
import type { MethodName, RpcMethodName } from './RpcMethodName.ts'
|
|
4
|
+
|
|
5
|
+
export const TimeSyncViewerRpcNamespace = 'timeSyncViewer' as const
|
|
6
|
+
export type TimeSyncViewerRpcNamespace = typeof TimeSyncViewerRpcNamespace
|
|
7
|
+
|
|
8
|
+
export type TimeSyncViewerMethodName = MethodName<TimeSyncViewerMethods>
|
|
9
|
+
export type TimeSyncViewerRpcMethodName = RpcMethodName<TimeSyncViewerRpcNamespace,
|
|
10
|
+
TimeSyncViewerMethodName>
|
|
11
|
+
|
|
12
|
+
export type TimeSyncViewerRpcMethodHandlers = {
|
|
13
|
+
[K in TimeSyncViewerMethodName as TimeSyncViewerRpcMethodName]: (
|
|
14
|
+
params: Parameters<TimeSyncViewerMethods[K]>,
|
|
15
|
+
) => ReturnType<TimeSyncViewerMethods[K]>
|
|
16
|
+
}
|
package/src/types/index.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export * from './DataLakeViewerRpc.ts'
|
|
1
2
|
export * from './ErrorCodes.ts'
|
|
2
3
|
export * from './JsonRpc.ts'
|
|
3
4
|
export * from './NetworkStakeViewerRpc.ts'
|
|
@@ -8,6 +9,7 @@ export * from './NetworkStakingStepRewardsTotalViewerRpc.ts'
|
|
|
8
9
|
export * from './NetworkStakingStepRewardsViewerRpc.ts'
|
|
9
10
|
export * from './RpcMethodName.ts'
|
|
10
11
|
export * from './schema/index.ts'
|
|
12
|
+
export * from './TimeSyncViewerRpc.ts'
|
|
11
13
|
export * from './XyoPermissions.ts'
|
|
12
14
|
export * from './XyoProviderRpc.ts'
|
|
13
15
|
export * from './XyoRunnerRpc.ts'
|
|
@@ -2,7 +2,7 @@ import { HashZod } from '@xylabs/hex'
|
|
|
2
2
|
import { PayloadZod } from '@xyo-network/payload-model'
|
|
3
3
|
import * as z from 'zod'
|
|
4
4
|
|
|
5
|
-
import type { DataLakeViewerRpcMethodName } from '../
|
|
5
|
+
import type { DataLakeViewerRpcMethodName } from '../DataLakeViewerRpc.ts'
|
|
6
6
|
import { ArrayBufferToJsonZod, JsonToArrayBufferZod } from './common/index.ts'
|
|
7
7
|
import type { RpcSchemaMap } from './RpcSchemaMap.ts'
|
|
8
8
|
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
AddressZod, BigIntToJsonZod, JsonToBigIntZod,
|
|
3
|
+
} from '@xylabs/hex'
|
|
2
4
|
import z from 'zod'
|
|
3
5
|
|
|
4
6
|
import type { NetworkStakingStepRewardsByStakerViewerRpcMethodName } from '../NetworkStakingStepRewardsByStakerViewerRpc.ts'
|
|
5
|
-
import {
|
|
7
|
+
import { RewardsRangeOptionsZod } from './common/index.ts'
|
|
6
8
|
import type { RpcSchemaMap } from './RpcSchemaMap.ts'
|
|
7
9
|
|
|
8
10
|
export const NetworkStakingStepRewardsByStakerViewerRpcSchemas = {
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
AddressZod, BigIntToJsonZod, JsonToBigIntZod,
|
|
3
|
+
} from '@xylabs/hex'
|
|
2
4
|
import z from 'zod'
|
|
3
5
|
|
|
4
6
|
import type { NetworkStakingStepRewardsByStepViewerRpcMethodName } from '../NetworkStakingStepRewardsByStepViewerRpc.ts'
|
|
5
|
-
import {
|
|
7
|
+
import { RewardsRangeOptionsZod } from './common/index.ts'
|
|
6
8
|
import type { RpcSchemaMap } from './RpcSchemaMap.ts'
|
|
7
9
|
|
|
8
10
|
export const NetworkStakingStepRewardsByStepViewerRpcSchemas = {
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AddressZod, BigIntToJsonZod, JsonToBigIntZod,
|
|
3
3
|
} from '@xylabs/hex'
|
|
4
|
+
import { StepIdentityZod } from '@xyo-network/xl1-protocol'
|
|
4
5
|
import z from 'zod'
|
|
5
6
|
|
|
6
7
|
import type { StepViewerMethodName } from '../StepViewerRpc.ts'
|
|
7
|
-
import {
|
|
8
|
-
JsonToStakeZod, StakeToJsonZod, StepIdentityZod,
|
|
9
|
-
} from './common/index.ts'
|
|
8
|
+
import { JsonToStakeZod, StakeToJsonZod } from './common/index.ts'
|
|
10
9
|
import type { RpcSchemaMap } from './RpcSchemaMap.ts'
|
|
11
10
|
|
|
12
11
|
export const StepViewerRpcSchemas = {
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { TimePayloadZod } from '@xyo-network/xl1-protocol'
|
|
2
|
+
import * as z from 'zod'
|
|
3
|
+
|
|
4
|
+
import type { TimeSyncViewerRpcMethodName } from '../TimeSyncViewerRpc.ts'
|
|
5
|
+
import { TimeDomainZod } from './common/index.ts'
|
|
6
|
+
import type { RpcSchemaMap } from './RpcSchemaMap.ts'
|
|
7
|
+
|
|
8
|
+
export const TimeSyncViewerRpcSchemas = {
|
|
9
|
+
timeSyncViewer_convertTime: {
|
|
10
|
+
params: {
|
|
11
|
+
from: z.tuple([TimeDomainZod, TimeDomainZod, z.number()]),
|
|
12
|
+
to: z.tuple([TimeDomainZod, TimeDomainZod, z.number()]),
|
|
13
|
+
},
|
|
14
|
+
result: {
|
|
15
|
+
from: z.number(),
|
|
16
|
+
to: z.number(),
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
timeSyncViewer_currentTime: {
|
|
20
|
+
params: {
|
|
21
|
+
from: z.tuple([TimeDomainZod]),
|
|
22
|
+
to: z.tuple([TimeDomainZod]),
|
|
23
|
+
},
|
|
24
|
+
result: {
|
|
25
|
+
from: z.tuple([TimeDomainZod, z.number()]),
|
|
26
|
+
to: z.tuple([TimeDomainZod, z.number()]),
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
timeSyncViewer_currentTimeAndHash: {
|
|
30
|
+
params: {
|
|
31
|
+
from: z.tuple([TimeDomainZod]),
|
|
32
|
+
to: z.tuple([TimeDomainZod]),
|
|
33
|
+
},
|
|
34
|
+
result: {
|
|
35
|
+
from: z.tuple([z.number(), z.nullable(z.string())]),
|
|
36
|
+
to: z.tuple([z.number(), z.nullable(z.string())]),
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
timeSyncViewer_currentTimePayload: {
|
|
40
|
+
params: {
|
|
41
|
+
from: z.tuple([]),
|
|
42
|
+
to: z.tuple([]),
|
|
43
|
+
},
|
|
44
|
+
result: {
|
|
45
|
+
from: TimePayloadZod,
|
|
46
|
+
to: TimePayloadZod,
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
} satisfies RpcSchemaMap<TimeSyncViewerRpcMethodName>
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { AddressZod } from '@xylabs/hex'
|
|
1
2
|
import { asHydratedTransactionWithStorageMeta } from '@xyo-network/xl1-protocol'
|
|
2
3
|
import { z } from 'zod'
|
|
3
4
|
|
|
4
5
|
import type { XyoSignerRpcMethodName } from '../XyoSignerRpc.ts'
|
|
5
6
|
import {
|
|
6
|
-
AddressZod,
|
|
7
7
|
SignedHydratedTransactionZod,
|
|
8
8
|
UnsignedHydratedTransactionZod,
|
|
9
9
|
} from './common/index.ts'
|