feat: add getCurrentBlock and getLastBlock methods
This commit is contained in:
parent
256f29b692
commit
661e146636
|
@ -77,6 +77,19 @@ export default abstract class BaseClient {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public getCurrentBlock(): number {
|
||||||
|
return getCurrentSlot(this.config.chainConfig, this.genesisTime);
|
||||||
|
}
|
||||||
|
public getLastBlock(): number | null {
|
||||||
|
if (this._latestOptimisticUpdate) {
|
||||||
|
return capella.ssz.LightClientOptimisticUpdate.deserialize(
|
||||||
|
this._latestOptimisticUpdate,
|
||||||
|
).attestedHeader.beacon.slot;
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
public async getNextValidExecutionInfo(
|
public async getNextValidExecutionInfo(
|
||||||
retry: number = 10,
|
retry: number = 10,
|
||||||
): Promise<ExecutionInfo> {
|
): Promise<ExecutionInfo> {
|
||||||
|
|
Loading…
Reference in New Issue