fix: implement getNetworkTip() in OgmiosProvider

Missing method caused slot=0, then spendSlot=-60, which wraps to
a huge unsigned int triggering PastHorizon errors from Ogmios.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
david
2026-04-09 13:37:47 +02:00
parent c14752ad75
commit a0f5dc25f8

View File

@@ -173,6 +173,14 @@ export class OgmiosProvider implements Provider {
); );
} }
async getNetworkTip(): Promise<{ slot: number; hash: string }> {
const result = await this.rpc('queryNetwork/tip');
return {
slot: result.slot ?? 0,
hash: result.id ?? '',
};
}
async getUtxosByOutRef(outRefs: OutRef[]): Promise<UTxO[]> { async getUtxosByOutRef(outRefs: OutRef[]): Promise<UTxO[]> {
const outputReferences = outRefs.map((ref) => ({ const outputReferences = outRefs.map((ref) => ({
transaction: { id: ref.txHash }, transaction: { id: ref.txHash },