@xyo-network/xl1-rpc 3.1.2 → 3.1.4

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.
@@ -106,8 +106,6 @@ var rpcMethodHandlersFromViewer = (viewer) => {
106
106
  xyoViewer_networkStakeStepRewardsForPosition: (params) => viewer.networkStakeStepRewardsForPosition?.(...params ?? []),
107
107
  xyoViewer_networkStakeStepRewardsForRange: (params) => viewer.networkStakeStepRewardsForRange?.(...params ?? []),
108
108
  xyoViewer_networkStakeStepRewardsForStepLevel: (params) => viewer.networkStakeStepRewardsForStepLevel?.(...params ?? []),
109
- xyoViewer_accountBalance: (params) => viewer.account.balance.accountBalance(...params ?? []),
110
- xyoViewer_accountBalanceHistory: (params) => viewer.account.balance.accountBalanceHistory(...params ?? []),
111
109
  xyoViewer_blocksByNumber: (params) => viewer.blocksByNumber(...params ?? []),
112
110
  xyoViewer_blocksByHash: (params) => viewer.blocksByHash(...params ?? []),
113
111
  xyoViewer_blocksByStep: (params) => viewer.blocksByStep(...params ?? []),
@@ -1120,41 +1118,15 @@ import {
1120
1118
  } from "@xylabs/sdk-js";
1121
1119
  import { PayloadZodLoose as PayloadZodLoose3, XyoAddressZod as XyoAddressZod7 } from "@xyo-network/sdk-js";
1122
1120
  import {
1123
- AccountBalanceHistoryItemZod as AccountBalanceHistoryItemZod2,
1124
1121
  asAttoXL1 as asAttoXL16,
1125
- ChainQualifiedConfigZod as ChainQualifiedConfigZod2,
1126
1122
  JsonToStakeZod as JsonToStakeZod3,
1127
1123
  SignedHydratedBlockWithHashMetaZod as SignedHydratedBlockWithHashMetaZod4,
1128
1124
  SignedHydratedTransactionZod as SignedHydratedTransactionZod3,
1129
1125
  StakeToJsonZod as StakeToJsonZod3,
1130
1126
  StepIdentityZod as StepIdentityZod2,
1131
- XL1BlockNumberZod as XL1BlockNumberZod2,
1132
- XL1BlockRangeZod
1127
+ XL1BlockNumberZod as XL1BlockNumberZod2
1133
1128
  } from "@xyo-network/xl1-protocol-lib";
1134
1129
  import { z as z21 } from "zod/mini";
1135
- var accountBalanceParamsFrom = z21.union([
1136
- z21.pipe(
1137
- z21.tuple([XyoAddressZod7]),
1138
- z21.transform(([addr]) => [addr])
1139
- ),
1140
- z21.pipe(
1141
- z21.tuple([XyoAddressZod7, HashZod5]),
1142
- z21.transform(([addr, head]) => [addr, { head }])
1143
- ),
1144
- z21.pipe(
1145
- z21.tuple([XyoAddressZod7, XL1BlockRangeZod]),
1146
- z21.transform(([addr, range]) => [addr, { range }])
1147
- )
1148
- ]);
1149
- var accountBalanceParamsTo = z21.pipe(
1150
- z21.tuple([XyoAddressZod7, z21.optional(ChainQualifiedConfigZod2)]),
1151
- z21.transform(([addr, config]) => {
1152
- if (config === void 0) return [addr];
1153
- if ("head" in config) return [addr, config.head];
1154
- if ("range" in config) return [addr, config.range];
1155
- return [addr];
1156
- })
1157
- );
1158
1130
  var XyoViewerRpcSchemas = {
1159
1131
  xyoViewer_networkStakeStepRewardClaimedByAddress: {
1160
1132
  params: {
@@ -1336,37 +1308,6 @@ var XyoViewerRpcSchemas = {
1336
1308
  from: z21.record(z21.string(), z21.tuple([z21.pipe(JsonToBigIntZod9, z21.transform((val) => asAttoXL16(val))), z21.pipe(JsonToBigIntZod9, z21.transform((val) => asAttoXL16(val)))]))
1337
1309
  }
1338
1310
  },
1339
- // params bridge between the positional wire format and the object-form
1340
- // in-memory shape the viewer expects:
1341
- // wire: `[Address] | [Address, Hash | [BlockNum, BlockNum]]`
1342
- // in-memory: `[Address, ChainQualifiedConfig?]`
1343
- // (ChainQualifiedConfig = {head} | {range} | {})
1344
- // `from` (wire → in-memory, server-side) wraps the bare hash/range in the
1345
- // {head} / {range} object; `to` (in-memory → wire, client-side) unwraps.
1346
- // The wire format itself is unchanged — existing positional callers keep
1347
- // working — but the handler now receives the object form the viewer
1348
- // implementation can actually qualify on.
1349
- xyoViewer_accountBalance: {
1350
- params: {
1351
- to: accountBalanceParamsTo,
1352
- from: accountBalanceParamsFrom
1353
- },
1354
- result: {
1355
- to: BigIntToJsonZod9,
1356
- from: z21.pipe(JsonToBigIntZod9, z21.transform((val) => asAttoXL16(val)))
1357
- }
1358
- },
1359
- // Same wire-vs-in-memory params bridge as `xyoViewer_accountBalance`.
1360
- xyoViewer_accountBalanceHistory: {
1361
- params: {
1362
- to: accountBalanceParamsTo,
1363
- from: accountBalanceParamsFrom
1364
- },
1365
- result: {
1366
- to: z21.array(AccountBalanceHistoryItemZod2),
1367
- from: z21.array(AccountBalanceHistoryItemZod2)
1368
- }
1369
- },
1370
1311
  xyoViewer_blocksByNumber: {
1371
1312
  params: {
1372
1313
  to: z21.tuple([XL1BlockNumberZod2, z21.optional(z21.number())]),