Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@solarti/solarti-token

miraland-labs103Apache-2.00.3.7TypeScript support: included

Solarti Token Program JS API

readme

@solarti/solarti-token

A TypeScript library for interacting with the Solarti Token and Token-2022 programs.

FAQs

How can I get support?

Please ask questions in the Solana Stack Exchange: https://solana.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 @solarti/solarti-token @solarti/web3.js

OR

yarn add @solarti/solarti-token @solarti/web3.js

Build from Source

  1. Prerequisites

  2. Node 16+

  3. NPM 8+

  4. Clone the project:

    git clone https://github.com/miraland-labs/solarti-program-library.git
  5. Navigate to the library:

    cd solarti-program-library/token/js
  6. Install the dependencies:

    npm install
  7. Build the library:

    npm run build
  8. Build the on-chain programs:

    npm run test:build-programs
  9. Run the tests:

    npm run test
  10. 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 solarti-token 0.1.x, you may see the following error in your code:

import {TOKEN_PROGRAM_ID, Token, AccountLayout} from '@solarti/solarti-token';
                          ^^^^^
SyntaxError: The requested module '@solarti/solarti-token' does not provide an export named 'Token'

The @solarti/solarti-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 @solarti/solarti-token@0.1.8

Otherwise you can find documentation on how to use new versions on the SPL docs or Solana Cookbook.