|
1 | 1 | # `@solana/spl-token`
|
2 | 2 |
|
3 |
| -A TypeScript library for interacting with the SPL Token program. |
| 3 | +A TypeScript library for interacting with the SPL Token and Token-2022 programs. |
4 | 4 |
|
5 | 5 | ## Links
|
6 | 6 |
|
7 | 7 | - [TypeScript Docs](https://solana-labs.github.io/solana-program-library/token/js/)
|
8 |
| -- [FAQ (Frequently Asked Questions)](./FAQ.md) |
| 8 | +- [FAQs (Frequently Asked Questions)](#faqs) |
9 | 9 | - [Install](#install)
|
10 | 10 | - [Build from Source](#build-from-source)
|
11 | 11 |
|
| 12 | +## FAQs |
| 13 | + |
| 14 | +### How can I get support? |
| 15 | + |
| 16 | +Please ask questions in the Solana Stack Exchange: https://solana.stackexchange.com/ |
| 17 | + |
| 18 | +If you've found a bug or you'd like to request a feature, please |
| 19 | +[open an issue](https://github.com/solana-labs/solana-program-library/issues/new). |
| 20 | + |
| 21 | +### No export named Token |
| 22 | + |
| 23 | +Please see [upgrading from 0.1.x](#upgrading-from-0.1.x). |
| 24 | + |
12 | 25 | ## Install
|
13 | 26 |
|
14 | 27 | ```shell
|
@@ -51,3 +64,32 @@ yarn test
|
51 | 64 | ```shell
|
52 | 65 | yarn example
|
53 | 66 | ```
|
| 67 | + |
| 68 | +## Upgrading |
| 69 | + |
| 70 | +### Upgrading from 0.2.0 |
| 71 | + |
| 72 | +There are no breaking changes from 0.2.0, only new functionality for Token-2022. |
| 73 | + |
| 74 | +### Upgrading from 0.1.x |
| 75 | + |
| 76 | +When upgrading from spl-token 0.1.x, you may see the following error in your code: |
| 77 | + |
| 78 | +``` |
| 79 | +import {TOKEN_PROGRAM_ID, Token, AccountLayout} from '@solana/spl-token'; |
| 80 | + ^^^^^ |
| 81 | +SyntaxError: The requested module '@solana/spl-token' does not provide an export named 'Token' |
| 82 | +``` |
| 83 | + |
| 84 | +The `@solana/spl-token` library as of version 0.2.0 does not have the `Token` |
| 85 | +class. Instead the actions are split up and exported separately. |
| 86 | + |
| 87 | +To use the old version, install it with: |
| 88 | + |
| 89 | +``` |
| 90 | +npm install @solana/[email protected] |
| 91 | +``` |
| 92 | + |
| 93 | +Otherwise you can find documentation on how to use new versions on the |
| 94 | +[SPL docs](https://spl.solana.com/token) or |
| 95 | +[Solana Cookbook](https://solanacookbook.com/references/token.html). |
0 commit comments