metaplex-foundation/kinobi

Magiceden IDL error

Closed this issue · 4 comments

4lve commented

When I tried to generate code from the magiceden idl I got this error

SyntaxError: Identifier expected. (10:10)
   8 |
   9 | import { GetDataEnumKind, GetDataEnumKindContent, Serializer, dataEnum, struct, tuple } from '@metaplex-foundation/umi/serializers';
> 10 | import { &'refsAccountInfo<'a>, &'refsAccountInfo<'a>Args, &'refsPubkey, &'refsPubkeyArgs, get&'refsAccountInfo<'a>Serializer, get&'refsPubkeySerializer } from '.';
     |          ^
  11 |
  12 |
  13 | export type DestinationSpecifier = { __kind: "Key", fields: [&'refsPubkey];  } | { __kind: "Ai", fields: [&'refsAccountInfo<'a>];  };
    at v (C:\Users\alvej\Documents\NodeJS\Solana\umi-testing\node_modules\.pnpm\prettier@2.8.8\node_modules\prettier\parser-typescript.js:1:14679)
    at _H (C:\Users\alvej\Documents\NodeJS\Solana\umi-testing\node_modules\.pnpm\prettier@2.8.8\node_modules\prettier\parser-typescript.js:49:10722)
    at Object.cH [as parse] (C:\Users\alvej\Documents\NodeJS\Solana\umi-testing\node_modules\.pnpm\prettier@2.8.8\node_modules\prettier\parser-typescript.js:49:11028)
    at Object.parse (C:\Users\alvej\Documents\NodeJS\Solana\umi-testing\node_modules\.pnpm\prettier@2.8.8\node_modules\prettier\index.js:7515:23)
    at coreFormat (C:\Users\alvej\Documents\NodeJS\Solana\umi-testing\node_modules\.pnpm\prettier@2.8.8\node_modules\prettier\index.js:8829:18)
    at formatWithCursor2 (C:\Users\alvej\Documents\NodeJS\Solana\umi-testing\node_modules\.pnpm\prettier@2.8.8\node_modules\prettier\index.js:9021:18)
    at C:\Users\alvej\Documents\NodeJS\Solana\umi-testing\node_modules\.pnpm\prettier@2.8.8\node_modules\prettier\index.js:38183:12
    at format (C:\Users\alvej\Documents\NodeJS\Solana\umi-testing\node_modules\.pnpm\prettier@2.8.8\node_modules\prettier\index.js:38197:12)
    at render (C:\Users\alvej\Documents\NodeJS\Solana\umi-testing\node_modules\.pnpm\@metaplex-foundation+kinobi@0.17.1_fastestsmallesttextencoderdecoder@1.0.22\node_modules\@metaplex-foundation\kino

Hmm... Looks like you are generated Rust code inside JavaScript import statements. How have you managed that?! 😅

4lve commented

Idk lol, it generated rust code with both experimental and normal. You could see if you get the same result with this idl
m2.json

The IDL looks normal. Are you able to show me how you use Kinobi to generate the clients? Either by sharing your repo or by creating a small public repo able to reproduce the issue.

4lve commented

This was fixed, Magiceden just had some rust code in their idl for some reason