@xyo-network/xl1-rpc 1.16.24 → 1.16.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/engine/rpcMethodHandlersFromAccountBalanceViewer.d.ts +4 -0
- package/dist/neutral/engine/rpcMethodHandlersFromAccountBalanceViewer.d.ts.map +1 -0
- package/dist/neutral/engine/rpcMethodHandlersFromConnection.d.ts.map +1 -1
- package/dist/neutral/engine/rpcMethodHandlersFromNetworkStakeStepRewardsByPositionViewer.d.ts +4 -0
- package/dist/neutral/engine/rpcMethodHandlersFromNetworkStakeStepRewardsByPositionViewer.d.ts.map +1 -0
- package/dist/neutral/index.mjs +176 -143
- package/dist/neutral/index.mjs.map +1 -1
- package/dist/neutral/provider/signer/JsonRpcXyoSigner.d.ts.map +1 -1
- package/dist/neutral/provider/viewer/JsonRpcMempoolViewer/JsonRpcMempoolViewer.d.ts +8 -0
- package/dist/neutral/provider/viewer/JsonRpcMempoolViewer/JsonRpcMempoolViewer.d.ts.map +1 -0
- package/dist/neutral/provider/viewer/JsonRpcMempoolViewer/JsonRpcMempoolViewerMethods.d.ts +10 -0
- package/dist/neutral/provider/viewer/JsonRpcMempoolViewer/JsonRpcMempoolViewerMethods.d.ts.map +1 -0
- package/dist/neutral/provider/viewer/JsonRpcMempoolViewer/index.d.ts +3 -0
- package/dist/neutral/provider/viewer/JsonRpcMempoolViewer/index.d.ts.map +1 -0
- package/dist/neutral/provider/viewer/JsonRpcXyoViewer.d.ts +5 -5
- package/dist/neutral/provider/viewer/JsonRpcXyoViewer.d.ts.map +1 -1
- package/dist/neutral/transport/HttpRpcTransport.d.ts +3 -2
- package/dist/neutral/transport/HttpRpcTransport.d.ts.map +1 -1
- package/dist/neutral/types/MempoolViewerRpc.d.ts +10 -0
- package/dist/neutral/types/MempoolViewerRpc.d.ts.map +1 -0
- package/dist/neutral/types/schema/AccountBalanceViewerRpcSchemas.d.ts +16 -28
- package/dist/neutral/types/schema/AccountBalanceViewerRpcSchemas.d.ts.map +1 -1
- package/dist/neutral/types/schema/AllRpcSchemas.d.ts +225 -446
- package/dist/neutral/types/schema/AllRpcSchemas.d.ts.map +1 -1
- package/dist/neutral/types/schema/DataLakeViewerRpcSchema.d.ts +4 -12
- package/dist/neutral/types/schema/DataLakeViewerRpcSchema.d.ts.map +1 -1
- package/dist/neutral/types/schema/MempoolViewerRpcSchemas.d.ts +74 -0
- package/dist/neutral/types/schema/MempoolViewerRpcSchemas.d.ts.map +1 -0
- package/dist/neutral/types/schema/RewardsByPositionViewerRpcSchemas.d.ts.map +1 -1
- package/dist/neutral/types/schema/RewardsTotalViewerRpcSchemas.d.ts.map +1 -1
- package/dist/neutral/types/schema/StepViewerRpcSchemas.d.ts.map +1 -1
- package/dist/neutral/types/schema/TimeSyncViewerRpcSchema.d.ts.map +1 -1
- package/dist/neutral/types/schema/XyoRunnerRpcSchemas.d.ts +16 -30
- package/dist/neutral/types/schema/XyoRunnerRpcSchemas.d.ts.map +1 -1
- package/dist/neutral/types/schema/XyoSignerRpcSchemas.d.ts +41 -90
- package/dist/neutral/types/schema/XyoSignerRpcSchemas.d.ts.map +1 -1
- package/dist/neutral/types/schema/XyoViewerRpcSchemas.d.ts +152 -298
- package/dist/neutral/types/schema/XyoViewerRpcSchemas.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/rpcMethodHandlersFromAccountBalanceViewer.d.ts +4 -0
- package/dist/node/engine/rpcMethodHandlersFromAccountBalanceViewer.d.ts.map +1 -0
- package/dist/node/engine/rpcMethodHandlersFromConnection.d.ts.map +1 -1
- package/dist/node/engine/rpcMethodHandlersFromNetworkStakeStepRewardsByPositionViewer.d.ts +4 -0
- package/dist/node/engine/rpcMethodHandlersFromNetworkStakeStepRewardsByPositionViewer.d.ts.map +1 -0
- package/dist/node/index-node.mjs +176 -143
- package/dist/node/index-node.mjs.map +1 -1
- package/dist/node/provider/signer/JsonRpcXyoSigner.d.ts.map +1 -1
- package/dist/node/provider/viewer/JsonRpcMempoolViewer/JsonRpcMempoolViewer.d.ts +8 -0
- package/dist/node/provider/viewer/JsonRpcMempoolViewer/JsonRpcMempoolViewer.d.ts.map +1 -0
- package/dist/node/provider/viewer/JsonRpcMempoolViewer/JsonRpcMempoolViewerMethods.d.ts +10 -0
- package/dist/node/provider/viewer/JsonRpcMempoolViewer/JsonRpcMempoolViewerMethods.d.ts.map +1 -0
- package/dist/node/provider/viewer/JsonRpcMempoolViewer/index.d.ts +3 -0
- package/dist/node/provider/viewer/JsonRpcMempoolViewer/index.d.ts.map +1 -0
- package/dist/node/provider/viewer/JsonRpcXyoViewer.d.ts +5 -5
- package/dist/node/provider/viewer/JsonRpcXyoViewer.d.ts.map +1 -1
- package/dist/node/transport/HttpRpcTransport.d.ts +3 -2
- package/dist/node/transport/HttpRpcTransport.d.ts.map +1 -1
- package/dist/node/types/MempoolViewerRpc.d.ts +10 -0
- package/dist/node/types/MempoolViewerRpc.d.ts.map +1 -0
- package/dist/node/types/schema/AccountBalanceViewerRpcSchemas.d.ts +16 -28
- package/dist/node/types/schema/AccountBalanceViewerRpcSchemas.d.ts.map +1 -1
- package/dist/node/types/schema/AllRpcSchemas.d.ts +225 -446
- package/dist/node/types/schema/AllRpcSchemas.d.ts.map +1 -1
- package/dist/node/types/schema/DataLakeViewerRpcSchema.d.ts +4 -12
- package/dist/node/types/schema/DataLakeViewerRpcSchema.d.ts.map +1 -1
- package/dist/node/types/schema/MempoolViewerRpcSchemas.d.ts +74 -0
- package/dist/node/types/schema/MempoolViewerRpcSchemas.d.ts.map +1 -0
- package/dist/node/types/schema/RewardsByPositionViewerRpcSchemas.d.ts.map +1 -1
- package/dist/node/types/schema/RewardsTotalViewerRpcSchemas.d.ts.map +1 -1
- package/dist/node/types/schema/StepViewerRpcSchemas.d.ts.map +1 -1
- package/dist/node/types/schema/TimeSyncViewerRpcSchema.d.ts.map +1 -1
- package/dist/node/types/schema/XyoRunnerRpcSchemas.d.ts +16 -30
- package/dist/node/types/schema/XyoRunnerRpcSchemas.d.ts.map +1 -1
- package/dist/node/types/schema/XyoSignerRpcSchemas.d.ts +41 -90
- package/dist/node/types/schema/XyoSignerRpcSchemas.d.ts.map +1 -1
- package/dist/node/types/schema/XyoViewerRpcSchemas.d.ts +152 -298
- package/dist/node/types/schema/XyoViewerRpcSchemas.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 +18 -18
- package/src/engine/rpcMethodHandlersFromAccountBalanceViewer.ts +10 -0
- package/src/engine/rpcMethodHandlersFromConnection.ts +8 -0
- package/src/engine/rpcMethodHandlersFromNetworkStakeStepRewardsByPositionViewer.ts +14 -0
- package/src/provider/signer/JsonRpcXyoSigner.ts +1 -2
- package/src/provider/viewer/JsonRpcMempoolViewer/JsonRpcMempoolViewer.ts +11 -0
- package/src/provider/viewer/JsonRpcMempoolViewer/JsonRpcMempoolViewerMethods.ts +21 -0
- package/src/provider/viewer/JsonRpcMempoolViewer/index.ts +2 -0
- package/src/provider/viewer/JsonRpcXyoViewer.ts +10 -10
- package/src/transport/HttpRpcTransport.ts +15 -4
- package/src/types/MempoolViewerRpc.ts +16 -0
- package/src/types/schema/DataLakeViewerRpcSchema.ts +1 -1
- package/src/types/schema/MempoolViewerRpcSchemas.ts +19 -0
- package/src/types/schema/RewardsByPositionViewerRpcSchemas.ts +1 -2
- package/src/types/schema/RewardsByStakerViewerRpcSchemas.ts +1 -1
- package/src/types/schema/RewardsByStepViewerRpcSchemas.ts +1 -1
- package/src/types/schema/RewardsTotalViewerRpcSchemas.ts +1 -2
- package/src/types/schema/StepViewerRpcSchemas.ts +3 -2
- package/src/types/schema/TimeSyncViewerRpcSchema.ts +1 -2
- package/src/types/schema/XyoPermissionsRpcSchemas.ts +1 -1
- package/src/types/schema/XyoRunnerRpcSchemas.ts +1 -1
- package/src/types/schema/XyoSignerRpcSchemas.ts +3 -4
- package/src/types/schema/XyoViewerRpcSchemas.ts +3 -4
- package/src/types/schema/index.ts +1 -0
package/dist/neutral/index.mjs
CHANGED
|
@@ -4,6 +4,14 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
|
|
|
4
4
|
// src/engine/requestSchemas.ts
|
|
5
5
|
var requestSchemas = {};
|
|
6
6
|
|
|
7
|
+
// src/engine/rpcMethodHandlersFromAccountBalanceViewer.ts
|
|
8
|
+
var rpcMethodHandlersFromAccountBalanceViewer = /* @__PURE__ */ __name((viewer) => {
|
|
9
|
+
return {
|
|
10
|
+
accountBalanceViewer_accountsBalances: /* @__PURE__ */ __name((params) => viewer.accountsBalances(params[0], params[1]), "accountBalanceViewer_accountsBalances"),
|
|
11
|
+
accountBalanceViewer_accountsBalancesHistory: /* @__PURE__ */ __name((params) => viewer.accountsBalancesHistory(params[0], params[1]), "accountBalanceViewer_accountsBalancesHistory")
|
|
12
|
+
};
|
|
13
|
+
}, "rpcMethodHandlersFromAccountBalanceViewer");
|
|
14
|
+
|
|
7
15
|
// src/engine/rpcMethodHandlersFromNetworkStakingStepRewardsByPositionViewer.ts
|
|
8
16
|
var rpcMethodHandlersFromNetworkStakingStepRewardsByPositionViewer = /* @__PURE__ */ __name((viewer) => {
|
|
9
17
|
return {
|
|
@@ -88,6 +96,13 @@ var rpcMethodHandlersFromConnection = /* @__PURE__ */ __name((connection, networ
|
|
|
88
96
|
...rpcMethodHandlersFromNetworkStakingStepRewardsByPositionViewer(networkStakeViewer.stepRewards.position)
|
|
89
97
|
};
|
|
90
98
|
}
|
|
99
|
+
const accountBalanceViewer = viewer?.account?.balance;
|
|
100
|
+
if (accountBalanceViewer) {
|
|
101
|
+
result = {
|
|
102
|
+
...result,
|
|
103
|
+
...rpcMethodHandlersFromAccountBalanceViewer(accountBalanceViewer)
|
|
104
|
+
};
|
|
105
|
+
}
|
|
91
106
|
return result;
|
|
92
107
|
}, "rpcMethodHandlersFromConnection");
|
|
93
108
|
|
|
@@ -117,9 +132,10 @@ var rpcMethodHandlersFromSigner = /* @__PURE__ */ __name((signer) => {
|
|
|
117
132
|
|
|
118
133
|
// src/transport/HttpRpcTransport.ts
|
|
119
134
|
import { axiosJsonConfig } from "@xylabs/axios";
|
|
120
|
-
import { isError, isUndefinedOrNull } from "@xylabs/sdk-js";
|
|
135
|
+
import { isDefined, isError, isUndefinedOrNull } from "@xylabs/sdk-js";
|
|
121
136
|
import { Axios, isAxiosError } from "axios";
|
|
122
137
|
import { v4 } from "uuid";
|
|
138
|
+
import * as z16 from "zod";
|
|
123
139
|
|
|
124
140
|
// src/types/AccountBalanceViewerRpc.ts
|
|
125
141
|
var AccountBalanceViewerRpcNamespace = "accountBalanceViewer";
|
|
@@ -272,7 +288,7 @@ var NetworkStakeViewerRpcSchemas = {
|
|
|
272
288
|
};
|
|
273
289
|
|
|
274
290
|
// src/types/schema/XyoPermissionsRpcSchemas.ts
|
|
275
|
-
import { InvokerPermissionZod, PermissionRequestZod, RequestedPermissionZod } from "@xyo-network/xl1-protocol
|
|
291
|
+
import { InvokerPermissionZod, PermissionRequestZod, RequestedPermissionZod } from "@xyo-network/xl1-protocol";
|
|
276
292
|
import * as z3 from "zod";
|
|
277
293
|
var XyoPermissionsRpcSchemas = {
|
|
278
294
|
xyoPermissions_getPermissions: {
|
|
@@ -317,7 +333,7 @@ var XyoPermissionsRpcSchemas = {
|
|
|
317
333
|
|
|
318
334
|
// src/types/schema/XyoRunnerRpcSchemas.ts
|
|
319
335
|
import { HashToJsonZod, JsonToHashZod } from "@xylabs/sdk-js";
|
|
320
|
-
import { SignedHydratedTransactionZod } from "@xyo-network/xl1-protocol
|
|
336
|
+
import { SignedHydratedTransactionZod } from "@xyo-network/xl1-protocol";
|
|
321
337
|
import * as z4 from "zod";
|
|
322
338
|
var XyoRunnerRpcSchemas = {
|
|
323
339
|
xyoRunner_broadcastTransaction: {
|
|
@@ -338,8 +354,7 @@ var XyoRunnerRpcSchemas = {
|
|
|
338
354
|
|
|
339
355
|
// src/types/schema/XyoSignerRpcSchemas.ts
|
|
340
356
|
import { AddressZod as AddressZod2 } from "@xylabs/sdk-js";
|
|
341
|
-
import {
|
|
342
|
-
import { SignedHydratedTransactionZod as SignedHydratedTransactionZod2, UnsignedHydratedTransactionZod } from "@xyo-network/xl1-protocol-sdk";
|
|
357
|
+
import { SignedHydratedTransactionWithHashMetaZod, UnsignedHydratedTransactionZod } from "@xyo-network/xl1-protocol";
|
|
343
358
|
import { z as z5 } from "zod";
|
|
344
359
|
var XyoSignerRpcSchemas = {
|
|
345
360
|
xyoSigner_address: {
|
|
@@ -362,18 +377,16 @@ var XyoSignerRpcSchemas = {
|
|
|
362
377
|
])
|
|
363
378
|
},
|
|
364
379
|
result: {
|
|
365
|
-
to:
|
|
366
|
-
from:
|
|
367
|
-
required: true
|
|
368
|
-
}))
|
|
380
|
+
to: SignedHydratedTransactionWithHashMetaZod,
|
|
381
|
+
from: SignedHydratedTransactionWithHashMetaZod
|
|
369
382
|
}
|
|
370
383
|
}
|
|
371
384
|
};
|
|
372
385
|
|
|
373
386
|
// src/types/schema/XyoViewerRpcSchemas.ts
|
|
374
387
|
import { AddressZod as AddressZod3, BigIntToJsonZod as BigIntToJsonZod3, HashToJsonZod as HashToJsonZod2, HashZod as HashZod2, JsonToBigIntZod as JsonToBigIntZod3, JsonToHashZod as JsonToHashZod2 } from "@xylabs/sdk-js";
|
|
375
|
-
import { BlockNumberZod as BlockNumberZod2, BlockRangeZod, StepIdentityZod, XL1BlockNumberZod, XL1BlockRangeZod as XL1BlockRangeZod2 } from "@xyo-network/xl1-protocol";
|
|
376
|
-
import { AccountBalanceHistoryItemZod as AccountBalanceHistoryItemZod2
|
|
388
|
+
import { BlockNumberZod as BlockNumberZod2, BlockRangeZod, JsonToStakeZod, SignedHydratedBlockZod, SignedHydratedTransactionZod as SignedHydratedTransactionZod2, StakeToJsonZod, StepIdentityZod, TransferPairZod, XL1BlockNumberZod, XL1BlockRangeZod as XL1BlockRangeZod2 } from "@xyo-network/xl1-protocol";
|
|
389
|
+
import { AccountBalanceHistoryItemZod as AccountBalanceHistoryItemZod2 } from "@xyo-network/xl1-protocol-sdk";
|
|
377
390
|
import * as z6 from "zod";
|
|
378
391
|
var XyoViewerRpcSchemas = {
|
|
379
392
|
xyoViewer_networkStakeStepRewardClaimedByAddress: {
|
|
@@ -1058,8 +1071,8 @@ var XyoViewerRpcSchemas = {
|
|
|
1058
1071
|
])
|
|
1059
1072
|
},
|
|
1060
1073
|
result: {
|
|
1061
|
-
to:
|
|
1062
|
-
from:
|
|
1074
|
+
to: SignedHydratedTransactionZod2.nullable(),
|
|
1075
|
+
from: SignedHydratedTransactionZod2.nullable()
|
|
1063
1076
|
}
|
|
1064
1077
|
},
|
|
1065
1078
|
xyoViewer_transactionByBlockNumberAndIndex: {
|
|
@@ -1074,8 +1087,8 @@ var XyoViewerRpcSchemas = {
|
|
|
1074
1087
|
])
|
|
1075
1088
|
},
|
|
1076
1089
|
result: {
|
|
1077
|
-
to:
|
|
1078
|
-
from:
|
|
1090
|
+
to: SignedHydratedTransactionZod2.nullable(),
|
|
1091
|
+
from: SignedHydratedTransactionZod2.nullable()
|
|
1079
1092
|
}
|
|
1080
1093
|
},
|
|
1081
1094
|
xyoViewer_transactionByHash: {
|
|
@@ -1088,8 +1101,8 @@ var XyoViewerRpcSchemas = {
|
|
|
1088
1101
|
])
|
|
1089
1102
|
},
|
|
1090
1103
|
result: {
|
|
1091
|
-
to:
|
|
1092
|
-
from:
|
|
1104
|
+
to: SignedHydratedTransactionZod2.nullable(),
|
|
1105
|
+
from: SignedHydratedTransactionZod2.nullable()
|
|
1093
1106
|
}
|
|
1094
1107
|
}
|
|
1095
1108
|
};
|
|
@@ -1130,7 +1143,7 @@ var createResponseSchema = /* @__PURE__ */ __name((resultSchema = z8.undefined()
|
|
|
1130
1143
|
// src/types/schema/DataLakeViewerRpcSchema.ts
|
|
1131
1144
|
import { HashZod as HashZod3 } from "@xylabs/sdk-js";
|
|
1132
1145
|
import { PayloadZod } from "@xyo-network/payload-model";
|
|
1133
|
-
import { ArrayBufferToJsonZod, JsonToArrayBufferZod } from "@xyo-network/xl1-protocol
|
|
1146
|
+
import { ArrayBufferToJsonZod, JsonToArrayBufferZod } from "@xyo-network/xl1-protocol";
|
|
1134
1147
|
import * as z9 from "zod";
|
|
1135
1148
|
var DataLakeViewerRpcSchemas = {
|
|
1136
1149
|
dataLakeViewer_get: {
|
|
@@ -1189,250 +1202,269 @@ var DataLakeViewerRpcSchemas = {
|
|
|
1189
1202
|
}
|
|
1190
1203
|
};
|
|
1191
1204
|
|
|
1205
|
+
// src/types/schema/MempoolViewerRpcSchemas.ts
|
|
1206
|
+
import { SignedHydratedTransactionWithHashMetaZod as SignedHydratedTransactionWithHashMetaZod2 } from "@xyo-network/xl1-protocol";
|
|
1207
|
+
import { PendingTransactionsOptionsZod } from "@xyo-network/xl1-protocol-sdk";
|
|
1208
|
+
import * as z10 from "zod";
|
|
1209
|
+
var MempoolViewerRpcSchemas = {
|
|
1210
|
+
mempoolViewer_pendingTransactions: {
|
|
1211
|
+
params: {
|
|
1212
|
+
to: z10.tuple([
|
|
1213
|
+
PendingTransactionsOptionsZod.optional()
|
|
1214
|
+
]),
|
|
1215
|
+
from: z10.tuple([
|
|
1216
|
+
PendingTransactionsOptionsZod.optional()
|
|
1217
|
+
])
|
|
1218
|
+
},
|
|
1219
|
+
result: {
|
|
1220
|
+
to: z10.array(SignedHydratedTransactionWithHashMetaZod2),
|
|
1221
|
+
from: z10.array(SignedHydratedTransactionWithHashMetaZod2)
|
|
1222
|
+
}
|
|
1223
|
+
}
|
|
1224
|
+
};
|
|
1225
|
+
|
|
1192
1226
|
// src/types/schema/RewardsByPositionViewerRpcSchemas.ts
|
|
1193
1227
|
import { BigIntToJsonZod as BigIntToJsonZod4, JsonToBigIntZod as JsonToBigIntZod4 } from "@xylabs/sdk-js";
|
|
1194
|
-
import { asAttoXL1 } from "@xyo-network/xl1-protocol";
|
|
1195
|
-
import
|
|
1196
|
-
import z10 from "zod";
|
|
1228
|
+
import { asAttoXL1, RewardsRangeOptionsZod } from "@xyo-network/xl1-protocol";
|
|
1229
|
+
import z11 from "zod";
|
|
1197
1230
|
var NetworkStakingStepRewardsByPositionViewerRpcSchemas = {
|
|
1198
1231
|
networkStakingStepRewardsByPositionViewer_bonus: {
|
|
1199
1232
|
params: {
|
|
1200
|
-
from:
|
|
1233
|
+
from: z11.tuple([
|
|
1201
1234
|
RewardsRangeOptionsZod.optional()
|
|
1202
1235
|
]),
|
|
1203
|
-
to:
|
|
1236
|
+
to: z11.tuple([
|
|
1204
1237
|
RewardsRangeOptionsZod.optional()
|
|
1205
1238
|
])
|
|
1206
1239
|
},
|
|
1207
1240
|
result: {
|
|
1208
|
-
from:
|
|
1209
|
-
to:
|
|
1241
|
+
from: z11.record(z11.number(), JsonToBigIntZod4.transform((val) => asAttoXL1(val))),
|
|
1242
|
+
to: z11.record(z11.number(), BigIntToJsonZod4)
|
|
1210
1243
|
}
|
|
1211
1244
|
},
|
|
1212
1245
|
networkStakingStepRewardsByPositionViewer_claimed: {
|
|
1213
1246
|
params: {
|
|
1214
|
-
from:
|
|
1247
|
+
from: z11.tuple([
|
|
1215
1248
|
RewardsRangeOptionsZod.optional()
|
|
1216
1249
|
]),
|
|
1217
|
-
to:
|
|
1250
|
+
to: z11.tuple([
|
|
1218
1251
|
RewardsRangeOptionsZod.optional()
|
|
1219
1252
|
])
|
|
1220
1253
|
},
|
|
1221
1254
|
result: {
|
|
1222
|
-
from:
|
|
1223
|
-
to:
|
|
1255
|
+
from: z11.record(z11.number(), BigIntToJsonZod4.transform((val) => asAttoXL1(val))),
|
|
1256
|
+
to: z11.record(z11.number(), JsonToBigIntZod4)
|
|
1224
1257
|
}
|
|
1225
1258
|
},
|
|
1226
1259
|
networkStakingStepRewardsByPositionViewer_earned: {
|
|
1227
1260
|
params: {
|
|
1228
|
-
from:
|
|
1261
|
+
from: z11.tuple([
|
|
1229
1262
|
RewardsRangeOptionsZod.optional()
|
|
1230
1263
|
]),
|
|
1231
|
-
to:
|
|
1264
|
+
to: z11.tuple([
|
|
1232
1265
|
RewardsRangeOptionsZod.optional()
|
|
1233
1266
|
])
|
|
1234
1267
|
},
|
|
1235
1268
|
result: {
|
|
1236
|
-
from:
|
|
1237
|
-
to:
|
|
1269
|
+
from: z11.record(z11.number(), BigIntToJsonZod4.transform((val) => asAttoXL1(val))),
|
|
1270
|
+
to: z11.record(z11.number(), JsonToBigIntZod4)
|
|
1238
1271
|
}
|
|
1239
1272
|
},
|
|
1240
1273
|
networkStakingStepRewardsByPositionViewer_total: {
|
|
1241
1274
|
params: {
|
|
1242
|
-
from:
|
|
1275
|
+
from: z11.tuple([
|
|
1243
1276
|
RewardsRangeOptionsZod.optional()
|
|
1244
1277
|
]),
|
|
1245
|
-
to:
|
|
1278
|
+
to: z11.tuple([
|
|
1246
1279
|
RewardsRangeOptionsZod.optional()
|
|
1247
1280
|
])
|
|
1248
1281
|
},
|
|
1249
1282
|
result: {
|
|
1250
|
-
from:
|
|
1251
|
-
to:
|
|
1283
|
+
from: z11.record(z11.number(), BigIntToJsonZod4.transform((val) => asAttoXL1(val))),
|
|
1284
|
+
to: z11.record(z11.number(), JsonToBigIntZod4)
|
|
1252
1285
|
}
|
|
1253
1286
|
},
|
|
1254
1287
|
networkStakingStepRewardsByPositionViewer_unclaimed: {
|
|
1255
1288
|
params: {
|
|
1256
|
-
from:
|
|
1289
|
+
from: z11.tuple([
|
|
1257
1290
|
RewardsRangeOptionsZod.optional()
|
|
1258
1291
|
]),
|
|
1259
|
-
to:
|
|
1292
|
+
to: z11.tuple([
|
|
1260
1293
|
RewardsRangeOptionsZod.optional()
|
|
1261
1294
|
])
|
|
1262
1295
|
},
|
|
1263
1296
|
result: {
|
|
1264
|
-
from:
|
|
1265
|
-
to:
|
|
1297
|
+
from: z11.record(z11.number(), BigIntToJsonZod4.transform((val) => asAttoXL1(val))),
|
|
1298
|
+
to: z11.record(z11.number(), JsonToBigIntZod4)
|
|
1266
1299
|
}
|
|
1267
1300
|
}
|
|
1268
1301
|
};
|
|
1269
1302
|
|
|
1270
1303
|
// src/types/schema/RewardsByStakerViewerRpcSchemas.ts
|
|
1271
1304
|
import { AddressZod as AddressZod4, BigIntToJsonZod as BigIntToJsonZod5, JsonToBigIntZod as JsonToBigIntZod5 } from "@xylabs/sdk-js";
|
|
1272
|
-
import { RewardsRangeOptionsZod as RewardsRangeOptionsZod2 } from "@xyo-network/xl1-protocol
|
|
1273
|
-
import
|
|
1305
|
+
import { RewardsRangeOptionsZod as RewardsRangeOptionsZod2 } from "@xyo-network/xl1-protocol";
|
|
1306
|
+
import z12 from "zod";
|
|
1274
1307
|
var NetworkStakingStepRewardsByStakerViewerRpcSchemas = {
|
|
1275
1308
|
networkStakingStepRewardsByStakerViewer_bonus: {
|
|
1276
1309
|
params: {
|
|
1277
|
-
from:
|
|
1310
|
+
from: z12.tuple([
|
|
1278
1311
|
RewardsRangeOptionsZod2.optional()
|
|
1279
1312
|
]),
|
|
1280
|
-
to:
|
|
1313
|
+
to: z12.tuple([
|
|
1281
1314
|
RewardsRangeOptionsZod2.optional()
|
|
1282
1315
|
])
|
|
1283
1316
|
},
|
|
1284
1317
|
result: {
|
|
1285
|
-
from:
|
|
1286
|
-
to:
|
|
1318
|
+
from: z12.record(AddressZod4, BigIntToJsonZod5),
|
|
1319
|
+
to: z12.record(AddressZod4, JsonToBigIntZod5)
|
|
1287
1320
|
}
|
|
1288
1321
|
},
|
|
1289
1322
|
networkStakingStepRewardsByStakerViewer_claimed: {
|
|
1290
1323
|
params: {
|
|
1291
|
-
from:
|
|
1324
|
+
from: z12.tuple([
|
|
1292
1325
|
RewardsRangeOptionsZod2.optional()
|
|
1293
1326
|
]),
|
|
1294
|
-
to:
|
|
1327
|
+
to: z12.tuple([
|
|
1295
1328
|
RewardsRangeOptionsZod2.optional()
|
|
1296
1329
|
])
|
|
1297
1330
|
},
|
|
1298
1331
|
result: {
|
|
1299
|
-
from:
|
|
1300
|
-
to:
|
|
1332
|
+
from: z12.record(AddressZod4, BigIntToJsonZod5),
|
|
1333
|
+
to: z12.record(AddressZod4, JsonToBigIntZod5)
|
|
1301
1334
|
}
|
|
1302
1335
|
},
|
|
1303
1336
|
networkStakingStepRewardsByStakerViewer_earned: {
|
|
1304
1337
|
params: {
|
|
1305
|
-
from:
|
|
1338
|
+
from: z12.tuple([
|
|
1306
1339
|
RewardsRangeOptionsZod2.optional()
|
|
1307
1340
|
]),
|
|
1308
|
-
to:
|
|
1341
|
+
to: z12.tuple([
|
|
1309
1342
|
RewardsRangeOptionsZod2.optional()
|
|
1310
1343
|
])
|
|
1311
1344
|
},
|
|
1312
1345
|
result: {
|
|
1313
|
-
from:
|
|
1314
|
-
to:
|
|
1346
|
+
from: z12.record(AddressZod4, BigIntToJsonZod5),
|
|
1347
|
+
to: z12.record(AddressZod4, JsonToBigIntZod5)
|
|
1315
1348
|
}
|
|
1316
1349
|
},
|
|
1317
1350
|
networkStakingStepRewardsByStakerViewer_total: {
|
|
1318
1351
|
params: {
|
|
1319
|
-
from:
|
|
1352
|
+
from: z12.tuple([
|
|
1320
1353
|
RewardsRangeOptionsZod2.optional()
|
|
1321
1354
|
]),
|
|
1322
|
-
to:
|
|
1355
|
+
to: z12.tuple([
|
|
1323
1356
|
RewardsRangeOptionsZod2.optional()
|
|
1324
1357
|
])
|
|
1325
1358
|
},
|
|
1326
1359
|
result: {
|
|
1327
|
-
from:
|
|
1328
|
-
to:
|
|
1360
|
+
from: z12.record(AddressZod4, BigIntToJsonZod5),
|
|
1361
|
+
to: z12.record(AddressZod4, JsonToBigIntZod5)
|
|
1329
1362
|
}
|
|
1330
1363
|
},
|
|
1331
1364
|
networkStakingStepRewardsByStakerViewer_unclaimed: {
|
|
1332
1365
|
params: {
|
|
1333
|
-
from:
|
|
1366
|
+
from: z12.tuple([
|
|
1334
1367
|
RewardsRangeOptionsZod2.optional()
|
|
1335
1368
|
]),
|
|
1336
|
-
to:
|
|
1369
|
+
to: z12.tuple([
|
|
1337
1370
|
RewardsRangeOptionsZod2.optional()
|
|
1338
1371
|
])
|
|
1339
1372
|
},
|
|
1340
1373
|
result: {
|
|
1341
|
-
from:
|
|
1342
|
-
to:
|
|
1374
|
+
from: z12.record(AddressZod4, BigIntToJsonZod5),
|
|
1375
|
+
to: z12.record(AddressZod4, JsonToBigIntZod5)
|
|
1343
1376
|
}
|
|
1344
1377
|
}
|
|
1345
1378
|
};
|
|
1346
1379
|
|
|
1347
1380
|
// src/types/schema/RewardsByStepViewerRpcSchemas.ts
|
|
1348
1381
|
import { AddressZod as AddressZod5, BigIntToJsonZod as BigIntToJsonZod6, JsonToBigIntZod as JsonToBigIntZod6 } from "@xylabs/sdk-js";
|
|
1349
|
-
import { RewardsRangeOptionsZod as RewardsRangeOptionsZod3 } from "@xyo-network/xl1-protocol
|
|
1350
|
-
import
|
|
1382
|
+
import { RewardsRangeOptionsZod as RewardsRangeOptionsZod3 } from "@xyo-network/xl1-protocol";
|
|
1383
|
+
import z13 from "zod";
|
|
1351
1384
|
var NetworkStakingStepRewardsByStepViewerRpcSchemas = {
|
|
1352
1385
|
networkStakingStepRewardsByStepViewer_bonus: {
|
|
1353
1386
|
params: {
|
|
1354
|
-
from:
|
|
1387
|
+
from: z13.tuple([
|
|
1355
1388
|
RewardsRangeOptionsZod3.optional()
|
|
1356
1389
|
]),
|
|
1357
|
-
to:
|
|
1390
|
+
to: z13.tuple([
|
|
1358
1391
|
RewardsRangeOptionsZod3.optional()
|
|
1359
1392
|
])
|
|
1360
1393
|
},
|
|
1361
1394
|
result: {
|
|
1362
|
-
from:
|
|
1363
|
-
to:
|
|
1395
|
+
from: z13.record(AddressZod5, BigIntToJsonZod6),
|
|
1396
|
+
to: z13.record(AddressZod5, JsonToBigIntZod6)
|
|
1364
1397
|
}
|
|
1365
1398
|
},
|
|
1366
1399
|
networkStakingStepRewardsByStepViewer_claimed: {
|
|
1367
1400
|
params: {
|
|
1368
|
-
from:
|
|
1401
|
+
from: z13.tuple([
|
|
1369
1402
|
RewardsRangeOptionsZod3.optional()
|
|
1370
1403
|
]),
|
|
1371
|
-
to:
|
|
1404
|
+
to: z13.tuple([
|
|
1372
1405
|
RewardsRangeOptionsZod3.optional()
|
|
1373
1406
|
])
|
|
1374
1407
|
},
|
|
1375
1408
|
result: {
|
|
1376
|
-
from:
|
|
1377
|
-
to:
|
|
1409
|
+
from: z13.record(AddressZod5, BigIntToJsonZod6),
|
|
1410
|
+
to: z13.record(AddressZod5, JsonToBigIntZod6)
|
|
1378
1411
|
}
|
|
1379
1412
|
},
|
|
1380
1413
|
networkStakingStepRewardsByStepViewer_earned: {
|
|
1381
1414
|
params: {
|
|
1382
|
-
from:
|
|
1415
|
+
from: z13.tuple([
|
|
1383
1416
|
RewardsRangeOptionsZod3.optional()
|
|
1384
1417
|
]),
|
|
1385
|
-
to:
|
|
1418
|
+
to: z13.tuple([
|
|
1386
1419
|
RewardsRangeOptionsZod3.optional()
|
|
1387
1420
|
])
|
|
1388
1421
|
},
|
|
1389
1422
|
result: {
|
|
1390
|
-
from:
|
|
1391
|
-
to:
|
|
1423
|
+
from: z13.record(AddressZod5, BigIntToJsonZod6),
|
|
1424
|
+
to: z13.record(AddressZod5, JsonToBigIntZod6)
|
|
1392
1425
|
}
|
|
1393
1426
|
},
|
|
1394
1427
|
networkStakingStepRewardsByStepViewer_total: {
|
|
1395
1428
|
params: {
|
|
1396
|
-
from:
|
|
1429
|
+
from: z13.tuple([
|
|
1397
1430
|
RewardsRangeOptionsZod3.optional()
|
|
1398
1431
|
]),
|
|
1399
|
-
to:
|
|
1432
|
+
to: z13.tuple([
|
|
1400
1433
|
RewardsRangeOptionsZod3.optional()
|
|
1401
1434
|
])
|
|
1402
1435
|
},
|
|
1403
1436
|
result: {
|
|
1404
|
-
from:
|
|
1405
|
-
to:
|
|
1437
|
+
from: z13.record(AddressZod5, BigIntToJsonZod6),
|
|
1438
|
+
to: z13.record(AddressZod5, JsonToBigIntZod6)
|
|
1406
1439
|
}
|
|
1407
1440
|
},
|
|
1408
1441
|
networkStakingStepRewardsByStepViewer_unclaimed: {
|
|
1409
1442
|
params: {
|
|
1410
|
-
from:
|
|
1443
|
+
from: z13.tuple([
|
|
1411
1444
|
RewardsRangeOptionsZod3.optional()
|
|
1412
1445
|
]),
|
|
1413
|
-
to:
|
|
1446
|
+
to: z13.tuple([
|
|
1414
1447
|
RewardsRangeOptionsZod3.optional()
|
|
1415
1448
|
])
|
|
1416
1449
|
},
|
|
1417
1450
|
result: {
|
|
1418
|
-
from:
|
|
1419
|
-
to:
|
|
1451
|
+
from: z13.record(AddressZod5, BigIntToJsonZod6),
|
|
1452
|
+
to: z13.record(AddressZod5, JsonToBigIntZod6)
|
|
1420
1453
|
}
|
|
1421
1454
|
}
|
|
1422
1455
|
};
|
|
1423
1456
|
|
|
1424
1457
|
// src/types/schema/RewardsTotalViewerRpcSchemas.ts
|
|
1425
1458
|
import { BigIntToJsonZod as BigIntToJsonZod7, JsonToBigIntZod as JsonToBigIntZod7 } from "@xylabs/sdk-js";
|
|
1426
|
-
import { asAttoXL1 as asAttoXL12 } from "@xyo-network/xl1-protocol";
|
|
1427
|
-
import
|
|
1428
|
-
import * as z13 from "zod";
|
|
1459
|
+
import { asAttoXL1 as asAttoXL12, RewardsRangeOptionsZod as RewardsRangeOptionsZod4 } from "@xyo-network/xl1-protocol";
|
|
1460
|
+
import * as z14 from "zod";
|
|
1429
1461
|
var NetworkStakingStepRewardsTotalViewerRpcSchemas = {
|
|
1430
1462
|
networkStakingStepRewardsTotalViewer_bonus: {
|
|
1431
1463
|
params: {
|
|
1432
|
-
from:
|
|
1464
|
+
from: z14.tuple([
|
|
1433
1465
|
RewardsRangeOptionsZod4.optional()
|
|
1434
1466
|
]),
|
|
1435
|
-
to:
|
|
1467
|
+
to: z14.tuple([
|
|
1436
1468
|
RewardsRangeOptionsZod4.optional()
|
|
1437
1469
|
])
|
|
1438
1470
|
},
|
|
@@ -1443,10 +1475,10 @@ var NetworkStakingStepRewardsTotalViewerRpcSchemas = {
|
|
|
1443
1475
|
},
|
|
1444
1476
|
networkStakingStepRewardsTotalViewer_claimed: {
|
|
1445
1477
|
params: {
|
|
1446
|
-
from:
|
|
1478
|
+
from: z14.tuple([
|
|
1447
1479
|
RewardsRangeOptionsZod4.optional()
|
|
1448
1480
|
]),
|
|
1449
|
-
to:
|
|
1481
|
+
to: z14.tuple([
|
|
1450
1482
|
RewardsRangeOptionsZod4.optional()
|
|
1451
1483
|
])
|
|
1452
1484
|
},
|
|
@@ -1457,10 +1489,10 @@ var NetworkStakingStepRewardsTotalViewerRpcSchemas = {
|
|
|
1457
1489
|
},
|
|
1458
1490
|
networkStakingStepRewardsTotalViewer_earned: {
|
|
1459
1491
|
params: {
|
|
1460
|
-
from:
|
|
1492
|
+
from: z14.tuple([
|
|
1461
1493
|
RewardsRangeOptionsZod4.optional()
|
|
1462
1494
|
]),
|
|
1463
|
-
to:
|
|
1495
|
+
to: z14.tuple([
|
|
1464
1496
|
RewardsRangeOptionsZod4.optional()
|
|
1465
1497
|
])
|
|
1466
1498
|
},
|
|
@@ -1471,10 +1503,10 @@ var NetworkStakingStepRewardsTotalViewerRpcSchemas = {
|
|
|
1471
1503
|
},
|
|
1472
1504
|
networkStakingStepRewardsTotalViewer_total: {
|
|
1473
1505
|
params: {
|
|
1474
|
-
from:
|
|
1506
|
+
from: z14.tuple([
|
|
1475
1507
|
RewardsRangeOptionsZod4.optional()
|
|
1476
1508
|
]),
|
|
1477
|
-
to:
|
|
1509
|
+
to: z14.tuple([
|
|
1478
1510
|
RewardsRangeOptionsZod4.optional()
|
|
1479
1511
|
])
|
|
1480
1512
|
},
|
|
@@ -1485,10 +1517,10 @@ var NetworkStakingStepRewardsTotalViewerRpcSchemas = {
|
|
|
1485
1517
|
},
|
|
1486
1518
|
networkStakingStepRewardsTotalViewer_unclaimed: {
|
|
1487
1519
|
params: {
|
|
1488
|
-
from:
|
|
1520
|
+
from: z14.tuple([
|
|
1489
1521
|
RewardsRangeOptionsZod4.optional()
|
|
1490
1522
|
]),
|
|
1491
|
-
to:
|
|
1523
|
+
to: z14.tuple([
|
|
1492
1524
|
RewardsRangeOptionsZod4.optional()
|
|
1493
1525
|
])
|
|
1494
1526
|
},
|
|
@@ -1503,72 +1535,71 @@ var NetworkStakingStepRewardsTotalViewerRpcSchemas = {
|
|
|
1503
1535
|
var NetworkStakingStepRewardsViewerRpcSchemas = {};
|
|
1504
1536
|
|
|
1505
1537
|
// src/types/schema/TimeSyncViewerRpcSchema.ts
|
|
1506
|
-
import { TimePayloadZod } from "@xyo-network/xl1-protocol";
|
|
1507
|
-
import
|
|
1508
|
-
import * as z14 from "zod";
|
|
1538
|
+
import { TimeDomainZod, TimePayloadZod } from "@xyo-network/xl1-protocol";
|
|
1539
|
+
import * as z15 from "zod";
|
|
1509
1540
|
var TimeSyncViewerRpcSchemas = {
|
|
1510
1541
|
timeSyncViewer_convertTime: {
|
|
1511
1542
|
params: {
|
|
1512
|
-
from:
|
|
1543
|
+
from: z15.tuple([
|
|
1513
1544
|
TimeDomainZod,
|
|
1514
1545
|
TimeDomainZod,
|
|
1515
|
-
|
|
1546
|
+
z15.number()
|
|
1516
1547
|
]),
|
|
1517
|
-
to:
|
|
1548
|
+
to: z15.tuple([
|
|
1518
1549
|
TimeDomainZod,
|
|
1519
1550
|
TimeDomainZod,
|
|
1520
|
-
|
|
1551
|
+
z15.number()
|
|
1521
1552
|
])
|
|
1522
1553
|
},
|
|
1523
1554
|
result: {
|
|
1524
|
-
from:
|
|
1525
|
-
to:
|
|
1555
|
+
from: z15.number(),
|
|
1556
|
+
to: z15.number()
|
|
1526
1557
|
}
|
|
1527
1558
|
},
|
|
1528
1559
|
timeSyncViewer_currentTime: {
|
|
1529
1560
|
params: {
|
|
1530
|
-
from:
|
|
1561
|
+
from: z15.tuple([
|
|
1531
1562
|
TimeDomainZod
|
|
1532
1563
|
]),
|
|
1533
|
-
to:
|
|
1564
|
+
to: z15.tuple([
|
|
1534
1565
|
TimeDomainZod
|
|
1535
1566
|
])
|
|
1536
1567
|
},
|
|
1537
1568
|
result: {
|
|
1538
|
-
from:
|
|
1569
|
+
from: z15.tuple([
|
|
1539
1570
|
TimeDomainZod,
|
|
1540
|
-
|
|
1571
|
+
z15.number()
|
|
1541
1572
|
]),
|
|
1542
|
-
to:
|
|
1573
|
+
to: z15.tuple([
|
|
1543
1574
|
TimeDomainZod,
|
|
1544
|
-
|
|
1575
|
+
z15.number()
|
|
1545
1576
|
])
|
|
1546
1577
|
}
|
|
1547
1578
|
},
|
|
1548
1579
|
timeSyncViewer_currentTimeAndHash: {
|
|
1549
1580
|
params: {
|
|
1550
|
-
from:
|
|
1581
|
+
from: z15.tuple([
|
|
1551
1582
|
TimeDomainZod
|
|
1552
1583
|
]),
|
|
1553
|
-
to:
|
|
1584
|
+
to: z15.tuple([
|
|
1554
1585
|
TimeDomainZod
|
|
1555
1586
|
])
|
|
1556
1587
|
},
|
|
1557
1588
|
result: {
|
|
1558
|
-
from:
|
|
1559
|
-
|
|
1560
|
-
|
|
1589
|
+
from: z15.tuple([
|
|
1590
|
+
z15.number(),
|
|
1591
|
+
z15.nullable(z15.string())
|
|
1561
1592
|
]),
|
|
1562
|
-
to:
|
|
1563
|
-
|
|
1564
|
-
|
|
1593
|
+
to: z15.tuple([
|
|
1594
|
+
z15.number(),
|
|
1595
|
+
z15.nullable(z15.string())
|
|
1565
1596
|
])
|
|
1566
1597
|
}
|
|
1567
1598
|
},
|
|
1568
1599
|
timeSyncViewer_currentTimePayload: {
|
|
1569
1600
|
params: {
|
|
1570
|
-
from:
|
|
1571
|
-
to:
|
|
1601
|
+
from: z15.tuple([]),
|
|
1602
|
+
to: z15.tuple([])
|
|
1572
1603
|
},
|
|
1573
1604
|
result: {
|
|
1574
1605
|
from: TimePayloadZod,
|
|
@@ -1585,11 +1616,13 @@ var HttpRpcTransport = class {
|
|
|
1585
1616
|
static {
|
|
1586
1617
|
__name(this, "HttpRpcTransport");
|
|
1587
1618
|
}
|
|
1619
|
+
_passThrough;
|
|
1588
1620
|
_rpcUrl;
|
|
1589
1621
|
_schemas;
|
|
1590
|
-
constructor(rpcUrl, schemas) {
|
|
1622
|
+
constructor(rpcUrl, schemas, passThrough = false) {
|
|
1591
1623
|
this._rpcUrl = rpcUrl;
|
|
1592
1624
|
this._schemas = schemas;
|
|
1625
|
+
this._passThrough = passThrough;
|
|
1593
1626
|
}
|
|
1594
1627
|
async sendRequest(method, params) {
|
|
1595
1628
|
return await this.callRpc(this._rpcUrl, this._schemas, method, params);
|
|
@@ -1602,15 +1635,19 @@ var HttpRpcTransport = class {
|
|
|
1602
1635
|
id,
|
|
1603
1636
|
method
|
|
1604
1637
|
};
|
|
1638
|
+
const schema = schemas[method];
|
|
1605
1639
|
if (params) {
|
|
1606
|
-
body.params =
|
|
1640
|
+
body.params = isDefined(schema) ? schema.params.to.parse(params) : this._passThrough ? z16.json().parse(params) : void 0;
|
|
1641
|
+
if (!isDefined(body.params)) {
|
|
1642
|
+
throw new Error(`RPC method ${String(method)} missing schema`);
|
|
1643
|
+
}
|
|
1607
1644
|
}
|
|
1608
1645
|
const res = await new Axios(axiosJsonConfig()).post(url, body);
|
|
1609
|
-
const
|
|
1610
|
-
if (isUndefinedOrNull(
|
|
1611
|
-
throw new Error(
|
|
1646
|
+
const json2 = res.data;
|
|
1647
|
+
if (isUndefinedOrNull(json2) || json2.error) {
|
|
1648
|
+
throw new Error(json2.error.message);
|
|
1612
1649
|
}
|
|
1613
|
-
return schemas[method].result.from.parse(
|
|
1650
|
+
return schemas[method].result.from.parse(json2.result);
|
|
1614
1651
|
} catch (ex) {
|
|
1615
1652
|
let message = isError(ex) ? ex.message : String(ex);
|
|
1616
1653
|
if (isAxiosError(ex)) {
|
|
@@ -1880,8 +1917,8 @@ var JsonRpcTimeSyncViewer = class extends JsonRpcTimeSyncViewerMethods {
|
|
|
1880
1917
|
};
|
|
1881
1918
|
|
|
1882
1919
|
// src/provider/viewer/JsonRpcXyoViewer.ts
|
|
1883
|
-
import { isDefined, isHash } from "@xylabs/sdk-js";
|
|
1884
|
-
import { asAttoXL1 as asAttoXL14,
|
|
1920
|
+
import { isDefined as isDefined2, isHash } from "@xylabs/sdk-js";
|
|
1921
|
+
import { asAttoXL1 as asAttoXL14, asSignedHydratedBlockWithHashMeta } from "@xyo-network/xl1-protocol";
|
|
1885
1922
|
var JsonRpcXyoViewer = class {
|
|
1886
1923
|
static {
|
|
1887
1924
|
__name(this, "JsonRpcXyoViewer");
|
|
@@ -1896,7 +1933,7 @@ var JsonRpcXyoViewer = class {
|
|
|
1896
1933
|
return this.providers?.networkStakeViewer;
|
|
1897
1934
|
}
|
|
1898
1935
|
async accountBalance(address, headOrRange) {
|
|
1899
|
-
if (
|
|
1936
|
+
if (isDefined2(headOrRange)) {
|
|
1900
1937
|
if (isHash(headOrRange)) {
|
|
1901
1938
|
return await this.transport.sendRequest("xyoViewer_accountBalance", [
|
|
1902
1939
|
address,
|
|
@@ -1913,7 +1950,7 @@ var JsonRpcXyoViewer = class {
|
|
|
1913
1950
|
]);
|
|
1914
1951
|
}
|
|
1915
1952
|
async accountBalanceHistory(address, headOrRange) {
|
|
1916
|
-
if (
|
|
1953
|
+
if (isDefined2(headOrRange)) {
|
|
1917
1954
|
if (isHash(headOrRange)) {
|
|
1918
1955
|
return await this.transport.sendRequest("xyoViewer_accountBalanceHistory", [
|
|
1919
1956
|
address,
|
|
@@ -1936,12 +1973,12 @@ var JsonRpcXyoViewer = class {
|
|
|
1936
1973
|
throw new Error("Method not implemented.");
|
|
1937
1974
|
}
|
|
1938
1975
|
async blockByHash(hash) {
|
|
1939
|
-
return
|
|
1976
|
+
return asSignedHydratedBlockWithHashMeta(await this.transport.sendRequest("xyoViewer_blockByHash", [
|
|
1940
1977
|
hash
|
|
1941
1978
|
])) ?? null;
|
|
1942
1979
|
}
|
|
1943
1980
|
async blockByNumber(blockNumber) {
|
|
1944
|
-
return
|
|
1981
|
+
return asSignedHydratedBlockWithHashMeta(await this.transport.sendRequest("xyoViewer_blockByNumber", [
|
|
1945
1982
|
blockNumber
|
|
1946
1983
|
])) ?? null;
|
|
1947
1984
|
}
|
|
@@ -1949,9 +1986,7 @@ var JsonRpcXyoViewer = class {
|
|
|
1949
1986
|
return (await this.transport.sendRequest("xyoViewer_blocksByHash", [
|
|
1950
1987
|
hash,
|
|
1951
1988
|
limit
|
|
1952
|
-
])).map((b) =>
|
|
1953
|
-
required: true
|
|
1954
|
-
}));
|
|
1989
|
+
])).map((b) => asSignedHydratedBlockWithHashMeta(b, true));
|
|
1955
1990
|
}
|
|
1956
1991
|
async chainId() {
|
|
1957
1992
|
return await this.transport.sendRequest("xyoViewer_chainId");
|
|
@@ -1962,9 +1997,7 @@ var JsonRpcXyoViewer = class {
|
|
|
1962
1997
|
]);
|
|
1963
1998
|
}
|
|
1964
1999
|
async currentBlock() {
|
|
1965
|
-
return
|
|
1966
|
-
required: true
|
|
1967
|
-
});
|
|
2000
|
+
return asSignedHydratedBlockWithHashMeta(await this.transport.sendRequest("xyoViewer_currentBlock"), true);
|
|
1968
2001
|
}
|
|
1969
2002
|
async currentBlockHash() {
|
|
1970
2003
|
return await this.transport.sendRequest("xyoViewer_currentBlockHash");
|
|
@@ -2247,10 +2280,9 @@ var RpcXyoSigner = class {
|
|
|
2247
2280
|
return await this.transport.sendRequest("xyoSigner_address");
|
|
2248
2281
|
}
|
|
2249
2282
|
async signTransaction(tx) {
|
|
2250
|
-
|
|
2283
|
+
return await this.transport.sendRequest("xyoSigner_signTransaction", [
|
|
2251
2284
|
tx
|
|
2252
2285
|
]);
|
|
2253
|
-
return ret;
|
|
2254
2286
|
}
|
|
2255
2287
|
};
|
|
2256
2288
|
export {
|
|
@@ -2276,6 +2308,7 @@ export {
|
|
|
2276
2308
|
JsonRpcXyoRunner,
|
|
2277
2309
|
JsonRpcXyoViewer,
|
|
2278
2310
|
MemoryRpcTransport,
|
|
2311
|
+
MempoolViewerRpcSchemas,
|
|
2279
2312
|
NetworkStakeViewerRpcNamespace,
|
|
2280
2313
|
NetworkStakeViewerRpcSchemas,
|
|
2281
2314
|
NetworkStakingStepRewardsByPositionViewerRpcNamespace,
|