diff --git a/cli/package.json b/cli/package.json index c29bcd265e..ae818675e3 100644 --- a/cli/package.json +++ b/cli/package.json @@ -1,6 +1,6 @@ { "name": "@lightprotocol/zk-compression-cli", - "version": "0.28.0-beta.8", + "version": "0.28.0-beta.10", "description": "ZK Compression: Secure Scaling on Solana", "maintainers": [ { diff --git a/js/compressed-token/CHANGELOG.md b/js/compressed-token/CHANGELOG.md index 7a772ba0da..16e9723335 100644 --- a/js/compressed-token/CHANGELOG.md +++ b/js/compressed-token/CHANGELOG.md @@ -1,4 +1,4 @@ -## [Unreleased] +## [0.23.0-beta.10] ### Breaking Changes @@ -15,10 +15,6 @@ - `getMintInterface` (decompressed light-mint branch) now validates the on-chain mint owner and throws `TokenInvalidAccountOwnerError` on mismatch; it also forwards the provided `commitment` to on-chain `getAccountInfo`. - **Migration impact:** callers that previously interpreted these paths as empty/not-found must now handle thrown errors explicitly (retry/backoff or surfacing RPC health). -## [0.23.0-beta.10] - -### Breaking Changes - - **`decompressInterface` removed.** Use `loadAta` (action) or `createLoadAtaInstructions` (instruction builder) instead. `decompressInterface` did not support >8 compressed inputs and has been fully removed. - **Action (send transaction):** Replace `decompressInterface(rpc, payer, owner, mint, amount?, destinationAta?, destinationOwner?, splInterfaceInfo?, confirmOptions?)` with `loadAta(rpc, ata, owner, mint, payer?, confirmOptions?, interfaceOptions?, wrap?)`. Derive the target ATA with `getAssociatedTokenAddressInterface(mint, owner)` for light-token, or pass the SPL/T22 ATA to decompress to that program. `loadAta` loads all cold balance into the given ATA (no partial amount); it supports >8 inputs via batched transactions and creates the ATA if needed. - **Instruction-level:** Use `createLoadAtaInstructions(rpc, ata, owner, mint, payer?, interfaceOptions?, wrap?)` to get `TransactionInstruction[][]` and send batches yourself. The single-instruction primitive is no longer exported; use the batched API only. diff --git a/js/compressed-token/package.json b/js/compressed-token/package.json index f42beb3b0b..1489d42cd1 100644 --- a/js/compressed-token/package.json +++ b/js/compressed-token/package.json @@ -1,6 +1,6 @@ { "name": "@lightprotocol/compressed-token", - "version": "0.23.0-beta.8", + "version": "0.23.0-beta.10", "description": "JS client to interact with the compressed-token program", "sideEffects": false, "main": "dist/cjs/node/index.cjs", @@ -147,13 +147,13 @@ "test:e2e:lighttoken:all": "pnpm test-validator && LIGHT_PROTOCOL_BETA=true vitest run tests/e2e/create-compressed-mint.test.ts --bail=1 && LIGHT_PROTOCOL_BETA=true vitest run tests/e2e/create-associated-light-token.test.ts --bail=1 && LIGHT_PROTOCOL_BETA=true vitest run tests/e2e/mint-to-light-token.test.ts --bail=1 && pnpm test-validator && LIGHT_PROTOCOL_BETA=true vitest run tests/e2e/mint-to-compressed.test.ts --bail=1 && LIGHT_PROTOCOL_BETA=true vitest run tests/e2e/mint-to-interface.test.ts --bail=1 && LIGHT_PROTOCOL_BETA=true vitest run tests/e2e/mint-workflow.test.ts --bail=1 && pnpm test-validator && LIGHT_PROTOCOL_BETA=true vitest run tests/e2e/update-mint.test.ts --bail=1 && LIGHT_PROTOCOL_BETA=true vitest run tests/e2e/update-metadata.test.ts --bail=1 && LIGHT_PROTOCOL_BETA=true vitest run tests/e2e/compressible-load.test.ts --bail=1 && pnpm test-validator && LIGHT_PROTOCOL_BETA=true vitest run tests/e2e/wrap.test.ts --bail=1 && LIGHT_PROTOCOL_BETA=true vitest run tests/e2e/get-mint-interface.test.ts --bail=1 && LIGHT_PROTOCOL_BETA=true vitest run tests/e2e/get-account-interface.test.ts --bail=1 && pnpm test-validator && LIGHT_PROTOCOL_BETA=true vitest run tests/e2e/create-mint-interface.test.ts --bail=1 && LIGHT_PROTOCOL_BETA=true vitest run tests/e2e/create-ata-interface.test.ts --bail=1 && pnpm test-validator && LIGHT_PROTOCOL_BETA=true vitest run tests/e2e/get-or-create-ata-interface.test.ts --bail=1 && LIGHT_PROTOCOL_BETA=true vitest run tests/e2e/transfer-interface.test.ts --bail=1 && pnpm test-validator && LIGHT_PROTOCOL_BETA=true vitest run tests/e2e/unwrap.test.ts --bail=1 && LIGHT_PROTOCOL_BETA=true vitest run tests/e2e/decompress2.test.ts --bail=1 && LIGHT_PROTOCOL_BETA=true vitest run tests/e2e/freeze-thaw-light-token.test.ts --bail=1 && LIGHT_PROTOCOL_BETA=true vitest run tests/e2e/payment-flows.test.ts --bail=1 && pnpm test-validator && vitest run tests/e2e/v1-v2-migration.test.ts --bail=1 && pnpm test-validator && LIGHT_PROTOCOL_BETA=true vitest run tests/e2e/load-ata-standard.test.ts --bail=1 && pnpm test-validator && LIGHT_PROTOCOL_BETA=true vitest run tests/e2e/load-ata-unified.test.ts --bail=1 && pnpm test-validator && LIGHT_PROTOCOL_BETA=true vitest run tests/e2e/load-ata-combined.test.ts --bail=1 && pnpm test-validator && LIGHT_PROTOCOL_BETA=true vitest run tests/e2e/load-ata-freeze.test.ts --bail=1 && pnpm test-validator && LIGHT_PROTOCOL_BETA=true vitest run tests/e2e/load-ata-spl-t22.test.ts --bail=1 && pnpm test-validator && LIGHT_PROTOCOL_VERSION=V2 LIGHT_PROTOCOL_BETA=true vitest run tests/e2e/multi-cold-inputs-batching.test.ts -t \"instruction-level|hash uniqueness|ensureRecipientAta\" --bail=1 && pnpm test-validator && LIGHT_PROTOCOL_VERSION=V2 LIGHT_PROTOCOL_BETA=true vitest run tests/e2e/multi-cold-inputs-batching.test.ts -t \"parallel multi-tx\" --bail=1", "test:e2e:all": "pnpm test:e2e:legacy:all && pnpm test:e2e:lighttoken:all", "pull-idl": "../../scripts/push-compressed-token-idl.sh", - "build": "if [ \"$LIGHT_PROTOCOL_VERSION\" = \"V2\" ]; then LIGHT_PROTOCOL_VERSION=V2 pnpm build:bundle; else LIGHT_PROTOCOL_VERSION=V1 pnpm build:bundle; fi", + "build": "if [ \"$LIGHT_PROTOCOL_VERSION\" = \"V1\" ]; then LIGHT_PROTOCOL_VERSION=V1 pnpm build:bundle; else LIGHT_PROTOCOL_VERSION=V2 pnpm build:bundle; fi", "build:bundle": "rimraf dist && rollup -c", "build:v1": "LIGHT_PROTOCOL_VERSION=V1 pnpm build:stateless:v1 && LIGHT_PROTOCOL_VERSION=V1 pnpm build:bundle", "build:v2": "LIGHT_PROTOCOL_VERSION=V2 pnpm build:stateless:v2 && LIGHT_PROTOCOL_VERSION=V2 pnpm build:bundle", "build:stateless:v1": "cd ../stateless.js && pnpm build:v1", "build:stateless:v2": "cd ../stateless.js && pnpm build:v2", - "build-ci": "if [ \"$LIGHT_PROTOCOL_VERSION\" = \"V2\" ]; then LIGHT_PROTOCOL_VERSION=V2 pnpm build:bundle; else LIGHT_PROTOCOL_VERSION=V1 pnpm build:bundle; fi", + "build-ci": "if [ \"$LIGHT_PROTOCOL_VERSION\" = \"V1\" ]; then LIGHT_PROTOCOL_VERSION=V1 pnpm build:bundle; else LIGHT_PROTOCOL_VERSION=V2 pnpm build:bundle; fi", "format": "prettier --write .", "lint": "eslint ." }, diff --git a/js/compressed-token/rollup.config.js b/js/compressed-token/rollup.config.js index 17e1371544..b478bd90e8 100644 --- a/js/compressed-token/rollup.config.js +++ b/js/compressed-token/rollup.config.js @@ -32,7 +32,7 @@ const rolls = (fmt, env) => ({ preventAssignment: true, values: { __BUILD_VERSION__: JSON.stringify( - process.env.LIGHT_PROTOCOL_VERSION || 'V1', + process.env.LIGHT_PROTOCOL_VERSION || 'V2', ), }, }), diff --git a/js/compressed-token/src/utils/version-check.ts b/js/compressed-token/src/utils/version-check.ts index 41b0bc4f83..e740881a71 100644 --- a/js/compressed-token/src/utils/version-check.ts +++ b/js/compressed-token/src/utils/version-check.ts @@ -4,12 +4,12 @@ import { featureFlags, VERSION } from '@lightprotocol/stateless.js'; * Validates that the built version of stateless.js matches the expected version. * Throws an error if there's a mismatch. * - * @param expectedVersion - The version expected (defaults to LIGHT_PROTOCOL_VERSION env var or V1) + * @param expectedVersion - The version expected (defaults to LIGHT_PROTOCOL_VERSION env var or V2) * @throws Error if the versions don't match */ export function validateVersionConsistency(expectedVersion?: string): void { const expected = - expectedVersion || process.env.LIGHT_PROTOCOL_VERSION || VERSION.V1; + expectedVersion || process.env.LIGHT_PROTOCOL_VERSION || VERSION.V2; const actual = featureFlags.version.replace(/['"]/g, ''); if (actual !== expected) { diff --git a/js/compressed-token/tests/setup/version-check.ts b/js/compressed-token/tests/setup/version-check.ts index 9c1fdaedba..60d116eb9b 100644 --- a/js/compressed-token/tests/setup/version-check.ts +++ b/js/compressed-token/tests/setup/version-check.ts @@ -6,7 +6,7 @@ export default function setup() { try { validateVersionConsistency(); - const expectedVersion = process.env.LIGHT_PROTOCOL_VERSION || 'V1'; + const expectedVersion = process.env.LIGHT_PROTOCOL_VERSION || 'V2'; console.log(`✅ Version check passed: Using ${expectedVersion}`); } catch (error) { console.error('❌ Version check failed:'); diff --git a/js/compressed-token/tests/unit/version.test.ts b/js/compressed-token/tests/unit/version.test.ts index fd6b369116..fdb3b0b412 100644 --- a/js/compressed-token/tests/unit/version.test.ts +++ b/js/compressed-token/tests/unit/version.test.ts @@ -4,7 +4,7 @@ import { featureFlags, VERSION } from '@lightprotocol/stateless.js'; describe('Versioning', () => { beforeAll(() => { const expectedVersion = - process.env.LIGHT_PROTOCOL_VERSION || VERSION.V1; + process.env.LIGHT_PROTOCOL_VERSION || VERSION.V2; const actualVersion = featureFlags.version.replace(/['"]/g, ''); if (actualVersion !== expectedVersion) { @@ -36,7 +36,7 @@ describe('Versioning', () => { it('should respect LIGHT_PROTOCOL_VERSION environment variable', () => { const expectedVersion = - process.env.LIGHT_PROTOCOL_VERSION || VERSION.V1; + process.env.LIGHT_PROTOCOL_VERSION || VERSION.V2; const actualVersion = featureFlags.version.replace(/['"]/g, ''); expect(actualVersion).toBe(expectedVersion); }); @@ -51,12 +51,12 @@ describe('Versioning', () => { const actualVersion = featureFlags.version.replace(/['"]/g, ''); const isV2 = featureFlags.isV2(); - if (process.env.LIGHT_PROTOCOL_VERSION === 'V2') { - expect(actualVersion).toBe(VERSION.V2); - expect(isV2).toBe(true); - } else { + if (process.env.LIGHT_PROTOCOL_VERSION === 'V1') { expect(actualVersion).toBe(VERSION.V1); expect(isV2).toBe(false); + } else { + expect(actualVersion).toBe(VERSION.V2); + expect(isV2).toBe(true); } }); }); diff --git a/js/stateless.js/CHANGELOG.md b/js/stateless.js/CHANGELOG.md index 0b853bd9eb..43ec744619 100644 --- a/js/stateless.js/CHANGELOG.md +++ b/js/stateless.js/CHANGELOG.md @@ -1,5 +1,15 @@ # Changelog +## [0.23.0-beta.10] + +### Breaking Changes + +- Default build target is now V2 when `LIGHT_PROTOCOL_VERSION` is unset. This applies to bundle replacement (`__BUILD_VERSION__`) and package scripts (`pnpm build`, `pnpm build-ci`). To force V1 builds, set `LIGHT_PROTOCOL_VERSION=V1`. + +### Changed + +- Beta-gated interface RPC paths remain enabled by default in V2, and `getAccountInfoInterface` now propagates upstream RPC errors whenever no definitive account result is available (instead of silently returning `null` on fetch failure paths). + ## [0.22.0] - 2025-06-16 ### Breaking Changes diff --git a/js/stateless.js/package.json b/js/stateless.js/package.json index e0d8e3bd11..3c89a2bf22 100644 --- a/js/stateless.js/package.json +++ b/js/stateless.js/package.json @@ -1,6 +1,6 @@ { "name": "@lightprotocol/stateless.js", - "version": "0.23.0-beta.8", + "version": "0.23.0-beta.10", "description": "JavaScript API for Light & ZK Compression", "sideEffects": false, "main": "dist/cjs/node/index.cjs", @@ -110,11 +110,11 @@ "test:verbose": "vitest run --reporter=verbose", "test:testnet": "vitest run tests/e2e/testnet.test.ts --reporter=verbose", "pull-idls": "../../scripts/push-stateless-js-idls.sh && ../../scripts/push-compressed-token-idl.sh", - "build": "if [ \"$LIGHT_PROTOCOL_VERSION\" = \"V2\" ]; then LIGHT_PROTOCOL_VERSION=V2 pnpm build:bundle; else LIGHT_PROTOCOL_VERSION=V1 pnpm build:bundle; fi", + "build": "if [ \"$LIGHT_PROTOCOL_VERSION\" = \"V1\" ]; then LIGHT_PROTOCOL_VERSION=V1 pnpm build:bundle; else LIGHT_PROTOCOL_VERSION=V2 pnpm build:bundle; fi", "build:bundle": "rimraf dist && rollup -c", "build:v1": "LIGHT_PROTOCOL_VERSION=V1 pnpm build:bundle", "build:v2": "LIGHT_PROTOCOL_VERSION=V2 pnpm build:bundle", - "build-ci": "if [ \"$LIGHT_PROTOCOL_VERSION\" = \"V2\" ]; then LIGHT_PROTOCOL_VERSION=V2 pnpm build:bundle; else LIGHT_PROTOCOL_VERSION=V1 pnpm build:bundle; fi", + "build-ci": "if [ \"$LIGHT_PROTOCOL_VERSION\" = \"V1\" ]; then LIGHT_PROTOCOL_VERSION=V1 pnpm build:bundle; else LIGHT_PROTOCOL_VERSION=V2 pnpm build:bundle; fi", "format": "prettier --write .", "lint": "eslint ." } diff --git a/js/stateless.js/rollup.config.js b/js/stateless.js/rollup.config.js index 00136d5037..2f2b08652e 100644 --- a/js/stateless.js/rollup.config.js +++ b/js/stateless.js/rollup.config.js @@ -23,7 +23,7 @@ const rolls = (fmt, env) => ({ preventAssignment: true, values: { __BUILD_VERSION__: JSON.stringify( - process.env.LIGHT_PROTOCOL_VERSION || 'V1', + process.env.LIGHT_PROTOCOL_VERSION || 'V2', ), }, }),