@xyo-network/chain-services 1.16.22 → 1.16.24

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.
Files changed (28) hide show
  1. package/dist/neutral/AccountBalance/BaseAccountBalanceService.d.ts +15 -7
  2. package/dist/neutral/AccountBalance/BaseAccountBalanceService.d.ts.map +1 -1
  3. package/dist/neutral/AccountBalance/accountBalanceServiceFromArchivist.d.ts +2 -2
  4. package/dist/neutral/AccountBalance/accountBalanceServiceFromArchivist.d.ts.map +1 -1
  5. package/dist/neutral/BlockProducer/BaseBlockProducerService.d.ts +12 -3
  6. package/dist/neutral/BlockProducer/BaseBlockProducerService.d.ts.map +1 -1
  7. package/dist/neutral/ChainService/Memory/Memory.d.ts +3 -0
  8. package/dist/neutral/ChainService/Memory/Memory.d.ts.map +1 -1
  9. package/dist/neutral/PendingTransactions/BasePendingTransactions.d.ts.map +1 -1
  10. package/dist/neutral/Schemas/BaseSchemasService.d.ts +13 -0
  11. package/dist/neutral/Schemas/BaseSchemasService.d.ts.map +1 -0
  12. package/dist/neutral/Schemas/index.d.ts +2 -0
  13. package/dist/neutral/Schemas/index.d.ts.map +1 -0
  14. package/dist/neutral/StakeIntent/XyoStakeIntentService.d.ts.map +1 -1
  15. package/dist/neutral/index.d.ts +1 -0
  16. package/dist/neutral/index.d.ts.map +1 -1
  17. package/dist/neutral/index.mjs +234 -142
  18. package/dist/neutral/index.mjs.map +1 -1
  19. package/package.json +16 -15
  20. package/src/AccountBalance/BaseAccountBalanceService.ts +36 -14
  21. package/src/AccountBalance/accountBalanceServiceFromArchivist.ts +2 -2
  22. package/src/BlockProducer/BaseBlockProducerService.ts +20 -5
  23. package/src/ChainService/Memory/Memory.ts +14 -4
  24. package/src/PendingTransactions/BasePendingTransactions.ts +12 -0
  25. package/src/Schemas/BaseSchemasService.ts +34 -0
  26. package/src/Schemas/index.ts +1 -0
  27. package/src/StakeIntent/XyoStakeIntentService.ts +47 -42
  28. package/src/index.ts +1 -0
@@ -2,17 +2,18 @@ var __defProp = Object.defineProperty;
2
2
  var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
3
 
4
4
  // src/AccountBalance/accountBalanceServiceFromArchivist.ts
5
- import { assertEx } from "@xylabs/sdk-js";
5
+ import { assertEx as assertEx2 } from "@xylabs/sdk-js";
6
6
  import { findMostRecentBlock } from "@xyo-network/chain-protocol";
7
7
  import { StepSizes } from "@xyo-network/xl1-protocol";
8
8
  import { LruCacheMap, readPayloadMapFromStore } from "@xyo-network/xl1-protocol-sdk";
9
9
  import { Semaphore } from "async-mutex";
10
10
 
11
11
  // src/AccountBalance/BaseAccountBalanceService.ts
12
- import { creatable as creatable2 } from "@xylabs/sdk-js";
12
+ import { assertEx, creatable as creatable2 } from "@xylabs/sdk-js";
13
13
  import { spanRootAsync as spanRootAsync2 } from "@xylabs/telemetry";
14
14
  import { AttoXL1 } from "@xyo-network/xl1-protocol";
15
15
  import { balancesSummary, SimpleAccountBalanceViewer } from "@xyo-network/xl1-protocol-sdk";
16
+ import z from "zod";
16
17
 
17
18
  // src/BaseService.ts
18
19
  import { AbstractCreatable, creatable } from "@xylabs/sdk-js";
@@ -133,24 +134,45 @@ function _ts_decorate2(decorators, target, key, desc) {
133
134
  return c > 3 && r && Object.defineProperty(target, key, r), r;
134
135
  }
135
136
  __name(_ts_decorate2, "_ts_decorate");
