Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error occurs when running the example code of offchain attestation verification. #120

Open
Fred-Porlock opened this issue Jan 14, 2025 · 3 comments

Comments

@Fred-Porlock
Copy link

I ran the example code provided in section "Verifying an Offchain Attestation" and encountered 2 errors.

@Fred-Porlock
Copy link
Author

The first error is "SyntaxError: Named export 'OffchainConfig' not found.". This can be solved by replacing the first line by
import pkg from '@ethereum-attestation-service/eas-sdk'; const { OffchainAttestationVersion, Offchain, OffchainConfig } = pkg;
or
import { OffchainAttestationVersion, Offchain } from "@ethereum-attestation-service/eas-sdk"; import type { OffchainConfig } from '@ethereum-attestation-service/eas-sdk';

@Fred-Porlock
Copy link
Author

The second error is:
83374d0d9c86683160568e7b48c8640
And the error occurs in const isValidAttestation = offchain.verifyOffchainAttestationSignature(attestation.signer, attestation.sig);
I have no idea how to fix it.

@lbeder
Copy link
Member

lbeder commented Jan 14, 2025

What Typescript version are you using? What type of project you use? You can post your tsconfig.json. Regarding the second error, it appears that you are providing the wrong types of parameters to the function, one of which is null, since you get the invalid BytesLike error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants