diff --git a/packages/core/src/lib/lit-core.ts b/packages/core/src/lib/lit-core.ts index 0deba36e13..54234bced2 100644 --- a/packages/core/src/lib/lit-core.ts +++ b/packages/core/src/lib/lit-core.ts @@ -490,7 +490,13 @@ export class LitCore { getLatestBlockhash = async (): Promise => { await this.connect(); - return this.latestBlockhash as string; + if (!this.latestBlockhash) { + throw new Error( + `latestBlockhash is not available. Received: "${this.latestBlockhash}"` + ); + } + + return this.latestBlockhash; }; /**