137
+ var BaseAccountBalanceServiceParamsZod = z.object({
138
+ chainArchivist: z.object().loose(),
139
+ chainIterator: z.object().loose(),
140
+ context: z.object().loose(),
141
+ transferContext: z.object().loose()
142
+ });
136
143
  var BaseAccountBalanceService = class extends BaseService {
137
144
  static {
138
145
  __name(this, "BaseAccountBalanceService");
139
146
  }
140
147
  accountBalanceViewer;
141
148
  blockViewer;
149
+ static async paramsHandler(params) {
150
+ BaseAccountBalanceServiceParamsZod.parse(params);
151
+ assertEx(params?.context?.head, () => "BalanceStepSummaryContext is required in BaseAccountBalanceServiceParams");
152
+ return {
153
+ ...await super.paramsHandler(params),
154
+ ...params
155
+ };
156
+ }
142
157
  async accountBalance(address, headOrRange) {
143
- const balances = await this.accountBalances([
158
+ const balances = await this.accountsBalances([
144
159
  address
145
160
  ], headOrRange);
146
161
  return balances[address] ?? AttoXL1(0n);
147
162
  }
148
- async accountBalanceHistory(address, headOrRange) {
149
- return await this.accountBalanceViewer.accountBalanceHistory(address, headOrRange);
163
+ accountBalanceHistory(_address, _headOrRange) {
164
+ throw new Error("Method not implemented.");
150
165
  }
151
- async accountBalances(address, _headOrRange) {
166
+ async accountsBalances(address, _headOrRange) {
152
167
  return await spanRootAsync2("balances", async () => {
153
- const summary = await balancesSummary(this.params.context);
168
+ const context = {
169
+ head: this.params.context.head,
170
+ stepSemaphores: this.params.context.stepSemaphores,
171
+ store: this.params.context.store,
172
+ chainId: this.params.context.chainId,
173
+ summaryMap: this.params.context.summaryMap
174
+ };
175
+ const summary = await balancesSummary(context);
154
176
  const result = {};
155
177
  for (const addr of address) {
156
178
  const summaryBalance = summary[addr] ?? 0n;
@@ -159,8 +181,8 @@ var BaseAccountBalanceService = class extends BaseService {
159
181
  return result;
160
182
  });
161
183
  }
162
- async accountBalancesHistories(addresses, headOrRange) {
163
- return await this.accountBalanceViewer.accountBalancesHistories(addresses, headOrRange);
184
+ accountsBalancesHistory(_addresses, _headOrRange) {
185
+ throw new Error("Method not implemented.");
164
186
  }
165
187
  createHandler() {
166
188
  this.blockViewer = blockViewerFromChainIteratorAndArchivist(this.params.chainIterator, this.params.chainArchivist);
@@ -183,8 +205,8 @@ var accountBalancesServiceFromArchivist = /* @__PURE__ */ __name(async (chainId,
183
205
  const headFunc = /* @__PURE__ */ __name(async () => {
184
206
  const head = await findMostRecentBlock(archivist);
185
207
  return [
186
- assertEx(head?._hash, () => "No head found in chainArchivist"),
187
- assertEx(head?.block, () => "No head found in chainArchivist")
208
+ assertEx2(head?._hash, () => "No head found in chainArchivist"),
209
+ assertEx2(head?.block, () => "No head found in chainArchivist")
188
210
  ];
189
211
  }, "headFunc");
190
212
  const service = await BaseAccountBalanceService.create({
@@ -239,15 +261,16 @@ BaseAccountTransfersService = _ts_decorate3([
239
261
  ], BaseAccountTransfersService);
240
262
 
241
263
  // src/BlockProducer/BaseBlockProducerService.ts
242
- import { asHash, assertEx as assertEx3, creatable as creatable4, exists, hexToBigInt, isDefined as isDefined2, toHex } from "@xylabs/sdk-js";
264
+ import { AddressZod, asHash, assertEx as assertEx4, creatable as creatable4, exists, hexToBigInt, isDefined as isDefined2, toHex } from "@xylabs/sdk-js";
243
265
  import { FixedPercentageBlockRewardDiviner, FixedPercentageBlockRewardDivinerConfigSchema } from "@xyo-network/chain-modules";
244
266
  import { buildNextBlock, createDeclarationIntent } from "@xyo-network/chain-protocol";
245
267
  import { PayloadBuilder as PayloadBuilder3 } from "@xyo-network/payload-builder";
246
268
  import { asBlockBoundWitness, AttoXL1 as AttoXL13, BlockNumberSchema, defaultRewardRatio, TimeSchema, XYO_STEP_REWARD_ADDRESS } from "@xyo-network/xl1-protocol";
269
+ import z2 from "zod";
247
270
 
248
271
  // src/BlockProducer/generateTransactionFeeTransfers.ts
249
272
  import { hexFromBigInt } from "@xylabs/sdk-js";
250
- import { assertEx as assertEx2 } from "@xylabs/sdk-js";
273
+ import { assertEx as assertEx3 } from "@xylabs/sdk-js";
251
274
  import { PayloadBuilder as PayloadBuilder2 } from "@xyo-network/payload-builder";
252
275
  import { TransferSchema, XYO_ZERO_ADDRESS } from "@xyo-network/xl1-protocol";
253
276
  import { transactionRequiredGas } from "@xyo-network/xl1-protocol-sdk";
@@ -282,7 +305,7 @@ async function generateTransactionFeeTransfers(address, transactions) {
282
305
  return payload;
283
306
  });
284
307
  for (const [from, amount] of Object.entries(txGasCosts)) {
285
- const fromPayload = assertEx2(payloads.find((p) => p.from === from), () => "from payload not found");
308
+ const fromPayload = assertEx3(payloads.find((p) => p.from === from), () => "from payload not found");
286
309
  fromPayload.transfers[address] = hexFromBigInt(amount);
287
310
  }
288
311
  return payloads;
@@ -300,6 +323,13 @@ __name(_ts_decorate4, "_ts_decorate");
300
323
  var DEFAULT_BLOCK_SIZE = 10;
301
324
  var XYO_PRODUCER_REDECLARATION_DURATION = 1e4;
302
325
  var XYO_PRODUCER_REDECLARATION_WINDOW = 500;
326
+ var BaseBlockProducerServiceParamsZod = z2.object({
327
+ balanceService: z2.object().loose(),
328
+ pendingTransactionsService: z2.object().loose(),
329
+ rejectedTransactionsArchivist: z2.object().loose(),
330
+ rewardAddress: AddressZod,
331
+ time: z2.object().loose()
332
+ });
303
333
  var BaseBlockProducerService = class _BaseBlockProducerService extends BaseService {
304
334
  static {
305
335
  __name(this, "BaseBlockProducerService");
@@ -329,40 +359,47 @@ var BaseBlockProducerService = class _BaseBlockProducerService extends BaseServi
329
359
  return this.account.address;
330
360
  }
331
361
  get account() {
332
- return assertEx3(this.params.account, () => "account is required");
362
+ return assertEx4(this.params.account, () => "account is required");
333
363
  }
334
364
  get balanceService() {
335
- return assertEx3(this.params.balanceService, () => "balanceService is required");
365
+ return assertEx4(this.params.balanceService, () => "balanceService is required");
336
366
  }
337
367
  get chainArchivist() {
338
- return assertEx3(this.params.chainArchivist, () => "chainArchivist is required");
368
+ return assertEx4(this.params.chainArchivist, () => "chainArchivist is required");
339
369
  }
340
370
  get chainId() {
341
- return assertEx3(this.params.chainId, () => "chainId is required");
371
+ return assertEx4(this.params.chainId, () => "chainId is required");
342
372
  }
343
373
  get electionService() {
344
- return assertEx3(this.params.electionService, () => "electionService is required");
374
+ return assertEx4(this.params.electionService, () => "electionService is required");
345
375
  }
346
376
  get pendingTransactionsService() {
347
- return assertEx3(this.params.pendingTransactionsService, () => "Missing pendingTransactionsService");
377
+ return assertEx4(this.params.pendingTransactionsService, () => "Missing pendingTransactionsService");
348
378
  }
349
379
  get rejectedTransactionsArchivist() {
350
- return assertEx3(this.params.rejectedTransactionsArchivist, () => "No rejected bundled transactions archivist");
380
+ return assertEx4(this.params.rejectedTransactionsArchivist, () => "No rejected bundled transactions archivist");
351
381
  }
352
382
  get rewardAddress() {
353
- return assertEx3(this.params.rewardAddress, () => "No reward address provided");
383
+ return assertEx4(this.params.rewardAddress, () => "No reward address provided");
354
384
  }
355
385
  get rewardService() {
356
- return assertEx3(this.params.rewardService, () => "rewardService is required");
386
+ return assertEx4(this.params.rewardService, () => "rewardService is required");
357
387
  }
358
388
  get stakeIntentService() {
359
- return assertEx3(this.params.stakeIntentService, () => "No StakeIntentService provided");
389
+ return assertEx4(this.params.stakeIntentService, () => "No StakeIntentService provided");
360
390
  }
361
391
  get time() {
362
- return assertEx3(this.params.time, () => "No TimeSyncViewer provided");
392
+ return assertEx4(this.params.time, () => "No TimeSyncViewer provided");
363
393
  }
364
394
  get validateHydratedBlockState() {
365
- return assertEx3(this.params.validateHydratedBlockState, () => "validateHydratedBlockState is required");
395
+ return assertEx4(this.params.validateHydratedBlockState, () => "validateHydratedBlockState is required");
396
+ }
397
+ static async paramsHandler(params) {
398
+ BaseBlockProducerServiceParamsZod.parse(params);
399
+ return {
400
+ ...await super.paramsHandler(params),
401
+ ...params
402
+ };
366
403
  }
367
404
  async next(head) {
368
405
  if (head.chain !== this.chainId) return;
@@ -387,7 +424,7 @@ var BaseBlockProducerService = class _BaseBlockProducerService extends BaseServi
387
424
  }
388
425
  });
389
426
  }
390
- const blockHex = assertEx3(toHex(block), () => "Failed to convert block to hex");
427
+ const blockHex = assertEx4(toHex(block), () => "Failed to convert block to hex");
391
428
  const blockId = new PayloadBuilder3({
392
429
  schema: BlockNumberSchema
393
430
  }).fields({
@@ -416,7 +453,7 @@ var BaseBlockProducerService = class _BaseBlockProducerService extends BaseServi
416
453
  }
417
454
  async proposeNextValidBlock(head, validateBalances = false) {
418
455
  return await this.spanAsync("proposeNextValidBlock", async () => {
419
- const { block: previousBlock } = assertEx3(asBlockBoundWitness(head), () => "Invalid head block");
456
+ const { block: previousBlock } = assertEx4(asBlockBoundWitness(head), () => "Invalid head block");
420
457
  const nextBlock = previousBlock + 1;
421
458
  const nextBlockTransactionsStart = Date.now();
422
459
  const nextBlockTransactions = await this.pendingTransactionsService.getPendingTransactions(head._hash, _BaseBlockProducerService.DefaultBlockSize);
@@ -441,7 +478,7 @@ var BaseBlockProducerService = class _BaseBlockProducerService extends BaseServi
441
478
  blockPayloads.push(...fundedTransfers, timePayload);
442
479
  this.logger?.info(`Building block ${head.block + 1}`);
443
480
  const startBuild = Date.now();
444
- const stepRewardPoolBalance = (await this.balanceService.accountBalances([
481
+ const stepRewardPoolBalance = (await this.balanceService.accountsBalances([
445
482
  XYO_STEP_REWARD_ADDRESS
446
483
  ]))[XYO_STEP_REWARD_ADDRESS];
447
484
  const block = await buildNextBlock(head, fundedNextBlockTransactions, blockPayloads, [
@@ -471,7 +508,7 @@ var BaseBlockProducerService = class _BaseBlockProducerService extends BaseServi
471
508
  if (!transfer) return;
472
509
  const totalTransferCost = Object.values(transfer?.transfers).reduce((acc, t) => acc + hexToBigInt(t ?? "00"), 0n);
473
510
  if (validateBalances) {
474
- const balance = (await this.balanceService.accountBalances([
511
+ const balance = (await this.balanceService.accountsBalances([
475
512
  transfer.from
476
513
  ]))[transfer.from] ?? AttoXL13(0n);
477
514
  if (balance >= totalTransferCost) {
@@ -545,7 +582,7 @@ BaseBlockRewardService = _ts_decorate5([
545
582
  ], BaseBlockRewardService);
546
583
 
547
584
  // src/BlockReward/EvmBlockRewardService.ts
548
- import { assertEx as assertEx4, creatable as creatable6, toEthAddress } from "@xylabs/sdk-js";
585
+ import { assertEx as assertEx5, creatable as creatable6, toEthAddress } from "@xylabs/sdk-js";
549
586
  import { XyoChainRewards__factory as XyoChainRewardsFactory } from "@xyo-network/typechain";
550
587
  function _ts_decorate6(decorators, target, key, desc) {
551
588
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
@@ -560,13 +597,13 @@ var EvmBlockRewardService = class extends BaseBlockRewardService {
560
597
  }
561
598
  _contractAddress;
562
599
  get chainService() {
563
- return assertEx4(this.params.chainService, () => "chainService is required");
600
+ return assertEx5(this.params.chainService, () => "chainService is required");
564
601
  }
565
602
  get contractAddress() {
566
- return assertEx4(this._contractAddress, () => "contractAddress is required");
603
+ return assertEx5(this._contractAddress, () => "contractAddress is required");
567
604
  }
568
605
  get provider() {
569
- return assertEx4(this.params.provider, () => "provider is required");
606
+ return assertEx5(this.params.provider, () => "provider is required");
570
607
  }
571
608
  async createHandler() {
572
609
  await super.createHandler();
@@ -587,7 +624,7 @@ EvmBlockRewardService = _ts_decorate6([
587
624
  ], EvmBlockRewardService);
588
625
 
589
626
  // src/BlockReward/MemoryBlockRewardService.ts
590
- import { assertEx as assertEx5, creatable as creatable7, toFixedPoint } from "@xylabs/sdk-js";
627
+ import { assertEx as assertEx6, creatable as creatable7, toFixedPoint } from "@xylabs/sdk-js";
591
628
  import { rewardFromBlockNumber } from "@xyo-network/chain-protocol";
592
629
  function _ts_decorate7(decorators, target, key, desc) {
593
630
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
@@ -602,22 +639,22 @@ var MemoryBlockRewardService = class extends BaseBlockRewardService {
602
639
  }
603
640
  rewardFromBlockNumber = rewardFromBlockNumber(18);
604
641
  get creatorReward() {
605
- return assertEx5(this.params.creatorReward, () => "creatorReward is required");
642
+ return assertEx6(this.params.creatorReward, () => "creatorReward is required");
606
643
  }
607
644
  get initialReward() {
608
- return assertEx5(this.params.initialStepReward, () => "initialStepReward is required");
645
+ return assertEx6(this.params.initialStepReward, () => "initialStepReward is required");
609
646
  }
610
647
  get minRewardPerBlock() {
611
- return assertEx5(this.params.minRewardPerBlock, () => "minRewardPerBlock is required");
648
+ return assertEx6(this.params.minRewardPerBlock, () => "minRewardPerBlock is required");
612
649
  }
613
650
  get stepFactorDenominator() {
614
- return assertEx5(this.params.stepFactorDenominator, () => "stepFactorDenominator is required");
651
+ return assertEx6(this.params.stepFactorDenominator, () => "stepFactorDenominator is required");
615
652
  }
616
653
  get stepFactorNumerator() {
617
- return assertEx5(this.params.stepFactorNumerator, () => "stepFactorNumerator is required");
654
+ return assertEx6(this.params.stepFactorNumerator, () => "stepFactorNumerator is required");
618
655
  }
619
656
  get stepSize() {
620
- return assertEx5(this.params.stepSize, () => "stepSize is required");
657
+ return assertEx6(this.params.stepSize, () => "stepSize is required");
621
658
  }
622
659
  static async paramsHandler(inParams) {
623
660
  return {
@@ -639,7 +676,7 @@ MemoryBlockRewardService = _ts_decorate7([
639
676
  ], MemoryBlockRewardService);
640
677
 
641
678
  // src/ChainBlockNumberIteration/ChainBlockNumberIterationService.ts
642
- import { assertEx as assertEx6, isDefined as isDefined3, isNull, isUndefined } from "@xylabs/sdk-js";
679
+ import { assertEx as assertEx7, isDefined as isDefined3, isNull, isUndefined } from "@xylabs/sdk-js";
643
680
  import { PayloadBuilder as PayloadBuilder4 } from "@xyo-network/payload-builder";
644
681
  import { asBlockBoundWitness as asBlockBoundWitness2, asBlockBoundWitnessWithStorageMeta as asBlockBoundWitnessWithStorageMeta2, isBlockBoundWitnessWithHashMeta } from "@xyo-network/xl1-protocol";
645
682
  import { LRUCache } from "lru-cache";
@@ -652,21 +689,21 @@ var ChainBlockNumberIterationService = class extends BaseService {
652
689
  });
653
690
  _currentHead;
654
691
  get chainId() {
655
- return assertEx6(this._currentHead?.chain ?? this.params?.head?.chain, () => "Current head is not set");
692
+ return assertEx7(this._currentHead?.chain ?? this.params?.head?.chain, () => "Current head is not set");
656
693
  }
657
694
  get chainMap() {
658
- return assertEx6(this.params.chainMap);
695
+ return assertEx7(this.params.chainMap);
659
696
  }
660
697
  async get(block) {
661
698
  const head = await this.head();
662
- assertEx6(head.block >= block, () => `Block requested is newer than the current head [${block}]`);
699
+ assertEx7(head.block >= block, () => `Block requested is newer than the current head [${block}]`);
663
700
  const cached = this._blocksByBlockNumber.get(block);
664
701
  if (cached) return cached;
665
702
  const startingBlock = head;
666
703
  const currentBlockHash = await PayloadBuilder4.hash(startingBlock);
667
704
  let currentBlock = await this.chainMap.get(currentBlockHash);
668
705
  while (isDefined3(currentBlock)) {
669
- assertEx6(asBlockBoundWitness2(currentBlock), () => `Expected hash to be a block bound witness [${currentBlock?._hash}]`);
706
+ assertEx7(asBlockBoundWitness2(currentBlock), () => `Expected hash to be a block bound witness [${currentBlock?._hash}]`);
670
707
  if (isBlockBoundWitnessWithHashMeta(currentBlock)) {
671
708
  this._blocksByBlockNumber.set(currentBlock.block, currentBlock);
672
709
  if (currentBlock.block === block) {
@@ -707,7 +744,7 @@ var ChainBlockNumberIterationService = class extends BaseService {
707
744
  currentBlock = asBlockBoundWitnessWithStorageMeta2(nextBlock);
708
745
  } else {
709
746
  const hash = PayloadBuilder4.hash(currentBlock);
710
- assertEx6(asBlockBoundWitnessWithStorageMeta2(currentBlock), () => `Expected hash to be a block bound witness [${hash}]`);
747
+ assertEx7(asBlockBoundWitnessWithStorageMeta2(currentBlock), () => `Expected hash to be a block bound witness [${hash}]`);
711
748
  }
712
749
  }
713
750
  return results;
@@ -731,7 +768,7 @@ var ChainBlockNumberIterationService = class extends BaseService {
731
768
  };
732
769
 
733
770
  // src/ChainService/Evm/Evm.ts
734
- import { assertEx as assertEx7, toAddress, toEthAddress as toEthAddress2 } from "@xylabs/sdk-js";
771
+ import { assertEx as assertEx8, toAddress, toEthAddress as toEthAddress2 } from "@xylabs/sdk-js";
735
772
  import { StakedXyoChain__factory as StakedXyoChainFactory } from "@xyo-network/typechain";
736
773
  import { getAddress } from "ethers/address";
737
774
  var EvmChainService = class extends BaseService {
@@ -739,16 +776,16 @@ var EvmChainService = class extends BaseService {
739
776
  __name(this, "EvmChainService");
740
777
  }
741
778
  get chainId() {
742
- return assertEx7(this.params.id);
779
+ return assertEx8(this.params.id);
743
780
  }
744
781
  get contract() {
745
782
  if (this.params.contract === void 0) {
746
783
  this.params.contract = StakedXyoChainFactory.connect(toEthAddress2(this.chainId), this.params.runner);
747
784
  }
748
- return assertEx7(this.params.contract);
785
+ return assertEx8(this.params.contract);
749
786
  }
750
787
  get runner() {
751
- return assertEx7(this.params.runner);
788
+ return assertEx8(this.params.runner);
752
789
  }
753
790
  async active() {
754
791
  return await this.contract.active();
@@ -807,14 +844,15 @@ var EvmChainService = class extends BaseService {
807
844
  };
808
845
 
809
846
  // src/ChainService/Memory/Memory.ts
810
- import { ZERO_ADDRESS } from "@xylabs/sdk-js";
847
+ import { assertEx as assertEx9, toAddress as toAddress2, ZERO_ADDRESS } from "@xylabs/sdk-js";
811
848
  var MemoryChainService = class extends BaseService {
812
849
  static {
813
850
  __name(this, "MemoryChainService");
814
851
  }
852
+ _chainId;
815
853
  _simulatedStake = 1n;
816
854
  get chainId() {
817
- return ZERO_ADDRESS;
855
+ return assertEx9(this._chainId, () => "Chain ID not set");
818
856
  }
819
857
  async active() {
820
858
  return await Promise.resolve(this._simulatedStake);
@@ -829,7 +867,7 @@ var MemoryChainService = class extends BaseService {
829
867
  return await Promise.resolve(true);
830
868
  }
831
869
  createHandler() {
832
- const { minStake } = this.params.config.producer;
870
+ const { minStake = 1 } = this.params.config.producer ?? {};
833
871
  this._simulatedStake = BigInt(minStake);
834
872
  }
835
873
  async forkedAtBlockNumber() {
@@ -868,10 +906,14 @@ var MemoryChainService = class extends BaseService {
868
906
  async withdrawnByStaker(_staker) {
869
907
  return await Promise.resolve(0n);
870
908
  }
909
+ async startHandler() {
910
+ await super.startHandler();
911
+ this._chainId = this.params.chainId ?? toAddress2(1n);
912
+ }
871
913
  };
872
914
 
873
915
  // src/ChainValidator/XyoValidator.ts
874
- import { assertEx as assertEx8, creatable as creatable8 } from "@xylabs/sdk-js";
916
+ import { assertEx as assertEx10, creatable as creatable8 } from "@xylabs/sdk-js";
875
917
  function _ts_decorate8(decorators, target, key, desc) {
876
918
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
877
919
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -887,22 +929,22 @@ var XyoValidator = class extends BaseService {
887
929
  return this.account.address;
888
930
  }
889
931
  get account() {
890
- return assertEx8(this.params.account, () => "account is required");
932
+ return assertEx10(this.params.account, () => "account is required");
891
933
  }
892
934
  get chainArchivist() {
893
- return assertEx8(this.params.chainArchivist, () => "chainArchivist is required");
935
+ return assertEx10(this.params.chainArchivist, () => "chainArchivist is required");
894
936
  }
895
937
  get chainInfo() {
896
- return assertEx8(this.params.chainId, () => "chainInfo is required");
938
+ return assertEx10(this.params.chainId, () => "chainInfo is required");
897
939
  }
898
940
  get electionService() {
899
- return assertEx8(this.params.electionService, () => "electionService is required");
941
+ return assertEx10(this.params.electionService, () => "electionService is required");
900
942
  }
901
943
  get pendingBundledTransactionsArchivist() {
902
- return assertEx8(this.params.pendingBundledTransactionsArchivist, () => "pendingBundledTransactions is required");
944
+ return assertEx10(this.params.pendingBundledTransactionsArchivist, () => "pendingBundledTransactions is required");
903
945
  }
904
946
  get rewardService() {
905
- return assertEx8(this.params.rewardService, () => "rewardService is required");
947
+ return assertEx10(this.params.rewardService, () => "rewardService is required");
906
948
  }
907
949
  validatePendingBlock(_block) {
908
950
  return [];
@@ -921,7 +963,7 @@ XyoValidator = _ts_decorate8([
921
963
  ], XyoValidator);
922
964
 
923
965
  // src/Election/BaseElectionService.ts
924
- import { assertEx as assertEx9, creatable as creatable9 } from "@xylabs/sdk-js";
966
+ import { assertEx as assertEx11, creatable as creatable9 } from "@xylabs/sdk-js";
925
967
  import { hexToLast4BytesInt, shuffleWithSeed } from "@xyo-network/chain-utils";
926
968
  function _ts_decorate9(decorators, target, key, desc) {
927
969
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
@@ -935,13 +977,13 @@ var BaseElectionService = class extends BaseService {
935
977
  __name(this, "BaseElectionService");
936
978
  }
937
979
  get chainIterator() {
938
- return assertEx9(this.params.chainIterator, () => "No chain iterator");
980
+ return assertEx11(this.params.chainIterator, () => "No chain iterator");
939
981
  }
940
982
  get chainStakeViewer() {
941
- return assertEx9(this.params.chainStakeViewer, () => "No chain stake viewer");
983
+ return assertEx11(this.params.chainStakeViewer, () => "No chain stake viewer");
942
984
  }
943
985
  get stakeIntentService() {
944
- return assertEx9(this.params.stakeIntentService, () => "No staked intent service");
986
+ return assertEx11(this.params.stakeIntentService, () => "No staked intent service");
945
987
  }
946
988
  async getCreatorCommitteeForNextBlock(current) {
947
989
  return await this.spanAsync("getCreatorCommitteeForNextBlock", async () => {
@@ -1036,7 +1078,7 @@ BaseNetworkStakeStepRewardService = _ts_decorate10([
1036
1078
 
1037
1079
  // src/PendingTransactions/BasePendingTransactions.ts
1038
1080
  import { ValueType } from "@opentelemetry/api";
1039
- import { assertEx as assertEx10, creatable as creatable11, exists as exists2, filterAs, filterAsync, forget, isDefined as isDefined4, isUndefined as isUndefined2 } from "@xylabs/sdk-js";
1081
+ import { assertEx as assertEx12, creatable as creatable11, exists as exists2, filterAs, filterAsync, forget, isDefined as isDefined4, isUndefined as isUndefined2 } from "@xylabs/sdk-js";
1040
1082
  import { MemoryArchivist } from "@xyo-network/archivist-memory";
1041
1083
  import { findMostRecentBlock as findMostRecentBlock2 } from "@xyo-network/chain-protocol";
1042
1084
  import { asBlockBoundWitnessWithHashMeta, isTransactionBoundWitnessWithStorageMeta } from "@xyo-network/xl1-protocol";
@@ -1130,23 +1172,23 @@ var BasePendingTransactionsService = class _BasePendingTransactionsService exten
1130
1172
  return this.params.additionalPendingTransactionValidators ?? [];
1131
1173
  }
1132
1174
  get chainArchivist() {
1133
- return assertEx10(this.params.chainArchivist, () => "No completed blocks with data archivist");
1175
+ return assertEx12(this.params.chainArchivist, () => "No completed blocks with data archivist");
1134
1176
  }
1135
1177
  get chainId() {
1136
- return assertEx10(this.params.chainId, () => "No chain id");
1178
+ return assertEx12(this.params.chainId, () => "No chain id");
1137
1179
  }
1138
1180
  get pendingBundledTransactionsArchivist() {
1139
- return assertEx10(this.params.pendingBundledTransactionsArchivist, () => "No pending bundled transactions archivist");
1181
+ return assertEx12(this.params.pendingBundledTransactionsArchivist, () => "No pending bundled transactions archivist");
1140
1182
  }
1141
1183
  get pendingBundledTransactionsLocalArchivist() {
1142
- return assertEx10(this._curatedPendingBundledTransactionsArchivist, () => "No pending bundled transactions curated archivist");
1184
+ return assertEx12(this._curatedPendingBundledTransactionsArchivist, () => "No pending bundled transactions curated archivist");
1143
1185
  }
1144
1186
  get pendingTransactionsCount() {
1145
1187
  forget(this.countPendingTransactions());
1146
1188
  return this._pendingTransactionsCount;
1147
1189
  }
1148
1190
  get rejectedTransactionsArchivist() {
1149
- return assertEx10(this.params.rejectedTransactionsArchivist, () => "No rejected transactions archivist");
1191
+ return assertEx12(this.params.rejectedTransactionsArchivist, () => "No rejected transactions archivist");
1150
1192
  }
1151
1193
  async createHandler() {
1152
1194
  await super.createHandler();
@@ -1201,6 +1243,13 @@ var BasePendingTransactionsService = class _BasePendingTransactionsService exten
1201
1243
  }, this.additionalPendingTransactionValidators)
1202
1244
  ]));
1203
1245
  const validTransactions = txValidationResults.filter(([, errors]) => errors.length === 0).map(([tx]) => tx);
1246
+ const invalidTransactions = txValidationResults.filter(([, errors]) => errors.length > 0).map(([tx]) => tx);
1247
+ if (invalidTransactions.length > 0) {
1248
+ this.logger?.warn(`getPendingTransactions: Found ${invalidTransactions.length} invalid pending transactions`);
1249
+ for (const tx of invalidTransactions) {
1250
+ this.logger?.warn(tx[0]._hash);
1251
+ }
1252
+ }
1204
1253
  foundPendingTransactions.push(...validTransactions);
1205
1254
  }
1206
1255
  if (foundPendingTransactions.length > 0) {
@@ -1318,6 +1367,42 @@ BasePendingTransactionsService = _ts_decorate11([
1318
1367
  var isTransactionExpired = /* @__PURE__ */ __name((block) => ([txBw]) => txBw.exp < block, "isTransactionExpired");
1319
1368
  var isTransactionActive = /* @__PURE__ */ __name((block) => ([txBw]) => txBw.nbf <= block && txBw.exp >= block, "isTransactionActive");
1320
1369
 
1370
+ // src/Schemas/BaseSchemasService.ts
1371
+ import { creatable as creatable12 } from "@xylabs/sdk-js";
1372
+ import { spanRootAsync as spanRootAsync4 } from "@xylabs/telemetry";
1373
+ import { schemasSummary } from "@xyo-network/xl1-protocol-sdk";
1374
+ function _ts_decorate12(decorators, target, key, desc) {
1375
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1376
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
1377
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
1378
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
1379
+ }
1380
+ __name(_ts_decorate12, "_ts_decorate");
1381
+ var BaseSchemasService = class extends BaseService {
1382
+ static {
1383
+ __name(this, "BaseSchemasService");
1384
+ }
1385
+ async schema(head, schema) {
1386
+ return (await this.schemas(head, [
1387
+ schema
1388
+ ]))[schema] ?? 0;
1389
+ }
1390
+ async schemas(head, schemas) {
1391
+ return await spanRootAsync4("transfers", async () => {
1392
+ const summary = await schemasSummary(this.params.context);
1393
+ const result = {};
1394
+ for (const schema of schemas) {
1395
+ const count = summary[schema] ?? 0;
1396
+ result[schema] = count;
1397
+ }
1398
+ return result;
1399
+ });
1400
+ }
1401
+ };
1402
+ BaseSchemasService = _ts_decorate12([
1403
+ creatable12()
1404
+ ], BaseSchemasService);
1405
+
1321
1406
  // src/StakeIntent/lib/getBlockSignedStakeDeclarations.ts
1322
1407
  import { exists as exists3, filterAs as filterAs2 } from "@xylabs/sdk-js";
1323
1408
  import { asOptionalBoundWitness } from "@xyo-network/boundwitness-model";
@@ -1345,21 +1430,21 @@ var mapBoundWitnessToStakeIntentHashes = /* @__PURE__ */ __name((bw) => {
1345
1430
  }, "mapBoundWitnessToStakeIntentHashes");
1346
1431
 
1347
1432
  // src/StakeIntent/XyoStakeIntentService.ts
1348
- import { asAddress, assertEx as assertEx11, creatable as creatable12, filterAs as filterAs3, isUndefined as isUndefined3 } from "@xylabs/sdk-js";
1433
+ import { asAddress, assertEx as assertEx13, creatable as creatable13, filterAs as filterAs3, isUndefined as isUndefined3 } from "@xylabs/sdk-js";
1349
1434
  import { analyzeChain, ChainStakeIntentAnalyzer, isChainSummaryStakeIntent } from "@xyo-network/chain-analyze";
1350
1435
  import { DEFAULT_FIND_FIRST_MATCHING_NEXT_OPTIONS, findFirstMatching, IntervalMap } from "@xyo-network/chain-utils";
1351
1436
  import { PayloadBuilder as PayloadBuilder7 } from "@xyo-network/payload-builder";
1352
1437
  import { asBlockBoundWitness as asBlockBoundWitness3, asBlockBoundWitnessWithStorageMeta as asBlockBoundWitnessWithStorageMeta3, asChainStakeIntent as asChainStakeIntent2 } from "@xyo-network/xl1-protocol";
1353
- import { asChainIndexingServiceStateWithStorageMeta, ChainIndexingServiceStateSchema, isChainIndexingServiceState, readPayloadMapFromStore as readPayloadMapFromStore2 } from "@xyo-network/xl1-protocol-sdk";
1438
+ import { asChainIndexingServiceStateWithStorageMeta, ChainIndexingServiceStateSchema, isChainIndexingServiceState, readPayloadMapFromStore as readPayloadMapFromStore2, timeBudget } from "@xyo-network/xl1-protocol-sdk";
1354
1439
  import { Mutex as Mutex3 } from "async-mutex";
1355
1440
  import { LRUCache as LRUCache2 } from "lru-cache";
1356
- function _ts_decorate12(decorators, target, key, desc) {
1441
+ function _ts_decorate13(decorators, target, key, desc) {
1357
1442
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1358
1443
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
1359
1444
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
1360
1445
  return c > 3 && r && Object.defineProperty(target, key, r), r;
1361
1446
  }
1362
- __name(_ts_decorate12, "_ts_decorate");
1447
+ __name(_ts_decorate13, "_ts_decorate");
1363
1448
  var ACTIVE_STAKE_TTL = 1e3 * 60 * 60 * 2;
1364
1449
  var NO_ACTIVE_STAKE_TTL = 1e3 * 2;
1365
1450
  var STAKE_CACHE_MAX_ENTRIES = 1e4;
@@ -1382,16 +1467,16 @@ var XyoStakeIntentService = class extends BaseService {
1382
1467
  });
1383
1468
  _updateMutex = new Mutex3();
1384
1469
  get chainArchivist() {
1385
- return assertEx11(this.params.chainArchivist, () => "chainArchivist not set");
1470
+ return assertEx13(this.params.chainArchivist, () => "chainArchivist not set");
1386
1471
  }
1387
1472
  get chainIterator() {
1388
- return assertEx11(this.params.chainIterator, () => "chainIterator not set");
1473
+ return assertEx13(this.params.chainIterator, () => "chainIterator not set");
1389
1474
  }
1390
1475
  get chainStakeViewer() {
1391
- return assertEx11(this.params.chainStakeViewer, () => "chainStakeViewer not set");
1476
+ return assertEx13(this.params.chainStakeViewer, () => "chainStakeViewer not set");
1392
1477
  }
1393
1478
  get stakeIntentStateArchivist() {
1394
- return assertEx11(this.params.stakeIntentStateArchivist, () => "stakeIntentStateArchivist not set");
1479
+ return assertEx13(this.params.stakeIntentStateArchivist, () => "stakeIntentStateArchivist not set");
1395
1480
  }
1396
1481
  async createHandler() {
1397
1482
  this.chainIterator.on("headUpdated", async () => {
@@ -1404,13 +1489,13 @@ var XyoStakeIntentService = class extends BaseService {
1404
1489
  }
1405
1490
  async getDeclaredCandidateRanges(address, intent) {
1406
1491
  await Promise.resolve();
1407
- assertEx11(intent === "producer", () => `Support not yet added for intent ${intent}`);
1492
+ assertEx13(intent === "producer", () => `Support not yet added for intent ${intent}`);
1408
1493
  const results = this._producers.get(address);
1409
1494
  return results ?? [];
1410
1495
  }
1411
1496
  async getDeclaredCandidatesForBlock(block, intent) {
1412
1497
  return await this.spanAsync("getDeclaredCandidatesForBlock", async () => {
1413
- assertEx11(intent === "producer", () => `Support not yet added for intent ${intent}`);
1498
+ assertEx13(intent === "producer", () => `Support not yet added for intent ${intent}`);
1414
1499
  const results = this._producers.findAllContaining(block);
1415
1500
  const candidates = [
1416
1501
  ...results
@@ -1475,38 +1560,40 @@ var XyoStakeIntentService = class extends BaseService {
1475
1560
  ]);
1476
1561
  }
1477
1562
  async recoverState(current) {
1478
- const currentBlock = assertEx11(asBlockBoundWitness3((await this.chainArchivist.get([
1479
- current
1480
- ]))?.[0]), () => `Block ${current} not found`);
1481
- const currentBlockNum = currentBlock.block;
1482
- const opts = {
1483
- ...DEFAULT_FIND_FIRST_MATCHING_NEXT_OPTIONS
1484
- };
1485
- while (true) {
1486
- const predicate = /* @__PURE__ */ __name((p) => {
1487
- const state2 = asChainIndexingServiceStateWithStorageMeta(p);
1488
- return state2 ? true : false;
1489
- }, "predicate");
1490
- const state = await findFirstMatching(this.stakeIntentStateArchivist, predicate, opts);
1491
- if (isChainIndexingServiceState(state)) {
1492
- const indexed = (await this.chainArchivist.get([
1493
- state.endBlockHash
1494
- ]))?.[0];
1495
- const indexedBlock = asBlockBoundWitnessWithStorageMeta3(indexed);
1496
- if (indexedBlock) {
1497
- const indexedBlockNum = indexedBlock.block;
1498
- if (indexedBlockNum <= currentBlockNum) {
1499
- const data = state.state;
1500
- this._producers = new IntervalMap(data);
1501
- this._lastIndexedBlockHash = indexedBlock._hash;
1502
- break;
1563
+ return await timeBudget("XyoStakeIntentService.recoverState", console, async () => {
1564
+ const currentBlock = assertEx13(asBlockBoundWitness3((await this.chainArchivist.get([
1565
+ current
1566
+ ]))?.[0]), () => `Block ${current} not found`);
1567
+ const currentBlockNum = currentBlock.block;
1568
+ const opts = {
1569
+ ...DEFAULT_FIND_FIRST_MATCHING_NEXT_OPTIONS
1570
+ };
1571
+ while (true) {
1572
+ const predicate = /* @__PURE__ */ __name((p) => {
1573
+ const state2 = asChainIndexingServiceStateWithStorageMeta(p);
1574
+ return state2 ? true : false;
1575
+ }, "predicate");
1576
+ const state = await findFirstMatching(this.stakeIntentStateArchivist, predicate, opts);
1577
+ if (isChainIndexingServiceState(state)) {
1578
+ const indexed = (await this.chainArchivist.get([
1579
+ state.endBlockHash
1580
+ ]))?.[0];
1581
+ const indexedBlock = asBlockBoundWitnessWithStorageMeta3(indexed);
1582
+ if (indexedBlock) {
1583
+ const indexedBlockNum = indexedBlock.block;
1584
+ if (indexedBlockNum <= currentBlockNum) {
1585
+ const data = state.state;
1586
+ this._producers = new IntervalMap(data);
1587
+ this._lastIndexedBlockHash = indexedBlock._hash;
1588
+ break;
1589
+ }
1503
1590
  }
1591
+ } else {
1592
+ break;
1504
1593
  }
1505
- } else {
1506
- break;
1594
+ opts.open = true;
1507
1595
  }
1508
- opts.open = true;
1509
- }
1596
+ }, 2e3, true);
1510
1597
  }
1511
1598
  async updateIndex(displayProgress = false) {
1512
1599
  if (this._updateMutex.isLocked()) {
@@ -1516,44 +1603,46 @@ var XyoStakeIntentService = class extends BaseService {
1516
1603
  return await this.spanAsync("updateIndex", async () => {
1517
1604
  const currentHead = await this.chainIterator.head();
1518
1605
  if (isUndefined3(currentHead)) return;
1519
- const currentHeadHash = await PayloadBuilder7.hash(currentHead);
1520
- const chainMap = readPayloadMapFromStore2(this.chainArchivist);
1521
- const result = await analyzeChain({
1522
- chainMap
1523
- }, [
1524
- new ChainStakeIntentAnalyzer("producer")
1525
- ], currentHeadHash, this._lastIndexedBlockHash);
1526
- const signedDeclarations = filterAs3(result.find(isChainSummaryStakeIntent)?.intents ?? [], asChainStakeIntent2);
1527
- if (currentHead.block === void 0) return;
1528
- const currentHeadBlockNum = currentHead.block;
1529
- if (displayProgress) this.logger?.log(`Updating index through 0x${currentHeadBlockNum}`);
1530
- for (const signedDeclaration of signedDeclarations) {
1531
- const { exp, nbf } = signedDeclaration;
1532
- const start = nbf;
1533
- const stop = exp;
1534
- const address = asAddress(signedDeclaration?.from);
1535
- if (start !== void 0 && stop !== void 0 && address !== void 0) {
1536
- this._producers.insert(address, start, stop);
1606
+ return await timeBudget("XyoStakeIntentService.updateIndex", console, async () => {
1607
+ const currentHeadHash = currentHead._hash;
1608
+ const chainMap = readPayloadMapFromStore2(this.chainArchivist);
1609
+ const result = await analyzeChain({
1610
+ chainMap
1611
+ }, [
1612
+ new ChainStakeIntentAnalyzer("producer")
1613
+ ], currentHeadHash, this._lastIndexedBlockHash);
1614
+ const signedDeclarations = filterAs3(result.find(isChainSummaryStakeIntent)?.intents ?? [], asChainStakeIntent2);
1615
+ if (currentHead.block === void 0) return;
1616
+ const currentHeadBlockNum = currentHead.block;
1617
+ if (displayProgress) this.logger?.log(`Updating index through 0x${currentHeadBlockNum}`);
1618
+ for (const signedDeclaration of signedDeclarations) {
1619
+ const { exp, nbf } = signedDeclaration;
1620
+ const start = nbf;
1621
+ const stop = exp;
1622
+ const address = asAddress(signedDeclaration?.from);
1623
+ if (start !== void 0 && stop !== void 0 && address !== void 0) {
1624
+ this._producers.insert(address, start, stop);
1625
+ }
1537
1626
  }
1538
- }
1539
- this._lastIndexedBlockHash = currentHeadHash;
1627
+ this._lastIndexedBlockHash = currentHeadHash;
1628
+ }, 2e3, true);
1540
1629
  });
1541
1630
  });
1542
1631
  }
1543
1632
  };
1544
- XyoStakeIntentService = _ts_decorate12([
1545
- creatable12()
1633
+ XyoStakeIntentService = _ts_decorate13([
1634
+ creatable13()
1546
1635
  ], XyoStakeIntentService);
1547
1636
 
1548
1637
  // src/StepStake/BaseStepStakeService.ts
1549
- import { creatable as creatable13 } from "@xylabs/sdk-js";
1550
- function _ts_decorate13(decorators, target, key, desc) {
1638
+ import { creatable as creatable14 } from "@xylabs/sdk-js";
1639
+ function _ts_decorate14(decorators, target, key, desc) {
1551
1640
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1552
1641
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
1553
1642
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
1554
1643
  return c > 3 && r && Object.defineProperty(target, key, r), r;
1555
1644
  }
1556
- __name(_ts_decorate13, "_ts_decorate");
1645
+ __name(_ts_decorate14, "_ts_decorate");
1557
1646
  var BaseStepStakeService = class extends BaseService {
1558
1647
  static {
1559
1648
  __name(this, "BaseStepStakeService");
@@ -1565,20 +1654,20 @@ var BaseStepStakeService = class extends BaseService {
1565
1654
  throw new Error("Method not implemented.");
1566
1655
  }
1567
1656
  };
1568
- BaseStepStakeService = _ts_decorate13([
1569
- creatable13()
1657
+ BaseStepStakeService = _ts_decorate14([
1658
+ creatable14()
1570
1659
  ], BaseStepStakeService);
1571
1660
 
1572
1661
  // src/Time/BaseTimeSyncService.ts
1573
- import { creatable as creatable14 } from "@xylabs/sdk-js";
1662
+ import { creatable as creatable15 } from "@xylabs/sdk-js";
1574
1663
  import { SimpleTimeSyncViewer } from "@xyo-network/xl1-protocol-sdk";
1575
- function _ts_decorate14(decorators, target, key, desc) {
1664
+ function _ts_decorate15(decorators, target, key, desc) {
1576
1665
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1577
1666
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
1578
1667
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
1579
1668
  return c > 3 && r && Object.defineProperty(target, key, r), r;
1580
1669
  }
1581
- __name(_ts_decorate14, "_ts_decorate");
1670
+ __name(_ts_decorate15, "_ts_decorate");
1582
1671
  var BaseTimeSyncService = class extends BaseService {
1583
1672
  static {
1584
1673
  __name(this, "BaseTimeSyncService");
@@ -1611,18 +1700,21 @@ var BaseTimeSyncService = class extends BaseService {
1611
1700
  return await this.timeSyncViewer.currentTimePayload();
1612
1701
  }
1613
1702
  };
1614
- BaseTimeSyncService = _ts_decorate14([
1615
- creatable14()
1703
+ BaseTimeSyncService = _ts_decorate15([
1704
+ creatable15()
1616
1705
  ], BaseTimeSyncService);
1617
1706
  export {
1618
1707
  BaseAccountBalanceService,
1708
+ BaseAccountBalanceServiceParamsZod,
1619
1709
  BaseAccountTransfersService,
1620
1710
  BaseAccountableService,
1621
1711
  BaseBlockProducerService,
1712
+ BaseBlockProducerServiceParamsZod,
1622
1713
  BaseBlockRewardService,
1623
1714
  BaseElectionService,
1624
1715
  BaseNetworkStakeStepRewardService,
1625
1716
  BasePendingTransactionsService,
1717
+ BaseSchemasService,
1626
1718
  BaseService,
1627
1719
  BaseStepStakeService,
1628
1720
  BaseTimeSyncService,