npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@xyo-network/chain-sdk

v1.20.5

Published

XYO Layer One SDK

Readme

@xyo-network/chain-sdk

![logo][]

[![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

Interfaces

Type Aliases

Variables

Functions

classes

AddressBalanceDivinerV2

@xyo-network/chain-sdk


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>.constructor

Properties

configSchemas

readonly static configSchemas: string[];

Overrides

AbstractDiviner.configSchemas

defaultConfigSchema

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.startHandler

divineHandler()

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.divineHandler

AddressTransferDiviner

@xyo-network/chain-sdk


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>.constructor

Properties

configSchemas

readonly static configSchemas: string[];

Overrides

AbstractDiviner.configSchemas

defaultConfigSchema

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.startHandler

divineHandler()

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.divineHandler

ArchivistNextWitness

@xyo-network/chain-sdk


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>.constructor

Properties

configSchemas

readonly static configSchemas: string[];

Overrides

AbstractWitness.configSchemas

defaultConfigSchema

readonly static defaultConfigSchema: string;

Overrides

AbstractWitness.defaultConfigSchema

Methods

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.observeHandler

ArchivistSyncDiviner

@xyo-network/chain-sdk


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

Constructors

Constructor

new ArchivistSyncDiviner(key, params): ArchivistSyncDiviner;

Parameters

key

unknown

params

Partial<TParams & RequiredCreatableParams>

Returns

ArchivistSyncDiviner

Inherited from

AbstractDiviner<ArchivistSyncDivinerParams>.constructor

Properties

configSchemas

readonly static configSchemas: string[];

Overrides

AbstractDiviner.configSchemas

defaultConfigSchema

readonly static defaultConfigSchema: string;

Overrides

AbstractDiviner.defaultConfigSchema

Accessors

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.divineHandler

resync()

resync(): Promise<void>;

Returns

Promise<void>


startHandler()

startHandler(): Promise<void>;

Returns

Promise<void>

Overrides

AbstractDiviner.startHandler

getInArchivist()

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

@xyo-network/chain-sdk


Implements

  • ChainAnalyzer

Constructors

Constructor

new BalanceAnalyzer(
   addresses?, 
   minBalances?, 
   startingBalances?): BalanceAnalyzer;

Parameters

addresses?

Address[]

minBalances?

bigint[]

startingBalances?

ChainSummaryBalances

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.onBlock

result()

result(): ChainSummaryBalances;

Returns

ChainSummaryBalances

Implementation of

ChainAnalyzer.result

shouldContinue()

shouldContinue(): boolean;

Returns

boolean

Implementation of

ChainAnalyzer.shouldContinue

allMinBalancesReached()

protected allMinBalancesReached(): boolean;

Returns

boolean

BaseAccountBalanceService

@xyo-network/chain-sdk


Extends

Implements

  • AccountBalanceService

Constructors

Constructor

new BaseAccountBalanceService(key, params): BaseAccountBalanceService;

Parameters

key

unknown

params

Partial<TParams & RequiredCreatableParams>

Returns

BaseAccountBalanceService

Inherited from

BaseService.constructor

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

BaseService.singletons

Methods

accountBalance()

accountBalance(address, headOrRange?): Promise<AttoXL1>;

Parameters

address

Address

headOrRange?

Hash | XL1BlockRange

Returns

Promise<AttoXL1>

Implementation of

AccountBalanceService.accountBalance

accountBalanceHistory()

Call Signature

accountBalanceHistory(address): Promise<AccountBalanceHistoryItem[]>;

Parameters

address

Address

Returns

Promise<AccountBalanceHistoryItem[]>

Implementation of

AccountBalanceService.accountBalanceHistory

Call Signature

accountBalanceHistory(address, head): Promise<AccountBalanceHistoryItem[]>;

Parameters

address

Address

head

Hash

Returns

Promise<AccountBalanceHistoryItem[]>

Implementation of

AccountBalanceService.accountBalanceHistory

Call Signature

accountBalanceHistory(address, range): Promise<AccountBalanceHistoryItem[]>;

Parameters

address

Address

range

XL1BlockRange

Returns

Promise<AccountBalanceHistoryItem[]>

Implementation of

AccountBalanceService.accountBalanceHistory

accountBalances()

accountBalances(address, _headOrRange?): Promise<Partial<Record<Address, AttoXL1>>>;

Parameters

address

Address[]

_headOrRange?

Hash | XL1BlockRange

Returns

Promise<Partial<Record<Address, AttoXL1>>>

Implementation of

AccountBalanceService.accountBalances

accountBalancesHistories()

Call Signature

accountBalancesHistories(addresses): Promise<Partial<Record<Address, AccountBalanceHistoryItem[]>>>;

Parameters

addresses

Address[]

Returns

Promise<Partial<Record<Address, AccountBalanceHistoryItem[]>>>

Implementation of

AccountBalanceService.accountBalancesHistories

Call Signature

accountBalancesHistories(addresses, head): Promise<Partial<Record<Address, AccountBalanceHistoryItem[]>>>;

Parameters

addresses

Address[]

head

Hash

Returns

Promise<Partial<Record<Address, AccountBalanceHistoryItem[]>>>

Implementation of

AccountBalanceService.accountBalancesHistories

Call Signature

accountBalancesHistories(addresses, range): Promise<Partial<Record<Address, AccountBalanceHistoryItem[]>>>;

Parameters

addresses

Address[]

range

XL1BlockRange

Returns

Promise<Partial<Record<Address, AccountBalanceHistoryItem[]>>>

Implementation of

AccountBalanceService.accountBalancesHistories

createHandler()

createHandler(): void;

Returns

void

Overrides

BaseService.createHandler

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

BaseService.initSingleton


paramsHandler()

paramsHandler(params?): BaseAccountBalanceServiceParams;

Parameters

params?

Partial<BaseAccountBalanceServiceParams>

Returns

BaseAccountBalanceServiceParams

Inherited from

BaseService.paramsHandler


span()

span<T>(name, fn): T;

Type Parameters

T

T

Parameters

name

string

fn

() => T

Returns

T

Inherited from

BaseService.span


spanAsync()

spanAsync<T>(name, fn): Promise<T>;

Type Parameters

T

T

Parameters

name

string

fn

() => Promise<T>

Returns

Promise<T>

Inherited from

BaseService.spanAsync

BaseAccountTransfersService

@xyo-network/chain-sdk


Extends

Implements

  • AccountTransfersService

Constructors

Constructor

new BaseAccountTransfersService(key, params): BaseAccountTransfersService;

Parameters

key

unknown

params

Partial<TParams & RequiredCreatableParams>

Returns

BaseAccountTransfersService

Inherited from

BaseService.constructor

Accessors

singletons

Get Signature

get static singletons(): Record<string, unknown>;

Returns

Record<string, unknown>

Inherited from

BaseService.singletons

Methods

transfer()

transfer(head, address): Promise<AttoXL1>;

Parameters

head

Hash

address

Address

Returns

Promise<AttoXL1>

Implementation of

AccountTransfersService.transfer

transfers()

transfers(head, addresses): Promise<Partial<Record<Address, AttoXL1>>>;

Parameters

head

Hash

addresses

Address[]

Returns

Promise<Partial<Record<Address, AttoXL1>>>

Implementation of

AccountTransfersService.transfers

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

BaseService.initSingleton


paramsHandler()

paramsHandler(params?): BaseAccountTransferServiceParams;

Parameters

params?

Partial<BaseAccountTransferServiceParams>

Returns

BaseAccountTransferServiceParams

Inherited from

BaseService.paramsHandler


span()

span<T>(name, fn): T;

Type Parameters

T

T

Parameters

name

string

fn

() => T

Returns

T

Inherited from

BaseService.span


spanAsync()

spanAsync<T>(name, fn): Promise<T>;

Type Parameters

T

T

Parameters

name

string

fn

() => Promise<T>

Returns

Promise<T>

Inherited from

BaseService.spanAsync

BaseAccountableService

@xyo-network/chain-sdk


Extends

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

BaseService.constructor

Accessors

singletons

Get Signature

get static singletons(): Record<string, unknown>;

Returns

Record<string, unknown>

Inherited from

BaseService.singletons

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

BaseService.initSingleton


paramsHandler()

paramsHandler(params?): TParams;

Parameters

params?

Partial<TParams>

Returns

TParams

Inherited from

BaseService.paramsHandler


span()

span<T>(name, fn): T;

Type Parameters

T

T

Parameters

name

string

fn

() => T

Returns

T

Inherited from

BaseService.span


spanAsync()

spanAsync<T>(name, fn): Promise<T>;

Type Parameters

T

T

Parameters

name

string

fn

() => Promise<T>

Returns

Promise<T>

Inherited from

BaseService.spanAsync

BaseBlockProducerService

@xyo-network/chain-sdk


Extends

Implements

  • BlockProducerService

Constructors

Constructor

new BaseBlockProducerService(key, params): BaseBlockProducerService;

Parameters

key

unknown

params

Partial<TParams & RequiredCreatableParams>

Returns

BaseBlockProducerService

Inherited from

BaseService.constructor

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

BaseService.singletons


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.address

account

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

BaseService.initSingleton


paramsHandler()

paramsHandler(params?): BaseBlockProducerServiceParams;

Parameters

params?

Partial<BaseBlockProducerServiceParams>

Returns

BaseBlockProducerServiceParams

Inherited from

BaseService.paramsHandler


span()

span<T>(name, fn): T;

Type Parameters

T

T

Parameters

name

string

fn

() => T

Returns

T

Inherited from

BaseService.span


spanAsync()

spanAsync<T>(name, fn): Promise<T>;

Type Parameters

T

T

Parameters

name

string

fn

() => Promise<T>

Returns

Promise<T>

Inherited from

BaseService.spanAsync


next()

next(head): Promise<HydratedBlock | undefined>;

Parameters

head

WithStorageMeta<BlockBoundWitness>

Returns

Promise<HydratedBlock | undefined>

Implementation of

BlockProducerService.next

getBlockRewardTransfers()

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

@xyo-network/chain-sdk


Extends

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

BaseService.constructor

Accessors

singletons

Get Signature

get static singletons(): Record<string, unknown>;

Returns

Record<string, unknown>

Inherited from

BaseService.singletons

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

BaseService.initSingleton


paramsHandler()

paramsHandler(params?): TParams;

Parameters

params?

Partial<TParams>

Returns

TParams

Inherited from

BaseService.paramsHandler


span()

span<T>(name, fn): T;

Type Parameters

T

T

Parameters

name

string

fn

() => T

Returns

T

Inherited from

BaseService.span


spanAsync()

spanAsync<T>(name, fn): Promise<T>;

Type Parameters

T

T

Parameters

name

string

fn

() => Promise<T>

Returns

Promise<T>

Inherited from

BaseService.spanAsync


getRewardForBlock()

getRewardForBlock(_blockNumber): Promisable<bigint>;

Parameters

_blockNumber

bigint

Returns

Promisable<bigint>

Implementation of

BlockRewardService.getRewardForBlock

BaseElectionService

@xyo-network/chain-sdk


Extends

Implements

  • ElectionService

Constructors

Constructor

new BaseElectionService(key, params): BaseElectionService;

Parameters

key

unknown

params

Partial<TParams & RequiredCreatableParams>

Returns

BaseElectionService

Inherited from

BaseService.constructor

Accessors

singletons

Get Signature

get static singletons(): Record<string, unknown>;

Returns

Record<string, unknown>

Inherited from

BaseService.singletons


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

BaseService.initSingleton


paramsHandler()

paramsHandler(params?): BaseElectionServicesParams;

Parameters

params?

Partial<BaseElectionServicesParams>

Returns

BaseElectionServicesParams

Inherited from

BaseService.paramsHandler


span()

span<T>(name, fn): T;

Type Parameters

T

T

Parameters

name

string

fn

() => T

Returns

T

Inherited from

BaseService.span


spanAsync()

spanAsync<T>(name, fn): Promise<T>;

Type Parameters

T

T

Parameters

name

string

fn

() => Promise<T>

Returns

Promise<T>

Inherited from

BaseService.spanAsync


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.getCreatorCommitteeForNextBlock

generateCreatorCommittee()

protected generateCreatorCommittee(
   candidates, 
   previousBlockHash, 
   maxSize?): Address[];

Parameters

candidates

Address[]

previousBlockHash

Hash

maxSize?

number

Returns

Address[]

BaseEthProvider

@xyo-network/chain-sdk


Implements

  • EthExecutionAPI

Constructors

Constructor

new BaseEthProvider(): BaseEthProvider;

Returns

BaseEthProvider

Methods

eth_accounts()

eth_accounts(): string[];

Returns

string[]

Implementation of

EthExecutionAPI.eth_accounts

eth_blockNumber()

eth_blockNumber(): string;

Returns

string

Implementation of

EthExecutionAPI.eth_blockNumber

eth_call()

eth_call(_transaction, _blockNumber): string;

Parameters

_transaction

TransactionCallAPI

_blockNumber

BlockNumberOrTag

Returns

string

Implementation of

EthExecutionAPI.eth_call

eth_clearSubscriptions()

eth_clearSubscriptions(_keepSyncing?): void;

Parameters

_keepSyncing?

boolean

Returns

void

Implementation of

EthExecutionAPI.eth_clearSubscriptions

eth_coinbase()

eth_coinbase(): string;

Returns

string

Implementation of

EthExecutionAPI.eth_coinbase

eth_compileLLL()

eth_compileLLL(_code): string;

Parameters

_code

string

Returns

string

Implementation of

EthExecutionAPI.eth_compileLLL

eth_compileSerpent()

eth_compileSerpent(_code): string;

Parameters

_code

string

Returns

string

Implementation of

EthExecutionAPI.eth_compileSerpent

eth_compileSolidity()

eth_compileSolidity(_code): CompileResultAPI;

Parameters

_code

string

Returns

CompileResultAPI

Implementation of

EthExecutionAPI.eth_compileSolidity

eth_estimateGas()

eth_estimateGas(_transaction, _blockNumber): string;

Parameters

_transaction

Partial<TransactionWithSenderAPI>

_blockNumber

BlockNumberOrTag

Returns

string

Implementation of

EthExecutionAPI.eth_estimateGas

eth_feeHistory()

eth_feeHistory(
   _blockCount, 
   _newestBlock, 
   _rewardPercentiles): FeeHistoryResultAPI;

Parameters

_blockCount

string

_newestBlock

BlockNumberOrTag

_rewardPercentiles

number[]

Returns

FeeHistoryResultAPI

Implementation of

EthExecutionAPI.eth_feeHistory

eth_gasPrice()

eth_gasPrice(): string;

Returns

string

Implementation of

EthExecutionAPI.eth_gasPrice

eth_getBalance()

eth_getBalance(_address, _blockNumber): string;

Parameters

_address

string

_blockNumber

BlockNumberOrTag

Returns

string

Implementation of

EthExecutionAPI.eth_getBalance

eth_getBlockByHash()

eth_getBlockByHash(_blockHash, _hydrated): BlockAPI;

Parameters

_blockHash

string

_hydrated

boolean

Returns

BlockAPI

Implementation of

EthExecutionAPI.eth_getBlockByHash

eth_getBlockByNumber()

eth_getBlockByNumber(_blockNumber, _hydrated): BlockAPI;

Parameters

_blockNumber

BlockNumberOrTag

_hydrated

boolean

Returns

BlockAPI

Implementation of

EthExecutionAPI.eth_getBlockByNumber

eth_getBlockTransactionCountByHash()

eth_getBlockTransactionCountByHash(_blockHash): string;

Parameters

_blockHash

string

Returns

string

Implementation of

EthExecutionAPI.eth_getBlockTransactionCountByHash

eth_getBlockTransactionCountByNumber()

eth_getBlockTransactionCountByNumber(_blockNumber): string;

Parameters

_blockNumber

BlockNumberOrTag

Returns

string

Implementation of

EthExecutionAPI.eth_getBlockTransactionCountByNumber

eth_getCode()

eth_getCode(_address, _blockNumber): string;

Parameters

_address

string

_blockNumber

BlockNumberOrTag

Returns

string

Implementation of

EthExecutionAPI.eth_getCode

eth_getCompilers()

eth_getCompilers(): string[];

Returns

string[]

Implementation of

EthExecutionAPI.eth_getCompilers

eth_getFilterChanges()

eth_getFilterChanges(_filterIdentifier): FilterResultsAPI;

Parameters

_filterIdentifier

string

Returns

FilterResultsAPI

Implementation of

EthExecutionAPI.eth_getFilterChanges

eth_getFilterLogs()

eth_getFilterLogs(_filterIdentifier): FilterResultsAPI;

Parameters

_filterIdentifier

string

Returns

FilterResultsAPI

Implementation of

EthExecutionAPI.eth_getFilterLogs

eth_getLogs()

eth_getLogs(_filter): FilterResultsAPI;

Parameters

_filter

Filter

Returns

FilterResultsAPI

Implementation of

EthExecutionAPI.eth_getLogs

eth_getStorageAt()

eth_getStorageAt(
   _address, 
   _storageSlot, 
   _blockNumber): string;

Parameters

_address

string

_storageSlot

string

_blockNumber

BlockNumberOrTag

Returns

string

Implementation of

EthExecutionAPI.eth_getStorageAt

eth_getTransactionByBlockHashAndIndex()

eth_getTransactionByBlockHashAndIndex(_blockHash, _transactionIndex): TransactionInfoAPI | undefined;

Parameters

_blockHash

string

_transactionIndex

string

Returns

TransactionInfoAPI | undefined

Implementation of

EthExecutionAPI.eth_getTransactionByBlockHashAndIndex

eth_getTransactionByBlockNumberAndIndex()

eth_getTransactionByBlockNumberAndIndex(_blockNumber, _transactionIndex): TransactionInfoAPI | undefined;

Parameters

_blockNumber

BlockNumberOrTag

_transactionIndex

string

Returns

TransactionInfoAPI | undefined

Implementation of

EthExecutionAPI.eth_getTransactionByBlockNumberAndIndex

eth_getTransactionByHash()

eth_getTransactionByHash(_transactionHash): TransactionInfoAPI | undefined;

Parameters

_transactionHash

string

Returns

TransactionInfoAPI | undefined

Implementation of

EthExecutionAPI.eth_getTransactionByHash

eth_getTransactionCount()

eth_getTransactionCount(_address, _blockNumber): string;

Parameters

_address

string

_blockNumber

BlockNumberOrTag

Returns

string

Implementation of

EthExecutionAPI.eth_getTransactionCount

eth_getTransactionReceipt()

eth_getTransactionReceipt(_transactionHash): TransactionReceiptAPI | undefined;

Parameters

_transactionHash

string

Returns

TransactionReceiptAPI | undefined

Implementation of

EthExecutionAPI.eth_getTransactionReceipt

eth_getUncleByBlockHashAndIndex()

eth_getUncleByBlockHashAndIndex(_blockHash, _uncleIndex): BlockAPI;

Parameters

_blockHash

string

_uncleIndex

string

Returns

BlockAPI

Implementation of

EthExecutionAPI.eth_getUncleByBlockHashAndIndex

eth_getUncleByBlockNumberAndIndex()

eth_getUncleByBlockNumberAndIndex(_blockNumber, _uncleIndex): BlockAPI;

Parameters

_blockNumber

BlockNumberOrTag

_uncleIndex

string

Returns

BlockAPI

Implementation of

EthExecutionAPI.eth_getUncleByBlockNumberAndIndex

eth_getUncleCountByBlockHash()

eth_getUncleCountByBlockHash(_blockHash): string;

Parameters

_blockHash

string

Returns

string

Implementation of

EthExecutionAPI.eth_getUncleCountByBlockHash

eth_getUncleCountByBlockNumber()

eth_getUncleCountByBlockNumber(_blockNumber): string;

Parameters

_blockNumber

BlockNumberOrTag

Returns

string

Implementation of

EthExecutionAPI.eth_getUncleCountByBlockNumber

eth_getWork()

eth_getWork(): [string, string, string];

Returns

[string, string, string]

Implementation of

EthExecutionAPI.eth_getWork

eth_hashrate()

eth_hashrate(): string;

Returns

string

Implementation of

EthExecutionAPI.eth_hashrate

eth_maxPriorityFeePerGas()

eth_maxPriorityFeePerGas(): string;

Returns

string

Implementation of

EthExecutionAPI.eth_maxPriorityFeePerGas

eth_mining()

eth_mining(): boolean;

Returns

boolean

Implementation of

EthExecutionAPI.eth_mining

eth_newBlockFilter()

eth_newBlockFilter(): string;

Returns

string

Implementation of

EthExecutionAPI.eth_newBlockFilter

eth_newFilter()

eth_newFilter(_filter): string;

Parameters

_filter

Filter

Returns

string

Implementation of

EthExecutionAPI.eth_newFilter

eth_newPendingTransactionFilter()

eth_newPendingTransactionFilter(): string;

Returns

string

Implementation of

EthExecutionAPI.eth_newPendingTransactionFilter

eth_protocolVersion()

eth_protocolVersion(): string;

Returns

string

Implementation of

EthExecutionAPI.eth_protocolVersion

eth_sendRawTransaction()

eth_sendRawTransaction(_transaction): string;

Parameters

_transaction

string

Returns

string

Implementation of

EthExecutionAPI.eth_sendRawTransaction

eth_sendTransaction()

eth_sendTransaction(_transaction): string;

Parameters

_transaction

TransactionWithSenderAPI | Partial<TransactionWithSenderAPI>

Returns

string

Implementation of

EthExecutionAPI.eth_sendTransaction

eth_sign()

eth_sign(_address, _message): string;

Parameters

_address

string

_message

string

Returns

string

Implementation of

EthExecutionAPI.eth_sign

eth_signTransaction()

eth_signTransaction(_transaction): string | SignedTransactionInfoAPI;

Parameters

_transaction

TransactionWithSenderAPI | Partial<TransactionWithSenderAPI>

Returns

string | `Signed