@xyo-network/xl1-rpc 1.24.23 → 1.24.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 +305 -198
- package/dist/neutral/index.mjs.map +1 -1
- package/dist/neutral/provider/viewer/JsonRpcBlockViewer/JsonRpcBlockViewerMethods.d.ts +10 -6
- package/dist/neutral/provider/viewer/JsonRpcBlockViewer/JsonRpcBlockViewerMethods.d.ts.map +1 -1
- package/dist/neutral/provider/viewer/JsonRpcTransactionViewer/JsonRpcTransactionViewer.d.ts +562 -0
- package/dist/neutral/provider/viewer/JsonRpcTransactionViewer/JsonRpcTransactionViewer.d.ts.map +1 -0
- package/dist/neutral/provider/viewer/JsonRpcTransactionViewer/index.d.ts +2 -0
- package/dist/neutral/provider/viewer/JsonRpcTransactionViewer/index.d.ts.map +1 -0
- package/dist/neutral/provider/viewer/JsonRpcXyoViewer.d.ts +4 -2
- 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/TransactionViewerRpc.d.ts +7 -0
- package/dist/neutral/types/TransactionViewerRpc.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 +338 -4
- package/dist/neutral/types/schema/AllRpcSchemas.d.ts.map +1 -1
- package/dist/neutral/types/schema/BlockViewerRpcSchemas.d.ts +10 -4
- package/dist/neutral/types/schema/BlockViewerRpcSchemas.d.ts.map +1 -1
- package/dist/neutral/types/schema/TransactionViewerRpcSchema.d.ts +333 -0
- package/dist/neutral/types/schema/TransactionViewerRpcSchema.d.ts.map +1 -0
- 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 +305 -198
- package/dist/node/index-node.mjs.map +1 -1
- package/dist/node/provider/viewer/JsonRpcBlockViewer/JsonRpcBlockViewerMethods.d.ts +10 -6
- package/dist/node/provider/viewer/JsonRpcBlockViewer/JsonRpcBlockViewerMethods.d.ts.map +1 -1
- package/dist/node/provider/viewer/JsonRpcTransactionViewer/JsonRpcTransactionViewer.d.ts +562 -0
- package/dist/node/provider/viewer/JsonRpcTransactionViewer/JsonRpcTransactionViewer.d.ts.map +1 -0
- package/dist/node/provider/viewer/JsonRpcTransactionViewer/index.d.ts +2 -0
- package/dist/node/provider/viewer/JsonRpcTransactionViewer/index.d.ts.map +1 -0
- package/dist/node/provider/viewer/JsonRpcXyoViewer.d.ts +4 -2
- 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/TransactionViewerRpc.d.ts +7 -0
- package/dist/node/types/TransactionViewerRpc.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 +338 -4
- package/dist/node/types/schema/AllRpcSchemas.d.ts.map +1 -1
- package/dist/node/types/schema/BlockViewerRpcSchemas.d.ts +10 -4
- package/dist/node/types/schema/BlockViewerRpcSchemas.d.ts.map +1 -1
- package/dist/node/types/schema/TransactionViewerRpcSchema.d.ts +333 -0
- package/dist/node/types/schema/TransactionViewerRpcSchema.d.ts.map +1 -0
- package/dist/node/types/schema/index.d.ts +1 -0
- package/dist/node/types/schema/index.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/provider/viewer/JsonRpcBlockViewer/JsonRpcBlockViewerMethods.ts +7 -30
- package/src/provider/viewer/JsonRpcTransactionViewer/JsonRpcTransactionViewer.ts +100 -0
- package/src/provider/viewer/JsonRpcTransactionViewer/index.ts +1 -0
- package/src/provider/viewer/JsonRpcXyoViewer.ts +10 -1
- package/src/provider/viewer/index.ts +1 -0
- package/src/transport/HttpRpcTransport.ts +1 -1
- package/src/types/TransactionViewerRpc.ts +11 -0
- package/src/types/index.ts +1 -0
- package/src/types/schema/AllRpcSchemas.ts +2 -0
- package/src/types/schema/BlockViewerRpcSchemas.ts +3 -3
- package/src/types/schema/TransactionViewerRpcSchema.ts +51 -0
- package/src/types/schema/index.ts +1 -0
package/dist/neutral/index.mjs
CHANGED
|
@@ -197,7 +197,7 @@ var rpcMethodHandlersFromSigner = (signer) => {
|
|
|
197
197
|
};
|
|
198
198
|
|
|
199
199
|
// src/provider/datalake/JsonRpcDataLakeViewer.ts
|
|
200
|
-
import { creatableProvider as
|
|
200
|
+
import { creatableProvider as creatableProvider12 } from "@xyo-network/xl1-protocol-sdk";
|
|
201
201
|
|
|
202
202
|
// src/provider/datalake/JsonRpcDataLakeViewerMethods.ts
|
|
203
203
|
import { DataLakeViewerMoniker as DataLakeViewerMoniker2 } from "@xyo-network/xl1-protocol";
|
|
@@ -269,7 +269,7 @@ var AccountBalanceViewerRpcSchemas = {
|
|
|
269
269
|
|
|
270
270
|
// src/types/schema/BlockViewerRpcSchemas.ts
|
|
271
271
|
import { HashZod } from "@xylabs/sdk-js";
|
|
272
|
-
import { PayloadZodLoose } from "@xyo-network/sdk-js";
|
|
272
|
+
import { PayloadZodLoose, WithHashMetaZod } from "@xyo-network/sdk-js";
|
|
273
273
|
import { SignedHydratedBlockWithHashMetaZod, XL1BlockNumberZod } from "@xyo-network/xl1-protocol";
|
|
274
274
|
import { z as z2 } from "zod";
|
|
275
275
|
var BlockViewerRpcSchemas = {
|
|
@@ -309,8 +309,8 @@ var BlockViewerRpcSchemas = {
|
|
|
309
309
|
from: z2.tuple([z2.array(HashZod)])
|
|
310
310
|
},
|
|
311
311
|
result: {
|
|
312
|
-
to: z2.array(PayloadZodLoose),
|
|
313
|
-
from: z2.array(PayloadZodLoose)
|
|
312
|
+
to: z2.array(WithHashMetaZod(PayloadZodLoose)),
|
|
313
|
+
from: z2.array(WithHashMetaZod(PayloadZodLoose))
|
|
314
314
|
}
|
|
315
315
|
}
|
|
316
316
|
};
|
|
@@ -948,55 +948,102 @@ var TimeSyncViewerRpcSchemas = {
|
|
|
948
948
|
}
|
|
949
949
|
};
|
|
950
950
|
|
|
951
|
+
// src/types/schema/TransactionViewerRpcSchema.ts
|
|
952
|
+
import { HashZod as HashZod4 } from "@xylabs/sdk-js";
|
|
953
|
+
import { SignedHydratedTransactionZod as SignedHydratedTransactionZod2 } from "@xyo-network/xl1-protocol";
|
|
954
|
+
import { z as z16 } from "zod";
|
|
955
|
+
var TransactionViewerRpcSchemas = {
|
|
956
|
+
transactionViewer_transactionByBlockHashAndIndex: {
|
|
957
|
+
params: {
|
|
958
|
+
to: z16.tuple([HashZod4, z16.number()]),
|
|
959
|
+
from: z16.tuple([HashZod4, z16.number()])
|
|
960
|
+
},
|
|
961
|
+
result: {
|
|
962
|
+
to: SignedHydratedTransactionZod2.nullable(),
|
|
963
|
+
from: SignedHydratedTransactionZod2.nullable()
|
|
964
|
+
}
|
|
965
|
+
},
|
|
966
|
+
transactionViewer_transactionByBlockNumberAndIndex: {
|
|
967
|
+
params: {
|
|
968
|
+
to: z16.tuple([z16.number(), z16.number()]),
|
|
969
|
+
from: z16.tuple([z16.number(), z16.number()])
|
|
970
|
+
},
|
|
971
|
+
result: {
|
|
972
|
+
to: SignedHydratedTransactionZod2.nullable(),
|
|
973
|
+
from: SignedHydratedTransactionZod2.nullable()
|
|
974
|
+
}
|
|
975
|
+
},
|
|
976
|
+
transactionViewer_byHash: {
|
|
977
|
+
params: {
|
|
978
|
+
to: z16.tuple([HashZod4]),
|
|
979
|
+
from: z16.tuple([HashZod4])
|
|
980
|
+
},
|
|
981
|
+
result: {
|
|
982
|
+
to: SignedHydratedTransactionZod2.nullable(),
|
|
983
|
+
from: SignedHydratedTransactionZod2.nullable()
|
|
984
|
+
}
|
|
985
|
+
},
|
|
986
|
+
transactionViewer_transactionByHash: {
|
|
987
|
+
params: {
|
|
988
|
+
to: z16.tuple([HashZod4]),
|
|
989
|
+
from: z16.tuple([HashZod4])
|
|
990
|
+
},
|
|
991
|
+
result: {
|
|
992
|
+
to: SignedHydratedTransactionZod2.nullable(),
|
|
993
|
+
from: SignedHydratedTransactionZod2.nullable()
|
|
994
|
+
}
|
|
995
|
+
}
|
|
996
|
+
};
|
|
997
|
+
|
|
951
998
|
// src/types/schema/XyoPermissionsRpcSchemas.ts
|
|
952
999
|
import {
|
|
953
1000
|
InvokerPermissionZod,
|
|
954
1001
|
PermissionRequestZod,
|
|
955
1002
|
RequestedPermissionZod
|
|
956
1003
|
} from "@xyo-network/xl1-protocol";
|
|
957
|
-
import { z as
|
|
1004
|
+
import { z as z17 } from "zod";
|
|
958
1005
|
var XyoPermissionsRpcSchemas = {
|
|
959
1006
|
xyoPermissions_getPermissions: {
|
|
960
1007
|
params: {
|
|
961
|
-
to:
|
|
962
|
-
from:
|
|
1008
|
+
to: z17.array(z17.any()).length(0),
|
|
1009
|
+
from: z17.array(z17.any()).length(0)
|
|
963
1010
|
},
|
|
964
1011
|
result: {
|
|
965
|
-
to:
|
|
966
|
-
from:
|
|
1012
|
+
to: z17.array(InvokerPermissionZod),
|
|
1013
|
+
from: z17.array(InvokerPermissionZod)
|
|
967
1014
|
}
|
|
968
1015
|
},
|
|
969
1016
|
xyoPermissions_requestPermissions: {
|
|
970
1017
|
params: {
|
|
971
|
-
to:
|
|
972
|
-
from:
|
|
1018
|
+
to: z17.tuple([z17.array(PermissionRequestZod)]),
|
|
1019
|
+
from: z17.tuple([z17.array(PermissionRequestZod)])
|
|
973
1020
|
},
|
|
974
1021
|
result: {
|
|
975
|
-
to:
|
|
976
|
-
from:
|
|
1022
|
+
to: z17.array(RequestedPermissionZod),
|
|
1023
|
+
from: z17.array(RequestedPermissionZod)
|
|
977
1024
|
}
|
|
978
1025
|
},
|
|
979
1026
|
xyoPermissions_revokePermissions: {
|
|
980
1027
|
params: {
|
|
981
|
-
to:
|
|
982
|
-
from:
|
|
1028
|
+
to: z17.tuple([z17.array(PermissionRequestZod)]),
|
|
1029
|
+
from: z17.tuple([z17.array(PermissionRequestZod)])
|
|
983
1030
|
},
|
|
984
1031
|
result: {
|
|
985
|
-
to:
|
|
986
|
-
from:
|
|
1032
|
+
to: z17.array(RequestedPermissionZod),
|
|
1033
|
+
from: z17.array(RequestedPermissionZod)
|
|
987
1034
|
}
|
|
988
1035
|
}
|
|
989
1036
|
};
|
|
990
1037
|
|
|
991
1038
|
// src/types/schema/XyoRunnerRpcSchemas.ts
|
|
992
1039
|
import { HashToJsonZod, JsonToHashZod } from "@xylabs/sdk-js";
|
|
993
|
-
import { SignedHydratedTransactionZod as
|
|
994
|
-
import { z as
|
|
1040
|
+
import { SignedHydratedTransactionZod as SignedHydratedTransactionZod3 } from "@xyo-network/xl1-protocol";
|
|
1041
|
+
import { z as z18 } from "zod";
|
|
995
1042
|
var XyoRunnerRpcSchemas = {
|
|
996
1043
|
xyoRunner_broadcastTransaction: {
|
|
997
1044
|
params: {
|
|
998
|
-
to:
|
|
999
|
-
from:
|
|
1045
|
+
to: z18.tuple([SignedHydratedTransactionZod3]),
|
|
1046
|
+
from: z18.tuple([SignedHydratedTransactionZod3])
|
|
1000
1047
|
},
|
|
1001
1048
|
result: {
|
|
1002
1049
|
to: HashToJsonZod,
|
|
@@ -1008,12 +1055,12 @@ var XyoRunnerRpcSchemas = {
|
|
|
1008
1055
|
// src/types/schema/XyoSignerRpcSchemas.ts
|
|
1009
1056
|
import { AddressZod as AddressZod6 } from "@xylabs/sdk-js";
|
|
1010
1057
|
import { SignedHydratedTransactionWithHashMetaZod as SignedHydratedTransactionWithHashMetaZod2, UnsignedHydratedTransactionZod } from "@xyo-network/xl1-protocol";
|
|
1011
|
-
import { z as
|
|
1058
|
+
import { z as z19 } from "zod";
|
|
1012
1059
|
var XyoSignerRpcSchemas = {
|
|
1013
1060
|
xyoSigner_address: {
|
|
1014
1061
|
params: {
|
|
1015
|
-
to:
|
|
1016
|
-
from:
|
|
1062
|
+
to: z19.array(z19.any()).length(0).optional(),
|
|
1063
|
+
from: z19.array(z19.any()).length(0).optional()
|
|
1017
1064
|
},
|
|
1018
1065
|
result: {
|
|
1019
1066
|
to: AddressZod6,
|
|
@@ -1022,8 +1069,8 @@ var XyoSignerRpcSchemas = {
|
|
|
1022
1069
|
},
|
|
1023
1070
|
xyoSigner_signTransaction: {
|
|
1024
1071
|
params: {
|
|
1025
|
-
to:
|
|
1026
|
-
from:
|
|
1072
|
+
to: z19.tuple([UnsignedHydratedTransactionZod]),
|
|
1073
|
+
from: z19.tuple([UnsignedHydratedTransactionZod])
|
|
1027
1074
|
},
|
|
1028
1075
|
result: {
|
|
1029
1076
|
to: SignedHydratedTransactionWithHashMetaZod2,
|
|
@@ -1036,7 +1083,7 @@ var XyoSignerRpcSchemas = {
|
|
|
1036
1083
|
import {
|
|
1037
1084
|
AddressZod as AddressZod7,
|
|
1038
1085
|
BigIntToJsonZod as BigIntToJsonZod9,
|
|
1039
|
-
HashZod as
|
|
1086
|
+
HashZod as HashZod5,
|
|
1040
1087
|
HexZod,
|
|
1041
1088
|
JsonToBigIntZod as JsonToBigIntZod9
|
|
1042
1089
|
} from "@xylabs/sdk-js";
|
|
@@ -1046,18 +1093,18 @@ import {
|
|
|
1046
1093
|
asAttoXL1 as asAttoXL16,
|
|
1047
1094
|
JsonToStakeZod as JsonToStakeZod3,
|
|
1048
1095
|
SignedHydratedBlockWithHashMetaZod as SignedHydratedBlockWithHashMetaZod3,
|
|
1049
|
-
SignedHydratedTransactionZod as
|
|
1096
|
+
SignedHydratedTransactionZod as SignedHydratedTransactionZod4,
|
|
1050
1097
|
StakeToJsonZod as StakeToJsonZod3,
|
|
1051
1098
|
StepIdentityZod as StepIdentityZod2,
|
|
1052
1099
|
XL1BlockNumberZod as XL1BlockNumberZod2,
|
|
1053
1100
|
XL1BlockRangeZod
|
|
1054
1101
|
} from "@xyo-network/xl1-protocol";
|
|
1055
|
-
import { z as
|
|
1102
|
+
import { z as z20 } from "zod";
|
|
1056
1103
|
var XyoViewerRpcSchemas = {
|
|
1057
1104
|
xyoViewer_networkStakeStepRewardClaimedByAddress: {
|
|
1058
1105
|
params: {
|
|
1059
|
-
to:
|
|
1060
|
-
from:
|
|
1106
|
+
to: z20.tuple([AddressZod7]),
|
|
1107
|
+
from: z20.tuple([AddressZod7])
|
|
1061
1108
|
},
|
|
1062
1109
|
result: {
|
|
1063
1110
|
to: BigIntToJsonZod9,
|
|
@@ -1066,38 +1113,38 @@ var XyoViewerRpcSchemas = {
|
|
|
1066
1113
|
},
|
|
1067
1114
|
xyoViewer_networkStakeStepRewardAddressReward: {
|
|
1068
1115
|
params: {
|
|
1069
|
-
to:
|
|
1070
|
-
from:
|
|
1116
|
+
to: z20.tuple([StepIdentityZod2, AddressZod7]),
|
|
1117
|
+
from: z20.tuple([StepIdentityZod2, AddressZod7])
|
|
1071
1118
|
},
|
|
1072
1119
|
result: {
|
|
1073
|
-
to:
|
|
1074
|
-
from:
|
|
1120
|
+
to: z20.record(AddressZod7, BigIntToJsonZod9),
|
|
1121
|
+
from: z20.record(AddressZod7, JsonToBigIntZod9.transform((val) => asAttoXL16(val)))
|
|
1075
1122
|
}
|
|
1076
1123
|
},
|
|
1077
1124
|
xyoViewer_networkStakeStepRewardAddressHistory: {
|
|
1078
1125
|
params: {
|
|
1079
|
-
to:
|
|
1080
|
-
from:
|
|
1126
|
+
to: z20.tuple([AddressZod7]),
|
|
1127
|
+
from: z20.tuple([AddressZod7])
|
|
1081
1128
|
},
|
|
1082
1129
|
result: {
|
|
1083
|
-
to:
|
|
1084
|
-
from:
|
|
1130
|
+
to: z20.record(AddressZod7, BigIntToJsonZod9),
|
|
1131
|
+
from: z20.record(AddressZod7, JsonToBigIntZod9.transform((val) => asAttoXL16(val)))
|
|
1085
1132
|
}
|
|
1086
1133
|
},
|
|
1087
1134
|
xyoViewer_networkStakeStepRewardAddressShare: {
|
|
1088
1135
|
params: {
|
|
1089
|
-
to:
|
|
1090
|
-
from:
|
|
1136
|
+
to: z20.tuple([StepIdentityZod2, AddressZod7]),
|
|
1137
|
+
from: z20.tuple([StepIdentityZod2, AddressZod7])
|
|
1091
1138
|
},
|
|
1092
1139
|
result: {
|
|
1093
|
-
to:
|
|
1094
|
-
from:
|
|
1140
|
+
to: z20.tuple([BigIntToJsonZod9, BigIntToJsonZod9]),
|
|
1141
|
+
from: z20.tuple([JsonToBigIntZod9, JsonToBigIntZod9])
|
|
1095
1142
|
}
|
|
1096
1143
|
},
|
|
1097
1144
|
xyoViewer_networkStakeStepRewardWeightForAddress: {
|
|
1098
1145
|
params: {
|
|
1099
|
-
to:
|
|
1100
|
-
from:
|
|
1146
|
+
to: z20.tuple([StepIdentityZod2, AddressZod7]),
|
|
1147
|
+
from: z20.tuple([StepIdentityZod2, AddressZod7])
|
|
1101
1148
|
},
|
|
1102
1149
|
result: {
|
|
1103
1150
|
to: BigIntToJsonZod9,
|
|
@@ -1106,8 +1153,8 @@ var XyoViewerRpcSchemas = {
|
|
|
1106
1153
|
},
|
|
1107
1154
|
xyoViewer_networkStakeStepRewardUnclaimedByAddress: {
|
|
1108
1155
|
params: {
|
|
1109
|
-
to:
|
|
1110
|
-
from:
|
|
1156
|
+
to: z20.tuple([AddressZod7]),
|
|
1157
|
+
from: z20.tuple([AddressZod7])
|
|
1111
1158
|
},
|
|
1112
1159
|
result: {
|
|
1113
1160
|
to: BigIntToJsonZod9,
|
|
@@ -1116,18 +1163,18 @@ var XyoViewerRpcSchemas = {
|
|
|
1116
1163
|
},
|
|
1117
1164
|
xyoViewer_networkStakeStepRewardPoolRewards: {
|
|
1118
1165
|
params: {
|
|
1119
|
-
to:
|
|
1120
|
-
from:
|
|
1166
|
+
to: z20.tuple([StepIdentityZod2]),
|
|
1167
|
+
from: z20.tuple([StepIdentityZod2])
|
|
1121
1168
|
},
|
|
1122
1169
|
result: {
|
|
1123
|
-
to:
|
|
1124
|
-
from:
|
|
1170
|
+
to: z20.record(AddressZod7, BigIntToJsonZod9),
|
|
1171
|
+
from: z20.record(AddressZod7, JsonToBigIntZod9.transform((val) => asAttoXL16(val)))
|
|
1125
1172
|
}
|
|
1126
1173
|
},
|
|
1127
1174
|
xyoViewer_networkStakeStepRewardPositionWeight: {
|
|
1128
1175
|
params: {
|
|
1129
|
-
to:
|
|
1130
|
-
from:
|
|
1176
|
+
to: z20.tuple([StepIdentityZod2, z20.number()]),
|
|
1177
|
+
from: z20.tuple([StepIdentityZod2, z20.number()])
|
|
1131
1178
|
},
|
|
1132
1179
|
result: {
|
|
1133
1180
|
to: BigIntToJsonZod9,
|
|
@@ -1136,8 +1183,8 @@ var XyoViewerRpcSchemas = {
|
|
|
1136
1183
|
},
|
|
1137
1184
|
xyoViewer_networkStakeStepRewardPotentialPositionLoss: {
|
|
1138
1185
|
params: {
|
|
1139
|
-
to:
|
|
1140
|
-
from:
|
|
1186
|
+
to: z20.tuple([StepIdentityZod2, z20.number()]),
|
|
1187
|
+
from: z20.tuple([StepIdentityZod2, z20.number()])
|
|
1141
1188
|
},
|
|
1142
1189
|
result: {
|
|
1143
1190
|
to: BigIntToJsonZod9,
|
|
@@ -1146,8 +1193,8 @@ var XyoViewerRpcSchemas = {
|
|
|
1146
1193
|
},
|
|
1147
1194
|
xyoViewer_networkStakeStepRewardForStep: {
|
|
1148
1195
|
params: {
|
|
1149
|
-
to:
|
|
1150
|
-
from:
|
|
1196
|
+
to: z20.tuple([StepIdentityZod2]),
|
|
1197
|
+
from: z20.tuple([StepIdentityZod2])
|
|
1151
1198
|
},
|
|
1152
1199
|
result: {
|
|
1153
1200
|
to: BigIntToJsonZod9,
|
|
@@ -1156,8 +1203,8 @@ var XyoViewerRpcSchemas = {
|
|
|
1156
1203
|
},
|
|
1157
1204
|
xyoViewer_networkStakeStepRewardRandomizer: {
|
|
1158
1205
|
params: {
|
|
1159
|
-
to:
|
|
1160
|
-
from:
|
|
1206
|
+
to: z20.tuple([StepIdentityZod2]),
|
|
1207
|
+
from: z20.tuple([StepIdentityZod2])
|
|
1161
1208
|
},
|
|
1162
1209
|
result: {
|
|
1163
1210
|
to: BigIntToJsonZod9,
|
|
@@ -1166,48 +1213,48 @@ var XyoViewerRpcSchemas = {
|
|
|
1166
1213
|
},
|
|
1167
1214
|
xyoViewer_networkStakeStepRewardStakerCount: {
|
|
1168
1215
|
params: {
|
|
1169
|
-
to:
|
|
1170
|
-
from:
|
|
1216
|
+
to: z20.tuple([StepIdentityZod2]),
|
|
1217
|
+
from: z20.tuple([StepIdentityZod2])
|
|
1171
1218
|
},
|
|
1172
1219
|
result: {
|
|
1173
|
-
to:
|
|
1174
|
-
from:
|
|
1220
|
+
to: z20.number(),
|
|
1221
|
+
from: z20.number()
|
|
1175
1222
|
}
|
|
1176
1223
|
},
|
|
1177
1224
|
xyoViewer_networkStakeStepRewardPoolShares: {
|
|
1178
1225
|
params: {
|
|
1179
|
-
to:
|
|
1180
|
-
from:
|
|
1226
|
+
to: z20.tuple([StepIdentityZod2]),
|
|
1227
|
+
from: z20.tuple([StepIdentityZod2])
|
|
1181
1228
|
},
|
|
1182
1229
|
result: {
|
|
1183
|
-
to:
|
|
1184
|
-
from:
|
|
1230
|
+
to: z20.record(AddressZod7, BigIntToJsonZod9),
|
|
1231
|
+
from: z20.record(AddressZod7, JsonToBigIntZod9)
|
|
1185
1232
|
}
|
|
1186
1233
|
},
|
|
1187
1234
|
xyoViewer_networkStakeStepRewardForStepForPosition: {
|
|
1188
1235
|
params: {
|
|
1189
|
-
to:
|
|
1190
|
-
from:
|
|
1236
|
+
to: z20.tuple([StepIdentityZod2, z20.number()]),
|
|
1237
|
+
from: z20.tuple([StepIdentityZod2, z20.number()])
|
|
1191
1238
|
},
|
|
1192
1239
|
result: {
|
|
1193
|
-
to:
|
|
1194
|
-
from:
|
|
1240
|
+
to: z20.tuple([BigIntToJsonZod9, BigIntToJsonZod9]),
|
|
1241
|
+
from: z20.tuple([JsonToBigIntZod9.transform((val) => asAttoXL16(val)), JsonToBigIntZod9.transform((val) => asAttoXL16(val))])
|
|
1195
1242
|
}
|
|
1196
1243
|
},
|
|
1197
1244
|
xyoViewer_networkStakeStepRewardForPosition: {
|
|
1198
1245
|
params: {
|
|
1199
|
-
to:
|
|
1200
|
-
from:
|
|
1246
|
+
to: z20.tuple([z20.number(), z20.tuple([z20.number(), z20.number()])]),
|
|
1247
|
+
from: z20.tuple([z20.number(), z20.tuple([z20.number(), z20.number()])])
|
|
1201
1248
|
},
|
|
1202
1249
|
result: {
|
|
1203
|
-
to:
|
|
1204
|
-
from:
|
|
1250
|
+
to: z20.tuple([BigIntToJsonZod9, BigIntToJsonZod9]),
|
|
1251
|
+
from: z20.tuple([JsonToBigIntZod9.transform((val) => asAttoXL16(val)), JsonToBigIntZod9.transform((val) => asAttoXL16(val))])
|
|
1205
1252
|
}
|
|
1206
1253
|
},
|
|
1207
1254
|
xyoViewer_networkStakeStepRewardsForRange: {
|
|
1208
1255
|
params: {
|
|
1209
|
-
to:
|
|
1210
|
-
from:
|
|
1256
|
+
to: z20.tuple([z20.tuple([z20.number(), z20.number()])]),
|
|
1257
|
+
from: z20.tuple([z20.tuple([z20.number(), z20.number()])])
|
|
1211
1258
|
},
|
|
1212
1259
|
result: {
|
|
1213
1260
|
to: BigIntToJsonZod9,
|
|
@@ -1216,8 +1263,8 @@ var XyoViewerRpcSchemas = {
|
|
|
1216
1263
|
},
|
|
1217
1264
|
xyoViewer_networkStakeStepRewardsForStepLevel: {
|
|
1218
1265
|
params: {
|
|
1219
|
-
to:
|
|
1220
|
-
from:
|
|
1266
|
+
to: z20.tuple([z20.number(), z20.tuple([z20.number(), z20.number()])]),
|
|
1267
|
+
from: z20.tuple([z20.number(), z20.tuple([z20.number(), z20.number()])])
|
|
1221
1268
|
},
|
|
1222
1269
|
result: {
|
|
1223
1270
|
to: BigIntToJsonZod9,
|
|
@@ -1226,18 +1273,18 @@ var XyoViewerRpcSchemas = {
|
|
|
1226
1273
|
},
|
|
1227
1274
|
xyoViewer_networkStakeStepRewardsForPosition: {
|
|
1228
1275
|
params: {
|
|
1229
|
-
to:
|
|
1230
|
-
from:
|
|
1276
|
+
to: z20.tuple([z20.number(), z20.tuple([z20.number(), z20.number()])]),
|
|
1277
|
+
from: z20.tuple([z20.number(), z20.tuple([z20.number(), z20.number()])])
|
|
1231
1278
|
},
|
|
1232
1279
|
result: {
|
|
1233
|
-
to:
|
|
1234
|
-
from:
|
|
1280
|
+
to: z20.record(z20.string(), z20.tuple([BigIntToJsonZod9, BigIntToJsonZod9])),
|
|
1281
|
+
from: z20.record(z20.string(), z20.tuple([JsonToBigIntZod9.transform((val) => asAttoXL16(val)), JsonToBigIntZod9.transform((val) => asAttoXL16(val))]))
|
|
1235
1282
|
}
|
|
1236
1283
|
},
|
|
1237
1284
|
xyoViewer_accountBalance: {
|
|
1238
1285
|
params: {
|
|
1239
|
-
to:
|
|
1240
|
-
from:
|
|
1286
|
+
to: z20.union([z20.tuple([AddressZod7]), z20.tuple([AddressZod7, z20.union([XL1BlockRangeZod, HashZod5])])]),
|
|
1287
|
+
from: z20.union([z20.tuple([AddressZod7]), z20.tuple([AddressZod7, z20.union([XL1BlockRangeZod, HashZod5])])])
|
|
1241
1288
|
},
|
|
1242
1289
|
result: {
|
|
1243
1290
|
to: BigIntToJsonZod9,
|
|
@@ -1246,38 +1293,38 @@ var XyoViewerRpcSchemas = {
|
|
|
1246
1293
|
},
|
|
1247
1294
|
xyoViewer_accountBalanceHistory: {
|
|
1248
1295
|
params: {
|
|
1249
|
-
to:
|
|
1250
|
-
from:
|
|
1296
|
+
to: z20.union([z20.tuple([AddressZod7]), z20.tuple([AddressZod7, z20.union([XL1BlockRangeZod, HashZod5])])]),
|
|
1297
|
+
from: z20.union([z20.tuple([AddressZod7]), z20.tuple([AddressZod7, z20.union([XL1BlockRangeZod, HashZod5])])])
|
|
1251
1298
|
},
|
|
1252
1299
|
result: {
|
|
1253
|
-
to:
|
|
1254
|
-
from:
|
|
1300
|
+
to: z20.array(AccountBalanceHistoryItemZod2),
|
|
1301
|
+
from: z20.array(AccountBalanceHistoryItemZod2)
|
|
1255
1302
|
}
|
|
1256
1303
|
},
|
|
1257
1304
|
xyoViewer_blocksByNumber: {
|
|
1258
1305
|
params: {
|
|
1259
|
-
to:
|
|
1260
|
-
from:
|
|
1306
|
+
to: z20.tuple([XL1BlockNumberZod2, z20.number().optional()]),
|
|
1307
|
+
from: z20.tuple([XL1BlockNumberZod2, z20.number().optional()])
|
|
1261
1308
|
},
|
|
1262
1309
|
result: {
|
|
1263
|
-
to:
|
|
1264
|
-
from:
|
|
1310
|
+
to: z20.array(SignedHydratedBlockWithHashMetaZod3),
|
|
1311
|
+
from: z20.array(SignedHydratedBlockWithHashMetaZod3)
|
|
1265
1312
|
}
|
|
1266
1313
|
},
|
|
1267
1314
|
xyoViewer_blocksByHash: {
|
|
1268
1315
|
params: {
|
|
1269
|
-
to:
|
|
1270
|
-
from:
|
|
1316
|
+
to: z20.tuple([HashZod5, z20.number().optional()]),
|
|
1317
|
+
from: z20.tuple([HashZod5, z20.number().optional()])
|
|
1271
1318
|
},
|
|
1272
1319
|
result: {
|
|
1273
|
-
to:
|
|
1274
|
-
from:
|
|
1320
|
+
to: z20.array(SignedHydratedBlockWithHashMetaZod3),
|
|
1321
|
+
from: z20.array(SignedHydratedBlockWithHashMetaZod3)
|
|
1275
1322
|
}
|
|
1276
1323
|
},
|
|
1277
1324
|
xyoViewer_currentBlock: {
|
|
1278
1325
|
params: {
|
|
1279
|
-
to:
|
|
1280
|
-
from:
|
|
1326
|
+
to: z20.array(z20.any()).length(0).optional(),
|
|
1327
|
+
from: z20.array(z20.any()).length(0).optional()
|
|
1281
1328
|
},
|
|
1282
1329
|
result: {
|
|
1283
1330
|
to: SignedHydratedBlockWithHashMetaZod3,
|
|
@@ -1286,18 +1333,18 @@ var XyoViewerRpcSchemas = {
|
|
|
1286
1333
|
},
|
|
1287
1334
|
xyoViewer_forkHistory: {
|
|
1288
1335
|
params: {
|
|
1289
|
-
to:
|
|
1290
|
-
from:
|
|
1336
|
+
to: z20.array(z20.any()).length(0).optional(),
|
|
1337
|
+
from: z20.array(z20.any()).length(0).optional()
|
|
1291
1338
|
},
|
|
1292
1339
|
result: {
|
|
1293
|
-
to:
|
|
1294
|
-
from:
|
|
1340
|
+
to: z20.record(z20.number(), HexZod),
|
|
1341
|
+
from: z20.record(z20.number(), HexZod)
|
|
1295
1342
|
}
|
|
1296
1343
|
},
|
|
1297
1344
|
xyoViewer_stakeByStaker: {
|
|
1298
1345
|
params: {
|
|
1299
|
-
to:
|
|
1300
|
-
from:
|
|
1346
|
+
to: z20.tuple([AddressZod7, z20.number()]),
|
|
1347
|
+
from: z20.tuple([AddressZod7, z20.number()])
|
|
1301
1348
|
},
|
|
1302
1349
|
result: {
|
|
1303
1350
|
to: StakeToJsonZod3,
|
|
@@ -1306,8 +1353,8 @@ var XyoViewerRpcSchemas = {
|
|
|
1306
1353
|
},
|
|
1307
1354
|
xyoViewer_stakeById: {
|
|
1308
1355
|
params: {
|
|
1309
|
-
to:
|
|
1310
|
-
from:
|
|
1356
|
+
to: z20.tuple([z20.number()]),
|
|
1357
|
+
from: z20.tuple([z20.number()])
|
|
1311
1358
|
},
|
|
1312
1359
|
result: {
|
|
1313
1360
|
to: StakeToJsonZod3,
|
|
@@ -1316,62 +1363,62 @@ var XyoViewerRpcSchemas = {
|
|
|
1316
1363
|
},
|
|
1317
1364
|
xyoViewer_stakesByStaker: {
|
|
1318
1365
|
params: {
|
|
1319
|
-
to:
|
|
1320
|
-
from:
|
|
1366
|
+
to: z20.tuple([AddressZod7]),
|
|
1367
|
+
from: z20.tuple([AddressZod7])
|
|
1321
1368
|
},
|
|
1322
1369
|
result: {
|
|
1323
|
-
to:
|
|
1324
|
-
from:
|
|
1370
|
+
to: z20.array(StakeToJsonZod3),
|
|
1371
|
+
from: z20.array(JsonToStakeZod3)
|
|
1325
1372
|
}
|
|
1326
1373
|
},
|
|
1327
1374
|
xyoViewer_stakesByStaked: {
|
|
1328
1375
|
params: {
|
|
1329
|
-
to:
|
|
1330
|
-
from:
|
|
1376
|
+
to: z20.tuple([AddressZod7]),
|
|
1377
|
+
from: z20.tuple([AddressZod7])
|
|
1331
1378
|
},
|
|
1332
1379
|
result: {
|
|
1333
|
-
to:
|
|
1334
|
-
from:
|
|
1380
|
+
to: z20.array(StakeToJsonZod3),
|
|
1381
|
+
from: z20.array(JsonToStakeZod3)
|
|
1335
1382
|
}
|
|
1336
1383
|
},
|
|
1337
1384
|
xyoViewer_transactionByBlockHashAndIndex: {
|
|
1338
1385
|
params: {
|
|
1339
|
-
to:
|
|
1340
|
-
from:
|
|
1386
|
+
to: z20.tuple([HashZod5, z20.number()]),
|
|
1387
|
+
from: z20.tuple([HashZod5, z20.number()])
|
|
1341
1388
|
},
|
|
1342
1389
|
result: {
|
|
1343
|
-
to:
|
|
1344
|
-
from:
|
|
1390
|
+
to: SignedHydratedTransactionZod4.nullable(),
|
|
1391
|
+
from: SignedHydratedTransactionZod4.nullable()
|
|
1345
1392
|
}
|
|
1346
1393
|
},
|
|
1347
1394
|
xyoViewer_transactionByBlockNumberAndIndex: {
|
|
1348
1395
|
params: {
|
|
1349
|
-
to:
|
|
1350
|
-
from:
|
|
1396
|
+
to: z20.tuple([z20.number(), z20.number()]),
|
|
1397
|
+
from: z20.tuple([z20.number(), z20.number()])
|
|
1351
1398
|
},
|
|
1352
1399
|
result: {
|
|
1353
|
-
to:
|
|
1354
|
-
from:
|
|
1400
|
+
to: SignedHydratedTransactionZod4.nullable(),
|
|
1401
|
+
from: SignedHydratedTransactionZod4.nullable()
|
|
1355
1402
|
}
|
|
1356
1403
|
},
|
|
1357
1404
|
xyoViewer_transactionByHash: {
|
|
1358
1405
|
params: {
|
|
1359
|
-
to:
|
|
1360
|
-
from:
|
|
1406
|
+
to: z20.tuple([HashZod5]),
|
|
1407
|
+
from: z20.tuple([HashZod5])
|
|
1361
1408
|
},
|
|
1362
1409
|
result: {
|
|
1363
|
-
to:
|
|
1364
|
-
from:
|
|
1410
|
+
to: SignedHydratedTransactionZod4.nullable(),
|
|
1411
|
+
from: SignedHydratedTransactionZod4.nullable()
|
|
1365
1412
|
}
|
|
1366
1413
|
},
|
|
1367
1414
|
xyoViewer_payloadsByHash: {
|
|
1368
1415
|
params: {
|
|
1369
|
-
to:
|
|
1370
|
-
from:
|
|
1416
|
+
to: z20.tuple([z20.array(HashZod5)]),
|
|
1417
|
+
from: z20.tuple([z20.array(HashZod5)])
|
|
1371
1418
|
},
|
|
1372
1419
|
result: {
|
|
1373
|
-
to:
|
|
1374
|
-
from:
|
|
1420
|
+
to: z20.array(PayloadZodLoose2),
|
|
1421
|
+
from: z20.array(PayloadZodLoose2)
|
|
1375
1422
|
}
|
|
1376
1423
|
}
|
|
1377
1424
|
};
|
|
@@ -1396,34 +1443,35 @@ var AllRpcSchemas = {
|
|
|
1396
1443
|
...NetworkStakingStepRewardsTotalViewerRpcSchemas,
|
|
1397
1444
|
...NetworkStakingStepRewardsByStepViewerRpcSchemas,
|
|
1398
1445
|
...NetworkStakingStepRewardsByStakerViewerRpcSchemas,
|
|
1399
|
-
...NetworkStakingStepRewardsByPositionViewerRpcSchemas
|
|
1446
|
+
...NetworkStakingStepRewardsByPositionViewerRpcSchemas,
|
|
1447
|
+
...TransactionViewerRpcSchemas
|
|
1400
1448
|
};
|
|
1401
1449
|
|
|
1402
1450
|
// src/types/schema/createRequestSchema.ts
|
|
1403
|
-
import { z as
|
|
1404
|
-
var createRequestSchema = (methodName, paramsSchema =
|
|
1405
|
-
id:
|
|
1406
|
-
jsonrpc:
|
|
1407
|
-
method:
|
|
1451
|
+
import { z as z21 } from "zod";
|
|
1452
|
+
var createRequestSchema = (methodName, paramsSchema = z21.undefined()) => z21.object({
|
|
1453
|
+
id: z21.union([z21.string(), z21.number()]),
|
|
1454
|
+
jsonrpc: z21.literal(jsonrpc),
|
|
1455
|
+
method: z21.literal(methodName),
|
|
1408
1456
|
params: paramsSchema
|
|
1409
1457
|
});
|
|
1410
1458
|
|
|
1411
1459
|
// src/types/schema/createResponseSchema.ts
|
|
1412
|
-
import { z as
|
|
1413
|
-
var createResponseSchema = (resultSchema =
|
|
1414
|
-
id:
|
|
1415
|
-
jsonrpc:
|
|
1460
|
+
import { z as z22 } from "zod";
|
|
1461
|
+
var createResponseSchema = (resultSchema = z22.undefined()) => z22.object({
|
|
1462
|
+
id: z22.union([z22.string(), z22.number()]),
|
|
1463
|
+
jsonrpc: z22.literal(jsonrpc),
|
|
1416
1464
|
result: resultSchema
|
|
1417
1465
|
});
|
|
1418
1466
|
|
|
1419
1467
|
// src/types/schema/FinalizationViewerRpcSchemas.ts
|
|
1420
1468
|
import { SignedHydratedBlockWithHashMetaZod as SignedHydratedBlockWithHashMetaZod4 } from "@xyo-network/xl1-protocol";
|
|
1421
|
-
import { z as
|
|
1469
|
+
import { z as z23 } from "zod";
|
|
1422
1470
|
var FinalizationViewerRpcSchemas = {
|
|
1423
1471
|
finalizationViewer_head: {
|
|
1424
1472
|
params: {
|
|
1425
|
-
to:
|
|
1426
|
-
from:
|
|
1473
|
+
to: z23.array(z23.any()).length(0).optional(),
|
|
1474
|
+
from: z23.array(z23.any()).length(0).optional()
|
|
1427
1475
|
},
|
|
1428
1476
|
result: {
|
|
1429
1477
|
to: SignedHydratedBlockWithHashMetaZod4,
|
|
@@ -1446,15 +1494,15 @@ import { isDefined as isDefined2 } from "@xylabs/sdk-js";
|
|
|
1446
1494
|
import { AbstractCreatableProvider } from "@xyo-network/xl1-protocol-sdk";
|
|
1447
1495
|
|
|
1448
1496
|
// src/transport/HttpRpcTransport.ts
|
|
1449
|
-
import { axiosJsonConfig } from "@xylabs/axios";
|
|
1450
1497
|
import {
|
|
1498
|
+
axiosJsonConfig,
|
|
1451
1499
|
isDefined,
|
|
1452
1500
|
isError,
|
|
1453
1501
|
isUndefinedOrNull
|
|
1454
1502
|
} from "@xylabs/sdk-js";
|
|
1455
1503
|
import { Axios, isAxiosError } from "axios";
|
|
1456
1504
|
import { v4 } from "uuid";
|
|
1457
|
-
import { z as
|
|
1505
|
+
import { z as z24 } from "zod";
|
|
1458
1506
|
var HttpRpcTransport = class {
|
|
1459
1507
|
_passThrough;
|
|
1460
1508
|
_rpcUrl;
|
|
@@ -1477,7 +1525,7 @@ var HttpRpcTransport = class {
|
|
|
1477
1525
|
};
|
|
1478
1526
|
const schema = schemas[method];
|
|
1479
1527
|
if (params) {
|
|
1480
|
-
body.params = isDefined(schema) ? schema.params.to.parse(params) : this._passThrough ?
|
|
1528
|
+
body.params = isDefined(schema) ? schema.params.to.parse(params) : this._passThrough ? z24.json().parse(params) : void 0;
|
|
1481
1529
|
if (!isDefined(body.params)) {
|
|
1482
1530
|
throw new Error(`[callRpc] RPC method ${String(method)} missing schema`);
|
|
1483
1531
|
}
|
|
@@ -1618,17 +1666,8 @@ import {
|
|
|
1618
1666
|
|
|
1619
1667
|
// src/provider/viewer/JsonRpcBlockViewer/JsonRpcBlockViewerMethods.ts
|
|
1620
1668
|
import { isDefined as isDefined3 } from "@xylabs/sdk-js";
|
|
1621
|
-
import {
|
|
1622
|
-
|
|
1623
|
-
asHashMeta,
|
|
1624
|
-
isAnyPayload
|
|
1625
|
-
} from "@xyo-network/sdk-js";
|
|
1626
|
-
import { PayloadBuilder } from "@xyo-network/sdk-js";
|
|
1627
|
-
import {
|
|
1628
|
-
asSignedHydratedBlockWithHashMeta,
|
|
1629
|
-
BlockViewerMoniker,
|
|
1630
|
-
DataLakeViewerMoniker
|
|
1631
|
-
} from "@xyo-network/xl1-protocol";
|
|
1669
|
+
import { BlockViewerMoniker, DataLakeViewerMoniker } from "@xyo-network/xl1-protocol";
|
|
1670
|
+
import { addDataLakePayloads, addDataLakePayloadsToPayloads } from "@xyo-network/xl1-protocol-sdk";
|
|
1632
1671
|
var JsonRpcBlockViewerMethods = class extends AbstractJsonRpcViewer {
|
|
1633
1672
|
moniker = BlockViewerMoniker;
|
|
1634
1673
|
dataLakeViewer;
|
|
@@ -1637,14 +1676,14 @@ var JsonRpcBlockViewerMethods = class extends AbstractJsonRpcViewer {
|
|
|
1637
1676
|
"blockViewer_blocksByHash",
|
|
1638
1677
|
isDefined3(limit) ? [hash, limit] : [hash]
|
|
1639
1678
|
);
|
|
1640
|
-
return await Promise.all(result.map(async (block) => await this.
|
|
1679
|
+
return await Promise.all(result.map(async (block) => (await addDataLakePayloads(block, this.dataLakeViewer))[0]));
|
|
1641
1680
|
}
|
|
1642
1681
|
async blocksByNumber(block, limit) {
|
|
1643
1682
|
const result = await this.transport.sendRequest(
|
|
1644
1683
|
"blockViewer_blocksByNumber",
|
|
1645
1684
|
isDefined3(limit) ? [block, limit] : [block]
|
|
1646
1685
|
);
|
|
1647
|
-
return await Promise.all(result.map(async (block2) => await this.
|
|
1686
|
+
return await Promise.all(result.map(async (block2) => (await addDataLakePayloads(block2, this.dataLakeViewer))[0]));
|
|
1648
1687
|
}
|
|
1649
1688
|
async createHandler() {
|
|
1650
1689
|
await super.createHandler();
|
|
@@ -1655,30 +1694,14 @@ var JsonRpcBlockViewerMethods = class extends AbstractJsonRpcViewer {
|
|
|
1655
1694
|
"blockViewer_currentBlock",
|
|
1656
1695
|
[]
|
|
1657
1696
|
);
|
|
1658
|
-
return await this.
|
|
1697
|
+
return (await addDataLakePayloads(result, this.dataLakeViewer))[0];
|
|
1659
1698
|
}
|
|
1660
1699
|
async payloadsByHash(hashes) {
|
|
1661
1700
|
const result = await this.transport.sendRequest(
|
|
1662
1701
|
"blockViewer_payloadsByHash",
|
|
1663
1702
|
[hashes]
|
|
1664
1703
|
);
|
|
1665
|
-
return await
|
|
1666
|
-
}
|
|
1667
|
-
async addDataLakePayloadsToBlock(block) {
|
|
1668
|
-
const dataLakeViewer = this.dataLakeViewer;
|
|
1669
|
-
if (!dataLakeViewer) return block;
|
|
1670
|
-
const missingPayloadHashes = block[0].payload_hashes.filter((hash) => !block[1].some((p) => p._hash === hash));
|
|
1671
|
-
const payloadsFromDataLake = await PayloadBuilder.addHashMeta((await dataLakeViewer.get(missingPayloadHashes)).filter(isAnyPayload));
|
|
1672
|
-
return asSignedHydratedBlockWithHashMeta([block[0], [...block[1], ...payloadsFromDataLake]], true);
|
|
1673
|
-
}
|
|
1674
|
-
async addDataLakePayloadsToPayloads(hashes, payloads) {
|
|
1675
|
-
const dataLakeViewer = this.dataLakeViewer;
|
|
1676
|
-
if (!dataLakeViewer) return payloads;
|
|
1677
|
-
const missingPayloadHashes = hashes.filter((hash) => !payloads.some((p) => p._hash === hash));
|
|
1678
|
-
const payloadsFromDataLake = await PayloadBuilder.addHashMeta(
|
|
1679
|
-
await PayloadBuilder.addHashMeta((await dataLakeViewer.get(missingPayloadHashes)).filter(isAnyPayload))
|
|
1680
|
-
);
|
|
1681
|
-
return [...payloads, ...payloadsFromDataLake];
|
|
1704
|
+
return (await addDataLakePayloadsToPayloads(hashes, result, this.dataLakeViewer))[0];
|
|
1682
1705
|
}
|
|
1683
1706
|
schemas() {
|
|
1684
1707
|
return BlockViewerRpcSchemas;
|
|
@@ -2021,26 +2044,103 @@ JsonRpcTimeSyncViewer = __decorateClass([
|
|
|
2021
2044
|
creatableProvider9()
|
|
2022
2045
|
], JsonRpcTimeSyncViewer);
|
|
2023
2046
|
|
|
2047
|
+
// src/provider/viewer/JsonRpcTransactionViewer/JsonRpcTransactionViewer.ts
|
|
2048
|
+
import {
|
|
2049
|
+
assertEx as assertEx2,
|
|
2050
|
+
exists
|
|
2051
|
+
} from "@xylabs/sdk-js";
|
|
2052
|
+
import { BoundWitnessSchema } from "@xyo-network/sdk-js";
|
|
2053
|
+
import {
|
|
2054
|
+
BlockViewerMoniker as BlockViewerMoniker3,
|
|
2055
|
+
isTransactionBoundWitnessWithHashMeta,
|
|
2056
|
+
TransactionViewerMoniker
|
|
2057
|
+
} from "@xyo-network/xl1-protocol";
|
|
2058
|
+
import { creatableProvider as creatableProvider10 } from "@xyo-network/xl1-protocol-sdk";
|
|
2059
|
+
var JsonRpcTransactionViewer = class extends AbstractJsonRpcViewer {
|
|
2060
|
+
moniker = JsonRpcTransactionViewer.defaultMoniker;
|
|
2061
|
+
_blockViewer;
|
|
2062
|
+
get blockViewer() {
|
|
2063
|
+
return this._blockViewer;
|
|
2064
|
+
}
|
|
2065
|
+
async byBlockHashAndIndex(blockHash, transactionIndex) {
|
|
2066
|
+
return await this.spanAsync("transactionByBlockHashAndIndex", async () => {
|
|
2067
|
+
assertEx2(transactionIndex >= 0, () => "transactionIndex must be greater than or equal to 0");
|
|
2068
|
+
try {
|
|
2069
|
+
const block = await this.blockViewer.blockByHash(blockHash);
|
|
2070
|
+
if (!block) return null;
|
|
2071
|
+
const blockBoundWitnessIndexes = block[0].payload_schemas.map((schema, index) => schema === BoundWitnessSchema ? index : void 0).filter(exists);
|
|
2072
|
+
const blockBoundWitnessHashes = new Set(blockBoundWitnessIndexes.map((index) => block[0].payload_hashes[index]));
|
|
2073
|
+
const blockBoundWitnesses = block[1].filter((payload) => blockBoundWitnessHashes.has(payload._hash) || blockBoundWitnessHashes.has(payload._dataHash));
|
|
2074
|
+
const blockTransactionBoundWitnesses = blockBoundWitnesses.filter(isTransactionBoundWitnessWithHashMeta);
|
|
2075
|
+
const transaction = blockTransactionBoundWitnesses.at(transactionIndex);
|
|
2076
|
+
if (!transaction) return null;
|
|
2077
|
+
return await this.transactionByHash(transaction._hash);
|
|
2078
|
+
} catch {
|
|
2079
|
+
return null;
|
|
2080
|
+
}
|
|
2081
|
+
}, this.context);
|
|
2082
|
+
}
|
|
2083
|
+
async byBlockNumberAndIndex(blockNumber, transactionIndex) {
|
|
2084
|
+
return await this.spanAsync("transactionByBlockNumberAndIndex", async () => {
|
|
2085
|
+
try {
|
|
2086
|
+
const block = await this.blockViewer.blockByNumber(blockNumber);
|
|
2087
|
+
if (!block) return null;
|
|
2088
|
+
return await this.transactionByBlockHashAndIndex(block[0]._hash, transactionIndex);
|
|
2089
|
+
} catch {
|
|
2090
|
+
return null;
|
|
2091
|
+
}
|
|
2092
|
+
}, this.context);
|
|
2093
|
+
}
|
|
2094
|
+
async byHash(transactionHash) {
|
|
2095
|
+
return await this.transport.sendRequest("transactionViewer_byHash", [transactionHash]);
|
|
2096
|
+
}
|
|
2097
|
+
async createHandler() {
|
|
2098
|
+
await super.createHandler();
|
|
2099
|
+
this._blockViewer = await this.locator.getInstance(BlockViewerMoniker3);
|
|
2100
|
+
}
|
|
2101
|
+
async transactionByBlockHashAndIndex(blockHash, transactionIndex) {
|
|
2102
|
+
return await this.transport.sendRequest("transactionViewer_transactionByBlockHashAndIndex", [blockHash, transactionIndex]);
|
|
2103
|
+
}
|
|
2104
|
+
async transactionByBlockNumberAndIndex(blockNumber, transactionIndex) {
|
|
2105
|
+
return await this.transport.sendRequest("transactionViewer_transactionByBlockNumberAndIndex", [blockNumber, transactionIndex]);
|
|
2106
|
+
}
|
|
2107
|
+
async transactionByHash(transactionHash) {
|
|
2108
|
+
return await this.transport.sendRequest("transactionViewer_transactionByHash", [transactionHash]);
|
|
2109
|
+
}
|
|
2110
|
+
schemas() {
|
|
2111
|
+
return TransactionViewerRpcSchemas;
|
|
2112
|
+
}
|
|
2113
|
+
};
|
|
2114
|
+
__publicField(JsonRpcTransactionViewer, "defaultMoniker", TransactionViewerMoniker);
|
|
2115
|
+
__publicField(JsonRpcTransactionViewer, "dependencies", [
|
|
2116
|
+
BlockViewerMoniker3
|
|
2117
|
+
]);
|
|
2118
|
+
__publicField(JsonRpcTransactionViewer, "monikers", [TransactionViewerMoniker]);
|
|
2119
|
+
JsonRpcTransactionViewer = __decorateClass([
|
|
2120
|
+
creatableProvider10()
|
|
2121
|
+
], JsonRpcTransactionViewer);
|
|
2122
|
+
|
|
2024
2123
|
// src/provider/viewer/JsonRpcXyoViewer.ts
|
|
2025
|
-
import { PayloadBuilder
|
|
2124
|
+
import { PayloadBuilder } from "@xyo-network/sdk-js";
|
|
2026
2125
|
import {
|
|
2027
2126
|
AccountBalanceViewerMoniker as AccountBalanceViewerMoniker3,
|
|
2028
|
-
BlockViewerMoniker as
|
|
2127
|
+
BlockViewerMoniker as BlockViewerMoniker4,
|
|
2029
2128
|
isSignedHydratedBlock,
|
|
2030
2129
|
isSignedHydratedBlockWithHashMeta,
|
|
2031
2130
|
MempoolViewerMoniker as MempoolViewerMoniker3,
|
|
2032
2131
|
NetworkStakeViewerMoniker as NetworkStakeViewerMoniker3,
|
|
2033
2132
|
StepViewerMoniker,
|
|
2034
2133
|
TimeSyncViewerMoniker as TimeSyncViewerMoniker3,
|
|
2134
|
+
TransactionViewerMoniker as TransactionViewerMoniker2,
|
|
2035
2135
|
XyoViewerMoniker
|
|
2036
2136
|
} from "@xyo-network/xl1-protocol";
|
|
2037
|
-
import { creatableProvider as
|
|
2137
|
+
import { creatableProvider as creatableProvider11 } from "@xyo-network/xl1-protocol-sdk";
|
|
2038
2138
|
async function fixSignedHydratedBlockWithHashMeta(block) {
|
|
2039
2139
|
if (isSignedHydratedBlockWithHashMeta(block)) {
|
|
2040
2140
|
return block;
|
|
2041
2141
|
}
|
|
2042
2142
|
if (isSignedHydratedBlock(block)) {
|
|
2043
|
-
return [await
|
|
2143
|
+
return [await PayloadBuilder.addHashMeta(block[0]), await PayloadBuilder.addHashMeta(block[1])];
|
|
2044
2144
|
}
|
|
2045
2145
|
throw new Error("Invalid block format");
|
|
2046
2146
|
}
|
|
@@ -2054,6 +2154,7 @@ var JsonRpcXyoViewer = class extends AbstractJsonRpcViewer {
|
|
|
2054
2154
|
_stakeViewer;
|
|
2055
2155
|
_stepViewer;
|
|
2056
2156
|
_timeSyncViewer;
|
|
2157
|
+
_transactionViewer;
|
|
2057
2158
|
get account() {
|
|
2058
2159
|
return { balance: this._accountBalanceViewer };
|
|
2059
2160
|
}
|
|
@@ -2075,6 +2176,9 @@ var JsonRpcXyoViewer = class extends AbstractJsonRpcViewer {
|
|
|
2075
2176
|
get time() {
|
|
2076
2177
|
return this._timeSyncViewer;
|
|
2077
2178
|
}
|
|
2179
|
+
get transaction() {
|
|
2180
|
+
return this._transactionViewer;
|
|
2181
|
+
}
|
|
2078
2182
|
async accountBalance(address, config = {}) {
|
|
2079
2183
|
return await this.account.balance.accountBalance(address, config);
|
|
2080
2184
|
}
|
|
@@ -2109,11 +2213,12 @@ var JsonRpcXyoViewer = class extends AbstractJsonRpcViewer {
|
|
|
2109
2213
|
async createHandler() {
|
|
2110
2214
|
await super.createHandler();
|
|
2111
2215
|
this._accountBalanceViewer = await this.locator.getInstance(AccountBalanceViewerMoniker3);
|
|
2112
|
-
this._blockViewer = await this.locator.getInstance(
|
|
2216
|
+
this._blockViewer = await this.locator.getInstance(BlockViewerMoniker4);
|
|
2113
2217
|
this._mempoolViewer = await this.locator.getInstance(MempoolViewerMoniker3);
|
|
2114
2218
|
this._stepViewer = await this.locator.getInstance(StepViewerMoniker);
|
|
2115
2219
|
this._networkStakeViewer = await this.locator.getInstance(NetworkStakeViewerMoniker3);
|
|
2116
2220
|
this._timeSyncViewer = await this.locator.getInstance(TimeSyncViewerMoniker3);
|
|
2221
|
+
this._transactionViewer = await this.locator.getInstance(TransactionViewerMoniker2);
|
|
2117
2222
|
}
|
|
2118
2223
|
async currentBlock() {
|
|
2119
2224
|
const result = await this.transport.sendRequest("xyoViewer_currentBlock");
|
|
@@ -2186,7 +2291,7 @@ var JsonRpcXyoViewer = class extends AbstractJsonRpcViewer {
|
|
|
2186
2291
|
return (await this.payloadsByHash([hash]))[0] ?? null;
|
|
2187
2292
|
}
|
|
2188
2293
|
async payloadsByHash(hashes) {
|
|
2189
|
-
return await
|
|
2294
|
+
return await PayloadBuilder.addHashMeta(await this.transport.sendRequest(
|
|
2190
2295
|
"xyoViewer_payloadsByHash",
|
|
2191
2296
|
[hashes]
|
|
2192
2297
|
));
|
|
@@ -2228,14 +2333,14 @@ var JsonRpcXyoViewer = class extends AbstractJsonRpcViewer {
|
|
|
2228
2333
|
__publicField(JsonRpcXyoViewer, "defaultMoniker", XyoViewerMoniker);
|
|
2229
2334
|
__publicField(JsonRpcXyoViewer, "dependencies", [
|
|
2230
2335
|
AccountBalanceViewerMoniker3,
|
|
2231
|
-
|
|
2336
|
+
BlockViewerMoniker4,
|
|
2232
2337
|
MempoolViewerMoniker3,
|
|
2233
2338
|
StepViewerMoniker,
|
|
2234
2339
|
TimeSyncViewerMoniker3
|
|
2235
2340
|
]);
|
|
2236
2341
|
__publicField(JsonRpcXyoViewer, "monikers", [XyoViewerMoniker]);
|
|
2237
2342
|
JsonRpcXyoViewer = __decorateClass([
|
|
2238
|
-
|
|
2343
|
+
creatableProvider11()
|
|
2239
2344
|
], JsonRpcXyoViewer);
|
|
2240
2345
|
|
|
2241
2346
|
// src/provider/datalake/JsonRpcDataLakeViewerMethods.ts
|
|
@@ -2259,7 +2364,7 @@ var JsonRpcDataLakeViewer = class extends JsonRpcDataLakeViewerMethods {
|
|
|
2259
2364
|
};
|
|
2260
2365
|
__publicField(JsonRpcDataLakeViewer, "dependencies", []);
|
|
2261
2366
|
JsonRpcDataLakeViewer = __decorateClass([
|
|
2262
|
-
|
|
2367
|
+
creatableProvider12()
|
|
2263
2368
|
], JsonRpcDataLakeViewer);
|
|
2264
2369
|
|
|
2265
2370
|
// src/provider/permissions/RpcXyoPermissions.ts
|
|
@@ -2284,7 +2389,7 @@ var RpcXyoPermissions = class {
|
|
|
2284
2389
|
import {
|
|
2285
2390
|
MempoolRunnerMoniker as MempoolRunnerMoniker2
|
|
2286
2391
|
} from "@xyo-network/xl1-protocol";
|
|
2287
|
-
import { creatableProvider as
|
|
2392
|
+
import { creatableProvider as creatableProvider13 } from "@xyo-network/xl1-protocol-sdk";
|
|
2288
2393
|
|
|
2289
2394
|
// src/provider/runner/JsonRpcMempoolRunner/JsonRpcMempoolRunnerMethods.ts
|
|
2290
2395
|
import { MempoolRunnerMoniker } from "@xyo-network/xl1-protocol";
|
|
@@ -2344,12 +2449,12 @@ __publicField(JsonRpcMempoolRunner, "defaultMoniker", MempoolRunnerMoniker2);
|
|
|
2344
2449
|
__publicField(JsonRpcMempoolRunner, "dependencies", []);
|
|
2345
2450
|
__publicField(JsonRpcMempoolRunner, "monikers", [MempoolRunnerMoniker2]);
|
|
2346
2451
|
JsonRpcMempoolRunner = __decorateClass([
|
|
2347
|
-
|
|
2452
|
+
creatableProvider13()
|
|
2348
2453
|
], JsonRpcMempoolRunner);
|
|
2349
2454
|
|
|
2350
2455
|
// src/provider/runner/JsonRpcXyoRunner.ts
|
|
2351
2456
|
import { MempoolRunnerMoniker as MempoolRunnerMoniker3, XyoRunnerMoniker } from "@xyo-network/xl1-protocol";
|
|
2352
|
-
import { creatableProvider as
|
|
2457
|
+
import { creatableProvider as creatableProvider14 } from "@xyo-network/xl1-protocol-sdk";
|
|
2353
2458
|
var JsonRpcXyoRunner = class extends AbstractJsonRpcRunner {
|
|
2354
2459
|
moniker = JsonRpcXyoRunner.defaultMoniker;
|
|
2355
2460
|
_mempoolRunner;
|
|
@@ -2371,18 +2476,18 @@ __publicField(JsonRpcXyoRunner, "defaultMoniker", XyoRunnerMoniker);
|
|
|
2371
2476
|
__publicField(JsonRpcXyoRunner, "dependencies", [MempoolRunnerMoniker3]);
|
|
2372
2477
|
__publicField(JsonRpcXyoRunner, "monikers", [XyoRunnerMoniker]);
|
|
2373
2478
|
JsonRpcXyoRunner = __decorateClass([
|
|
2374
|
-
|
|
2479
|
+
creatableProvider14()
|
|
2375
2480
|
], JsonRpcXyoRunner);
|
|
2376
2481
|
|
|
2377
2482
|
// src/provider/runner/NodeXyoRunner.ts
|
|
2378
|
-
import { assertEx as
|
|
2483
|
+
import { assertEx as assertEx3 } from "@xylabs/sdk-js";
|
|
2379
2484
|
import { asArchivistInstance } from "@xyo-network/sdk-js";
|
|
2380
2485
|
import {
|
|
2381
2486
|
XyoRunnerMoniker as XyoRunnerMoniker2
|
|
2382
2487
|
} from "@xyo-network/xl1-protocol";
|
|
2383
2488
|
import {
|
|
2384
2489
|
AbstractCreatableProvider as AbstractCreatableProvider3,
|
|
2385
|
-
creatableProvider as
|
|
2490
|
+
creatableProvider as creatableProvider15,
|
|
2386
2491
|
SimpleMempoolRunner
|
|
2387
2492
|
} from "@xyo-network/xl1-protocol-sdk";
|
|
2388
2493
|
var NodeXyoRunner = class extends AbstractCreatableProvider3 {
|
|
@@ -2414,19 +2519,19 @@ var NodeXyoRunner = class extends AbstractCreatableProvider3 {
|
|
|
2414
2519
|
}
|
|
2415
2520
|
getArchivist = async (identifier) => {
|
|
2416
2521
|
const archivist = await this.node.resolve(identifier);
|
|
2417
|
-
return
|
|
2522
|
+
return assertEx3(asArchivistInstance(archivist), () => `Could not resolve ${identifier} to an archivist instance`);
|
|
2418
2523
|
};
|
|
2419
2524
|
async startHandler() {
|
|
2420
2525
|
await super.startHandler();
|
|
2421
|
-
this._pendingTransactionsArchivist =
|
|
2526
|
+
this._pendingTransactionsArchivist = assertEx3(
|
|
2422
2527
|
await this.getArchivist(this.pendingTransactionsArchivistPath),
|
|
2423
2528
|
() => `Could not resolve pending archivist at ${this.pendingTransactionsArchivistPath}`
|
|
2424
2529
|
);
|
|
2425
|
-
this._pendingBlocksArchivist =
|
|
2530
|
+
this._pendingBlocksArchivist = assertEx3(
|
|
2426
2531
|
await this.getArchivist(this.pendingBlocksArchivistPath),
|
|
2427
2532
|
() => `Could not resolve pending archivist at ${this.pendingBlocksArchivistPath}`
|
|
2428
2533
|
);
|
|
2429
|
-
this._mempoolRunner =
|
|
2534
|
+
this._mempoolRunner = assertEx3(await SimpleMempoolRunner.create({
|
|
2430
2535
|
context: this.context,
|
|
2431
2536
|
pendingTransactionsArchivist: this.pendingTransactionsArchivist,
|
|
2432
2537
|
pendingBlocksArchivist: this.pendingBlocksArchivist
|
|
@@ -2437,7 +2542,7 @@ __publicField(NodeXyoRunner, "defaultMoniker", XyoRunnerMoniker2);
|
|
|
2437
2542
|
__publicField(NodeXyoRunner, "dependencies", []);
|
|
2438
2543
|
__publicField(NodeXyoRunner, "monikers", [XyoRunnerMoniker2]);
|
|
2439
2544
|
NodeXyoRunner = __decorateClass([
|
|
2440
|
-
|
|
2545
|
+
creatableProvider15()
|
|
2441
2546
|
], NodeXyoRunner);
|
|
2442
2547
|
|
|
2443
2548
|
// src/provider/signer/JsonRpcXyoSigner.ts
|
|
@@ -2496,6 +2601,7 @@ export {
|
|
|
2496
2601
|
JsonRpcStakeViewerMethods,
|
|
2497
2602
|
JsonRpcTimeSyncViewer,
|
|
2498
2603
|
JsonRpcTimeSyncViewerMethods,
|
|
2604
|
+
JsonRpcTransactionViewer,
|
|
2499
2605
|
JsonRpcXyoRunner,
|
|
2500
2606
|
JsonRpcXyoSigner,
|
|
2501
2607
|
JsonRpcXyoSignerMethods,
|
|
@@ -2521,6 +2627,7 @@ export {
|
|
|
2521
2627
|
StakeTotalsViewerRpcSchemas,
|
|
2522
2628
|
StakeViewerRpcSchemas,
|
|
2523
2629
|
TimeSyncViewerRpcSchemas,
|
|
2630
|
+
TransactionViewerRpcSchemas,
|
|
2524
2631
|
XyoPermissionsRpcSchemas,
|
|
2525
2632
|
XyoRunnerRpcSchemas,
|
|
2526
2633
|
XyoSignerRpcSchemas,
|