Skip to main content
SPLLight
Get BalancegetAccount()getAtaInterface()
Tx HistorygetSignaturesForAddress()rpc.getSignaturesForOwnerInterface()
Use the payments agent skill to add light-token payment support to your project:
Add the marketplace and install:
/plugin marketplace add Lightprotocol/skills
/plugin install solana-rent-free-dev
For orchestration, install the general skill:
npx skills add https://zkcompression.com

Setup

npm install @lightprotocol/compressed-token@beta \
            @lightprotocol/stateless.js@beta
import { createRpc } from "@lightprotocol/stateless.js";

const rpc = createRpc(RPC_ENDPOINT);

Query balance

Find a full code example here.
import {
  getAssociatedTokenAddressInterface,
  getAtaInterface,
} from "@lightprotocol/compressed-token/unified";

const ata = getAssociatedTokenAddressInterface(mint, owner);
const account = await getAtaInterface(rpc, ata, owner, mint);

console.log(account.parsed.amount);
import { getAccount } from "@solana/spl-token";

const account = await getAccount(connection, ata);

console.log(account.amount);

Transaction history

Find a full code example here.
Query all transactions for an owner across both on-chain and compressed state:
const result = await rpc.getSignaturesForOwnerInterface(owner);

console.log(result.signatures); // Merged + deduplicated
console.log(result.solana);     // On-chain transactions only
console.log(result.compressed); // Compressed transactions only
Use getSignaturesForAddressInterface(address) if you want address-specific rather than owner-wide history.
const signatures = await connection.getSignaturesForAddress(ata);

Receive payments

Load cold accounts and prepare to receive.

Basic payment

Send a single token transfer.

Verify address

Validate recipient addresses before sending.

Didn’t find what you were looking for?

Reach out! Telegram | email | Discord