@xyo-network/xl1-protocol-sdk 1.15.28 → 1.16.1
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/ChainServiceCollectionV2.d.ts +1 -1
- package/dist/neutral/ChainServiceCollectionV2.d.ts.map +1 -1
- package/dist/neutral/block/primitives/transfers/transfersStepSummaryFromRange.d.ts.map +1 -1
- package/dist/neutral/block/primitives/transfers/transfersSummary.d.ts +3 -2
- package/dist/neutral/block/primitives/transfers/transfersSummary.d.ts.map +1 -1
- package/dist/neutral/config/Config.d.ts +6 -0
- package/dist/neutral/config/Config.d.ts.map +1 -1
- package/dist/neutral/config/Mempool.d.ts +9 -0
- package/dist/neutral/config/Mempool.d.ts.map +1 -0
- package/dist/neutral/index.d.ts +3 -0
- package/dist/neutral/index.d.ts.map +1 -1
- package/dist/neutral/index.mjs +239 -126
- package/dist/neutral/index.mjs.map +1 -1
- package/dist/neutral/interfaces/index.d.ts +2 -0
- package/dist/neutral/interfaces/index.d.ts.map +1 -0
- package/dist/neutral/interfaces/viewers/AccountBalance.d.ts +19 -0
- package/dist/neutral/interfaces/viewers/AccountBalance.d.ts.map +1 -0
- package/dist/neutral/interfaces/viewers/Block.d.ts +12 -0
- package/dist/neutral/interfaces/viewers/Block.d.ts.map +1 -0
- package/dist/neutral/interfaces/viewers/Chain.d.ts +6 -0
- package/dist/neutral/interfaces/viewers/Chain.d.ts.map +1 -0
- package/dist/neutral/interfaces/viewers/ChainContract.d.ts +10 -0
- package/dist/neutral/interfaces/viewers/ChainContract.d.ts.map +1 -0
- package/dist/neutral/interfaces/viewers/Fork.d.ts +8 -0
- package/dist/neutral/interfaces/viewers/Fork.d.ts.map +1 -0
- package/dist/neutral/interfaces/viewers/NetworkStakeStepReward.d.ts +30 -0
- package/dist/neutral/interfaces/viewers/NetworkStakeStepReward.d.ts.map +1 -0
- package/dist/neutral/interfaces/viewers/Stake.d.ts +14 -0
- package/dist/neutral/interfaces/viewers/Stake.d.ts.map +1 -0
- package/dist/neutral/interfaces/viewers/StakeTotalsViewer.d.ts +12 -0
- package/dist/neutral/interfaces/viewers/StakeTotalsViewer.d.ts.map +1 -0
- package/dist/neutral/interfaces/viewers/StakeViewer.d.ts +11 -0
- package/dist/neutral/interfaces/viewers/StakeViewer.d.ts.map +1 -0
- package/dist/neutral/interfaces/viewers/StepStake.d.ts +8 -0
- package/dist/neutral/interfaces/viewers/StepStake.d.ts.map +1 -0
- package/dist/neutral/interfaces/viewers/TimeSync.d.ts +16 -0
- package/dist/neutral/interfaces/viewers/TimeSync.d.ts.map +1 -0
- package/dist/neutral/interfaces/viewers/Transaction.d.ts +9 -0
- package/dist/neutral/interfaces/viewers/Transaction.d.ts.map +1 -0
- package/dist/neutral/interfaces/viewers/TransferBalance.d.ts +23 -0
- package/dist/neutral/interfaces/viewers/TransferBalance.d.ts.map +1 -0
- package/dist/neutral/interfaces/viewers/index.d.ts +14 -0
- package/dist/neutral/interfaces/viewers/index.d.ts.map +1 -0
- package/dist/neutral/model/ChainStake/ChainStakeRead.d.ts +1 -1
- package/dist/neutral/model/ChainStake/ChainStakeRead.d.ts.map +1 -1
- package/dist/neutral/model/RecordKeyType.d.ts +2 -0
- package/dist/neutral/model/RecordKeyType.d.ts.map +1 -0
- package/dist/neutral/model/index.d.ts +1 -0
- package/dist/neutral/model/index.d.ts.map +1 -1
- package/dist/neutral/model/summary.d.ts +2 -2
- package/dist/neutral/model/summary.d.ts.map +1 -1
- package/dist/neutral/provider/DataLake.d.ts +11 -0
- package/dist/neutral/provider/DataLake.d.ts.map +1 -0
- package/dist/neutral/provider/TransactionHelper.d.ts +8 -0
- package/dist/neutral/provider/TransactionHelper.d.ts.map +1 -0
- package/dist/neutral/provider/TransactionSubmitter.d.ts +18 -0
- package/dist/neutral/provider/TransactionSubmitter.d.ts.map +1 -0
- package/dist/neutral/provider/XyoClient.d.ts +19 -0
- package/dist/neutral/provider/XyoClient.d.ts.map +1 -0
- package/dist/neutral/provider/XyoConnection.d.ts +34 -0
- package/dist/neutral/provider/XyoConnection.d.ts.map +1 -0
- package/dist/neutral/provider/XyoGateway.d.ts +19 -0
- package/dist/neutral/provider/XyoGateway.d.ts.map +1 -0
- package/dist/neutral/provider/XyoGatewayHelpers.d.ts +16 -0
- package/dist/neutral/provider/XyoGatewayHelpers.d.ts.map +1 -0
- package/dist/neutral/provider/XyoNetwork.d.ts +6 -0
- package/dist/neutral/provider/XyoNetwork.d.ts.map +1 -0
- package/dist/neutral/provider/XyoRunner.d.ts +7 -0
- package/dist/neutral/provider/XyoRunner.d.ts.map +1 -0
- package/dist/neutral/provider/XyoSigner.d.ts +14 -0
- package/dist/neutral/provider/XyoSigner.d.ts.map +1 -0
- package/dist/neutral/provider/XyoWallet.d.ts +15 -0
- package/dist/neutral/provider/XyoWallet.d.ts.map +1 -0
- package/dist/neutral/provider/index.d.ts +13 -0
- package/dist/neutral/provider/index.d.ts.map +1 -0
- package/dist/neutral/provider/permissions/InvokerPermission.d.ts +51 -0
- package/dist/neutral/provider/permissions/InvokerPermission.d.ts.map +1 -0
- package/dist/neutral/provider/permissions/XyoPermissions.d.ts +32 -0
- package/dist/neutral/provider/permissions/XyoPermissions.d.ts.map +1 -0
- package/dist/neutral/provider/permissions/index.d.ts +3 -0
- package/dist/neutral/provider/permissions/index.d.ts.map +1 -0
- package/dist/neutral/provider/viewer/NetworkStake/NetworkStakeViewer.d.ts +10 -0
- package/dist/neutral/provider/viewer/NetworkStake/NetworkStakeViewer.d.ts.map +1 -0
- package/dist/neutral/provider/viewer/NetworkStake/Rewards/ByPositionViewer.d.ts +7 -0
- package/dist/neutral/provider/viewer/NetworkStake/Rewards/ByPositionViewer.d.ts.map +1 -0
- package/dist/neutral/provider/viewer/NetworkStake/Rewards/ByStakerViewer.d.ts +8 -0
- package/dist/neutral/provider/viewer/NetworkStake/Rewards/ByStakerViewer.d.ts.map +1 -0
- package/dist/neutral/provider/viewer/NetworkStake/Rewards/ByStepViewer.d.ts +8 -0
- package/dist/neutral/provider/viewer/NetworkStake/Rewards/ByStepViewer.d.ts.map +1 -0
- package/dist/neutral/provider/viewer/NetworkStake/Rewards/Options.d.ts +15 -0
- package/dist/neutral/provider/viewer/NetworkStake/Rewards/Options.d.ts.map +1 -0
- package/dist/neutral/provider/viewer/NetworkStake/Rewards/TotalViewer.d.ts +8 -0
- package/dist/neutral/provider/viewer/NetworkStake/Rewards/TotalViewer.d.ts.map +1 -0
- package/dist/neutral/provider/viewer/NetworkStake/Rewards/Viewer.d.ts +13 -0
- package/dist/neutral/provider/viewer/NetworkStake/Rewards/Viewer.d.ts.map +1 -0
- package/dist/neutral/provider/viewer/NetworkStake/Rewards/index.d.ts +8 -0
- package/dist/neutral/provider/viewer/NetworkStake/Rewards/index.d.ts.map +1 -0
- package/dist/neutral/provider/viewer/NetworkStake/Rewards/templates/ByIndexMethodsTemplate.d.ts +6 -0
- package/dist/neutral/provider/viewer/NetworkStake/Rewards/templates/ByIndexMethodsTemplate.d.ts.map +1 -0
- package/dist/neutral/provider/viewer/NetworkStake/Rewards/templates/MethodsTemplate.d.ts +9 -0
- package/dist/neutral/provider/viewer/NetworkStake/Rewards/templates/MethodsTemplate.d.ts.map +1 -0
- package/dist/neutral/provider/viewer/NetworkStake/Rewards/templates/index.d.ts +3 -0
- package/dist/neutral/provider/viewer/NetworkStake/Rewards/templates/index.d.ts.map +1 -0
- package/dist/neutral/provider/viewer/NetworkStake/index.d.ts +3 -0
- package/dist/neutral/provider/viewer/NetworkStake/index.d.ts.map +1 -0
- package/dist/neutral/provider/viewer/StepViewer.d.ts +30 -0
- package/dist/neutral/provider/viewer/StepViewer.d.ts.map +1 -0
- package/dist/neutral/provider/viewer/XyoViewer.d.ts +10 -0
- package/dist/neutral/provider/viewer/XyoViewer.d.ts.map +1 -0
- package/dist/neutral/provider/viewer/index.d.ts +4 -0
- package/dist/neutral/provider/viewer/index.d.ts.map +1 -0
- package/dist/neutral/services/AccountBalanceService.d.ts +16 -0
- package/dist/neutral/services/AccountBalanceService.d.ts.map +1 -0
- package/dist/neutral/services/AccountTransfersService.d.ts +11 -0
- package/dist/neutral/services/AccountTransfersService.d.ts.map +1 -0
- package/dist/neutral/services/BlockProducerService.d.ts +6 -0
- package/dist/neutral/services/BlockProducerService.d.ts.map +1 -0
- package/dist/neutral/services/BlockRewardService.d.ts +6 -0
- package/dist/neutral/services/BlockRewardService.d.ts.map +1 -0
- package/dist/neutral/services/BlockRewardServiceV2.d.ts +6 -0
- package/dist/neutral/services/BlockRewardServiceV2.d.ts.map +1 -0
- package/dist/neutral/services/Chain/BaseChainService.d.ts +6 -0
- package/dist/neutral/services/Chain/BaseChainService.d.ts.map +1 -0
- package/dist/neutral/services/Chain/ChainHeadService.d.ts +6 -0
- package/dist/neutral/services/Chain/ChainHeadService.d.ts.map +1 -0
- package/dist/neutral/services/Chain/ChainService.d.ts +5 -0
- package/dist/neutral/services/Chain/ChainService.d.ts.map +1 -0
- package/dist/neutral/services/Chain/index.d.ts +5 -0
- package/dist/neutral/services/Chain/index.d.ts.map +1 -0
- package/dist/neutral/services/Chain/interfaces/ChainContractViewer.d.ts +4 -0
- package/dist/neutral/services/Chain/interfaces/ChainContractViewer.d.ts.map +1 -0
- package/dist/neutral/services/Chain/interfaces/ChainStakeViewer.d.ts +5 -0
- package/dist/neutral/services/Chain/interfaces/ChainStakeViewer.d.ts.map +1 -0
- package/dist/neutral/services/Chain/interfaces/ChainStaker.d.ts +6 -0
- package/dist/neutral/services/Chain/interfaces/ChainStaker.d.ts.map +1 -0
- package/dist/neutral/services/Chain/interfaces/index.d.ts +4 -0
- package/dist/neutral/services/Chain/interfaces/index.d.ts.map +1 -0
- package/dist/neutral/services/ChainIterator/ChainIteratorService.d.ts +23 -0
- package/dist/neutral/services/ChainIterator/ChainIteratorService.d.ts.map +1 -0
- package/dist/neutral/services/ChainIterator/ChainIteratorServiceEventData.d.ts +11 -0
- package/dist/neutral/services/ChainIterator/ChainIteratorServiceEventData.d.ts.map +1 -0
- package/dist/neutral/services/ChainIterator/index.d.ts +3 -0
- package/dist/neutral/services/ChainIterator/index.d.ts.map +1 -0
- package/dist/neutral/services/Election.d.ts +12 -0
- package/dist/neutral/services/Election.d.ts.map +1 -0
- package/dist/neutral/services/NetworkStakeService.d.ts +5 -0
- package/dist/neutral/services/NetworkStakeService.d.ts.map +1 -0
- package/dist/neutral/services/Params.d.ts +9 -0
- package/dist/neutral/services/Params.d.ts.map +1 -0
- package/dist/neutral/services/PendingTransactionsService.d.ts +7 -0
- package/dist/neutral/services/PendingTransactionsService.d.ts.map +1 -0
- package/dist/neutral/services/Service.d.ts +5 -0
- package/dist/neutral/services/Service.d.ts.map +1 -0
- package/dist/neutral/services/StakeIntentService/ChainIndexingServiceStateSchema.d.ts +32 -0
- package/dist/neutral/services/StakeIntentService/ChainIndexingServiceStateSchema.d.ts.map +1 -0
- package/dist/neutral/services/StakeIntentService/StakeIntentService.d.ts +31 -0
- package/dist/neutral/services/StakeIntentService/StakeIntentService.d.ts.map +1 -0
- package/dist/neutral/services/StakeIntentService/index.d.ts +3 -0
- package/dist/neutral/services/StakeIntentService/index.d.ts.map +1 -0
- package/dist/neutral/services/StepStakeService.d.ts +5 -0
- package/dist/neutral/services/StepStakeService.d.ts.map +1 -0
- package/dist/neutral/services/TimeSyncService.d.ts +7 -0
- package/dist/neutral/services/TimeSyncService.d.ts.map +1 -0
- package/dist/neutral/services/index.d.ts +15 -0
- package/dist/neutral/services/index.d.ts.map +1 -0
- package/dist/neutral/transaction/confirmSubmittedTransaction.d.ts +2 -1
- package/dist/neutral/transaction/confirmSubmittedTransaction.d.ts.map +1 -1
- package/dist/neutral/validation/block/BlockValidationFunction.d.ts +5 -0
- package/dist/neutral/validation/block/BlockValidationFunction.d.ts.map +1 -0
- package/dist/neutral/validation/block/HydratedBlockStateValidationFunction.d.ts +18 -0
- package/dist/neutral/validation/block/HydratedBlockStateValidationFunction.d.ts.map +1 -0
- package/dist/neutral/validation/block/HydratedBlockValidationFunction.d.ts +11 -0
- package/dist/neutral/validation/block/HydratedBlockValidationFunction.d.ts.map +1 -0
- package/dist/neutral/validation/block/error.d.ts +15 -0
- package/dist/neutral/validation/block/error.d.ts.map +1 -0
- package/dist/neutral/validation/block/error.spec.d.ts +2 -0
- package/dist/neutral/validation/block/error.spec.d.ts.map +1 -0
- package/dist/neutral/validation/block/index.d.ts +5 -0
- package/dist/neutral/validation/block/index.d.ts.map +1 -0
- package/dist/neutral/validation/index.d.ts +1 -0
- package/dist/neutral/validation/index.d.ts.map +1 -1
- package/package.json +28 -25
- package/src/ChainServiceCollectionV2.ts +4 -3
- package/src/block/primitives/frames/spec/calculateFramesFromRange.spec.ts +1 -1
- package/src/block/primitives/transfers/transfersStepSummaryFromRange.ts +7 -4
- package/src/block/primitives/transfers/transfersSummary.ts +11 -7
- package/src/config/Config.ts +2 -0
- package/src/config/Mempool.ts +42 -0
- package/src/index.ts +3 -0
- package/src/interfaces/index.ts +1 -0
- package/src/interfaces/viewers/AccountBalance.ts +25 -0
- package/src/interfaces/viewers/Block.ts +13 -0
- package/src/interfaces/viewers/Chain.ts +6 -0
- package/src/interfaces/viewers/ChainContract.ts +10 -0
- package/src/interfaces/viewers/Fork.ts +9 -0
- package/src/interfaces/viewers/NetworkStakeStepReward.ts +69 -0
- package/src/interfaces/viewers/Stake.ts +22 -0
- package/src/interfaces/viewers/StakeTotalsViewer.ts +12 -0
- package/src/interfaces/viewers/StakeViewer.ts +13 -0
- package/src/interfaces/viewers/StepStake.ts +19 -0
- package/src/interfaces/viewers/TimeSync.ts +19 -0
- package/src/interfaces/viewers/Transaction.ts +9 -0
- package/src/interfaces/viewers/TransferBalance.ts +29 -0
- package/src/interfaces/viewers/index.ts +13 -0
- package/src/model/ChainStake/ChainStakeRead.ts +2 -1
- package/src/model/RecordKeyType.ts +2 -0
- package/src/model/index.ts +1 -0
- package/src/model/summary.ts +3 -2
- package/src/provider/DataLake.ts +14 -0
- package/src/provider/TransactionHelper.ts +14 -0
- package/src/provider/TransactionSubmitter.ts +26 -0
- package/src/provider/XyoClient.ts +21 -0
- package/src/provider/XyoConnection.ts +54 -0
- package/src/provider/XyoGateway.ts +21 -0
- package/src/provider/XyoGatewayHelpers.ts +30 -0
- package/src/provider/XyoNetwork.ts +6 -0
- package/src/provider/XyoRunner.ts +7 -0
- package/src/provider/XyoSigner.ts +29 -0
- package/src/provider/XyoWallet.ts +15 -0
- package/src/provider/index.ts +12 -0
- package/src/provider/permissions/InvokerPermission.ts +56 -0
- package/src/provider/permissions/XyoPermissions.ts +40 -0
- package/src/provider/permissions/index.ts +2 -0
- package/src/provider/viewer/NetworkStake/NetworkStakeViewer.ts +12 -0
- package/src/provider/viewer/NetworkStake/Rewards/ByPositionViewer.ts +9 -0
- package/src/provider/viewer/NetworkStake/Rewards/ByStakerViewer.ts +10 -0
- package/src/provider/viewer/NetworkStake/Rewards/ByStepViewer.ts +10 -0
- package/src/provider/viewer/NetworkStake/Rewards/Options.ts +18 -0
- package/src/provider/viewer/NetworkStake/Rewards/TotalViewer.ts +9 -0
- package/src/provider/viewer/NetworkStake/Rewards/Viewer.ts +13 -0
- package/src/provider/viewer/NetworkStake/Rewards/index.ts +7 -0
- package/src/provider/viewer/NetworkStake/Rewards/templates/ByIndexMethodsTemplate.ts +7 -0
- package/src/provider/viewer/NetworkStake/Rewards/templates/MethodsTemplate.ts +9 -0
- package/src/provider/viewer/NetworkStake/Rewards/templates/index.ts +2 -0
- package/src/provider/viewer/NetworkStake/index.ts +4 -0
- package/src/provider/viewer/StepViewer.ts +47 -0
- package/src/provider/viewer/XyoViewer.ts +19 -0
- package/src/provider/viewer/index.ts +3 -0
- package/src/services/AccountBalanceService.ts +22 -0
- package/src/services/AccountTransfersService.ts +12 -0
- package/src/services/BlockProducerService.ts +10 -0
- package/src/services/BlockRewardService.ts +8 -0
- package/src/services/BlockRewardServiceV2.ts +8 -0
- package/src/services/Chain/BaseChainService.ts +7 -0
- package/src/services/Chain/ChainHeadService.ts +7 -0
- package/src/services/Chain/ChainService.ts +6 -0
- package/src/services/Chain/index.ts +4 -0
- package/src/services/Chain/interfaces/ChainContractViewer.ts +5 -0
- package/src/services/Chain/interfaces/ChainStakeViewer.ts +6 -0
- package/src/services/Chain/interfaces/ChainStaker.ts +5 -0
- package/src/services/Chain/interfaces/index.ts +3 -0
- package/src/services/ChainIterator/ChainIteratorService.ts +45 -0
- package/src/services/ChainIterator/ChainIteratorServiceEventData.ts +13 -0
- package/src/services/ChainIterator/index.ts +2 -0
- package/src/services/Election.ts +15 -0
- package/src/services/NetworkStakeService.ts +4 -0
- package/src/services/Params.ts +11 -0
- package/src/services/PendingTransactionsService.ts +8 -0
- package/src/services/Service.ts +5 -0
- package/src/services/StakeIntentService/ChainIndexingServiceStateSchema.ts +43 -0
- package/src/services/StakeIntentService/StakeIntentService.ts +36 -0
- package/src/services/StakeIntentService/index.ts +2 -0
- package/src/services/StepStakeService.ts +4 -0
- package/src/services/TimeSyncService.ts +6 -0
- package/src/services/index.ts +14 -0
- package/src/transaction/confirmSubmittedTransaction.ts +3 -3
- package/src/validation/block/BlockValidationFunction.ts +9 -0
- package/src/validation/block/HydratedBlockStateValidationFunction.ts +24 -0
- package/src/validation/block/HydratedBlockValidationFunction.ts +15 -0
- package/src/validation/block/error.spec.ts +20 -0
- package/src/validation/block/error.ts +46 -0
- package/src/validation/block/index.ts +4 -0
- package/src/validation/index.ts +1 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Promisable } from '@xylabs/promise'
|
|
2
|
+
|
|
3
|
+
import type { NetworkStakeStepRewardsViewer } from './Rewards/index.ts'
|
|
4
|
+
|
|
5
|
+
export interface NetworkStakeViewerMethods {
|
|
6
|
+
/** @returns the active stake and the number of active validators [active, block] */
|
|
7
|
+
active(blockNumber?: number): Promisable<[bigint, number]>
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface NetworkStakeViewer extends NetworkStakeViewerMethods {
|
|
11
|
+
stepRewards?: NetworkStakeStepRewardsViewer
|
|
12
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { NetworkStakeStepRewardsByPositionViewerOptions } from './Options.ts'
|
|
2
|
+
import type { NetworkStakeStepRewardsByIndexViewerMethodsTemplate } from './templates/index.ts'
|
|
3
|
+
|
|
4
|
+
// Note: Viewers are client objects that can nest other viewers and ViewerMethods objects consist only of methods that return data.
|
|
5
|
+
|
|
6
|
+
export interface NetworkStakeStepRewardsByPositionViewerMethods extends
|
|
7
|
+
NetworkStakeStepRewardsByIndexViewerMethodsTemplate<NetworkStakeStepRewardsByPositionViewerOptions, number> {}
|
|
8
|
+
|
|
9
|
+
export interface NetworkStakeStepRewardsByPositionViewer extends NetworkStakeStepRewardsByPositionViewerMethods {}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Address } from '@xylabs/hex'
|
|
2
|
+
|
|
3
|
+
import type { NetworkStakeStepRewardsByStakerViewerOptions } from './Options.ts'
|
|
4
|
+
import type { NetworkStakeStepRewardsByIndexViewerMethodsTemplate } from './templates/index.ts'
|
|
5
|
+
|
|
6
|
+
// Note: Viewers are client objects that can nest other viewers and ViewerMethods objects consist only of methods that return data.
|
|
7
|
+
|
|
8
|
+
export interface NetworkStakeStepRewardsByStakerViewerMethods
|
|
9
|
+
extends NetworkStakeStepRewardsByIndexViewerMethodsTemplate<NetworkStakeStepRewardsByStakerViewerOptions, Address> {}
|
|
10
|
+
export interface NetworkStakeStepRewardsByStakerViewer extends NetworkStakeStepRewardsByStakerViewerMethods {}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { StepIdentityString } from '@xyo-network/xl1-protocol'
|
|
2
|
+
|
|
3
|
+
import type { NetworkStakeStepRewardsByStepViewerOptions } from './Options.ts'
|
|
4
|
+
import type { NetworkStakeStepRewardsByIndexViewerMethodsTemplate } from './templates/index.ts'
|
|
5
|
+
|
|
6
|
+
// Note: Viewers are client objects that can nest other viewers and ViewerMethods objects consist only of methods that return data.
|
|
7
|
+
|
|
8
|
+
export interface NetworkStakeStepRewardsByStepViewerMethods extends
|
|
9
|
+
NetworkStakeStepRewardsByIndexViewerMethodsTemplate<NetworkStakeStepRewardsByStepViewerOptions, StepIdentityString> {}
|
|
10
|
+
export interface NetworkStakeStepRewardsByStepViewer extends NetworkStakeStepRewardsByStepViewerMethods {}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Address } from '@xylabs/hex'
|
|
2
|
+
import type { BlockRange, StepIdentity } from '@xyo-network/xl1-protocol'
|
|
3
|
+
|
|
4
|
+
export interface NetworkStakeStepRewardsRangeOptions {
|
|
5
|
+
range?: BlockRange
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface NetworkStakeStepRewardsByStepViewerOptions extends NetworkStakeStepRewardsRangeOptions {
|
|
9
|
+
steps?: StepIdentity[]
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface NetworkStakeStepRewardsByStakerViewerOptions extends NetworkStakeStepRewardsRangeOptions {
|
|
13
|
+
stakers?: Address[]
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface NetworkStakeStepRewardsByPositionViewerOptions extends NetworkStakeStepRewardsRangeOptions {
|
|
17
|
+
positions?: number[]
|
|
18
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { AttoXL1 } from '@xyo-network/xl1-protocol'
|
|
2
|
+
|
|
3
|
+
import type { NetworkStakeStepRewardsRangeOptions } from './Options.ts'
|
|
4
|
+
import type { NetworkStakeStepRewardsViewerMethodsTemplate } from './templates/index.ts'
|
|
5
|
+
|
|
6
|
+
// Note: Viewers are client objects that can nest other viewers and ViewerMethods objects consist only of methods that return data.
|
|
7
|
+
|
|
8
|
+
export interface NetworkStakeStepRewardsTotalViewerMethods extends NetworkStakeStepRewardsViewerMethodsTemplate<NetworkStakeStepRewardsRangeOptions, AttoXL1> {}
|
|
9
|
+
export interface NetworkStakeStepRewardsTotalViewer extends NetworkStakeStepRewardsTotalViewerMethods {}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { NetworkStakeStepRewardsByPositionViewer } from './ByPositionViewer.ts'
|
|
2
|
+
import type { NetworkStakeStepRewardsByStakerViewer } from './ByStakerViewer.ts'
|
|
3
|
+
import type { NetworkStakeStepRewardsByStepViewer } from './ByStepViewer.ts'
|
|
4
|
+
import type { NetworkStakeStepRewardsTotalViewer } from './TotalViewer.ts'
|
|
5
|
+
|
|
6
|
+
export interface NetworkStakeStepRewardsViewerMethods {}
|
|
7
|
+
|
|
8
|
+
export interface NetworkStakeStepRewardsViewer extends NetworkStakeStepRewardsViewerMethods {
|
|
9
|
+
position?: NetworkStakeStepRewardsByPositionViewer
|
|
10
|
+
staker?: NetworkStakeStepRewardsByStakerViewer
|
|
11
|
+
step?: NetworkStakeStepRewardsByStepViewer
|
|
12
|
+
total?: NetworkStakeStepRewardsTotalViewer
|
|
13
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { AttoXL1 } from '@xyo-network/xl1-protocol'
|
|
2
|
+
|
|
3
|
+
import type { RecordKeyType } from '../../../../../model/index.ts'
|
|
4
|
+
import type { NetworkStakeStepRewardsViewerMethodsTemplate } from './MethodsTemplate.ts'
|
|
5
|
+
|
|
6
|
+
export interface NetworkStakeStepRewardsByIndexViewerMethodsTemplate<TOptions, TResultIndex extends RecordKeyType>
|
|
7
|
+
extends NetworkStakeStepRewardsViewerMethodsTemplate<TOptions, Record<TResultIndex, AttoXL1>> {}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Promisable } from '@xylabs/promise'
|
|
2
|
+
|
|
3
|
+
export interface NetworkStakeStepRewardsViewerMethodsTemplate<TOptions, TResult> {
|
|
4
|
+
bonus(options?: TOptions): Promisable<TResult>
|
|
5
|
+
claimed(options?: TOptions): Promisable<TResult>
|
|
6
|
+
earned(options?: TOptions): Promisable<TResult>
|
|
7
|
+
total(options?: TOptions): Promisable<TResult>
|
|
8
|
+
unclaimed(options?: TOptions): Promisable<TResult>
|
|
9
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { Address } from '@xylabs/hex'
|
|
2
|
+
import type { Promisable } from '@xylabs/promise'
|
|
3
|
+
import type { PositionId, StepIdentity } from '@xyo-network/xl1-protocol'
|
|
4
|
+
|
|
5
|
+
import type { Position } from '../../interfaces/index.ts'
|
|
6
|
+
import type { NetworkStakeStepRewardsViewer } from './NetworkStake/Rewards/Viewer.ts'
|
|
7
|
+
|
|
8
|
+
export interface PagedPositionsOptions {
|
|
9
|
+
cursor?: PositionId
|
|
10
|
+
limit?: number
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface PagedStakersOptions {
|
|
14
|
+
cursor?: Address
|
|
15
|
+
limit?: number
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface StepStatistics {
|
|
19
|
+
endTime: number
|
|
20
|
+
startTime: number
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface StepViewerMethods {
|
|
24
|
+
|
|
25
|
+
// the total number of positions for a given step
|
|
26
|
+
positionCount(step: StepIdentity): Promisable<number>
|
|
27
|
+
|
|
28
|
+
positions(step: StepIdentity, options?: PagedPositionsOptions): Promisable<Position[]>
|
|
29
|
+
|
|
30
|
+
// the predictable random number for a given step
|
|
31
|
+
randomizer(step: StepIdentity): Promisable<bigint>
|
|
32
|
+
|
|
33
|
+
// total amount staked during a given step
|
|
34
|
+
stake(step: StepIdentity): Promisable<bigint>
|
|
35
|
+
|
|
36
|
+
// the total number of stakers for a given step
|
|
37
|
+
stakerCount(step: StepIdentity): Promisable<number>
|
|
38
|
+
|
|
39
|
+
stakers(step: StepIdentity, options?: PagedStakersOptions): Promisable<Address[]>
|
|
40
|
+
|
|
41
|
+
// if no positionId is supplied, returns the total stake weight for the step
|
|
42
|
+
weight(step: StepIdentity, positionId?: PositionId): Promisable<bigint>
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface StepViewer extends StepViewerMethods {
|
|
46
|
+
rewards?: NetworkStakeStepRewardsViewer
|
|
47
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
AccountBalanceViewInterface, BlockViewInterface, ChainViewInterface,
|
|
3
|
+
ForkViewer,
|
|
4
|
+
NetworkStakeStepRewardViewInterface,
|
|
5
|
+
StakeViewer,
|
|
6
|
+
TransactionViewInterface, TransferBalanceViewInterface,
|
|
7
|
+
} from '../../interfaces/index.ts'
|
|
8
|
+
import type { NetworkStakeViewer } from './NetworkStake/index.ts'
|
|
9
|
+
import type { StepViewer } from './StepViewer.ts'
|
|
10
|
+
|
|
11
|
+
export interface XyoViewerMethods extends AccountBalanceViewInterface, TransferBalanceViewInterface,
|
|
12
|
+
NetworkStakeStepRewardViewInterface,
|
|
13
|
+
ChainViewInterface, BlockViewInterface, TransactionViewInterface, StakeViewer, ForkViewer {
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface XyoViewer extends XyoViewerMethods {
|
|
17
|
+
networkStake?: NetworkStakeViewer
|
|
18
|
+
step?: StepViewer
|
|
19
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
Address, Hash, Hex,
|
|
3
|
+
} from '@xylabs/hex'
|
|
4
|
+
import type { Promisable } from '@xylabs/promise'
|
|
5
|
+
import type { AttoXL1 } from '@xyo-network/xl1-protocol'
|
|
6
|
+
|
|
7
|
+
import type { ServiceInterface } from './Service.ts'
|
|
8
|
+
|
|
9
|
+
export interface AccountBalanceProvider {
|
|
10
|
+
getBalanceValue: (address: Address) => bigint
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface AccountBalanceService extends AccountBalanceProvider, ServiceInterface {
|
|
14
|
+
getBalanceValues?: Record<Address, bigint>
|
|
15
|
+
|
|
16
|
+
getBalance(address: Address): Hex
|
|
17
|
+
getBalances(): Record<Address, Hex>
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface AccountBalanceServiceV2 extends ServiceInterface {
|
|
21
|
+
balances(head: Hash, addresses: Address[]): Promisable<Partial<Record<Address, AttoXL1>>>
|
|
22
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Address, Hash } from '@xylabs/hex'
|
|
2
|
+
import type { Promisable } from '@xylabs/promise'
|
|
3
|
+
import type { AttoXL1 } from '@xyo-network/xl1-protocol'
|
|
4
|
+
|
|
5
|
+
import type { ServiceInterface } from './Service.ts'
|
|
6
|
+
|
|
7
|
+
export interface AccountTransfersProvider {
|
|
8
|
+
transfer(head: Hash, account: Address): Promisable<AttoXL1>
|
|
9
|
+
transfers(head: Hash, accounts: Address[]): Promisable<Partial<Record<Address, AttoXL1>>>
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface AccountTransfersService extends AccountTransfersProvider, ServiceInterface {}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
Addressable,
|
|
3
|
+
BlockBoundWitness, HydratedBlock, IterableRepository,
|
|
4
|
+
} from '@xyo-network/xl1-protocol'
|
|
5
|
+
|
|
6
|
+
import type { ServiceInterface } from './Service.ts'
|
|
7
|
+
|
|
8
|
+
export type NextBlockProducer = IterableRepository<BlockBoundWitness, HydratedBlock | undefined>
|
|
9
|
+
|
|
10
|
+
export interface BlockProducerService extends Addressable, NextBlockProducer, ServiceInterface {}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Promisable } from '@xylabs/promise'
|
|
2
|
+
|
|
3
|
+
import type { ServiceInterface } from './Service.ts'
|
|
4
|
+
|
|
5
|
+
export interface BlockRewardService extends ServiceInterface {
|
|
6
|
+
// The amount of xl1 to send to the producer from the block reward
|
|
7
|
+
getRewardForBlock(block: bigint): Promisable<bigint>
|
|
8
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Promisable } from '@xylabs/promise'
|
|
2
|
+
|
|
3
|
+
import type { BlockRewardService } from './BlockRewardService.ts'
|
|
4
|
+
|
|
5
|
+
export interface BlockRewardServiceV2 extends BlockRewardService {
|
|
6
|
+
// The amount of xl1 to send to the step pool from the block reward
|
|
7
|
+
getRewardForStepPool(block: bigint): Promisable<bigint>
|
|
8
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { BaseChainService } from './BaseChainService.ts'
|
|
2
|
+
import type {
|
|
3
|
+
ChainContractViewer, ChainStaker, ChainStakeViewer,
|
|
4
|
+
} from './interfaces/index.ts'
|
|
5
|
+
|
|
6
|
+
export interface ChainService extends ChainContractViewer, ChainStakeViewer, ChainStaker, BaseChainService {}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { BaseParams } from '@xylabs/base'
|
|
2
|
+
import type { BaseEmitter } from '@xylabs/events'
|
|
3
|
+
import type { Hash } from '@xylabs/hex'
|
|
4
|
+
import type { WithStorageMeta } from '@xyo-network/payload-model'
|
|
5
|
+
import type {
|
|
6
|
+
BlockBoundWitness, ChainId, IterableRepository, ReadRepository,
|
|
7
|
+
} from '@xyo-network/xl1-protocol'
|
|
8
|
+
|
|
9
|
+
import type { ChainIteratorServiceEventData } from './ChainIteratorServiceEventData.ts'
|
|
10
|
+
|
|
11
|
+
export interface ChainIteratorService<TKey>
|
|
12
|
+
extends ReadRepository<TKey, BlockBoundWitness | undefined>, IterableRepository<TKey, WithStorageMeta<BlockBoundWitness> | undefined> {
|
|
13
|
+
chainId: ChainId
|
|
14
|
+
head(): Promise<WithStorageMeta<BlockBoundWitness>>
|
|
15
|
+
previous(cursor?: TKey | undefined, limit?: number): Promise<WithStorageMeta<BlockBoundWitness>[]>
|
|
16
|
+
updateHead(head: BlockBoundWitness): Promise<void>
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// /** @deprecated use ChainIteratorService instead */
|
|
20
|
+
// export interface ChainIterator<TKey> extends ChainIteratorService<TKey> {}
|
|
21
|
+
|
|
22
|
+
export interface EventingChainIteratorService<TKey> extends ChainIteratorService<TKey>, BaseEmitter<BaseParams, ChainIteratorServiceEventData> {}
|
|
23
|
+
|
|
24
|
+
// /** @deprecated use EventingChainIteratorService instead */
|
|
25
|
+
// export interface EventingChainIterator<TKey> extends EventingChainIteratorService<TKey> {}
|
|
26
|
+
|
|
27
|
+
export interface ChainBlockNumberIteratorService extends ChainIteratorService<number> {}
|
|
28
|
+
|
|
29
|
+
// /** @deprecated use ChainBlockNumberIteratorService instead */
|
|
30
|
+
// export interface ChainBlockNumberIterator extends ChainBlockNumberIteratorService {}
|
|
31
|
+
|
|
32
|
+
export interface EventingChainBlockNumberIteratorService extends EventingChainIteratorService<number> {}
|
|
33
|
+
|
|
34
|
+
// /** @deprecated use EventingChainBlockNumberIteratorService instead */
|
|
35
|
+
// export interface EventingChainBlockNumberIterator extends EventingChainBlockNumberIteratorService {}
|
|
36
|
+
|
|
37
|
+
export interface ChainHashIteratorService extends ChainIteratorService<Hash> {}
|
|
38
|
+
|
|
39
|
+
// /** @deprecated use ChainHashIteratorService instead */
|
|
40
|
+
// export interface ChainHashIterator extends ChainHashIteratorService {}
|
|
41
|
+
|
|
42
|
+
export interface EventingChainHashIteratorService extends EventingChainIteratorService<Hash> {}
|
|
43
|
+
|
|
44
|
+
// /** @deprecated use EventingChainHashIteratorService instead */
|
|
45
|
+
// export interface EventingChainHashIterator extends EventingChainHashIteratorService {}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { EventData } from '@xylabs/events'
|
|
2
|
+
import type { BlockBoundWitness } from '@xyo-network/xl1-protocol'
|
|
3
|
+
|
|
4
|
+
export type HeadEventArgs = { blocks: [BlockBoundWitness] }
|
|
5
|
+
|
|
6
|
+
export interface HeadEventData extends EventData {
|
|
7
|
+
headUpdated: HeadEventArgs
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface ChainIteratorServiceEventData extends HeadEventData { }
|
|
11
|
+
|
|
12
|
+
// /** @deprecated use ChainIteratorServiceEventData instead */
|
|
13
|
+
// export interface ChainIteratorEventData extends ChainIteratorServiceEventData { }
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Address } from '@xylabs/hex'
|
|
2
|
+
import type { WithHashMeta } from '@xyo-network/payload-model'
|
|
3
|
+
import type { BlockBoundWitness } from '@xyo-network/xl1-protocol'
|
|
4
|
+
|
|
5
|
+
import type { ServiceInterface } from './Service.ts'
|
|
6
|
+
|
|
7
|
+
export interface ElectionService extends ServiceInterface {
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Given the current block, get the leader for the next block
|
|
11
|
+
* @param current The previous block
|
|
12
|
+
*/
|
|
13
|
+
getCreatorCommitteeForNextBlock(current: WithHashMeta<BlockBoundWitness>): Promise<Address[]>
|
|
14
|
+
|
|
15
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { CreatableParams } from '@xylabs/creatable'
|
|
2
|
+
import type { AccountInstance } from '@xyo-network/account-model'
|
|
3
|
+
import type { OpenTelemetryProviders } from '@xyo-network/xl1-protocol'
|
|
4
|
+
|
|
5
|
+
export interface BaseServiceParams extends CreatableParams, OpenTelemetryProviders {
|
|
6
|
+
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface BaseAccountableServiceParams extends BaseServiceParams {
|
|
10
|
+
account: AccountInstance
|
|
11
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Hash } from '@xylabs/hex'
|
|
2
|
+
import type { SignedHydratedTransaction } from '@xyo-network/xl1-protocol'
|
|
3
|
+
|
|
4
|
+
import type { ServiceInterface } from './Service.ts'
|
|
5
|
+
|
|
6
|
+
export interface PendingTransactionsService extends ServiceInterface {
|
|
7
|
+
getPendingTransactions(head: Hash, limit: number, timeout?: number): Promise<SignedHydratedTransaction[]>
|
|
8
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { Hash } from '@xylabs/hex'
|
|
2
|
+
import type { JsonValue } from '@xylabs/object'
|
|
3
|
+
import { AsObjectFactory } from '@xylabs/object'
|
|
4
|
+
import type { Payload, WithStorageMeta } from '@xyo-network/payload-model'
|
|
5
|
+
import { isPayloadOfSchemaType, isStorageMeta } from '@xyo-network/payload-model'
|
|
6
|
+
|
|
7
|
+
export interface ChainIndexingServiceStateFields<T extends JsonValue = JsonValue> {
|
|
8
|
+
/**
|
|
9
|
+
* The hash of the last block that this service has indexing
|
|
10
|
+
*/
|
|
11
|
+
endBlockHash: Hash
|
|
12
|
+
/**
|
|
13
|
+
* The hash of the block that the service started indexing. If undefined, the service is
|
|
14
|
+
* assumed to have started indexing from the genesis block
|
|
15
|
+
*/
|
|
16
|
+
startBlockHash?: Hash
|
|
17
|
+
/**
|
|
18
|
+
* The indexed state for the range
|
|
19
|
+
*/
|
|
20
|
+
state: T
|
|
21
|
+
}
|
|
22
|
+
export const ChainIndexingServiceStateSchema = 'network.xyo.chain.indexing.service.state' as const
|
|
23
|
+
export type ChainIndexingServiceStateSchema = typeof ChainIndexingServiceStateSchema
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* The result of a ChainIndexingServiceState
|
|
27
|
+
*/
|
|
28
|
+
export type ChainIndexingServiceState<T extends JsonValue = JsonValue> = Payload<ChainIndexingServiceStateFields<T>, ChainIndexingServiceStateSchema>
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Identity functions for determining if an object is an ChainIndexingServiceState
|
|
32
|
+
*/
|
|
33
|
+
export const isChainIndexingServiceState = <T extends JsonValue = JsonValue>(payload?: unknown): payload is ChainIndexingServiceState<T> => {
|
|
34
|
+
return isPayloadOfSchemaType<ChainIndexingServiceState<T>>(ChainIndexingServiceStateSchema)(payload)
|
|
35
|
+
}
|
|
36
|
+
export const asChainIndexingServiceState = AsObjectFactory.create<ChainIndexingServiceState<JsonValue>>(isChainIndexingServiceState)
|
|
37
|
+
|
|
38
|
+
export const isChainIndexingServiceStateWithStorageMeta
|
|
39
|
+
= <T extends JsonValue = JsonValue>(value: unknown): value is WithStorageMeta<ChainIndexingServiceState<T>> =>
|
|
40
|
+
isChainIndexingServiceState<T>(value) && isStorageMeta(value)
|
|
41
|
+
|
|
42
|
+
export const asChainIndexingServiceStateWithStorageMeta
|
|
43
|
+
= AsObjectFactory.create<WithStorageMeta<ChainIndexingServiceState>>(isChainIndexingServiceStateWithStorageMeta)
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { Address } from '@xylabs/hex'
|
|
2
|
+
import type { Intent } from '@xyo-network/xl1-protocol'
|
|
3
|
+
|
|
4
|
+
import type { ServiceInterface } from '../Service.ts'
|
|
5
|
+
|
|
6
|
+
export interface StakeIntentService extends ServiceInterface {
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Gets the declared ranges for an address based on historical on-chain data
|
|
10
|
+
* @param address The address to get the declared ranges for
|
|
11
|
+
* @param intent The declared intent to filter for
|
|
12
|
+
*/
|
|
13
|
+
getDeclaredCandidateRanges(address: Address, intent: Intent): Promise<Readonly<Readonly<[number, number]>[]>>
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Gets the declared candidates for a block based on historical on-chain data
|
|
17
|
+
* @param block The block number to get the declared candidates for
|
|
18
|
+
* @param intent The declared intent to filter for
|
|
19
|
+
*/
|
|
20
|
+
getDeclaredCandidatesForBlock(block: number, intent: Intent): Promise<Address[]>
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Gets the required minimum stake for a given intent
|
|
24
|
+
* @param intent The declared intent to filter for
|
|
25
|
+
* @returns The required minimum stake for the intent
|
|
26
|
+
*/
|
|
27
|
+
getRequiredMinimumStakeForIntent(intent: Intent): bigint
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Checks if the address is staked for a block for a given intent
|
|
31
|
+
* @param block The block number to check
|
|
32
|
+
* @param intent The declared intent to filter for
|
|
33
|
+
* @param address The address to check
|
|
34
|
+
*/
|
|
35
|
+
isStakedForBlock(block: number, intent: Intent, address: Address): Promise<boolean>
|
|
36
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { TimeSyncViewInterface, TimeSyncViewInterfaceV2 } from '../interfaces/index.ts'
|
|
2
|
+
import type { ServiceInterface } from './Service.ts'
|
|
3
|
+
|
|
4
|
+
export interface TimeSyncService extends ServiceInterface, TimeSyncViewInterface {}
|
|
5
|
+
|
|
6
|
+
export interface TimeSyncServiceV2 extends ServiceInterface, TimeSyncViewInterfaceV2 {}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export * from './AccountBalanceService.ts'
|
|
2
|
+
export * from './AccountTransfersService.ts'
|
|
3
|
+
export * from './BlockProducerService.ts'
|
|
4
|
+
export * from './BlockRewardService.ts'
|
|
5
|
+
export * from './BlockRewardServiceV2.ts'
|
|
6
|
+
export * from './Chain/index.ts'
|
|
7
|
+
export * from './ChainIterator/index.ts'
|
|
8
|
+
export * from './Election.ts'
|
|
9
|
+
export * from './NetworkStakeService.ts'
|
|
10
|
+
export * from './PendingTransactionsService.ts'
|
|
11
|
+
export * from './Service.ts'
|
|
12
|
+
export * from './StakeIntentService/index.ts'
|
|
13
|
+
export * from './StepStakeService.ts'
|
|
14
|
+
export * from './TimeSyncService.ts'
|
|
@@ -3,9 +3,9 @@ import type { Logger } from '@xylabs/logger'
|
|
|
3
3
|
import { isDefined } from '@xylabs/typeof'
|
|
4
4
|
import type { Signed } from '@xyo-network/boundwitness-model'
|
|
5
5
|
import { PayloadBuilder } from '@xyo-network/payload-builder'
|
|
6
|
-
import type {
|
|
7
|
-
|
|
8
|
-
} from '
|
|
6
|
+
import type { SignedHydratedTransaction, TransactionBoundWitness } from '@xyo-network/xl1-protocol'
|
|
7
|
+
|
|
8
|
+
import type { XyoViewer } from '../provider/index.ts'
|
|
9
9
|
|
|
10
10
|
const DEFAULT_CONFIRMATION_ATTEMPTS = 20
|
|
11
11
|
const DEFAULT_DELAY_BETWEEN_ATTEMPTS = 1000 // milliseconds
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Promisable } from '@xylabs/promise'
|
|
2
|
+
import type { BlockBoundWitness, ChainId } from '@xyo-network/xl1-protocol'
|
|
3
|
+
|
|
4
|
+
import type { BlockValidationError } from './error.ts'
|
|
5
|
+
|
|
6
|
+
export type BlockValidatorFunction = (
|
|
7
|
+
block: BlockBoundWitness,
|
|
8
|
+
chainId?: ChainId,
|
|
9
|
+
) => Promisable<BlockValidationError[]>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Promisable } from '@xylabs/promise'
|
|
2
|
+
import type { ChainId, HydratedBlock } from '@xyo-network/xl1-protocol'
|
|
3
|
+
|
|
4
|
+
import type { AccountBalanceService, AccountBalanceServiceV2 } from '../../services/index.ts'
|
|
5
|
+
import type { HydratedBlockStateValidationError } from './error.ts'
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* A function that validates a hydrated block against chain state.
|
|
9
|
+
* @param hydratedBlock The hydrated block to validate.
|
|
10
|
+
* @param chainId The chain ID to use for validation.
|
|
11
|
+
* @param archivist The archivist to use for validation.
|
|
12
|
+
* @returns An array of errors if the block is invalid, or an empty array if it is valid.
|
|
13
|
+
*/
|
|
14
|
+
export type HydratedBlockStateValidationFunction = (
|
|
15
|
+
hydratedBlock: HydratedBlock,
|
|
16
|
+
chainId: ChainId,
|
|
17
|
+
services: { accountBalance: AccountBalanceService },
|
|
18
|
+
) => Promisable<HydratedBlockStateValidationError[]>
|
|
19
|
+
|
|
20
|
+
export type HydratedBlockStateValidationFunctionV2 = (
|
|
21
|
+
hydratedBlock: HydratedBlock,
|
|
22
|
+
chainId: ChainId,
|
|
23
|
+
services: { accountBalance: AccountBalanceServiceV2 },
|
|
24
|
+
) => Promisable<HydratedBlockStateValidationError[]>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Promisable } from '@xylabs/promise'
|
|
2
|
+
import type { ChainId, HydratedBlock } from '@xyo-network/xl1-protocol'
|
|
3
|
+
|
|
4
|
+
import type { HydratedBlockValidationError } from './error.ts'
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* A function that validates a hydrated block.
|
|
8
|
+
* @param hydratedBlock The hydrated block to validate.
|
|
9
|
+
* @param chainId The chain ID to use for validation.
|
|
10
|
+
* @returns An array of errors if the block is invalid, or an empty array if it is valid.
|
|
11
|
+
*/
|
|
12
|
+
export type HydratedBlockValidationFunction = (
|
|
13
|
+
hydratedBlock: HydratedBlock,
|
|
14
|
+
chainId?: ChainId,
|
|
15
|
+
) => Promisable<HydratedBlockValidationError[]>
|