@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/node/index-node.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
|
|
|
@@ -269,7 +284,7 @@ var NetworkStakeViewerRpcSchemas = {
|
|
|
269
284
|
};
|
|
270
285
|
|
|
271
286
|
// src/types/schema/XyoPermissionsRpcSchemas.ts
|
|
272
|
-
import { InvokerPermissionZod, PermissionRequestZod, RequestedPermissionZod } from "@xyo-network/xl1-protocol
|
|
287
|
+
import { InvokerPermissionZod, PermissionRequestZod, RequestedPermissionZod } from "@xyo-network/xl1-protocol";
|
|
273
288
|
import * as z3 from "zod";
|
|
274
289
|
var XyoPermissionsRpcSchemas = {
|
|
275
290
|
xyoPermissions_getPermissions: {
|
|
@@ -314,7 +329,7 @@ var XyoPermissionsRpcSchemas = {
|
|
|
314
329
|
|
|
315
330
|
// src/types/schema/XyoRunnerRpcSchemas.ts
|
|
316
331
|
import { HashToJsonZod, JsonToHashZod } from "@xylabs/sdk-js";
|
|
317
|
-
import { SignedHydratedTransactionZod } from "@xyo-network/xl1-protocol
|
|
332
|
+
import { SignedHydratedTransactionZod } from "@xyo-network/xl1-protocol";
|
|
318
333
|
import * as z4 from "zod";
|
|
319
334
|
var XyoRunnerRpcSchemas = {
|
|
320
335
|
xyoRunner_broadcastTransaction: {
|
|
@@ -335,8 +350,7 @@ var XyoRunnerRpcSchemas = {
|
|
|
335
350
|
|
|
336
351
|
// src/types/schema/XyoSignerRpcSchemas.ts
|
|
337
352
|
import { AddressZod as AddressZod2 } from "@xylabs/sdk-js";
|
|
338
|
-
import {
|
|
339
|
-
import { SignedHydratedTransactionZod as SignedHydratedTransactionZod2, UnsignedHydratedTransactionZod } from "@xyo-network/xl1-protocol-sdk";
|
|
353
|
+
import { SignedHydratedTransactionWithHashMetaZod, UnsignedHydratedTransactionZod } from "@xyo-network/xl1-protocol";
|
|
340
354
|
import { z as z5 } from "zod";
|
|
341
355
|
var XyoSignerRpcSchemas = {
|
|
342
356
|
xyoSigner_address: {
|
|
@@ -359,18 +373,16 @@ var XyoSignerRpcSchemas = {
|
|
|
359
373
|
])
|
|
360
374
|
},
|
|
361
375
|
result: {
|
|
362
|
-
to:
|
|
363
|
-
from:
|
|
364
|
-
required: true
|
|
365
|
-
}))
|
|
376
|
+
to: SignedHydratedTransactionWithHashMetaZod,
|
|
377
|
+
from: SignedHydratedTransactionWithHashMetaZod
|
|
366
378
|
}
|
|
367
379
|
}
|
|
368
380
|
};
|
|
369
381
|
|
|
370
382
|
// src/types/schema/XyoViewerRpcSchemas.ts
|
|
371
383
|
import { AddressZod as AddressZod3, BigIntToJsonZod as BigIntToJsonZod3, HashToJsonZod as HashToJsonZod2, HashZod as HashZod2, JsonToBigIntZod as JsonToBigIntZod3, JsonToHashZod as JsonToHashZod2 } from "@xylabs/sdk-js";
|
|
372
|
-
import { BlockNumberZod as BlockNumberZod2, BlockRangeZod, StepIdentityZod, XL1BlockNumberZod, XL1BlockRangeZod as XL1BlockRangeZod2 } from "@xyo-network/xl1-protocol";
|
|
373
|
-
import { AccountBalanceHistoryItemZod as AccountBalanceHistoryItemZod2
|
|
384
|
+
import { BlockNumberZod as BlockNumberZod2, BlockRangeZod, JsonToStakeZod, SignedHydratedBlockZod, SignedHydratedTransactionZod as SignedHydratedTransactionZod2, StakeToJsonZod, StepIdentityZod, TransferPairZod, XL1BlockNumberZod, XL1BlockRangeZod as XL1BlockRangeZod2 } from "@xyo-network/xl1-protocol";
|
|
385
|
+
import { AccountBalanceHistoryItemZod as AccountBalanceHistoryItemZod2 } from "@xyo-network/xl1-protocol-sdk";
|
|
374
386
|
import * as z6 from "zod";
|
|
375
387
|
var XyoViewerRpcSchemas = {
|
|
376
388
|
xyoViewer_networkStakeStepRewardClaimedByAddress: {
|
|
@@ -1055,8 +1067,8 @@ var XyoViewerRpcSchemas = {
|
|
|
1055
1067
|
])
|
|
1056
1068
|
},
|
|
1057
1069
|
result: {
|
|
1058
|
-
to:
|
|
1059
|
-
from:
|
|
1070
|
+
to: SignedHydratedTransactionZod2.nullable(),
|
|
1071
|
+
from: SignedHydratedTransactionZod2.nullable()
|
|
1060
1072
|
}
|
|
1061
1073
|
},
|
|
1062
1074
|
xyoViewer_transactionByBlockNumberAndIndex: {
|
|
@@ -1071,8 +1083,8 @@ var XyoViewerRpcSchemas = {
|
|
|
1071
1083
|
])
|
|
1072
1084
|
},
|
|
1073
1085
|
result: {
|
|
1074
|
-
to:
|
|
1075
|
-
from:
|
|
1086
|
+
to: SignedHydratedTransactionZod2.nullable(),
|
|
1087
|
+
from: SignedHydratedTransactionZod2.nullable()
|
|
1076
1088
|
}
|
|
1077
1089
|
},
|
|
1078
1090
|
xyoViewer_transactionByHash: {
|
|
@@ -1085,8 +1097,8 @@ var XyoViewerRpcSchemas = {
|
|
|
1085
1097
|
])
|
|
1086
1098
|
},
|
|
1087
1099
|
result: {
|
|
1088
|
-
to:
|
|
1089
|
-
from:
|
|
1100
|
+
to: SignedHydratedTransactionZod2.nullable(),
|
|
1101
|
+
from: SignedHydratedTransactionZod2.nullable()
|
|
1090
1102
|
}
|
|
1091
1103
|
}
|
|
1092
1104
|
};
|
|
@@ -1127,7 +1139,7 @@ var createResponseSchema = /* @__PURE__ */ __name((resultSchema = z8.undefined()
|
|
|
1127
1139
|
// src/types/schema/DataLakeViewerRpcSchema.ts
|
|
1128
1140
|
import { HashZod as HashZod3 } from "@xylabs/sdk-js";
|
|
1129
1141
|
import { PayloadZod } from "@xyo-network/payload-model";
|
|
1130
|
-
import { ArrayBufferToJsonZod, JsonToArrayBufferZod } from "@xyo-network/xl1-protocol
|
|
1142
|
+
import { ArrayBufferToJsonZod, JsonToArrayBufferZod } from "@xyo-network/xl1-protocol";
|
|
1131
1143
|
import * as z9 from "zod";
|
|
1132
1144
|
var DataLakeViewerRpcSchemas = {
|
|
1133
1145
|
dataLakeViewer_get: {
|
|
@@ -1186,250 +1198,269 @@ var DataLakeViewerRpcSchemas = {
|
|
|
1186
1198
|
}
|
|
1187
1199
|
};
|
|
1188
1200
|
|
|
1201
|
+
// src/types/schema/MempoolViewerRpcSchemas.ts
|
|
1202
|
+
import { SignedHydratedTransactionWithHashMetaZod as SignedHydratedTransactionWithHashMetaZod2 } from "@xyo-network/xl1-protocol";
|
|
1203
|
+
import { PendingTransactionsOptionsZod } from "@xyo-network/xl1-protocol-sdk";
|
|
1204
|
+
import * as z10 from "zod";
|
|
1205
|
+
var MempoolViewerRpcSchemas = {
|
|
1206
|
+
mempoolViewer_pendingTransactions: {
|
|
1207
|
+
params: {
|
|
1208
|
+
to: z10.tuple([
|
|
1209
|
+
PendingTransactionsOptionsZod.optional()
|
|
1210
|
+
]),
|
|
1211
|
+
from: z10.tuple([
|
|
1212
|
+
PendingTransactionsOptionsZod.optional()
|
|
1213
|
+
])
|
|
1214
|
+
},
|
|
1215
|
+
result: {
|
|
1216
|
+
to: z10.array(SignedHydratedTransactionWithHashMetaZod2),
|
|
1217
|
+
from: z10.array(SignedHydratedTransactionWithHashMetaZod2)
|
|
1218
|
+
}
|
|
1219
|
+
}
|
|
1220
|
+
};
|
|
1221
|
+
|
|
1189
1222
|
// src/types/schema/RewardsByPositionViewerRpcSchemas.ts
|
|
1190
1223
|
import { BigIntToJsonZod as BigIntToJsonZod4, JsonToBigIntZod as JsonToBigIntZod4 } from "@xylabs/sdk-js";
|
|
1191
|
-
import { asAttoXL1 } from "@xyo-network/xl1-protocol";
|
|
1192
|
-
import
|
|
1193
|
-
import z10 from "zod";
|
|
1224
|
+
import { asAttoXL1, RewardsRangeOptionsZod } from "@xyo-network/xl1-protocol";
|
|
1225
|
+
import z11 from "zod";
|
|
1194
1226
|
var NetworkStakingStepRewardsByPositionViewerRpcSchemas = {
|
|
1195
1227
|
networkStakingStepRewardsByPositionViewer_bonus: {
|
|
1196
1228
|
params: {
|
|
1197
|
-
from:
|
|
1229
|
+
from: z11.tuple([
|
|
1198
1230
|
RewardsRangeOptionsZod.optional()
|
|
1199
1231
|
]),
|
|
1200
|
-
to:
|
|
1232
|
+
to: z11.tuple([
|
|
1201
1233
|
RewardsRangeOptionsZod.optional()
|
|
1202
1234
|
])
|
|
1203
1235
|
},
|
|
1204
1236
|
result: {
|
|
1205
|
-
from:
|
|
1206
|
-
to:
|
|
1237
|
+
from: z11.record(z11.number(), JsonToBigIntZod4.transform((val) => asAttoXL1(val))),
|
|
1238
|
+
to: z11.record(z11.number(), BigIntToJsonZod4)
|
|
1207
1239
|
}
|
|
1208
1240
|
},
|
|
1209
1241
|
networkStakingStepRewardsByPositionViewer_claimed: {
|
|
1210
1242
|
params: {
|
|
1211
|
-
from:
|
|
1243
|
+
from: z11.tuple([
|
|
1212
1244
|
RewardsRangeOptionsZod.optional()
|
|
1213
1245
|
]),
|
|
1214
|
-
to:
|
|
1246
|
+
to: z11.tuple([
|
|
1215
1247
|
RewardsRangeOptionsZod.optional()
|
|
1216
1248
|
])
|
|
1217
1249
|
},
|
|
1218
1250
|
result: {
|
|
1219
|
-
from:
|
|
1220
|
-
to:
|
|
1251
|
+
from: z11.record(z11.number(), BigIntToJsonZod4.transform((val) => asAttoXL1(val))),
|
|
1252
|
+
to: z11.record(z11.number(), JsonToBigIntZod4)
|
|
1221
1253
|
}
|
|
1222
1254
|
},
|
|
1223
1255
|
networkStakingStepRewardsByPositionViewer_earned: {
|
|
1224
1256
|
params: {
|
|
1225
|
-
from:
|
|
1257
|
+
from: z11.tuple([
|
|
1226
1258
|
RewardsRangeOptionsZod.optional()
|
|
1227
1259
|
]),
|
|
1228
|
-
to:
|
|
1260
|
+
to: z11.tuple([
|
|
1229
1261
|
RewardsRangeOptionsZod.optional()
|
|
1230
1262
|
])
|
|
1231
1263
|
},
|
|
1232
1264
|
result: {
|
|
1233
|
-
from:
|
|
1234
|
-
to:
|
|
1265
|
+
from: z11.record(z11.number(), BigIntToJsonZod4.transform((val) => asAttoXL1(val))),
|
|
1266
|
+
to: z11.record(z11.number(), JsonToBigIntZod4)
|
|
1235
1267
|
}
|
|
1236
1268
|
},
|
|
1237
1269
|
networkStakingStepRewardsByPositionViewer_total: {
|
|
1238
1270
|
params: {
|
|
1239
|
-
from:
|
|
1271
|
+
from: z11.tuple([
|
|
1240
1272
|
RewardsRangeOptionsZod.optional()
|
|
1241
1273
|
]),
|
|
1242
|
-
to:
|
|
1274
|
+
to: z11.tuple([
|
|
1243
1275
|
RewardsRangeOptionsZod.optional()
|
|
1244
1276
|
])
|
|
1245
1277
|
},
|
|
1246
1278
|
result: {
|
|
1247
|
-
from:
|
|
1248
|
-
to:
|
|
1279
|
+
from: z11.record(z11.number(), BigIntToJsonZod4.transform((val) => asAttoXL1(val))),
|
|
1280
|
+
to: z11.record(z11.number(), JsonToBigIntZod4)
|
|
1249
1281
|
}
|
|
1250
1282
|
},
|
|
1251
1283
|
networkStakingStepRewardsByPositionViewer_unclaimed: {
|
|
1252
1284
|
params: {
|
|
1253
|
-
from:
|
|
1285
|
+
from: z11.tuple([
|
|
1254
1286
|
RewardsRangeOptionsZod.optional()
|
|
1255
1287
|
]),
|
|
1256
|
-
to:
|
|
1288
|
+
to: z11.tuple([
|
|
1257
1289
|
RewardsRangeOptionsZod.optional()
|
|
1258
1290
|
])
|
|
1259
1291
|
},
|
|
1260
1292
|
result: {
|
|
1261
|
-
from:
|
|
1262
|
-
to:
|
|
1293
|
+
from: z11.record(z11.number(), BigIntToJsonZod4.transform((val) => asAttoXL1(val))),
|
|
1294
|
+
to: z11.record(z11.number(), JsonToBigIntZod4)
|
|
1263
1295
|
}
|
|
1264
1296
|
}
|
|
1265
1297
|
};
|
|
1266
1298
|
|
|
1267
1299
|
// src/types/schema/RewardsByStakerViewerRpcSchemas.ts
|
|
1268
1300
|
import { AddressZod as AddressZod4, BigIntToJsonZod as BigIntToJsonZod5, JsonToBigIntZod as JsonToBigIntZod5 } from "@xylabs/sdk-js";
|
|
1269
|
-
import { RewardsRangeOptionsZod as RewardsRangeOptionsZod2 } from "@xyo-network/xl1-protocol
|
|
1270
|
-
import
|
|
1301
|
+
import { RewardsRangeOptionsZod as RewardsRangeOptionsZod2 } from "@xyo-network/xl1-protocol";
|
|
1302
|
+
import z12 from "zod";
|
|
1271
1303
|
var NetworkStakingStepRewardsByStakerViewerRpcSchemas = {
|
|
1272
1304
|
networkStakingStepRewardsByStakerViewer_bonus: {
|
|
1273
1305
|
params: {
|
|
1274
|
-
from:
|
|
1306
|
+
from: z12.tuple([
|
|
1275
1307
|
RewardsRangeOptionsZod2.optional()
|
|
1276
1308
|
]),
|
|
1277
|
-
to:
|
|
1309
|
+
to: z12.tuple([
|
|
1278
1310
|
RewardsRangeOptionsZod2.optional()
|
|
1279
1311
|
])
|
|
1280
1312
|
},
|
|
1281
1313
|
result: {
|
|
1282
|
-
from:
|
|
1283
|
-
to:
|
|
1314
|
+
from: z12.record(AddressZod4, BigIntToJsonZod5),
|
|
1315
|
+
to: z12.record(AddressZod4, JsonToBigIntZod5)
|
|
1284
1316
|
}
|
|
1285
1317
|
},
|
|
1286
1318
|
networkStakingStepRewardsByStakerViewer_claimed: {
|
|
1287
1319
|
params: {
|
|
1288
|
-
from:
|
|
1320
|
+
from: z12.tuple([
|
|
1289
1321
|
RewardsRangeOptionsZod2.optional()
|
|
1290
1322
|
]),
|
|
1291
|
-
to:
|
|
1323
|
+
to: z12.tuple([
|
|
1292
1324
|
RewardsRangeOptionsZod2.optional()
|
|
1293
1325
|
])
|
|
1294
1326
|
},
|
|
1295
1327
|
result: {
|
|
1296
|
-
from:
|
|
1297
|
-
to:
|
|
1328
|
+
from: z12.record(AddressZod4, BigIntToJsonZod5),
|
|
1329
|
+
to: z12.record(AddressZod4, JsonToBigIntZod5)
|
|
1298
1330
|
}
|
|
1299
1331
|
},
|
|
1300
1332
|
networkStakingStepRewardsByStakerViewer_earned: {
|
|
1301
1333
|
params: {
|
|
1302
|
-
from:
|
|
1334
|
+
from: z12.tuple([
|
|
1303
1335
|
RewardsRangeOptionsZod2.optional()
|
|
1304
1336
|
]),
|
|
1305
|
-
to:
|
|
1337
|
+
to: z12.tuple([
|
|
1306
1338
|
RewardsRangeOptionsZod2.optional()
|
|
1307
1339
|
])
|
|
1308
1340
|
},
|
|
1309
1341
|
result: {
|
|
1310
|
-
from:
|
|
1311
|
-
to:
|
|
1342
|
+
from: z12.record(AddressZod4, BigIntToJsonZod5),
|
|
1343
|
+
to: z12.record(AddressZod4, JsonToBigIntZod5)
|
|
1312
1344
|
}
|
|
1313
1345
|
},
|
|
1314
1346
|
networkStakingStepRewardsByStakerViewer_total: {
|
|
1315
1347
|
params: {
|
|
1316
|
-
from:
|
|
1348
|
+
from: z12.tuple([
|
|
1317
1349
|
RewardsRangeOptionsZod2.optional()
|
|
1318
1350
|
]),
|
|
1319
|
-
to:
|
|
1351
|
+
to: z12.tuple([
|
|
1320
1352
|
RewardsRangeOptionsZod2.optional()
|
|
1321
1353
|
])
|
|
1322
1354
|
},
|
|
1323
1355
|
result: {
|
|
1324
|
-
from:
|
|
1325
|
-
to:
|
|
1356
|
+
from: z12.record(AddressZod4, BigIntToJsonZod5),
|
|
1357
|
+
to: z12.record(AddressZod4, JsonToBigIntZod5)
|
|
1326
1358
|
}
|
|
1327
1359
|
},
|
|
1328
1360
|
networkStakingStepRewardsByStakerViewer_unclaimed: {
|
|
1329
1361
|
params: {
|
|
1330
|
-
from:
|
|
1362
|
+
from: z12.tuple([
|
|
1331
1363
|
RewardsRangeOptionsZod2.optional()
|
|
1332
1364
|
]),
|
|
1333
|
-
to:
|
|
1365
|
+
to: z12.tuple([
|
|
1334
1366
|
RewardsRangeOptionsZod2.optional()
|
|
1335
1367
|
])
|
|
1336
1368
|
},
|
|
1337
1369
|
result: {
|
|
1338
|
-
from:
|
|
1339
|
-
to:
|
|
1370
|
+
from: z12.record(AddressZod4, BigIntToJsonZod5),
|
|
1371
|
+
to: z12.record(AddressZod4, JsonToBigIntZod5)
|
|
1340
1372
|
}
|
|
1341
1373
|
}
|
|
1342
1374
|
};
|
|
1343
1375
|
|
|
1344
1376
|
// src/types/schema/RewardsByStepViewerRpcSchemas.ts
|
|
1345
1377
|
import { AddressZod as AddressZod5, BigIntToJsonZod as BigIntToJsonZod6, JsonToBigIntZod as JsonToBigIntZod6 } from "@xylabs/sdk-js";
|
|
1346
|
-
import { RewardsRangeOptionsZod as RewardsRangeOptionsZod3 } from "@xyo-network/xl1-protocol
|
|
1347
|
-
import
|
|
1378
|
+
import { RewardsRangeOptionsZod as RewardsRangeOptionsZod3 } from "@xyo-network/xl1-protocol";
|
|
1379
|
+
import z13 from "zod";
|
|
1348
1380
|
var NetworkStakingStepRewardsByStepViewerRpcSchemas = {
|
|
1349
1381
|
networkStakingStepRewardsByStepViewer_bonus: {
|
|
1350
1382
|
params: {
|
|
1351
|
-
from:
|
|
1383
|
+
from: z13.tuple([
|
|
1352
1384
|
RewardsRangeOptionsZod3.optional()
|
|
1353
1385
|
]),
|
|
1354
|
-
to:
|
|
1386
|
+
to: z13.tuple([
|
|
1355
1387
|
RewardsRangeOptionsZod3.optional()
|
|
1356
1388
|
])
|
|
1357
1389
|
},
|
|
1358
1390
|
result: {
|
|
1359
|
-
from:
|
|
1360
|
-
to:
|
|
1391
|
+
from: z13.record(AddressZod5, BigIntToJsonZod6),
|
|
1392
|
+
to: z13.record(AddressZod5, JsonToBigIntZod6)
|
|
1361
1393
|
}
|
|
1362
1394
|
},
|
|
1363
1395
|
networkStakingStepRewardsByStepViewer_claimed: {
|
|
1364
1396
|
params: {
|
|
1365
|
-
from:
|
|
1397
|
+
from: z13.tuple([
|
|
1366
1398
|
RewardsRangeOptionsZod3.optional()
|
|
1367
1399
|
]),
|
|
1368
|
-
to:
|
|
1400
|
+
to: z13.tuple([
|
|
1369
1401
|
RewardsRangeOptionsZod3.optional()
|
|
1370
1402
|
])
|
|
1371
1403
|
},
|
|
1372
1404
|
result: {
|
|
1373
|
-
from:
|
|
1374
|
-
to:
|
|
1405
|
+
from: z13.record(AddressZod5, BigIntToJsonZod6),
|
|
1406
|
+
to: z13.record(AddressZod5, JsonToBigIntZod6)
|
|
1375
1407
|
}
|
|
1376
1408
|
},
|
|
1377
1409
|
networkStakingStepRewardsByStepViewer_earned: {
|
|
1378
1410
|
params: {
|
|
1379
|
-
from:
|
|
1411
|
+
from: z13.tuple([
|
|
1380
1412
|
RewardsRangeOptionsZod3.optional()
|
|
1381
1413
|
]),
|
|
1382
|
-
to:
|
|
1414
|
+
to: z13.tuple([
|
|
1383
1415
|
RewardsRangeOptionsZod3.optional()
|
|
1384
1416
|
])
|
|
1385
1417
|
},
|
|
1386
1418
|
result: {
|
|
1387
|
-
from:
|
|
1388
|
-
to:
|
|
1419
|
+
from: z13.record(AddressZod5, BigIntToJsonZod6),
|
|
1420
|
+
to: z13.record(AddressZod5, JsonToBigIntZod6)
|
|
1389
1421
|
}
|
|
1390
1422
|
},
|
|
1391
1423
|
networkStakingStepRewardsByStepViewer_total: {
|
|
1392
1424
|
params: {
|
|
1393
|
-
from:
|
|
1425
|
+
from: z13.tuple([
|
|
1394
1426
|
RewardsRangeOptionsZod3.optional()
|
|
1395
1427
|
]),
|
|
1396
|
-
to:
|
|
1428
|
+
to: z13.tuple([
|
|
1397
1429
|
RewardsRangeOptionsZod3.optional()
|
|
1398
1430
|
])
|
|
1399
1431
|
},
|
|
1400
1432
|
result: {
|
|
1401
|
-
from:
|
|
1402
|
-
to:
|
|
1433
|
+
from: z13.record(AddressZod5, BigIntToJsonZod6),
|
|
1434
|
+
to: z13.record(AddressZod5, JsonToBigIntZod6)
|
|
1403
1435
|
}
|
|
1404
1436
|
},
|
|
1405
1437
|
networkStakingStepRewardsByStepViewer_unclaimed: {
|
|
1406
1438
|
params: {
|
|
1407
|
-
from:
|
|
1439
|
+
from: z13.tuple([
|
|
1408
1440
|
RewardsRangeOptionsZod3.optional()
|
|
1409
1441
|
]),
|
|
1410
|
-
to:
|
|
1442
|
+
to: z13.tuple([
|
|
1411
1443
|
RewardsRangeOptionsZod3.optional()
|
|
1412
1444
|
])
|
|
1413
1445
|
},
|
|
1414
1446
|
result: {
|
|
1415
|
-
from:
|
|
1416
|
-
to:
|
|
1447
|
+
from: z13.record(AddressZod5, BigIntToJsonZod6),
|
|
1448
|
+
to: z13.record(AddressZod5, JsonToBigIntZod6)
|
|
1417
1449
|
}
|
|
1418
1450
|
}
|
|
1419
1451
|
};
|
|
1420
1452
|
|
|
1421
1453
|
// src/types/schema/RewardsTotalViewerRpcSchemas.ts
|
|
1422
1454
|
import { BigIntToJsonZod as BigIntToJsonZod7, JsonToBigIntZod as JsonToBigIntZod7 } from "@xylabs/sdk-js";
|
|
1423
|
-
import { asAttoXL1 as asAttoXL12 } from "@xyo-network/xl1-protocol";
|
|
1424
|
-
import
|
|
1425
|
-
import * as z13 from "zod";
|
|
1455
|
+
import { asAttoXL1 as asAttoXL12, RewardsRangeOptionsZod as RewardsRangeOptionsZod4 } from "@xyo-network/xl1-protocol";
|
|
1456
|
+
import * as z14 from "zod";
|
|
1426
1457
|
var NetworkStakingStepRewardsTotalViewerRpcSchemas = {
|
|
1427
1458
|
networkStakingStepRewardsTotalViewer_bonus: {
|
|
1428
1459
|
params: {
|
|
1429
|
-
from:
|
|
1460
|
+
from: z14.tuple([
|
|
1430
1461
|
RewardsRangeOptionsZod4.optional()
|
|
1431
1462
|
]),
|
|
1432
|
-
to:
|
|
1463
|
+
to: z14.tuple([
|
|
1433
1464
|
RewardsRangeOptionsZod4.optional()
|
|
1434
1465
|
])
|
|
1435
1466
|
},
|
|
@@ -1440,10 +1471,10 @@ var NetworkStakingStepRewardsTotalViewerRpcSchemas = {
|
|
|
1440
1471
|
},
|
|
1441
1472
|
networkStakingStepRewardsTotalViewer_claimed: {
|
|
1442
1473
|
params: {
|
|
1443
|
-
from:
|
|
1474
|
+
from: z14.tuple([
|
|
1444
1475
|
RewardsRangeOptionsZod4.optional()
|
|
1445
1476
|
]),
|
|
1446
|
-
to:
|
|
1477
|
+
to: z14.tuple([
|
|
1447
1478
|
RewardsRangeOptionsZod4.optional()
|
|
1448
1479
|
])
|
|
1449
1480
|
},
|
|
@@ -1454,10 +1485,10 @@ var NetworkStakingStepRewardsTotalViewerRpcSchemas = {
|
|
|
1454
1485
|
},
|
|
1455
1486
|
networkStakingStepRewardsTotalViewer_earned: {
|
|
1456
1487
|
params: {
|
|
1457
|
-
from:
|
|
1488
|
+
from: z14.tuple([
|
|
1458
1489
|
RewardsRangeOptionsZod4.optional()
|
|
1459
1490
|
]),
|
|
1460
|
-
to:
|
|
1491
|
+
to: z14.tuple([
|
|
1461
1492
|
RewardsRangeOptionsZod4.optional()
|
|
1462
1493
|
])
|
|
1463
1494
|
},
|
|
@@ -1468,10 +1499,10 @@ var NetworkStakingStepRewardsTotalViewerRpcSchemas = {
|
|
|
1468
1499
|
},
|
|
1469
1500
|
networkStakingStepRewardsTotalViewer_total: {
|
|
1470
1501
|
params: {
|
|
1471
|
-
from:
|
|
1502
|
+
from: z14.tuple([
|
|
1472
1503
|
RewardsRangeOptionsZod4.optional()
|
|
1473
1504
|
]),
|
|
1474
|
-
to:
|
|
1505
|
+
to: z14.tuple([
|
|
1475
1506
|
RewardsRangeOptionsZod4.optional()
|
|
1476
1507
|
])
|
|
1477
1508
|
},
|
|
@@ -1482,10 +1513,10 @@ var NetworkStakingStepRewardsTotalViewerRpcSchemas = {
|
|
|
1482
1513
|
},
|
|
1483
1514
|
networkStakingStepRewardsTotalViewer_unclaimed: {
|
|
1484
1515
|
params: {
|
|
1485
|
-
from:
|
|
1516
|
+
from: z14.tuple([
|
|
1486
1517
|
RewardsRangeOptionsZod4.optional()
|
|
1487
1518
|
]),
|
|
1488
|
-
to:
|
|
1519
|
+
to: z14.tuple([
|
|
1489
1520
|
RewardsRangeOptionsZod4.optional()
|
|
1490
1521
|
])
|
|
1491
1522
|
},
|
|
@@ -1500,72 +1531,71 @@ var NetworkStakingStepRewardsTotalViewerRpcSchemas = {
|
|
|
1500
1531
|
var NetworkStakingStepRewardsViewerRpcSchemas = {};
|
|
1501
1532
|
|
|
1502
1533
|
// src/types/schema/TimeSyncViewerRpcSchema.ts
|
|
1503
|
-
import { TimePayloadZod } from "@xyo-network/xl1-protocol";
|
|
1504
|
-
import
|
|
1505
|
-
import * as z14 from "zod";
|
|
1534
|
+
import { TimeDomainZod, TimePayloadZod } from "@xyo-network/xl1-protocol";
|
|
1535
|
+
import * as z15 from "zod";
|
|
1506
1536
|
var TimeSyncViewerRpcSchemas = {
|
|
1507
1537
|
timeSyncViewer_convertTime: {
|
|
1508
1538
|
params: {
|
|
1509
|
-
from:
|
|
1539
|
+
from: z15.tuple([
|
|
1510
1540
|
TimeDomainZod,
|
|
1511
1541
|
TimeDomainZod,
|
|
1512
|
-
|
|
1542
|
+
z15.number()
|
|
1513
1543
|
]),
|
|
1514
|
-
to:
|
|
1544
|
+
to: z15.tuple([
|
|
1515
1545
|
TimeDomainZod,
|
|
1516
1546
|
TimeDomainZod,
|
|
1517
|
-
|
|
1547
|
+
z15.number()
|
|
1518
1548
|
])
|
|
1519
1549
|
},
|
|
1520
1550
|
result: {
|
|
1521
|
-
from:
|
|
1522
|
-
to:
|
|
1551
|
+
from: z15.number(),
|
|
1552
|
+
to: z15.number()
|
|
1523
1553
|
}
|
|
1524
1554
|
},
|
|
1525
1555
|
timeSyncViewer_currentTime: {
|
|
1526
1556
|
params: {
|
|
1527
|
-
from:
|
|
1557
|
+
from: z15.tuple([
|
|
1528
1558
|
TimeDomainZod
|
|
1529
1559
|
]),
|
|
1530
|
-
to:
|
|
1560
|
+
to: z15.tuple([
|
|
1531
1561
|
TimeDomainZod
|
|
1532
1562
|
])
|
|
1533
1563
|
},
|
|
1534
1564
|
result: {
|
|
1535
|
-
from:
|
|
1565
|
+
from: z15.tuple([
|
|
1536
1566
|
TimeDomainZod,
|
|
1537
|
-
|
|
1567
|
+
z15.number()
|
|
1538
1568
|
]),
|
|
1539
|
-
to:
|
|
1569
|
+
to: z15.tuple([
|
|
1540
1570
|
TimeDomainZod,
|
|
1541
|
-
|
|
1571
|
+
z15.number()
|
|
1542
1572
|
])
|
|
1543
1573
|
}
|
|
1544
1574
|
},
|
|
1545
1575
|
timeSyncViewer_currentTimeAndHash: {
|
|
1546
1576
|
params: {
|
|
1547
|
-
from:
|
|
1577
|
+
from: z15.tuple([
|
|
1548
1578
|
TimeDomainZod
|
|
1549
1579
|
]),
|
|
1550
|
-
to:
|
|
1580
|
+
to: z15.tuple([
|
|
1551
1581
|
TimeDomainZod
|
|
1552
1582
|
])
|
|
1553
1583
|
},
|
|
1554
1584
|
result: {
|
|
1555
|
-
from:
|
|
1556
|
-
|
|
1557
|
-
|
|
1585
|
+
from: z15.tuple([
|
|
1586
|
+
z15.number(),
|
|
1587
|
+
z15.nullable(z15.string())
|
|
1558
1588
|
]),
|
|
1559
|
-
to:
|
|
1560
|
-
|
|
1561
|
-
|
|
1589
|
+
to: z15.tuple([
|
|
1590
|
+
z15.number(),
|
|
1591
|
+
z15.nullable(z15.string())
|
|
1562
1592
|
])
|
|
1563
1593
|
}
|
|
1564
1594
|
},
|
|
1565
1595
|
timeSyncViewer_currentTimePayload: {
|
|
1566
1596
|
params: {
|
|
1567
|
-
from:
|
|
1568
|
-
to:
|
|
1597
|
+
from: z15.tuple([]),
|
|
1598
|
+
to: z15.tuple([])
|
|
1569
1599
|
},
|
|
1570
1600
|
result: {
|
|
1571
1601
|
from: TimePayloadZod,
|
|
@@ -1619,18 +1649,21 @@ var rpcEngineFromConnection = /* @__PURE__ */ __name((connection, networkStakeVi
|
|
|
1619
1649
|
|
|
1620
1650
|
// src/transport/HttpRpcTransport.ts
|
|
1621
1651
|
import { axiosJsonConfig } from "@xylabs/axios";
|
|
1622
|
-
import { isError, isUndefinedOrNull } from "@xylabs/sdk-js";
|
|
1652
|
+
import { isDefined, isError, isUndefinedOrNull } from "@xylabs/sdk-js";
|
|
1623
1653
|
import { Axios, isAxiosError } from "axios";
|
|
1624
1654
|
import { v4 } from "uuid";
|
|
1655
|
+
import * as z16 from "zod";
|
|
1625
1656
|
var HttpRpcTransport = class {
|
|
1626
1657
|
static {
|
|
1627
1658
|
__name(this, "HttpRpcTransport");
|
|
1628
1659
|
}
|
|
1660
|
+
_passThrough;
|
|
1629
1661
|
_rpcUrl;
|
|
1630
1662
|
_schemas;
|
|
1631
|
-
constructor(rpcUrl, schemas) {
|
|
1663
|
+
constructor(rpcUrl, schemas, passThrough = false) {
|
|
1632
1664
|
this._rpcUrl = rpcUrl;
|
|
1633
1665
|
this._schemas = schemas;
|
|
1666
|
+
this._passThrough = passThrough;
|
|
1634
1667
|
}
|
|
1635
1668
|
async sendRequest(method, params) {
|
|
1636
1669
|
return await this.callRpc(this._rpcUrl, this._schemas, method, params);
|
|
@@ -1643,15 +1676,19 @@ var HttpRpcTransport = class {
|
|
|
1643
1676
|
id,
|
|
1644
1677
|
method
|
|
1645
1678
|
};
|
|
1679
|
+
const schema = schemas[method];
|
|
1646
1680
|
if (params) {
|
|
1647
|
-
body.params =
|
|
1681
|
+
body.params = isDefined(schema) ? schema.params.to.parse(params) : this._passThrough ? z16.json().parse(params) : void 0;
|
|
1682
|
+
if (!isDefined(body.params)) {
|
|
1683
|
+
throw new Error(`RPC method ${String(method)} missing schema`);
|
|
1684
|
+
}
|
|
1648
1685
|
}
|
|
1649
1686
|
const res = await new Axios(axiosJsonConfig()).post(url, body);
|
|
1650
|
-
const
|
|
1651
|
-
if (isUndefinedOrNull(
|
|
1652
|
-
throw new Error(
|
|
1687
|
+
const json2 = res.data;
|
|
1688
|
+
if (isUndefinedOrNull(json2) || json2.error) {
|
|
1689
|
+
throw new Error(json2.error.message);
|
|
1653
1690
|
}
|
|
1654
|
-
return schemas[method].result.from.parse(
|
|
1691
|
+
return schemas[method].result.from.parse(json2.result);
|
|
1655
1692
|
} catch (ex) {
|
|
1656
1693
|
let message = isError(ex) ? ex.message : String(ex);
|
|
1657
1694
|
if (isAxiosError(ex)) {
|
|
@@ -1921,8 +1958,8 @@ var JsonRpcTimeSyncViewer = class extends JsonRpcTimeSyncViewerMethods {
|
|
|
1921
1958
|
};
|
|
1922
1959
|
|
|
1923
1960
|
// src/provider/viewer/JsonRpcXyoViewer.ts
|
|
1924
|
-
import { isDefined, isHash } from "@xylabs/sdk-js";
|
|
1925
|
-
import { asAttoXL1 as asAttoXL14,
|
|
1961
|
+
import { isDefined as isDefined2, isHash } from "@xylabs/sdk-js";
|
|
1962
|
+
import { asAttoXL1 as asAttoXL14, asSignedHydratedBlockWithHashMeta } from "@xyo-network/xl1-protocol";
|
|
1926
1963
|
var JsonRpcXyoViewer = class {
|
|
1927
1964
|
static {
|
|
1928
1965
|
__name(this, "JsonRpcXyoViewer");
|
|
@@ -1937,7 +1974,7 @@ var JsonRpcXyoViewer = class {
|
|
|
1937
1974
|
return this.providers?.networkStakeViewer;
|
|
1938
1975
|
}
|
|
1939
1976
|
async accountBalance(address, headOrRange) {
|
|
1940
|
-
if (
|
|
1977
|
+
if (isDefined2(headOrRange)) {
|
|
1941
1978
|
if (isHash(headOrRange)) {
|
|
1942
1979
|
return await this.transport.sendRequest("xyoViewer_accountBalance", [
|
|
1943
1980
|
address,
|
|
@@ -1954,7 +1991,7 @@ var JsonRpcXyoViewer = class {
|
|
|
1954
1991
|
]);
|
|
1955
1992
|
}
|
|
1956
1993
|
async accountBalanceHistory(address, headOrRange) {
|
|
1957
|
-
if (
|
|
1994
|
+
if (isDefined2(headOrRange)) {
|
|
1958
1995
|
if (isHash(headOrRange)) {
|
|
1959
1996
|
return await this.transport.sendRequest("xyoViewer_accountBalanceHistory", [
|
|
1960
1997
|
address,
|
|
@@ -1977,12 +2014,12 @@ var JsonRpcXyoViewer = class {
|
|
|
1977
2014
|
throw new Error("Method not implemented.");
|
|
1978
2015
|
}
|
|
1979
2016
|
async blockByHash(hash) {
|
|
1980
|
-
return
|
|
2017
|
+
return asSignedHydratedBlockWithHashMeta(await this.transport.sendRequest("xyoViewer_blockByHash", [
|
|
1981
2018
|
hash
|
|
1982
2019
|
])) ?? null;
|
|
1983
2020
|
}
|
|
1984
2021
|
async blockByNumber(blockNumber) {
|
|
1985
|
-
return
|
|
2022
|
+
return asSignedHydratedBlockWithHashMeta(await this.transport.sendRequest("xyoViewer_blockByNumber", [
|
|
1986
2023
|
blockNumber
|
|
1987
2024
|
])) ?? null;
|
|
1988
2025
|
}
|
|
@@ -1990,9 +2027,7 @@ var JsonRpcXyoViewer = class {
|
|
|
1990
2027
|
return (await this.transport.sendRequest("xyoViewer_blocksByHash", [
|
|
1991
2028
|
hash,
|
|
1992
2029
|
limit
|
|
1993
|
-
])).map((b) =>
|
|
1994
|
-
required: true
|
|
1995
|
-
}));
|
|
2030
|
+
])).map((b) => asSignedHydratedBlockWithHashMeta(b, true));
|
|
1996
2031
|
}
|
|
1997
2032
|
async chainId() {
|
|
1998
2033
|
return await this.transport.sendRequest("xyoViewer_chainId");
|
|
@@ -2003,9 +2038,7 @@ var JsonRpcXyoViewer = class {
|
|
|
2003
2038
|
]);
|
|
2004
2039
|
}
|
|
2005
2040
|
async currentBlock() {
|
|
2006
|
-
return
|
|
2007
|
-
required: true
|
|
2008
|
-
});
|
|
2041
|
+
return asSignedHydratedBlockWithHashMeta(await this.transport.sendRequest("xyoViewer_currentBlock"), true);
|
|
2009
2042
|
}
|
|
2010
2043
|
async currentBlockHash() {
|
|
2011
2044
|
return await this.transport.sendRequest("xyoViewer_currentBlockHash");
|
|
@@ -2288,10 +2321,9 @@ var RpcXyoSigner = class {
|
|
|
2288
2321
|
return await this.transport.sendRequest("xyoSigner_address");
|
|
2289
2322
|
}
|
|
2290
2323
|
async signTransaction(tx) {
|
|
2291
|
-
|
|
2324
|
+
return await this.transport.sendRequest("xyoSigner_signTransaction", [
|
|
2292
2325
|
tx
|
|
2293
2326
|
]);
|
|
2294
|
-
return ret;
|
|
2295
2327
|
}
|
|
2296
2328
|
};
|
|
2297
2329
|
export {
|
|
@@ -2317,6 +2349,7 @@ export {
|
|
|
2317
2349
|
JsonRpcXyoRunner,
|
|
2318
2350
|
JsonRpcXyoViewer,
|
|
2319
2351
|
MemoryRpcTransport,
|
|
2352
|
+
MempoolViewerRpcSchemas,
|
|
2320
2353
|
NetworkStakeViewerRpcNamespace,
|
|
2321
2354
|
NetworkStakeViewerRpcSchemas,
|
|
2322
2355
|
NetworkStakingStepRewardsByPositionViewerRpcNamespace,
|