@xyo-network/chain-services 1.6.0 → 1.6.2

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 (95) hide show
  1. package/dist/neutral/index.mjs +273 -361
  2. package/dist/neutral/index.mjs.map +1 -1
  3. package/dist/types/AccountBalance/{ChainAccountBalanceServiceV2.d.ts → BaseAccountBalanceService.d.ts} +4 -4
  4. package/dist/types/AccountBalance/BaseAccountBalanceService.d.ts.map +1 -0
  5. package/dist/types/AccountBalance/accountBalanceServiceFromArchivist.d.ts +4 -4
  6. package/dist/types/AccountBalance/accountBalanceServiceFromArchivist.d.ts.map +1 -1
  7. package/dist/types/AccountBalance/index.d.ts +1 -2
  8. package/dist/types/AccountBalance/index.d.ts.map +1 -1
  9. package/dist/types/BaseService.d.ts +1 -1
  10. package/dist/types/BaseService.d.ts.map +1 -1
  11. package/dist/types/BlockProducer/{XyoBlockProducer.d.ts → BaseBlockProducerService.d.ts} +4 -4
  12. package/dist/types/BlockProducer/BaseBlockProducerService.d.ts.map +1 -0
  13. package/dist/types/BlockProducer/index.d.ts +1 -1
  14. package/dist/types/BlockProducer/index.d.ts.map +1 -1
  15. package/dist/types/BlockReward/BaseBlockRewardService.d.ts +10 -0
  16. package/dist/types/BlockReward/BaseBlockRewardService.d.ts.map +1 -0
  17. package/dist/types/BlockReward/EvmBlockRewardService.d.ts +5 -4
  18. package/dist/types/BlockReward/EvmBlockRewardService.d.ts.map +1 -1
  19. package/dist/types/BlockReward/{XyoBlockRewardService.d.ts → MemoryBlockRewardService.d.ts} +5 -6
  20. package/dist/types/BlockReward/MemoryBlockRewardService.d.ts.map +1 -0
  21. package/dist/types/BlockReward/index.d.ts +2 -1
  22. package/dist/types/BlockReward/index.d.ts.map +1 -1
  23. package/dist/types/ChainBlockNumberIteration/model/Params.d.ts +1 -1
  24. package/dist/types/ChainBlockNumberIteration/model/Params.d.ts.map +1 -1
  25. package/dist/types/{Staker → ChainService}/Evm/Evm.d.ts +1 -1
  26. package/dist/types/ChainService/Evm/Evm.d.ts.map +1 -0
  27. package/dist/types/ChainService/Evm/index.d.ts.map +1 -0
  28. package/dist/types/{Staker → ChainService}/Memory/Memory.d.ts +1 -1
  29. package/dist/types/ChainService/Memory/Memory.d.ts.map +1 -0
  30. package/dist/types/ChainService/Memory/index.d.ts.map +1 -0
  31. package/dist/types/ChainService/index.d.ts.map +1 -0
  32. package/dist/types/ChainValidator/XyoValidator.d.ts +1 -1
  33. package/dist/types/ChainValidator/XyoValidator.d.ts.map +1 -1
  34. package/dist/types/Election/{XyoElectionService.d.ts → BaseElectionService.d.ts} +4 -4
  35. package/dist/types/Election/BaseElectionService.d.ts.map +1 -0
  36. package/dist/types/Election/index.d.ts +1 -1
  37. package/dist/types/Election/index.d.ts.map +1 -1
  38. package/dist/types/PendingTransactions/{PendingTransactions.d.ts → BasePendingTransactions.d.ts} +4 -4
  39. package/dist/types/PendingTransactions/BasePendingTransactions.d.ts.map +1 -0
  40. package/dist/types/PendingTransactions/index.d.ts +1 -1
  41. package/dist/types/PendingTransactions/index.d.ts.map +1 -1
  42. package/dist/types/StakeIntent/XyoStakeIntentService.d.ts +1 -1
  43. package/dist/types/StakeIntent/XyoStakeIntentService.d.ts.map +1 -1
  44. package/dist/types/index.d.ts +2 -2
  45. package/dist/types/index.d.ts.map +1 -1
  46. package/dist/types/model/Params.d.ts.map +1 -0
  47. package/dist/types/model/index.d.ts +2 -0
  48. package/dist/types/model/index.d.ts.map +1 -0
  49. package/package.json +39 -40
  50. package/src/AccountBalance/{ChainAccountBalanceServiceV2.ts → BaseAccountBalanceService.ts} +3 -3
  51. package/src/AccountBalance/accountBalanceServiceFromArchivist.ts +8 -50
  52. package/src/AccountBalance/index.ts +1 -2
  53. package/src/BaseService.ts +1 -1
  54. package/src/BlockProducer/{XyoBlockProducer.ts → BaseBlockProducerService.ts} +7 -7
  55. package/src/BlockProducer/index.ts +1 -1
  56. package/src/BlockReward/BaseBlockRewardService.ts +16 -0
  57. package/src/BlockReward/EvmBlockRewardService.ts +6 -5
  58. package/src/BlockReward/{XyoBlockRewardService.ts → MemoryBlockRewardService.ts} +6 -6
  59. package/src/BlockReward/index.ts +2 -1
  60. package/src/ChainBlockNumberIteration/model/Params.ts +1 -1
  61. package/src/{Staker → ChainService}/Evm/Evm.ts +1 -1
  62. package/src/{Staker → ChainService}/Memory/Memory.ts +1 -1
  63. package/src/ChainValidator/XyoValidator.ts +1 -1
  64. package/src/Election/{XyoElectionService.ts → BaseElectionService.ts} +3 -3
  65. package/src/Election/index.ts +1 -1
  66. package/src/PendingTransactions/{PendingTransactions.ts → BasePendingTransactions.ts} +8 -8
  67. package/src/PendingTransactions/index.ts +1 -1
  68. package/src/StakeIntent/XyoStakeIntentService.ts +1 -1
  69. package/src/index.ts +2 -2
  70. package/src/model/index.ts +1 -0
  71. package/dist/types/AccountBalance/ChainAccountBalanceServiceV2.d.ts.map +0 -1
  72. package/dist/types/AccountBalance/XyoChainAccountBalanceService.d.ts +0 -24
  73. package/dist/types/AccountBalance/XyoChainAccountBalanceService.d.ts.map +0 -1
  74. package/dist/types/BlockProducer/XyoBlockProducer.d.ts.map +0 -1
  75. package/dist/types/BlockReward/XyoBlockRewardService.d.ts.map +0 -1
  76. package/dist/types/ChainIndexService.d.ts +0 -23
  77. package/dist/types/ChainIndexService.d.ts.map +0 -1
  78. package/dist/types/Election/XyoElectionService.d.ts.map +0 -1
  79. package/dist/types/Params.d.ts.map +0 -1
  80. package/dist/types/PendingTransactions/PendingTransactions.d.ts.map +0 -1
  81. package/dist/types/Staker/Evm/Evm.d.ts.map +0 -1
  82. package/dist/types/Staker/Evm/index.d.ts.map +0 -1
  83. package/dist/types/Staker/Memory/Memory.d.ts.map +0 -1
  84. package/dist/types/Staker/Memory/index.d.ts.map +0 -1
  85. package/dist/types/Staker/index.d.ts.map +0 -1
  86. package/src/AccountBalance/XyoChainAccountBalanceService.ts +0 -86
  87. package/src/ChainIndexService.ts +0 -46
  88. /package/dist/types/{Staker → ChainService}/Evm/index.d.ts +0 -0
  89. /package/dist/types/{Staker → ChainService}/Memory/index.d.ts +0 -0
  90. /package/dist/types/{Staker → ChainService}/index.d.ts +0 -0
  91. /package/dist/types/{Params.d.ts → model/Params.d.ts} +0 -0
  92. /package/src/{Staker → ChainService}/Evm/index.ts +0 -0
  93. /package/src/{Staker → ChainService}/Memory/index.ts +0 -0
  94. /package/src/{Staker → ChainService}/index.ts +0 -0
  95. /package/src/{Params.ts → model/Params.ts} +0 -0
