1

Hi I am new to solana and i am testing my mint nft contract , while testing when i import my program using :

import { SolanaNftAnchor } from "../target/types/solana_nft_anchor";

It gives me an error: Type 'SolanaNftAnchor' does not satisfy the constraint 'Idl'. Type 'SolanaNftAnchor' is missing the following properties from type 'Idl': address, metadata enter image description here

While the json in /target/idl/solana-nft-anchor.json contains metadata and address but /target/types/solana-nft-anchor.ts doesnt.

anchor : 0.30.0

Program is successfully Deployed

1 Answer 1

4

As per this answer, it's because the IDL spec was rewritten with the 0.0.30 release and it's incompatible with previous versions of anchor.

Please update your anchor TS client version to 0.0.29 "@coral-xyz/anchor": "^0.29.0",

7
  • yes exactly i am importing same like this. and i actually follow your tutorial. Commented Apr 27 at 4:56
  • could you share the repo? Other thing to try, 1. restart the TS dev server. 2. run anchor test to regenerate the idl and types from the build step. 3. downgrade to a lower version of anchor, preferably the one specified on the tutorial
    – Jimii
    Commented Apr 27 at 10:58
  • I didnt find the anchor version in tutorial but for sure ill share the repo link : github.com/MohammadAbuzar945/Solana-NFTMint-Program.git Commented Apr 27 at 11:10
  • FYI: I just try all three methods but didnt work for me. Commented Apr 27 at 12:04
  • check edited answer @MohammadAbuzar
    – Jimii
    Commented Apr 27 at 14:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.