diff --git a/CHANGELOG.md b/CHANGELOG.md index 07f9ad9c53..1a99323c9e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm ### Changed - Improve all-around performance by reverting the Apple silicon workaround (https://github.com/o1-labs/o1js/pull/683) as the root problem is now fixed upstream https://github.com/o1-labs/o1js/pull/1456 +- Improved error message when trying to use `fetchActions`/`fetchEvents` with a missing Archive Node endpoint https://github.com/o1-labs/o1js/pull/1459 ### Deprecated diff --git a/src/lib/fetch.ts b/src/lib/fetch.ts index 73d324770d..e357579501 100644 --- a/src/lib/fetch.ts +++ b/src/lib/fetch.ts @@ -640,8 +640,8 @@ async function fetchEvents( filterOptions: EventActionFilterOptions = {} ) { if (!graphqlEndpoint) - throw new Error( - 'fetchEvents: Specified GraphQL endpoint is undefined. Please specify a valid endpoint.' + throw Error( + 'fetchEvents: Specified GraphQL endpoint is undefined. When using events, you must set the archive node endpoint in Mina.Network(). Please ensure your Mina.Network() configuration includes an archive node endpoint.' ); const { publicKey, tokenId } = accountInfo; let [response, error] = await makeGraphqlRequest( @@ -689,8 +689,8 @@ async function fetchActions( graphqlEndpoint = networkConfig.archiveEndpoint ) { if (!graphqlEndpoint) - throw new Error( - 'fetchActions: Specified GraphQL endpoint is undefined. Please specify a valid endpoint.' + throw Error( + 'fetchActions: Specified GraphQL endpoint is undefined. When using actions, you must set the archive node endpoint in Mina.Network(). Please ensure your Mina.Network() configuration includes an archive node endpoint.' ); const { publicKey,