> ## Documentation Index
> Fetch the complete documentation index at: https://luminouslabs-cc5545c6-swen-add-code-runner.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Light Token Cookbook

> Client and program guides using the light-token-sdk.

## Recipes

<table>
  <colgroup>
    <col style={{width: "25%"}} />

    <col style={{width: "45%"}} />

    <col style={{width: "10%"}} />

    <col style={{width: "10%"}} />

    <col style={{width: "10%"}} />
  </colgroup>

  <thead>
    <tr>
      <th />

      <th />

      <th style={{textAlign: "center"}}>TypeScript Client</th>
      <th style={{textAlign: "center"}}>Rust Client</th>
      <th style={{textAlign: "center"}}>Program Guide</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td><a href="/light-token/cookbook/create-mint">Create Mint</a></td>
      <td>Create light-mints with token metadata</td>
      <td style={{textAlign: "center"}}>x</td>
      <td style={{textAlign: "center"}}>x</td>
      <td style={{textAlign: "center"}}>x</td>
    </tr>

    <tr>
      <td><a href="/light-token/cookbook/create-ata">Create ATA</a></td>
      <td>Create associated light-token accounts</td>
      <td style={{textAlign: "center"}}>x</td>
      <td style={{textAlign: "center"}}>x</td>
      <td style={{textAlign: "center"}}>x</td>
    </tr>

    <tr>
      <td><a href="/light-token/cookbook/create-token-account">Create Token Account</a></td>
      <td>Create light-token accounts</td>

      <td style={{textAlign: "center"}} />

      <td style={{textAlign: "center"}}>x</td>
      <td style={{textAlign: "center"}}>x</td>
    </tr>

    <tr>
      <td><a href="/light-token/cookbook/mint-to">Mint To</a></td>
      <td>Mint tokens to light-token accounts</td>
      <td style={{textAlign: "center"}}>x</td>
      <td style={{textAlign: "center"}}>x</td>
      <td style={{textAlign: "center"}}>x</td>
    </tr>

    <tr>
      <td><a href="/light-token/cookbook/close-token-account">Close Token Account</a></td>
      <td>Close and reclaim rent</td>

      <td style={{textAlign: "center"}} />

      <td style={{textAlign: "center"}}>x</td>
      <td style={{textAlign: "center"}}>x</td>
    </tr>

    <tr>
      <td><a href="/light-token/cookbook/transfer-interface">Transfer</a></td>
      <td>Transfer between light-token and SPL accounts</td>
      <td style={{textAlign: "center"}}>x</td>
      <td style={{textAlign: "center"}}>x</td>
      <td style={{textAlign: "center"}}>x</td>
    </tr>

    <tr>
      <td><a href="/light-token/cookbook/wrap-unwrap">Wrap & Unwrap</a></td>
      <td>Convert between SPL/T22 and light-token</td>
      <td style={{textAlign: "center"}}>x</td>

      <td style={{textAlign: "center"}} />

      <td style={{textAlign: "center"}} />
    </tr>
  </tbody>
</table>

## Setup

<Accordion title="Dependencies">
  <Tabs>
    <Tab title="npm">
      ```bash theme={null}
      npm install @lightprotocol/stateless.js@alpha \
                  @lightprotocol/compressed-token@alpha
      ```
    </Tab>

    <Tab title="yarn">
      ```bash theme={null}
      yarn add @lightprotocol/stateless.js@alpha \
               @lightprotocol/compressed-token@alpha
      ```
    </Tab>

    <Tab title="pnpm">
      ```bash theme={null}
      pnpm add @lightprotocol/stateless.js@alpha \
               @lightprotocol/compressed-token@alpha
      ```
    </Tab>
  </Tabs>
</Accordion>

<Accordion title="Developer Environment">
  <Tabs>
    <Tab title="Localnet">
      By default, all guides use Localnet.

      <Tabs>
        <Tab title="npm">
          ```bash theme={null}
          npm install -g @lightprotocol/zk-compression-cli@alpha
          ```
        </Tab>

        <Tab title="yarn">
          ```bash theme={null}
          yarn global add @lightprotocol/zk-compression-cli@alpha
          ```
        </Tab>

        <Tab title="pnpm">
          ```bash theme={null}
          pnpm add -g @lightprotocol/zk-compression-cli@alpha
          ```
        </Tab>
      </Tabs>

      ```bash theme={null}
      # Start a local test validator
      light test-validator

      ## ensure you have the Solana CLI accessible in your system PATH
      ```

      ```typescript theme={null}
      // 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();
      ```
    </Tab>

    <Tab title="Devnet">
      Replace `<your-api-key>` with your actual API key. [Get your API key here](https://www.helius.dev/zk-compression), if you don't have one yet.

      ```typescript theme={null}
      import { createRpc } from "@lightprotocol/stateless.js";

      // Helius exposes Solana and Photon RPC endpoints through a single URL
      const RPC_ENDPOINT = "https://devnet.helius-rpc.com?api-key=<your_api_key>";
      const connection = createRpc(RPC_ENDPOINT, RPC_ENDPOINT, RPC_ENDPOINT);

      console.log("Connection created!");
      console.log("RPC Endpoint:", RPC_ENDPOINT);
      ```
    </Tab>
  </Tabs>
</Accordion>
