@xyo-network/chain-sdk
v1.20.5
Published
XYO Layer One SDK
Keywords
Readme
@xyo-network/chain-sdk
[![npm-badge][]][npm-link] [![npm-downloads-badge][]][npm-link] [![jsdelivr-badge][]][jsdelivr-link] ![npm-license-badge][] [![socket-badge][]][socket-link]
XYO Layer One SDK
Reference
@xyo-network/chain-sdk
Classes
- BalanceAnalyzer
- ChainFinalizer
- ChainHeadSelector
- TransferAnalyzer
- ChainProducersAnalyzer
- ChainStakeIntentAnalyzer
- BaseEthProvider
- EthereumChainStakeViewer
- EthereumChainStakeEvents
- AddressBalanceDivinerV2
- AddressTransferDiviner
- ArchivistSyncDiviner
- BlockRewardDiviner
- FixedPercentageBlockRewardDiviner
- BlockValidationDiviner
- HeadValidationDiviner
- ArchivistNextWitness
- NetworkStakeWitness
- SynchronousLmdbMap
- MongoMap
- TransactionBuilder
- NodeXyoViewer
- BaseAccountBalanceService
- BaseAccountTransfersService
- BaseService
- BaseAccountableService
- BaseBlockProducerService
- BaseBlockRewardService
- EvmBlockRewardService
- MemoryBlockRewardService
- ChainBlockNumberIterationService
- EvmChainService
- MemoryChainService
- XyoValidator
- BaseElectionService
- BaseNetworkStakeStepRewardService
- BasePendingTransactionsService
- XyoStakeIntentService
- BaseStepStakeService
- BaseTimeSyncService
- HydratedCache
- IntervalMap
- Node
- IntervalTree
- DataIntervalTree
- InOrder
- ReverseInOrder
- PreOrder
- XyoConsoleSpanExporter
- SimpleNetworkStakeViewer
- SimpleStepRewardsByPositionViewer
- SimpleStepRewardsByStakerViewer
- SimpleStepRewardsByStepViewer
- SimpleStepRewardsViewer
- HydratedBlockWrapper
- IndexedHydratedBlockRangeStore
- BaseWrapper
- FeesWrapper
- SignatureWrapper
- ChainWrapper
- HydratedTransactionWrapper
Interfaces
- ChainSummaryBalancesFields
- ChainFinalizerParams
- ChainHeadSelectorParams
- ChainSummaryTransfersFields
- AnalyzedProducer
- ChainSummaryProducersFields
- EthereumChainStakeParams
- EthereumChainStakeEventsParams
- GasConfig
- AddressBalanceDivinerParams
- AddressTransferDivinerParams
- ArchivistSyncDivinerParams
- ArchivistSyncDivinerConfig
- BlockRewardDivinerParams
- BlockRewardFields
- FixedPercentageBlockRewardDivinerParams
- HeadValidationDivinerParams
- BaseBuildBlockOptions
- BuildGenesisBlockOptions
- BuildNextBlockOptions
- MongoMapParams
- NodeXyoViewerParams
- BaseAccountBalanceServiceParams
- BaseAccountTransferServiceParams
- CreatableService
- BaseBlockProducerServiceParams
- BaseBlockRewardServiceParams
- EvmBlockRewardServiceParams
- MemoryBlockRewardServiceParams
- BlockNumberIteration
- XyoChainIteratorParams
- EvmChainServiceParams
- MemoryChainServiceParams
- XyoValidatorParams
- Validator
- BaseElectionServicesParams
- BaseNetworkStakeStepRewardServiceParams
- BasePendingTransactionsServiceParams
- XyoStakeIntentServiceParams
- BaseStepStakeServiceParams
- BaseTimeServiceParams
- BaseServiceParams
- BaseAccountableServiceParams
- FloatStringFormatterResults
- Serializable
- Interval
- DataInterval
- SimpleNetworkStakeViewerParams
- SimpleStepRewardsByPositionViewerParams
- SimpleStepRewardsByStakerViewerParams
- SimpleStepRewardsByStepViewerParams
- NodeStepRewardsViewerParams
- HydratedBlockStoreInstance
- IndexedHydratedBlockStoreInstance
- HydratedBlockRangeStoreParams
- IndexedHydratedBlockRangeStoreInstance
- BaseWrapperConfig
Type Aliases
- ChainSummaryBalancesSchema
- ChainSummaryBalances
- ChainSummaryTransfersSchema
- ChainSummaryTransfers
- ChainSummaryProducersSchema
- ChainSummaryProducers
- ChainSummaryStakeIntentSchema
- ChainSummaryStakeIntent
- AddressBalanceDivinerConfigSchema
- AddressBalanceDivinerConfig
- AddressBalanceDivinerInputType
- AddressBalanceDivinerOutputType
- AddressTransferDivinerConfigSchema
- AddressTransferDivinerConfig
- AddressTransferDivinerInputType
- AddressTransferDivinerOutputType
- ArchivistSyncDivinerSyncConfigSchema
- BlockRewardDivinerConfigSchema
- BlockRewardDivinerConfig
- BlockRewardDivinerInputType
- BlockRewardDivinerOutputType
- BlockRewardSchema
- BlockReward
- FixedPercentageBlockRewardDivinerConfigSchema
- FixedPercentageBlockRewardDivinerConfig
- BlockValidationDivinerConfigSchema
- BlockValidationDivinerConfig
- BlockValidationDivinerParams
- HeadValidationDivinerConfigSchema
- HeadValidationDivinerConfig
- ArchivistNextWitnessConfigSchema
- ArchivistNextWitnessConfig
- ArchivistNextWitnessParams
- WeightedNetworkStakeSchema
- WeightedNetworkStake
- NetworkStakeObserveSchema
- NetworkStakeObserve
- NetworkStakeWitnessConfigSchema
- NetworkStakeWitnessConfig
- NetworkStakeWitnessParams
- BuildBlockOptions
- BlockBoundWitnessComparator
- StoreKind
- TelemetryProviders
- ResourceAttributes
- MetricsConfig
- HydrateFunction
- BigIntDecimal
- IntervalMapInterval
- SerializedIntervalMap
- StepWindow
- HydratedBlockStoreParams
Variables
- ChainSummaryBalancesSchema
- isChainSummaryBalances
- ChainSummaryTransfersSchema
- isChainSummaryTransfers
- analyzeChain
- ChainSummaryProducersSchema
- isChainSummaryProducers
- ChainSummaryStakeIntentSchema
- isChainSummaryStakeIntent
- createChainContract
- createChainRewardsContract
- getDefaultGasConfig
- nextContractAddressForAddress
- nextContractAddress
- AddressBalanceDivinerConfigSchema
- AddressTransferDivinerConfigSchema
- ArchivistSyncDivinerSyncConfigSchema
- isArchivistSyncDivinerSyncConfig
- BlockRewardDivinerConfigSchema
- BlockRewardSchema
- isBlockReward
- asBlockReward
- asOptionalBlockReward
- isBlockRewardWithSources
- asBlockRewardWithSources
- asOptionalBlockRewardWithSources
- FixedPercentageBlockRewardDivinerConfigSchema
- BlockValidationDivinerConfigSchema
- HeadValidationDivinerConfigSchema
- ArchivistNextWitnessConfigSchema
- WeightedNetworkStakeSchema
- isWeightedNetworkStake
- asWeightedNetworkStakePayload
- asWeightedNetworkStakePayloadWithStorageMeta
- NetworkStakeObserveSchema
- isNetworkStakeObserve
- asNetworkStakeObservePayload
- asNetworkStakeObservePayloadWithStorageMeta
- NetworkStakeWitnessConfigSchema
- isBaseBuildBlockOptions
- isBuildGenesisBlockOptions
- isBuildNextBlockOptions
- TestGenesisBlockRewardAddress
- buildRandomChain
- buildRandomChainArchivist
- TestChainId
- buildRandomGenesisBlock
- buildRandomNextBlock
- createGenesisBlock
- sortBlocksAscending
- sortBlocksDescending
- sortBlocks
- toSortedBlocks
- createDeclarationIntent
- getLocalPersistentMap
- deleteLocalPersistentMap
- rewardFromBlockNumber
- findMostRecentBlock
- gasRequired
- totalBlockGasCost
- totalBlockGasCostHex
- getStoreDirectory
- buildRandomTransaction
- accountBalancesServiceFromArchivist
- DEFAULT_BLOCK_SIZE
- XYO_PRODUCER_REDECLARATION_DURATION
- XYO_PRODUCER_REDECLARATION_WINDOW
- getBlockSignedStakeDeclarations
- initTelemetry
- DEFAULT_FIND_FIRST_MATCHING_NEXT_OPTIONS
- findFirstMatching
- payloadsToArchivist
- synchronizeArchivists
- formattedMXL1toXl1
- bigIntToFixedPointString
- removeTrailingZeros
- stepWindowCalculatorFromBlock
- validateBlock
- BlockAllowedPayloadSchemasValidator
- BlockFieldsValidator
- BlockJsonSchemaValidator
- BlockPreviousHashValidator
- validateHydratedBlock
- PayloadsInBlockValidator
- validateHydratedBlockState
- RequiredBalanceBlockStateValidator
- createSignatureWrappers
Functions
- createChain
- buildBlock
- buildGenesisBlock
- buildNextBlock
- createProducerChainStakeIntent
- createProducerChainStakeIntentTransaction
- createTransferPayload
- frameList
- blockRangeSteps
- chainStepRewardAddress
- stepRewardBlock
- stepRewardTotal
- stepsRewardTotalGenesisPeriod
- stepsRewardTotalRange
- stepsRewardTotal
- externalBlockNumberFromXL1BlockNumber
- externalBlockRangeFromStep
- externalBlockRangeFromXL1BlockRange
- mapToMapType
- mergeTransfers
- rewardPercentForStep
- networkStakeStepRewardPositionWeight
- activeStakeAtTimeByAddress
- activeStakeAtTimeByPosition
- allStakersForRange
- allStakersForStep
- mergedAddRemoveStakeEventsByPosition
- weightedStakeForRangeByAddress
- weightedStakeForRangeByPosition
- hydratedBlockByNumber
- creatableService
- formatNumberForDisplay
- hexToLast4BytesInt
- shuffleWithSeed
- spanDurationInMillis
- startupSpanAsync
classes
AddressBalanceDivinerV2
Extends
AbstractDiviner<TParams,TIn,TOut,TEventData>
Type Parameters
TParams
TParams extends AddressBalanceDivinerParams = AddressBalanceDivinerParams
TIn
TIn extends AddressBalanceDivinerInputType = AddressBalanceDivinerInputType
TOut
TOut extends AddressBalanceDivinerOutputType = AddressBalanceDivinerOutputType
TEventData
TEventData extends DivinerModuleEventData<DivinerInstance<TParams, TIn, TOut>, TIn, TOut> = DivinerModuleEventData<DivinerInstance<TParams, TIn, TOut>, TIn, TOut>
Constructors
Constructor
new AddressBalanceDivinerV2<TParams, TIn, TOut, TEventData>(key, params): AddressBalanceDivinerV2<TParams, TIn, TOut, TEventData>;Parameters
key
unknown
params
Partial<TParams & RequiredCreatableParams>
Returns
AddressBalanceDivinerV2<TParams, TIn, TOut, TEventData>
Inherited from
AbstractDiviner<TParams, TIn, TOut, TEventData>.constructorProperties
configSchemas
readonly static configSchemas: string[];Overrides
AbstractDiviner.configSchemasdefaultConfigSchema
readonly static defaultConfigSchema: "network.xyo.diviner.chain.address.balance.config";Overrides
AbstractDiviner.defaultConfigSchema_balances
protected _balances: Partial<Record<Address, SignedBigInt>>;The balances for each address
_firstBlock
protected _firstBlock: Hash | null;The most recent head that was indexed to
_lastBlock
protected _lastBlock: Hash | null;The oldest block that was indexed through
_summaryMap?
protected optional _summaryMap: MapType<string, BalancesStepSummary>;Accessors
stepSemaphores
Get Signature
get stepSemaphores(): Semaphore[];Returns
Semaphore[]
summaryMap
Get Signature
get summaryMap(): MapType<string, BalancesStepSummary>;Returns
MapType<string, BalancesStepSummary>
Methods
head()
head(): Promise<WithStorageMeta<BlockBoundWitness> | undefined>;Returns
Promise<WithStorageMeta<BlockBoundWitness> | undefined>
startHandler()
startHandler(): Promise<void>;Returns
Promise<void>
Overrides
AbstractDiviner.startHandlerdivineHandler()
protected divineHandler(payloads?): Promise<TOut[]>;Function
divineHandler Implement or override to add custom functionality to a diviner
Parameters
payloads?
TIn[]
Returns
Promise<TOut[]>
Overrides
AbstractDiviner.divineHandlerAddressTransferDiviner
Extends
AbstractDiviner<TParams,TIn,TOut,TEventData>
Type Parameters
TParams
TParams extends AddressTransferDivinerParams = AddressTransferDivinerParams
TIn
TIn extends AddressTransferDivinerInputType = AddressTransferDivinerInputType
TOut
TOut extends AddressTransferDivinerOutputType = AddressTransferDivinerOutputType
TEventData
TEventData extends DivinerModuleEventData<DivinerInstance<TParams, TIn, TOut>, TIn, TOut> = DivinerModuleEventData<DivinerInstance<TParams, TIn, TOut>, TIn, TOut>
Constructors
Constructor
new AddressTransferDiviner<TParams, TIn, TOut, TEventData>(key, params): AddressTransferDiviner<TParams, TIn, TOut, TEventData>;Parameters
key
unknown
params
Partial<TParams & RequiredCreatableParams>
Returns
AddressTransferDiviner<TParams, TIn, TOut, TEventData>
Inherited from
AbstractDiviner<TParams, TIn, TOut, TEventData>.constructorProperties
configSchemas
readonly static configSchemas: string[];Overrides
AbstractDiviner.configSchemasdefaultConfigSchema
readonly static defaultConfigSchema: "network.xyo.diviner.chain.address.transfer.config";Overrides
AbstractDiviner.defaultConfigSchema_balances
protected _balances: Partial<Record<Address, SignedBigInt>>;The balances for each address
_firstBlock
protected _firstBlock: Hash | null;The most recent head that was indexed to
_lastBlock
protected _lastBlock: Hash | null;The oldest block that was indexed through
_summaryMap?
protected optional _summaryMap: MapType<string, TransfersStepSummary>;Accessors
stepSemaphores
Get Signature
get stepSemaphores(): Semaphore[];Returns
Semaphore[]
summaryMap
Get Signature
get summaryMap(): MapType<string, TransfersStepSummary>;Returns
MapType<string, TransfersStepSummary>
Methods
head()
head(): Promise<WithStorageMeta<BlockBoundWitness> | undefined>;Returns
Promise<WithStorageMeta<BlockBoundWitness> | undefined>
startHandler()
startHandler(): Promise<void>;Returns
Promise<void>
Overrides
AbstractDiviner.startHandlerdivineHandler()
protected divineHandler(payloads?): Promise<TOut[]>;Function
divineHandler Implement or override to add custom functionality to a diviner
Parameters
payloads?
TIn[]
Returns
Promise<TOut[]>
Overrides
AbstractDiviner.divineHandlerArchivistNextWitness
Extends
AbstractWitness<TParams>
Type Parameters
TParams
TParams extends ArchivistNextWitnessParams = ArchivistNextWitnessParams
Implements
WitnessModule
Constructors
Constructor
new ArchivistNextWitness<TParams>(key, params): ArchivistNextWitness<TParams>;Parameters
key
unknown
params
Partial<TParams & RequiredCreatableParams>
Returns
ArchivistNextWitness<TParams>
Inherited from
AbstractWitness<TParams>.constructorProperties
configSchemas
readonly static configSchemas: string[];Overrides
AbstractWitness.configSchemasdefaultConfigSchema
readonly static defaultConfigSchema: string;Overrides
AbstractWitness.defaultConfigSchemaMethods
getSourceArchivist()
getSourceArchivist(): Promise<ArchivistInstance<ArchivistParams<AnyConfigSchema<ArchivistConfig>>, ArchivistModuleEventData, Payload>>;Returns
Promise<ArchivistInstance<ArchivistParams<AnyConfigSchema<ArchivistConfig>>, ArchivistModuleEventData, Payload>>
observeHandler()
protected observeHandler(): Promise<Payload[]>;Function
observeHandler Implement or override to add custom functionality to a witness
Returns
Promise<Payload[]>
Overrides
AbstractWitness.observeHandlerArchivistSyncDiviner
This is for syncing a remote archivist to a local archivist. We do not handle cases of delete on the remote archivist We assume the outArchivist is a read only archivist for the consumers of the service
Extends
AbstractDiviner<ArchivistSyncDivinerParams>
Constructors
Constructor
new ArchivistSyncDiviner(key, params): ArchivistSyncDiviner;Parameters
key
unknown
params
Partial<TParams & RequiredCreatableParams>
Returns
ArchivistSyncDiviner
Inherited from
AbstractDiviner<ArchivistSyncDivinerParams>.constructorProperties
configSchemas
readonly static configSchemas: string[];Overrides
AbstractDiviner.configSchemasdefaultConfigSchema
readonly static defaultConfigSchema: string;Overrides
AbstractDiviner.defaultConfigSchemaAccessors
max
Get Signature
get max(): number;Returns
number
Methods
divineHandler()
divineHandler(_payloads?): Promise<never[]>;Function
divineHandler Implement or override to add custom functionality to a diviner
Parameters
_payloads?
Payload[]
Returns
Promise<never[]>
Overrides
AbstractDiviner.divineHandlerresync()
resync(): Promise<void>;Returns
Promise<void>
startHandler()
startHandler(): Promise<void>;Returns
Promise<void>
Overrides
AbstractDiviner.startHandlergetInArchivist()
protected getInArchivist(): Promise<
| ArchivistInstance<ArchivistParams<AnyConfigSchema<ArchivistConfig<void, void>>>, ArchivistModuleEventData, Payload>
| undefined>;Returns
Promise<
| ArchivistInstance<ArchivistParams<AnyConfigSchema<ArchivistConfig<void, void>>>, ArchivistModuleEventData, Payload>
| undefined>
getOutArchivist()
protected getOutArchivist(): Promise<
| ArchivistInstance<ArchivistParams<AnyConfigSchema<ArchivistConfig<void, void>>>, ArchivistModuleEventData, Payload>
| undefined>;Returns
Promise<
| ArchivistInstance<ArchivistParams<AnyConfigSchema<ArchivistConfig<void, void>>>, ArchivistModuleEventData, Payload>
| undefined>
BalanceAnalyzer
Implements
ChainAnalyzer
Constructors
Constructor
new BalanceAnalyzer(
addresses?,
minBalances?,
startingBalances?): BalanceAnalyzer;Parameters
addresses?
Address[]
minBalances?
bigint[]
startingBalances?
Returns
BalanceAnalyzer
Properties
_tracer
protected _tracer: Tracer | undefined;Accessors
tracer
Get Signature
get protected tracer(): Tracer;Returns
Tracer
Methods
onBlock()
onBlock(__namedParameters): boolean;Parameters
__namedParameters
HydratedBlock
Returns
boolean
Implementation of
ChainAnalyzer.onBlockresult()
result(): ChainSummaryBalances;Returns
Implementation of
ChainAnalyzer.resultshouldContinue()
shouldContinue(): boolean;Returns
boolean
Implementation of
ChainAnalyzer.shouldContinueallMinBalancesReached()
protected allMinBalancesReached(): boolean;Returns
boolean
BaseAccountBalanceService
Extends
Implements
AccountBalanceService
Constructors
Constructor
new BaseAccountBalanceService(key, params): BaseAccountBalanceService;Parameters
key
unknown
params
Partial<TParams & RequiredCreatableParams>
Returns
BaseAccountBalanceService
Inherited from
Properties
accountBalanceViewer
protected accountBalanceViewer: AccountBalanceService;blockViewer
protected blockViewer: BlockViewer;Accessors
singletons
Get Signature
get static singletons(): Record<string, unknown>;Returns
Record<string, unknown>
Inherited from
Methods
accountBalance()
accountBalance(address, headOrRange?): Promise<AttoXL1>;Parameters
address
Address
headOrRange?
Hash | XL1BlockRange
Returns
Promise<AttoXL1>
Implementation of
AccountBalanceService.accountBalanceaccountBalanceHistory()
Call Signature
accountBalanceHistory(address): Promise<AccountBalanceHistoryItem[]>;Parameters
address
Address
Returns
Promise<AccountBalanceHistoryItem[]>
Implementation of
AccountBalanceService.accountBalanceHistoryCall Signature
accountBalanceHistory(address, head): Promise<AccountBalanceHistoryItem[]>;Parameters
address
Address
head
Hash
Returns
Promise<AccountBalanceHistoryItem[]>
Implementation of
AccountBalanceService.accountBalanceHistoryCall Signature
accountBalanceHistory(address, range): Promise<AccountBalanceHistoryItem[]>;Parameters
address
Address
range
XL1BlockRange
Returns
Promise<AccountBalanceHistoryItem[]>
Implementation of
AccountBalanceService.accountBalanceHistoryaccountBalances()
accountBalances(address, _headOrRange?): Promise<Partial<Record<Address, AttoXL1>>>;Parameters
address
Address[]
_headOrRange?
Hash | XL1BlockRange
Returns
Promise<Partial<Record<Address, AttoXL1>>>
Implementation of
AccountBalanceService.accountBalancesaccountBalancesHistories()
Call Signature
accountBalancesHistories(addresses): Promise<Partial<Record<Address, AccountBalanceHistoryItem[]>>>;Parameters
addresses
Address[]
Returns
Promise<Partial<Record<Address, AccountBalanceHistoryItem[]>>>
Implementation of
AccountBalanceService.accountBalancesHistoriesCall Signature
accountBalancesHistories(addresses, head): Promise<Partial<Record<Address, AccountBalanceHistoryItem[]>>>;Parameters
addresses
Address[]
head
Hash
Returns
Promise<Partial<Record<Address, AccountBalanceHistoryItem[]>>>
Implementation of
AccountBalanceService.accountBalancesHistoriesCall Signature
accountBalancesHistories(addresses, range): Promise<Partial<Record<Address, AccountBalanceHistoryItem[]>>>;Parameters
addresses
Address[]
range
XL1BlockRange
Returns
Promise<Partial<Record<Address, AccountBalanceHistoryItem[]>>>
Implementation of
AccountBalanceService.accountBalancesHistoriescreateHandler()
createHandler(): void;Returns
void
Overrides
BaseService.createHandlerinitSingleton()
static initSingleton<TService, TParams>(params): Promise<TService>;Type Parameters
TService
TService extends BaseService<TParams, EventData>
TParams
TParams extends BaseServiceParams<object>
Parameters
params
Partial<TParams>
Returns
Promise<TService>
Inherited from
paramsHandler()
paramsHandler(params?): BaseAccountBalanceServiceParams;Parameters
params?
Partial<BaseAccountBalanceServiceParams>
Returns
BaseAccountBalanceServiceParams
Inherited from
span()
span<T>(name, fn): T;Type Parameters
T
T
Parameters
name
string
fn
() => T
Returns
T
Inherited from
spanAsync()
spanAsync<T>(name, fn): Promise<T>;Type Parameters
T
T
Parameters
name
string
fn
() => Promise<T>
Returns
Promise<T>
Inherited from
BaseAccountTransfersService
Extends
Implements
AccountTransfersService
Constructors
Constructor
new BaseAccountTransfersService(key, params): BaseAccountTransfersService;Parameters
key
unknown
params
Partial<TParams & RequiredCreatableParams>
Returns
BaseAccountTransfersService
Inherited from
Accessors
singletons
Get Signature
get static singletons(): Record<string, unknown>;Returns
Record<string, unknown>
Inherited from
Methods
transfer()
transfer(head, address): Promise<AttoXL1>;Parameters
head
Hash
address
Address
Returns
Promise<AttoXL1>
Implementation of
AccountTransfersService.transfertransfers()
transfers(head, addresses): Promise<Partial<Record<Address, AttoXL1>>>;Parameters
head
Hash
addresses
Address[]
Returns
Promise<Partial<Record<Address, AttoXL1>>>
Implementation of
AccountTransfersService.transfersinitSingleton()
static initSingleton<TService, TParams>(params): Promise<TService>;Type Parameters
TService
TService extends BaseService<TParams, EventData>
TParams
TParams extends BaseServiceParams<object>
Parameters
params
Partial<TParams>
Returns
Promise<TService>
Inherited from
paramsHandler()
paramsHandler(params?): BaseAccountTransferServiceParams;Parameters
params?
Partial<BaseAccountTransferServiceParams>
Returns
BaseAccountTransferServiceParams
Inherited from
span()
span<T>(name, fn): T;Type Parameters
T
T
Parameters
name
string
fn
() => T
Returns
T
Inherited from
spanAsync()
spanAsync<T>(name, fn): Promise<T>;Type Parameters
T
T
Parameters
name
string
fn
() => Promise<T>
Returns
Promise<T>
Inherited from
BaseAccountableService
Extends
BaseService<TParams>
Type Parameters
TParams
TParams extends BaseAccountableServiceParams = BaseAccountableServiceParams
Constructors
Constructor
new BaseAccountableService<TParams>(key, params): BaseAccountableService<TParams>;Parameters
key
unknown
params
Partial<TParams & RequiredCreatableParams>
Returns
BaseAccountableService<TParams>
Inherited from
Accessors
singletons
Get Signature
get static singletons(): Record<string, unknown>;Returns
Record<string, unknown>
Inherited from
Methods
initSingleton()
static initSingleton<TService, TParams>(params): Promise<TService>;Type Parameters
TService
TService extends BaseService<TParams, EventData>
TParams
TParams extends BaseServiceParams<object>
Parameters
params
Partial<TParams>
Returns
Promise<TService>
Inherited from
paramsHandler()
paramsHandler(params?): TParams;Parameters
params?
Partial<TParams>
Returns
TParams
Inherited from
span()
span<T>(name, fn): T;Type Parameters
T
T
Parameters
name
string
fn
() => T
Returns
T
Inherited from
spanAsync()
spanAsync<T>(name, fn): Promise<T>;Type Parameters
T
T
Parameters
name
string
fn
() => Promise<T>
Returns
Promise<T>
Inherited from
BaseBlockProducerService
Extends
Implements
BlockProducerService
Constructors
Constructor
new BaseBlockProducerService(key, params): BaseBlockProducerService;Parameters
key
unknown
params
Partial<TParams & RequiredCreatableParams>
Returns
BaseBlockProducerService
Inherited from
Properties
_blockRewardDiviner
protected _blockRewardDiviner:
| BlockRewardDiviner<BlockRewardDivinerParams<AnyConfigSchema<BlockRewardDivinerConfig>>, BlockNumberPayload, {
}, DivinerModuleEventData<DivinerInstance<BlockRewardDivinerParams<AnyConfigSchema<BlockRewardDivinerConfig>>, BlockNumberPayload, {
}, DivinerModuleEventData>, BlockNumberPayload, {
}>>
| undefined;Accessors
singletons
Get Signature
get static singletons(): Record<string, unknown>;Returns
Record<string, unknown>
Inherited from
DefaultBlockSize
Get Signature
get static DefaultBlockSize(): number;The default block size for a block
Returns
number
RedeclarationDuration
Get Signature
get static RedeclarationDuration(): number;The amount of time for which the producer will redeclare their intent to continue producing blocks
Returns
number
RedeclarationWindow
Get Signature
get static RedeclarationWindow(): number;The number of blocks within which the producer will redeclare their intent to continue producing blocks
Returns
number
address
Get Signature
get address(): Address;Returns
Address
Implementation of
BlockProducerService.addressaccount
Get Signature
get protected account(): AccountInstance;Returns
AccountInstance
balanceService
Get Signature
get protected balanceService(): AccountBalanceService;Returns
AccountBalanceService
chainArchivist
Get Signature
get protected chainArchivist(): ReadArchivist<Payload<void, void>, Hash, Sequence>;Returns
ReadArchivist<Payload<void, void>, Hash, Sequence>
chainId
Get Signature
get protected chainId(): Hex | Address;Returns
Hex | Address
electionService
Get Signature
get protected electionService(): ElectionService;Returns
ElectionService
pendingTransactionsService
Get Signature
get protected pendingTransactionsService(): PendingTransactionsService;Returns
PendingTransactionsService
rejectedTransactionsArchivist
Get Signature
get protected rejectedTransactionsArchivist(): ArchivistInstance<ArchivistParams<AnyConfigSchema<ArchivistConfig<void, void>>>, ArchivistModuleEventData, Payload<void, void>>;Returns
ArchivistInstance<ArchivistParams<AnyConfigSchema<ArchivistConfig<void, void>>>, ArchivistModuleEventData, Payload<void, void>>
rewardAddress
Get Signature
get protected rewardAddress(): Address;Returns
Address
rewardService
Get Signature
get protected rewardService(): BlockRewardService;Returns
BlockRewardService
stakeIntentService
Get Signature
get protected stakeIntentService(): StakeIntentService;Returns
StakeIntentService
time
Get Signature
get protected time(): TimeSyncViewer;Returns
TimeSyncViewer
validateHydratedBlockState
Get Signature
get protected validateHydratedBlockState(): HydratedBlockStateValidationFunction;Returns
HydratedBlockStateValidationFunction
Methods
initSingleton()
static initSingleton<TService, TParams>(params): Promise<TService>;Type Parameters
TService
TService extends BaseService<TParams, EventData>
TParams
TParams extends BaseServiceParams<object>
Parameters
params
Partial<TParams>
Returns
Promise<TService>
Inherited from
paramsHandler()
paramsHandler(params?): BaseBlockProducerServiceParams;Parameters
params?
Partial<BaseBlockProducerServiceParams>
Returns
BaseBlockProducerServiceParams
Inherited from
span()
span<T>(name, fn): T;Type Parameters
T
T
Parameters
name
string
fn
() => T
Returns
T
Inherited from
spanAsync()
spanAsync<T>(name, fn): Promise<T>;Type Parameters
T
T
Parameters
name
string
fn
() => Promise<T>
Returns
Promise<T>
Inherited from
next()
next(head): Promise<HydratedBlock | undefined>;Parameters
head
WithStorageMeta<BlockBoundWitness>
Returns
Promise<HydratedBlock | undefined>
Implementation of
BlockProducerService.nextgetBlockRewardTransfers()
protected getBlockRewardTransfers(block): Promise<object[]>;Parameters
block
number
Returns
Promise<object[]>
getProducerRedeclaration()
protected getProducerRedeclaration(head): Promise<ChainStakeIntent | undefined>;Handles the producer redeclaration logic
Parameters
head
WithStorageMeta<BlockBoundWitness>
The current head block
Returns
Promise<ChainStakeIntent | undefined>
chain stake intent for the producer redeclaration, or undefined if no redeclaration is needed
proposeNextValidBlock()
protected proposeNextValidBlock(head, validateBalances?): Promise<HydratedBlock | undefined>;Parameters
head
WithStorageMeta<BlockBoundWitness>
validateBalances?
boolean
Returns
Promise<HydratedBlock | undefined>
BaseBlockRewardService
Extends
BaseService<TParams>
Extended by
Type Parameters
TParams
TParams extends BaseBlockRewardServiceParams = BaseBlockRewardServiceParams
Implements
BlockRewardService
Constructors
Constructor
new BaseBlockRewardService<TParams>(key, params): BaseBlockRewardService<TParams>;Parameters
key
unknown
params
Partial<TParams & RequiredCreatableParams>
Returns
BaseBlockRewardService<TParams>
Inherited from
Accessors
singletons
Get Signature
get static singletons(): Record<string, unknown>;Returns
Record<string, unknown>
Inherited from
Methods
initSingleton()
static initSingleton<TService, TParams>(params): Promise<TService>;Type Parameters
TService
TService extends BaseService<TParams, EventData>
TParams
TParams extends BaseServiceParams<object>
Parameters
params
Partial<TParams>
Returns
Promise<TService>
Inherited from
paramsHandler()
paramsHandler(params?): TParams;Parameters
params?
Partial<TParams>
Returns
TParams
Inherited from
span()
span<T>(name, fn): T;Type Parameters
T
T
Parameters
name
string
fn
() => T
Returns
T
Inherited from
spanAsync()
spanAsync<T>(name, fn): Promise<T>;Type Parameters
T
T
Parameters
name
string
fn
() => Promise<T>
Returns
Promise<T>
Inherited from
getRewardForBlock()
getRewardForBlock(_blockNumber): Promisable<bigint>;Parameters
_blockNumber
bigint
Returns
Promisable<bigint>
Implementation of
BlockRewardService.getRewardForBlockBaseElectionService
Extends
Implements
ElectionService
Constructors
Constructor
new BaseElectionService(key, params): BaseElectionService;Parameters
key
unknown
params
Partial<TParams & RequiredCreatableParams>
Returns
BaseElectionService
Inherited from
Accessors
singletons
Get Signature
get static singletons(): Record<string, unknown>;Returns
Record<string, unknown>
Inherited from
chainIterator
Get Signature
get chainIterator(): ChainBlockNumberIteratorService;Returns
ChainBlockNumberIteratorService
chainStakeViewer
Get Signature
get chainStakeViewer(): ChainStakeViewer;Returns
ChainStakeViewer
stakeIntentService
Get Signature
get stakeIntentService(): StakeIntentService;Returns
StakeIntentService
Methods
initSingleton()
static initSingleton<TService, TParams>(params): Promise<TService>;Type Parameters
TService
TService extends BaseService<TParams, EventData>
TParams
TParams extends BaseServiceParams<object>
Parameters
params
Partial<TParams>
Returns
Promise<TService>
Inherited from
paramsHandler()
paramsHandler(params?): BaseElectionServicesParams;Parameters
params?
Partial<BaseElectionServicesParams>
Returns
Inherited from
span()
span<T>(name, fn): T;Type Parameters
T
T
Parameters
name
string
fn
() => T
Returns
T
Inherited from
spanAsync()
spanAsync<T>(name, fn): Promise<T>;Type Parameters
T
T
Parameters
name
string
fn
() => Promise<T>
Returns
Promise<T>
Inherited from
getCreatorCommitteeForNextBlock()
getCreatorCommitteeForNextBlock(current): Promise<Address[]>;Given the current block, get the leader for the next block
Parameters
current
WithHashMeta<BlockBoundWitness>
The previous block
Returns
Promise<Address[]>
Implementation of
ElectionService.getCreatorCommitteeForNextBlockgenerateCreatorCommittee()
protected generateCreatorCommittee(
candidates,
previousBlockHash,
maxSize?): Address[];Parameters
candidates
Address[]
previousBlockHash
Hash
maxSize?
number
Returns
Address[]
BaseEthProvider
Implements
EthExecutionAPI
Constructors
Constructor
new BaseEthProvider(): BaseEthProvider;Returns
BaseEthProvider
Methods
eth_accounts()
eth_accounts(): string[];Returns
string[]
Implementation of
EthExecutionAPI.eth_accountseth_blockNumber()
eth_blockNumber(): string;Returns
string
Implementation of
EthExecutionAPI.eth_blockNumbereth_call()
eth_call(_transaction, _blockNumber): string;Parameters
_transaction
TransactionCallAPI
_blockNumber
BlockNumberOrTag
Returns
string
Implementation of
EthExecutionAPI.eth_calleth_clearSubscriptions()
eth_clearSubscriptions(_keepSyncing?): void;Parameters
_keepSyncing?
boolean
Returns
void
Implementation of
EthExecutionAPI.eth_clearSubscriptionseth_coinbase()
eth_coinbase(): string;Returns
string
Implementation of
EthExecutionAPI.eth_coinbaseeth_compileLLL()
eth_compileLLL(_code): string;Parameters
_code
string
Returns
string
Implementation of
EthExecutionAPI.eth_compileLLLeth_compileSerpent()
eth_compileSerpent(_code): string;Parameters
_code
string
Returns
string
Implementation of
EthExecutionAPI.eth_compileSerpenteth_compileSolidity()
eth_compileSolidity(_code): CompileResultAPI;Parameters
_code
string
Returns
CompileResultAPI
Implementation of
EthExecutionAPI.eth_compileSolidityeth_estimateGas()
eth_estimateGas(_transaction, _blockNumber): string;Parameters
_transaction
Partial<TransactionWithSenderAPI>
_blockNumber
BlockNumberOrTag
Returns
string
Implementation of
EthExecutionAPI.eth_estimateGaseth_feeHistory()
eth_feeHistory(
_blockCount,
_newestBlock,
_rewardPercentiles): FeeHistoryResultAPI;Parameters
_blockCount
string
_newestBlock
BlockNumberOrTag
_rewardPercentiles
number[]
Returns
FeeHistoryResultAPI
Implementation of
EthExecutionAPI.eth_feeHistoryeth_gasPrice()
eth_gasPrice(): string;Returns
string
Implementation of
EthExecutionAPI.eth_gasPriceeth_getBalance()
eth_getBalance(_address, _blockNumber): string;Parameters
_address
string
_blockNumber
BlockNumberOrTag
Returns
string
Implementation of
EthExecutionAPI.eth_getBalanceeth_getBlockByHash()
eth_getBlockByHash(_blockHash, _hydrated): BlockAPI;Parameters
_blockHash
string
_hydrated
boolean
Returns
BlockAPI
Implementation of
EthExecutionAPI.eth_getBlockByHasheth_getBlockByNumber()
eth_getBlockByNumber(_blockNumber, _hydrated): BlockAPI;Parameters
_blockNumber
BlockNumberOrTag
_hydrated
boolean
Returns
BlockAPI
Implementation of
EthExecutionAPI.eth_getBlockByNumbereth_getBlockTransactionCountByHash()
eth_getBlockTransactionCountByHash(_blockHash): string;Parameters
_blockHash
string
Returns
string
Implementation of
EthExecutionAPI.eth_getBlockTransactionCountByHasheth_getBlockTransactionCountByNumber()
eth_getBlockTransactionCountByNumber(_blockNumber): string;Parameters
_blockNumber
BlockNumberOrTag
Returns
string
Implementation of
EthExecutionAPI.eth_getBlockTransactionCountByNumbereth_getCode()
eth_getCode(_address, _blockNumber): string;Parameters
_address
string
_blockNumber
BlockNumberOrTag
Returns
string
Implementation of
EthExecutionAPI.eth_getCodeeth_getCompilers()
eth_getCompilers(): string[];Returns
string[]
Implementation of
EthExecutionAPI.eth_getCompilerseth_getFilterChanges()
eth_getFilterChanges(_filterIdentifier): FilterResultsAPI;Parameters
_filterIdentifier
string
Returns
FilterResultsAPI
Implementation of
EthExecutionAPI.eth_getFilterChangeseth_getFilterLogs()
eth_getFilterLogs(_filterIdentifier): FilterResultsAPI;Parameters
_filterIdentifier
string
Returns
FilterResultsAPI
Implementation of
EthExecutionAPI.eth_getFilterLogseth_getLogs()
eth_getLogs(_filter): FilterResultsAPI;Parameters
_filter
Filter
Returns
FilterResultsAPI
Implementation of
EthExecutionAPI.eth_getLogseth_getStorageAt()
eth_getStorageAt(
_address,
_storageSlot,
_blockNumber): string;Parameters
_address
string
_storageSlot
string
_blockNumber
BlockNumberOrTag
Returns
string
Implementation of
EthExecutionAPI.eth_getStorageAteth_getTransactionByBlockHashAndIndex()
eth_getTransactionByBlockHashAndIndex(_blockHash, _transactionIndex): TransactionInfoAPI | undefined;Parameters
_blockHash
string
_transactionIndex
string
Returns
TransactionInfoAPI | undefined
Implementation of
EthExecutionAPI.eth_getTransactionByBlockHashAndIndexeth_getTransactionByBlockNumberAndIndex()
eth_getTransactionByBlockNumberAndIndex(_blockNumber, _transactionIndex): TransactionInfoAPI | undefined;Parameters
_blockNumber
BlockNumberOrTag
_transactionIndex
string
Returns
TransactionInfoAPI | undefined
Implementation of
EthExecutionAPI.eth_getTransactionByBlockNumberAndIndexeth_getTransactionByHash()
eth_getTransactionByHash(_transactionHash): TransactionInfoAPI | undefined;Parameters
_transactionHash
string
Returns
TransactionInfoAPI | undefined
Implementation of
EthExecutionAPI.eth_getTransactionByHasheth_getTransactionCount()
eth_getTransactionCount(_address, _blockNumber): string;Parameters
_address
string
_blockNumber
BlockNumberOrTag
Returns
string
Implementation of
EthExecutionAPI.eth_getTransactionCounteth_getTransactionReceipt()
eth_getTransactionReceipt(_transactionHash): TransactionReceiptAPI | undefined;Parameters
_transactionHash
string
Returns
TransactionReceiptAPI | undefined
Implementation of
EthExecutionAPI.eth_getTransactionReceipteth_getUncleByBlockHashAndIndex()
eth_getUncleByBlockHashAndIndex(_blockHash, _uncleIndex): BlockAPI;Parameters
_blockHash
string
_uncleIndex
string
Returns
BlockAPI
Implementation of
EthExecutionAPI.eth_getUncleByBlockHashAndIndexeth_getUncleByBlockNumberAndIndex()
eth_getUncleByBlockNumberAndIndex(_blockNumber, _uncleIndex): BlockAPI;Parameters
_blockNumber
BlockNumberOrTag
_uncleIndex
string
Returns
BlockAPI
Implementation of
EthExecutionAPI.eth_getUncleByBlockNumberAndIndexeth_getUncleCountByBlockHash()
eth_getUncleCountByBlockHash(_blockHash): string;Parameters
_blockHash
string
Returns
string
Implementation of
EthExecutionAPI.eth_getUncleCountByBlockHasheth_getUncleCountByBlockNumber()
eth_getUncleCountByBlockNumber(_blockNumber): string;Parameters
_blockNumber
BlockNumberOrTag
Returns
string
Implementation of
EthExecutionAPI.eth_getUncleCountByBlockNumbereth_getWork()
eth_getWork(): [string, string, string];Returns
[string, string, string]
Implementation of
EthExecutionAPI.eth_getWorketh_hashrate()
eth_hashrate(): string;Returns
string
Implementation of
EthExecutionAPI.eth_hashrateeth_maxPriorityFeePerGas()
eth_maxPriorityFeePerGas(): string;Returns
string
Implementation of
EthExecutionAPI.eth_maxPriorityFeePerGaseth_mining()
eth_mining(): boolean;Returns
boolean
Implementation of
EthExecutionAPI.eth_miningeth_newBlockFilter()
eth_newBlockFilter(): string;Returns
string
Implementation of
EthExecutionAPI.eth_newBlockFiltereth_newFilter()
eth_newFilter(_filter): string;Parameters
_filter
Filter
Returns
string
Implementation of
EthExecutionAPI.eth_newFiltereth_newPendingTransactionFilter()
eth_newPendingTransactionFilter(): string;Returns
string
Implementation of
EthExecutionAPI.eth_newPendingTransactionFiltereth_protocolVersion()
eth_protocolVersion(): string;Returns
string
Implementation of
EthExecutionAPI.eth_protocolVersioneth_sendRawTransaction()
eth_sendRawTransaction(_transaction): string;Parameters
_transaction
string
Returns
string
Implementation of
EthExecutionAPI.eth_sendRawTransactioneth_sendTransaction()
eth_sendTransaction(_transaction): string;Parameters
_transaction
TransactionWithSenderAPI | Partial<TransactionWithSenderAPI>
Returns
string
Implementation of
EthExecutionAPI.eth_sendTransactioneth_sign()
eth_sign(_address, _message): string;Parameters
_address
string
_message
string
Returns
string
Implementation of
EthExecutionAPI.eth_signeth_signTransaction()
eth_signTransaction(_transaction): string | SignedTransactionInfoAPI;Parameters
_transaction
TransactionWithSenderAPI | Partial<TransactionWithSenderAPI>
Returns
string | `Signed