@@ -1,46 +0,0 @@
1
- import { assertEx } from '@xylabs/assert'
2
- import { creatable } from '@xylabs/creatable'
3
- import { Hash, Hex } from '@xylabs/hex'
4
- import { Promisable } from '@xylabs/promise'
5
- import { MemoryArchivist } from '@xyo-network/archivist-memory'
6
- import { ArchivistInstance } from '@xyo-network/archivist-model'
7
- import { HydratedBlock, Service } from '@xyo-network/xl1-protocol'
8
-
9
- import { BaseService } from './BaseService.ts'
10
- import { BaseServiceParams } from './Params.ts'
11
-
12
- export interface ChainIndexServiceParams extends BaseServiceParams {
13
- archivist?: ArchivistInstance
14
- }
15
-
16
- export interface ChainIndexService extends Service {
17
- get(index: bigint): Promisable<HydratedBlock | undefined>
18
- updateHead(head: Hash | null): Promisable<void>
19
- }
20
-
21
- @creatable()
22
- export class XyoChainIndexService extends BaseService<ChainIndexServiceParams> implements ChainIndexService {
23
- private _head: Hash | null = null
24
- private _internalArchivist: ArchivistInstance | undefined
25
-
26
- protected get externalArchivist() {
27
- return this.params.archivist
28
- }
29
-
30
- protected get internalArchivist() {
31
- return assertEx(this._internalArchivist, () => 'No internal archivist')
32
- }
33
-
34
- override async createHandler() {
35
- this._internalArchivist = await MemoryArchivist.create({ account: 'random' })
36
- }
37
-
38
- get(index: bigint | Hex): Promisable<HydratedBlock | undefined> {
39
- const _resolvedIndex = typeof index === 'bigint' ? index : BigInt(index)
40
- return undefined
41
- }
42
-
43
- updateHead(_head: Hash | null): Promisable<void> {
44
- throw new Error('Method not implemented.')
45
- }
46
- }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes