Skip to main content

Recipes

TypeScript ClientRust ClientProgram Guide
Create MintCreate light-mints with token metadataxxx
Create ATACreate associated light-token accountsxxx
Create Token AccountCreate light-token accountsxx
Mint ToMint tokens to light-token accountsxxx
Close Token AccountClose and reclaim rentxx
TransferTransfer between light-token and SPL accountsxxx
Wrap & UnwrapConvert between SPL/T22 and light-tokenx

Setup

npm install @lightprotocol/stateless.js@alpha \
            @lightprotocol/compressed-token@alpha
By default, all guides use Localnet.
npm install -g @lightprotocol/zk-compression-cli@alpha
# Start a local test validator
light test-validator

## ensure you have the Solana CLI accessible in your system PATH
// createRpc() defaults to local test validator endpoints
import {
  Rpc,
  createRpc,
} from "@lightprotocol/stateless.js";

const connection: Rpc = createRpc();

async function main() {
  let slot = await connection.getSlot();
  console.log(slot);

  let health = await connection.getIndexerHealth(slot);
  console.log(health);
  // "Ok"
}

main();