@cartbc/cpl-token
v0.1.0
Published
CPL Token Program JS API
Downloads
2
Readme
@cartbc/cpl-token
A TypeScript library for interacting with the CPL Token and Token-2022 programs.
Links
- TypeScript Docs
- TypeScript Docs - Standalone
- FAQs (Frequently Asked Questions)
- Install
- Build from Source
FAQs
How can I get support?
Please ask questions in the Cartes Stack Exchange: https://cartes.stackexchange.com/
If you've found a bug or you'd like to request a feature, please open an issue.
No export named Token
Please see upgrading from 0.1.x.
Install
npm install --save @cartbc/cpl-token @cartbc/web3.js
OR
yarn add @cartbc/cpl-token @cartbc/web3.js
Build from Source
- Prerequisites
- Node 16+
- NPM 8+
- Clone the project:
git clone https://github.com/cartallum/cpl-token.git
- Navigate to the library:
cd cpl-token
- Install the dependencies:
npm install
- Build the library:
npm run build
- Build the on-chain programs:
npm run test:build-programs
- Run the tests:
npm run test
- Run the example:
npm run example
Upgrading
Upgrading from 0.2.0
There are no breaking changes from 0.2.0, only new functionality for Token-2022.
Upgrading from 0.1.x
When upgrading from cpl-token 0.1.x, you may see the following error in your code:
import {TOKEN_PROGRAM_ID, Token, AccountLayout} from '@cartbc/cpl-token';
^^^^^
SyntaxError: The requested module '@cartbc/cpl-token' does not provide an export named 'Token'
The @cartbc/cpl-token
library as of version 0.2.0 does not have the Token
class. Instead the actions are split up and exported separately.
To use the old version, install it with:
npm install @cartbc/[email protected]
Otherwise you can find documentation on how to use new versions on the CPL docs or Cartes Cookbook.