@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.
Files changed (35) hide show
  1. package/README.md +5302 -2235
  2. package/dist/neutral/AccountBalance/BaseAccountBalanceService.d.ts +3 -5
  3. package/dist/neutral/AccountBalance/BaseAccountBalanceService.d.ts.map +1 -1
  4. package/dist/neutral/AccountBalance/accountBalanceServiceFromArchivist.d.ts +3 -2
  5. package/dist/neutral/AccountBalance/accountBalanceServiceFromArchivist.d.ts.map +1 -1
  6. package/dist/neutral/AccountTransfers/BaseAccountTransfersService.d.ts +3 -6
  7. package/dist/neutral/AccountTransfers/BaseAccountTransfersService.d.ts.map +1 -1
  8. package/dist/neutral/AccountTransfers/accountTransfersServiceFromArchivist.d.ts +3 -3
  9. package/dist/neutral/AccountTransfers/accountTransfersServiceFromArchivist.d.ts.map +1 -1
  10. package/dist/neutral/BlockProducer/spec/BaseBlockProducerService.spec.d.ts.map +1 -1
  11. package/dist/neutral/ChainBlockNumberIteration/ChainBlockNumberIterationService.d.ts +3 -3
  12. package/dist/neutral/ChainBlockNumberIteration/ChainBlockNumberIterationService.d.ts.map +1 -1
  13. package/dist/neutral/ChainBlockNumberIteration/model/Params.d.ts +3 -2
  14. package/dist/neutral/ChainBlockNumberIteration/model/Params.d.ts.map +1 -1
  15. package/dist/neutral/ChainValidator/XyoValidator.d.ts +2 -2
  16. package/dist/neutral/ChainValidator/XyoValidator.d.ts.map +1 -1
  17. package/dist/neutral/NetworkStakeStepReward/BaseNetworkStakeStepRewardService.d.ts +14 -13
  18. package/dist/neutral/NetworkStakeStepReward/BaseNetworkStakeStepRewardService.d.ts.map +1 -1
  19. package/dist/neutral/PendingTransactions/BasePendingTransactions.d.ts +2 -2
  20. package/dist/neutral/PendingTransactions/BasePendingTransactions.d.ts.map +1 -1
  21. package/dist/neutral/StakeIntent/XyoStakeIntentService.d.ts.map +1 -1
  22. package/dist/neutral/index.mjs +102 -144
  23. package/dist/neutral/index.mjs.map +1 -1
  24. package/package.json +40 -40
  25. package/src/AccountBalance/BaseAccountBalanceService.ts +6 -8
  26. package/src/AccountBalance/accountBalanceServiceFromArchivist.ts +18 -33
  27. package/src/AccountTransfers/BaseAccountTransfersService.ts +4 -12
  28. package/src/AccountTransfers/accountTransfersServiceFromArchivist.ts +18 -35
  29. package/src/BlockProducer/spec/BaseBlockProducerService.spec.ts +62 -8
  30. package/src/ChainBlockNumberIteration/ChainBlockNumberIterationService.ts +11 -11
  31. package/src/ChainBlockNumberIteration/model/Params.ts +3 -2
  32. package/src/ChainValidator/XyoValidator.ts +2 -2
  33. package/src/NetworkStakeStepReward/BaseNetworkStakeStepRewardService.ts +20 -14
  34. package/src/PendingTransactions/BasePendingTransactions.ts +2 -2
  35. 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, Chain, isTransactionBoundWitnessWithStorageMeta, PendingTransactionsService,
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?: Chain
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 result = await analyzeChain(this.chainArchivist, [new ChainStakeIntentAnalyzer('producer')], currentHeadHash, this._lastIndexedBlockHash)
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