This repository contains the SPL Token program and its clients:
program: the original SPL Token program (spl-token).pinocchio/program: the pinocchio-based Token program (p-token).interfaceandpinocchio/interface: the instruction and state definitions used by the programs.clients/js: the JS client, generated from the IDL.
This repository uses a Makefile for building, testing and linting. Package names are mapped to directories by replacing the first - with a / (for example, pinocchio-program refers to pinocchio/program and clients-js to clients/js).
Install the NPM dependencies once to make the Codama renderers available for client generation:
pnpm installBuild the SBF artifacts into target/deploy/ with:
make build-sbf-program
make build-sbf-pinocchio-programThe program tests run against the built artifacts using Mollusk, so build the program before testing it:
make test-program
make test-pinocchio-programYou can also format-check and lint any Rust package, for example:
make format-check-program
make clippy-programThe program IDL is checked in at the repository root as idl.json. Regenerate the JS client from it with:
make generate-clientsThe following clients are available for your programs. You may use the following links to learn more about each client.
The JS client tests load target/deploy/pinocchio_token_program.so into LiteSVM, so build the pinocchio program first:
make build-sbf-pinocchio-program
make test-js-clients-js