@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.
- package/dist/neutral/index.mjs +273 -361
- package/dist/neutral/index.mjs.map +1 -1
- package/dist/types/AccountBalance/{ChainAccountBalanceServiceV2.d.ts → BaseAccountBalanceService.d.ts} +4 -4
- package/dist/types/AccountBalance/BaseAccountBalanceService.d.ts.map +1 -0
- package/dist/types/AccountBalance/accountBalanceServiceFromArchivist.d.ts +4 -4
- package/dist/types/AccountBalance/accountBalanceServiceFromArchivist.d.ts.map +1 -1
- package/dist/types/AccountBalance/index.d.ts +1 -2
- package/dist/types/AccountBalance/index.d.ts.map +1 -1
- package/dist/types/BaseService.d.ts +1 -1
- package/dist/types/BaseService.d.ts.map +1 -1
- package/dist/types/BlockProducer/{XyoBlockProducer.d.ts → BaseBlockProducerService.d.ts} +4 -4
- package/dist/types/BlockProducer/BaseBlockProducerService.d.ts.map +1 -0
- package/dist/types/BlockProducer/index.d.ts +1 -1
- package/dist/types/BlockProducer/index.d.ts.map +1 -1
- package/dist/types/BlockReward/BaseBlockRewardService.d.ts +10 -0
- package/dist/types/BlockReward/BaseBlockRewardService.d.ts.map +1 -0
- package/dist/types/BlockReward/EvmBlockRewardService.d.ts +5 -4
- package/dist/types/BlockReward/EvmBlockRewardService.d.ts.map +1 -1
- package/dist/types/BlockReward/{XyoBlockRewardService.d.ts → MemoryBlockRewardService.d.ts} +5 -6
- package/dist/types/BlockReward/MemoryBlockRewardService.d.ts.map +1 -0
- package/dist/types/BlockReward/index.d.ts +2 -1
- package/dist/types/BlockReward/index.d.ts.map +1 -1
- package/dist/types/ChainBlockNumberIteration/model/Params.d.ts +1 -1
- package/dist/types/ChainBlockNumberIteration/model/Params.d.ts.map +1 -1
- package/dist/types/{Staker → ChainService}/Evm/Evm.d.ts +1 -1
- package/dist/types/ChainService/Evm/Evm.d.ts.map +1 -0
- package/dist/types/ChainService/Evm/index.d.ts.map +1 -0
- package/dist/types/{Staker → ChainService}/Memory/Memory.d.ts +1 -1
- package/dist/types/ChainService/Memory/Memory.d.ts.map +1 -0
- package/dist/types/ChainService/Memory/index.d.ts.map +1 -0
- package/dist/types/ChainService/index.d.ts.map +1 -0
- package/dist/types/ChainValidator/XyoValidator.d.ts +1 -1
- package/dist/types/ChainValidator/XyoValidator.d.ts.map +1 -1
- package/dist/types/Election/{XyoElectionService.d.ts → BaseElectionService.d.ts} +4 -4
- package/dist/types/Election/BaseElectionService.d.ts.map +1 -0
- package/dist/types/Election/index.d.ts +1 -1
- package/dist/types/Election/index.d.ts.map +1 -1
- package/dist/types/PendingTransactions/{PendingTransactions.d.ts → BasePendingTransactions.d.ts} +4 -4
- package/dist/types/PendingTransactions/BasePendingTransactions.d.ts.map +1 -0
- package/dist/types/PendingTransactions/index.d.ts +1 -1
- package/dist/types/PendingTransactions/index.d.ts.map +1 -1
- package/dist/types/StakeIntent/XyoStakeIntentService.d.ts +1 -1
- package/dist/types/StakeIntent/XyoStakeIntentService.d.ts.map +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/model/Params.d.ts.map +1 -0
- package/dist/types/model/index.d.ts +2 -0
- package/dist/types/model/index.d.ts.map +1 -0
- package/package.json +39 -40
- package/src/AccountBalance/{ChainAccountBalanceServiceV2.ts → BaseAccountBalanceService.ts} +3 -3
- package/src/AccountBalance/accountBalanceServiceFromArchivist.ts +8 -50
- package/src/AccountBalance/index.ts +1 -2
- package/src/BaseService.ts +1 -1
- package/src/BlockProducer/{XyoBlockProducer.ts → BaseBlockProducerService.ts} +7 -7
- package/src/BlockProducer/index.ts +1 -1
- package/src/BlockReward/BaseBlockRewardService.ts +16 -0
- package/src/BlockReward/EvmBlockRewardService.ts +6 -5
- package/src/BlockReward/{XyoBlockRewardService.ts → MemoryBlockRewardService.ts} +6 -6
- package/src/BlockReward/index.ts +2 -1
- package/src/ChainBlockNumberIteration/model/Params.ts +1 -1
- package/src/{Staker → ChainService}/Evm/Evm.ts +1 -1
- package/src/{Staker → ChainService}/Memory/Memory.ts +1 -1
- package/src/ChainValidator/XyoValidator.ts +1 -1
- package/src/Election/{XyoElectionService.ts → BaseElectionService.ts} +3 -3
- package/src/Election/index.ts +1 -1
- package/src/PendingTransactions/{PendingTransactions.ts → BasePendingTransactions.ts} +8 -8
- package/src/PendingTransactions/index.ts +1 -1
- package/src/StakeIntent/XyoStakeIntentService.ts +1 -1
- package/src/index.ts +2 -2
- package/src/model/index.ts +1 -0
- package/dist/types/AccountBalance/ChainAccountBalanceServiceV2.d.ts.map +0 -1
- package/dist/types/AccountBalance/XyoChainAccountBalanceService.d.ts +0 -24
- package/dist/types/AccountBalance/XyoChainAccountBalanceService.d.ts.map +0 -1
- package/dist/types/BlockProducer/XyoBlockProducer.d.ts.map +0 -1
- package/dist/types/BlockReward/XyoBlockRewardService.d.ts.map +0 -1
- package/dist/types/ChainIndexService.d.ts +0 -23
- package/dist/types/ChainIndexService.d.ts.map +0 -1
- package/dist/types/Election/XyoElectionService.d.ts.map +0 -1
- package/dist/types/Params.d.ts.map +0 -1
- package/dist/types/PendingTransactions/PendingTransactions.d.ts.map +0 -1
- package/dist/types/Staker/Evm/Evm.d.ts.map +0 -1
- package/dist/types/Staker/Evm/index.d.ts.map +0 -1
- package/dist/types/Staker/Memory/Memory.d.ts.map +0 -1
- package/dist/types/Staker/Memory/index.d.ts.map +0 -1
- package/dist/types/Staker/index.d.ts.map +0 -1
- package/src/AccountBalance/XyoChainAccountBalanceService.ts +0 -86
- package/src/ChainIndexService.ts +0 -46
- /package/dist/types/{Staker → ChainService}/Evm/index.d.ts +0 -0
- /package/dist/types/{Staker → ChainService}/Memory/index.d.ts +0 -0
- /package/dist/types/{Staker → ChainService}/index.d.ts +0 -0
- /package/dist/types/{Params.d.ts → model/Params.d.ts} +0 -0
- /package/src/{Staker → ChainService}/Evm/index.ts +0 -0
- /package/src/{Staker → ChainService}/Memory/index.ts +0 -0
- /package/src/{Staker → ChainService}/index.ts +0 -0
- /package/src/{Params.ts → model/Params.ts} +0 -0
package/src/ChainIndexService.ts
DELETED
|
@@ -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
|
|
File without changes
|
|
File without changes
|