@xyo-network/chain-services 1.15.2 → 1.15.3
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/README.md +5302 -2235
- package/dist/neutral/AccountBalance/BaseAccountBalanceService.d.ts +3 -5
- package/dist/neutral/AccountBalance/BaseAccountBalanceService.d.ts.map +1 -1
- package/dist/neutral/AccountBalance/accountBalanceServiceFromArchivist.d.ts +3 -2
- package/dist/neutral/AccountBalance/accountBalanceServiceFromArchivist.d.ts.map +1 -1
- package/dist/neutral/AccountTransfers/BaseAccountTransfersService.d.ts +3 -6
- package/dist/neutral/AccountTransfers/BaseAccountTransfersService.d.ts.map +1 -1
- package/dist/neutral/AccountTransfers/accountTransfersServiceFromArchivist.d.ts +3 -3
- package/dist/neutral/AccountTransfers/accountTransfersServiceFromArchivist.d.ts.map +1 -1
- package/dist/neutral/BlockProducer/spec/BaseBlockProducerService.spec.d.ts.map +1 -1
- package/dist/neutral/ChainBlockNumberIteration/ChainBlockNumberIterationService.d.ts +3 -3
- package/dist/neutral/ChainBlockNumberIteration/ChainBlockNumberIterationService.d.ts.map +1 -1
- package/dist/neutral/ChainBlockNumberIteration/model/Params.d.ts +3 -2
- package/dist/neutral/ChainBlockNumberIteration/model/Params.d.ts.map +1 -1
- package/dist/neutral/ChainValidator/XyoValidator.d.ts +2 -2
- package/dist/neutral/ChainValidator/XyoValidator.d.ts.map +1 -1
- package/dist/neutral/NetworkStakeStepReward/BaseNetworkStakeStepRewardService.d.ts +14 -13
- package/dist/neutral/NetworkStakeStepReward/BaseNetworkStakeStepRewardService.d.ts.map +1 -1
- package/dist/neutral/PendingTransactions/BasePendingTransactions.d.ts +2 -2
- package/dist/neutral/PendingTransactions/BasePendingTransactions.d.ts.map +1 -1
- package/dist/neutral/StakeIntent/XyoStakeIntentService.d.ts.map +1 -1
- package/dist/neutral/index.mjs +102 -144
- package/dist/neutral/index.mjs.map +1 -1
- package/package.json +40 -40
- package/src/AccountBalance/BaseAccountBalanceService.ts +6 -8
- package/src/AccountBalance/accountBalanceServiceFromArchivist.ts +18 -33
- package/src/AccountTransfers/BaseAccountTransfersService.ts +4 -12
- package/src/AccountTransfers/accountTransfersServiceFromArchivist.ts +18 -35
- package/src/BlockProducer/spec/BaseBlockProducerService.spec.ts +62 -8
- package/src/ChainBlockNumberIteration/ChainBlockNumberIterationService.ts +11 -11
- package/src/ChainBlockNumberIteration/model/Params.ts +3 -2
- package/src/ChainValidator/XyoValidator.ts +2 -2
- package/src/NetworkStakeStepReward/BaseNetworkStakeStepRewardService.ts +20 -14
- package/src/PendingTransactions/BasePendingTransactions.ts +2 -2
- package/src/StakeIntent/XyoStakeIntentService.ts +3 -1
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
Payload, PayloadBundle, Sequence, WithStorageMeta,
|
|
14
14
|
} from '@xyo-network/payload-model'
|
|
15
15
|
import {
|
|
16
|
-
asBlockBoundWitnessWithHashStorageMeta,
|
|
16
|
+
asBlockBoundWitnessWithHashStorageMeta, ChainId, isTransactionBoundWitnessWithStorageMeta, PendingTransactionsService,
|
|
17
17
|
SignedHydratedTransactionWithStorageMeta,
|
|
18
18
|
} from '@xyo-network/xl1-protocol'
|
|
19
19
|
import { TransactionJsonSchemaValidator, validateTransaction } from '@xyo-network/xl1-validation'
|
|
@@ -26,7 +26,7 @@ import { hydratedTransactionToPayloadBundle } from './hydratedTransactionToPaylo
|
|
|
26
26
|
|
|
27
27
|
export interface BasePendingTransactionsServiceParams extends BaseServiceParams {
|
|
28
28
|
chainArchivist?: ArchivistInstance
|
|
29
|
-
chainId?:
|
|
29
|
+
chainId?: ChainId
|
|
30
30
|
pendingBundledTransactionsArchivist?: ArchivistInstance
|
|
31
31
|
rejectedTransactionsArchivist?: ArchivistInstance
|
|
32
32
|
}
|
|
@@ -25,6 +25,7 @@ import {
|
|
|
25
25
|
isChainIndexingServiceState,
|
|
26
26
|
StakeIntentService,
|
|
27
27
|
} from '@xyo-network/xl1-protocol'
|
|
28
|
+
import { readPayloadMapFromStore } from '@xyo-network/xl1-protocol-sdk'
|
|
28
29
|
import { Mutex } from 'async-mutex'
|
|
29
30
|
import { LRUCache } from 'lru-cache'
|
|
30
31
|
|
|
@@ -206,7 +207,8 @@ export class XyoStakeIntentService extends BaseService<XyoStakeIntentServicePara
|
|
|
206
207
|
const currentHead = await this.chainIterator.head()
|
|
207
208
|
if (isUndefined(currentHead)) return
|
|
208
209
|
const currentHeadHash = await PayloadBuilder.hash(currentHead)
|
|
209
|
-
const
|
|
210
|
+
const chainMap = readPayloadMapFromStore<WithStorageMeta<Payload>>(this.chainArchivist)
|
|
211
|
+
const result = await analyzeChain({ chainMap }, [new ChainStakeIntentAnalyzer('producer')], currentHeadHash, this._lastIndexedBlockHash)
|
|
210
212
|
const signedDeclarations = filterAs(result.find(isChainSummaryStakeIntent)?.intents ?? [], asChainStakeIntent)
|
|
211
213
|
if (currentHead.block === undefined) return
|
|
212
214
|
const currentHeadBlockNum = currentHead.block
|