Skip to content
Open
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
76 changes: 0 additions & 76 deletions .github/workflows/cli-v1.yml

This file was deleted.

10 changes: 5 additions & 5 deletions .github/workflows/cli-v2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,66 +11,66 @@
- reopened
- ready_for_review

name: cli-tests-v2
name: cli-tests

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

jobs:
cli-v2:
name: cli-v2
cli:
name: cli
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest

services:
redis:
image: redis:8.0.1
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5

env:
LIGHT_PROTOCOL_VERSION: V2
REDIS_URL: redis://localhost:6379
CI: true

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

- name: Setup and build
uses: ./.github/actions/setup-and-build
with:
skip-components: "redis,disk-cleanup,go"
cache-key: "js"

- name: Build stateless.js with V2
run: |
cd js/stateless.js
pnpm build:v2

- name: Build compressed-token with V2
run: |
cd js/compressed-token
pnpm build:v2

- name: Build CLI with V2
- name: Build CLI
run: |
just cli build

- name: Run CLI tests with V2
- name: Run CLI tests
run: |
just cli test

- name: Display prover logs on failure
if: failure()
run: |
echo "=== Displaying prover logs ==="
find . -path "*/test-ledger/*prover*.log" -type f -exec echo "=== Contents of {} ===" \; -exec cat {} \; -exec echo "=== End of {} ===" \; || echo "No prover logs found"

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
51 changes: 28 additions & 23 deletions cli/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ZK Compression CLI

CLI to interact with compressed accounts and compressed tokens on Solana.
CLI to interact with compressed accounts and Light Tokens on Solana.

## Requirements

Expand Down Expand Up @@ -119,7 +119,7 @@ solana address

### Commands

#### Create a compressed token mint
#### Create a Light Token mint

```bash
light create-mint
Expand All @@ -140,7 +140,25 @@ FLAGS
random keypair.
```

#### Mint compressed tokens to a Solana wallet
#### Create a token account

```bash
light create-token-account YOUR_MINT_ADDRESS
```

```
USAGE
$ light create-token-account MINT [--owner <value>]

ARGUMENTS
MINT Base58 encoded mint address.

FLAGS
--owner=<value> Owner of the token account. Defaults to the fee
payer's public key.
```

#### Mint Light Tokens to a Solana wallet

```bash
light mint-to --mint "YOUR_MINT_ADDRESS" --to "YOUR_WALLET_ADDRESS" --amount 4200000000
Expand All @@ -159,7 +177,7 @@ FLAGS
--to=<value> (required) Recipient address.
```

#### Transfer compressed tokens from one wallet to another
#### Transfer Light Tokens from one wallet to another

```bash
light transfer --mint "YOUR_MINT_ADDRESS" --to "RECIPIENT_WALLET_ADDRESS" --amount 4200000000
Expand All @@ -179,35 +197,22 @@ FLAGS

```

#### Assign native SOL to a compressed account
#### Get token balance

```bash
light compress-sol --amount 1000 --to "YOUR_WALLET_ADDRESS_BASE58"
light token-balance --mint "YOUR_MINT_ADDRESS" --owner "OWNER_ADDRESS"
```

```
USAGE
$ light compress-sol --to <value> --amount <value>
$ light token-balance --mint <value> --owner <value>

FLAGS
--amount=<value> (required) Amount to compress in lamports.
--to=<value> (required) Specify the recipient address.
```

#### Decompress into native SOL

```bash
light decompress-sol --amount 42 --to "YOUR_WALLET_ADDRESS_BASE58"
--mint=<value> (required) Mint address of the token account.
--owner=<value> (required) Address of the token owner.
```

```
USAGE
$ light decompress-sol --to <value> --amount <value>

FLAGS
--amount=<value> (required) Amount to decompress in lamports.
--to=<value> (required) Specify the recipient address.
```
Displays light token account (hot), compressed light token (cold), and total balances.

### Support

Expand Down
14 changes: 5 additions & 9 deletions cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,21 +105,17 @@
"test-utils": "mocha ./test/utils/index.test.ts -t 10000000 --exit",
"test-config": "mocha ./test/commands/config/index.test.ts -t 10000000 --exit",
"test-create-mint": "mocha ./test/commands/create-mint/index.test.ts -t 10000000 --exit",
"test-merge-token-accounts": "mocha ./test/commands/merge-token-accounts/index.test.ts -t 10000000 --exit",
"test-create-token-pool": "mocha ./test/commands/create-token-pool/index.test.ts -t 10000000 --exit",
"test-approve-and-mint-to": "mocha ./test/commands/approve-and-mint-to/index.test.ts -t 10000000 --exit",
"test-create-interface-pda": "mocha ./test/commands/create-interface-pda/index.test.ts -t 10000000 --exit",
"test-create-token-account": "mocha ./test/commands/create-token-account/index.test.ts -t 10000000 --exit",
"test-mint-to": "mocha ./test/commands/mint-to/index.test.ts -t 10000000 --exit",
"test-transfer": "mocha ./test/commands/transfer/index.test.ts -t 10000000 --exit",
"test-token-balance": "mocha test/commands/token-balance/index.test.ts -t 10000000 --exit",
"test-compress-sol": "mocha ./test/commands/compress-sol/index.test.ts -t 10000000 --exit",
"test-balance": "mocha ./test/commands/balance/index.test.ts -t 10000000 --exit",
"test-decompress-sol": "mocha ./test/commands/decompress-sol/index.test.ts -t 10000000 --exit",
"test-compress-spl": "mocha ./test/commands/compress-spl/index.test.ts -t 10000000 --exit",
"test-decompress-spl": "mocha ./test/commands/decompress-spl/index.test.ts -t 10000000 --exit",
"test-wrap-spl": "mocha ./test/commands/wrap-spl/index.test.ts -t 10000000 --exit",
"test-unwrap-spl": "mocha ./test/commands/unwrap-spl/index.test.ts -t 10000000 --exit",
"test-test-validator": "mocha ./test/commands/test-validator/index.test.ts -t 10000000 --exit",
"kill": "killall solana-test-validator || true && killall solana-test-val || true && sleep 1",
"test-cli": "pnpm test-config && pnpm kill",
"test": "pnpm kill && pnpm test-cli && pnpm test-utils && pnpm test-create-mint && pnpm test-mint-to && pnpm test-transfer && pnpm test-merge-token-accounts && pnpm test-create-token-pool && pnpm test-compress-spl && pnpm test-decompress-spl && pnpm test-token-balance && pnpm test-compress-sol && pnpm test-balance && pnpm test-decompress-sol && pnpm test-approve-and-mint-to && pnpm test-test-validator",
"test": "pnpm kill && pnpm test-cli && pnpm test-utils && pnpm test-create-mint && pnpm test-create-token-account && pnpm test-mint-to && pnpm test-transfer && pnpm test-create-interface-pda && pnpm test-wrap-spl && pnpm test-unwrap-spl && pnpm test-token-balance && pnpm test-test-validator",
"install-local": "pnpm build && pnpm global remove @lightprotocol/zk-compression-cli || true && pnpm global add $PWD",
"version": "oclif readme && git add README.md"
},
Expand Down
81 changes: 0 additions & 81 deletions cli/src/commands/approve-and-mint-to/index.ts

This file was deleted.

50 changes: 0 additions & 50 deletions cli/src/commands/balance/index.ts

This file was deleted.

Loading
Loading