Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions js/token-client/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"name": "@lightprotocol/token-client",
"version": "0.1.0",
"description": "Light Protocol indexer client for compressed tokens",
"type": "module",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"exports": {
".": {
"import": "./dist/index.js",
"types": "./dist/index.d.ts"
}
},
"files": [
"dist",
"src"
],
"scripts": {
"build": "tsc",
"clean": "rm -rf dist",
"test": "vitest run",
"test:watch": "vitest"
},
"peerDependencies": {
"@solana/kit": "^2.1.0"
},
"dependencies": {
"@lightprotocol/token-sdk": "workspace:*",
"@solana/addresses": "^2.1.0",
"@solana/codecs": "^2.1.0"
},
"devDependencies": {
"typescript": "^5.7.3",
"vitest": "^2.1.8"
},
"engines": {
"node": ">=18"
},
"keywords": [
"solana",
"light-protocol",
"compressed-token",
"indexer",
"zk-compression"
],
"license": "Apache-2.0",
"repository": {
"type": "git",
"url": "https://github.com/Lightprotocol/light-protocol.git",
"directory": "js/token-client"
}
}
56 changes: 56 additions & 0 deletions js/token-client/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/**
* Light Protocol Token Client
*
* Indexer client and account loading functions for compressed tokens.
*
* @example
* ```typescript
* import {
* createLightIndexer,
* loadTokenAccountsForTransfer,
* selectAccountsForAmount,
* } from '@lightprotocol/token-client';
*
* // Types from token-sdk:
* import { TreeType, CompressedTokenAccount } from '@lightprotocol/token-sdk';
*
* const indexer = createLightIndexer('https://photon.helius.dev');
* const loaded = await loadTokenAccountsForTransfer(indexer, owner, 1000n);
* ```
*
* @packageDocumentation
*/

// Indexer
export {
type LightIndexer,
PhotonIndexer,
createLightIndexer,
isLightIndexerAvailable,
} from './indexer.js';

// Load functions
export {
// Types
type InputTokenAccount,
type MerkleContext,
type LoadedTokenAccounts,
type LoadTokenAccountsOptions,
type SelectedAccounts,

// Load functions
loadTokenAccountsForTransfer,
loadTokenAccount,
loadAllTokenAccounts,
loadCompressedAccount,
loadCompressedAccountByHash,

// Account selection
selectAccountsForAmount,

// Proof helpers
getValidityProofForAccounts,
needsValidityProof,
getTreeInfo,
getOutputTreeInfo,
} from './load.js';
Loading
Loading