From d85ff5bf8f779003d8e4292f54539303a7167a87 Mon Sep 17 00:00:00 2001 From: ricomiles Date: Fri, 20 Dec 2024 17:47:19 +0800 Subject: [PATCH] feat: implement readTip function for SyncClient --- src/cardano.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/cardano.ts b/src/cardano.ts index 900247e..c1a7d80 100644 --- a/src/cardano.ts +++ b/src/cardano.ts @@ -141,6 +141,11 @@ export class SyncClient { } } + async readTip(): Promise { + const res = await this.inner.readTip({}); + return blockRefToPoint(res.tip!); + } + async fetchBlock(p: ChainPoint): Promise { const req = pointToBlockRef(p); const res = await this.inner.fetchBlock({ ref: [req] });