Search code examples
tokenanchorsolana

Token is not imported from the @solana/spl-token


enter image description here

I can't import token from the library. What's the reason?


Solution

  • The latest version of @solana/spl-token exports all the actions that were originally on the Token class, giving more flexibility to the client.

    If you want to use the old Token class, you can do the following:

    npm install @solana/spl-token@0.1.8
    

    Otherwise you'll find documentation on @solana/spl-token@0.2.0 at the SPL docs and Solanacookbook