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
69 changes: 69 additions & 0 deletions .github/workflows/token-kit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
on:
push:
branches:
- main
paths:
- "js/token-sdk/**"
- "js/token-client/**"
- "js/token-idl/**"
- "pnpm-lock.yaml"
pull_request:
branches:
- "*"
paths:
- "js/token-sdk/**"
- "js/token-client/**"
- "js/token-idl/**"
- "pnpm-lock.yaml"
types:
- opened
- synchronize
- reopened
- ready_for_review

name: token-kit

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
token-kit-tests:
name: token-kit-tests
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- name: Checkout sources
uses: actions/checkout@v6

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22"

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9
run_install: false

- name: Install just
uses: extractions/setup-just@v2

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Build token-sdk
run: cd js/token-sdk && pnpm build

- name: Run token-sdk unit tests
run: just js test-token-sdk

- name: Run token-client unit tests
run: just js test-token-client

- name: Lint token-sdk
run: just js lint-token-kit
7 changes: 7 additions & 0 deletions js/compressed-token/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ export {
getOrCreateAtaInterface,
transferInterface,
decompressInterface,
decompressMint,
wrap,
mintTo as mintToCToken,
mintToCompressed,
Expand All @@ -90,6 +91,8 @@ export {
updateMetadataField,
updateMetadataAuthority,
removeMetadataKey,
createAssociatedCTokenAccount,
createAssociatedCTokenAccountIdempotent,
// Action types
InterfaceOptions,
// Helpers
Expand Down Expand Up @@ -120,6 +123,10 @@ export {
encodeTokenMetadata,
extractTokenMetadata,
ExtensionType,
// Derivation
getAssociatedCTokenAddress,
getAssociatedCTokenAddressAndBump,
findMintAddress,
// Metadata formatting (for use with any uploader)
toOffChainMetadataJson,
OffChainTokenMetadata,
Expand Down
26 changes: 26 additions & 0 deletions js/justfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ build:
cd stateless.js && pnpm build
cd compressed-token && pnpm build

build-token-kit:
cd token-sdk && pnpm build
cd token-client && pnpm build

test: test-stateless test-compressed-token

test-stateless:
Expand All @@ -18,10 +22,32 @@ test-compressed-token:
test-compressed-token-unit-v2:
cd compressed-token && pnpm test:unit:all:v2

test-token-sdk:
cd token-sdk && pnpm test

test-token-client:
cd token-client && pnpm test

test-token-kit: test-token-sdk test-token-client

start-validator:
./../cli/test_bin/run test-validator

test-token-sdk-e2e: start-validator
cd token-sdk && LIGHT_PROTOCOL_VERSION=V2 LIGHT_PROTOCOL_BETA=true pnpm test:e2e

test-token-client-e2e: start-validator
cd token-client && LIGHT_PROTOCOL_VERSION=V2 LIGHT_PROTOCOL_BETA=true pnpm test:e2e

test-token-kit-e2e: start-validator test-token-sdk-e2e test-token-client-e2e

lint:
cd stateless.js && pnpm lint
cd compressed-token && pnpm lint

lint-token-kit:
cd token-sdk && pnpm lint

format:
cd stateless.js && pnpm format
cd compressed-token && pnpm format
54 changes: 54 additions & 0 deletions js/token-client/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"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 tests/unit/",
"test:e2e": "vitest run --config vitest.e2e.config.ts",
"test:watch": "vitest"
},
"peerDependencies": {
"@solana/kit": "^2.1.0"
},
"dependencies": {
"@lightprotocol/token-sdk": "workspace:*",
"@solana/addresses": "^2.1.0",
"@solana/codecs": "^2.1.0",
"@solana/instructions": "^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"
}
}
Loading
Loading