@xyo-network/chain-services 1.16.25 → 1.17.0
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/AccountBalance/BaseAccountBalanceService.d.ts +2 -3
- package/dist/neutral/AccountBalance/BaseAccountBalanceService.d.ts.map +1 -1
- package/dist/neutral/AccountBalance/accountBalanceServiceFromArchivist.d.ts.map +1 -1
- package/dist/neutral/BlockProducer/BaseBlockProducerService.d.ts +4 -4
- package/dist/neutral/BlockProducer/BaseBlockProducerService.d.ts.map +1 -1
- package/dist/neutral/ChainBlockNumberIteration/ChainBlockNumberIterationService.d.ts +20 -10
- package/dist/neutral/ChainBlockNumberIteration/ChainBlockNumberIterationService.d.ts.map +1 -1
- package/dist/neutral/ChainService/Evm/Evm.d.ts +4 -4
- package/dist/neutral/ChainService/Evm/Evm.d.ts.map +1 -1
- package/dist/neutral/ChainService/Memory/Memory.d.ts +4 -4
- package/dist/neutral/ChainService/Memory/Memory.d.ts.map +1 -1
- package/dist/neutral/ChainValidator/XyoValidator.d.ts +4 -4
- package/dist/neutral/ChainValidator/XyoValidator.d.ts.map +1 -1
- package/dist/neutral/Election/BaseElectionService.d.ts +3 -3
- package/dist/neutral/Election/BaseElectionService.d.ts.map +1 -1
- package/dist/neutral/PendingTransactions/BasePendingTransactions.d.ts +3 -4
- package/dist/neutral/PendingTransactions/BasePendingTransactions.d.ts.map +1 -1
- package/dist/neutral/StakeIntent/XyoStakeIntentService.d.ts +3 -3
- package/dist/neutral/StakeIntent/XyoStakeIntentService.d.ts.map +1 -1
- package/dist/neutral/Time/BaseTimeSyncService.d.ts +3 -6
- package/dist/neutral/Time/BaseTimeSyncService.d.ts.map +1 -1
- package/dist/neutral/blockViewerFromChainIteratorAndArchivist.d.ts.map +1 -1
- package/dist/neutral/index.mjs +115 -67
- package/dist/neutral/index.mjs.map +1 -1
- package/package.json +16 -16
- package/src/AccountBalance/BaseAccountBalanceService.ts +2 -4
- package/src/AccountBalance/accountBalanceServiceFromArchivist.ts +3 -2
- package/src/BlockProducer/BaseBlockProducerService.ts +5 -5
- package/src/ChainBlockNumberIteration/ChainBlockNumberIterationService.ts +61 -5
- package/src/ChainService/Evm/Evm.ts +34 -32
- package/src/ChainService/Memory/Memory.ts +9 -7
- package/src/ChainValidator/XyoValidator.ts +6 -6
- package/src/Election/BaseElectionService.ts +5 -4
- package/src/PendingTransactions/BasePendingTransactions.ts +6 -5
- package/src/StakeIntent/XyoStakeIntentService.ts +9 -13
- package/src/Time/BaseTimeSyncService.ts +6 -16
- package/src/blockViewerFromChainIteratorAndArchivist.ts +12 -0
|
@@ -44,6 +44,18 @@ export function blockViewerFromChainIteratorAndArchivist(
|
|
|
44
44
|
}
|
|
45
45
|
return results
|
|
46
46
|
},
|
|
47
|
+
blocksByNumber: async function (number: XL1BlockNumber, limit = 10): Promise<SignedHydratedBlockWithHashMeta[]> {
|
|
48
|
+
const results: SignedHydratedBlockWithHashMeta[] = []
|
|
49
|
+
for (let i = 0; i < limit; i++) {
|
|
50
|
+
const block = await this.blockByNumber(number)
|
|
51
|
+
if (block) {
|
|
52
|
+
results.push(block)
|
|
53
|
+
} else {
|
|
54
|
+
break
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return results
|
|
58
|
+
},
|
|
47
59
|
currentBlock: async function (): Promise<SignedHydratedBlockWithHashMeta> {
|
|
48
60
|
const head = await chainIterator.head()
|
|
49
61
|
return this.blockByHash(head._hash) as Promise<SignedHydratedBlockWithHashMeta>
|