|
| 1 | +## [0.23.0] - 2026-03-24 |
| 2 | + |
| 3 | +Stable release. It supersedes the **`0.23.0-beta.x`** line and is intended for production use with **ZK Compression V2**. Upgrade from **`0.22.x`** or any beta version requires addressing the breaking changes listed below. |
| 4 | + |
| 5 | +### Highlights |
| 6 | + |
| 7 | +- **V2 is the default for npm consumers:** **`@lightprotocol/compressed-token@0.23.0`** pairs with **`@lightprotocol/stateless.js@0.23.0`**. You do **not** need **`LIGHT_PROTOCOL_VERSION=V2`** in app code for published packages. Set **`LIGHT_PROTOCOL_VERSION=V1`** only when **building these packages from source** and you need V1 artifacts. |
| 8 | +- **Light token surface:** Public names are **LightToken** / **`LIGHT_TOKEN_PROGRAM_ID`** (replacing CToken / **`CTOKEN_PROGRAM_ID`**). |
| 9 | +- **Interface transfers & loads:** The new token API is much closer to spl-token now, and uses the same Account types. Changes include: Recipient wallet vs explicit destination account, **owner pubkey + signing authority** split for delegates, batched **`TransactionInstruction[][]`**, and **`loadAta`** / **`createLoadAtaInstructions`** replacing **`decompressInterface`**. |
| 10 | + |
| 11 | +### Breaking changes (since 0.22.0) |
| 12 | + |
| 13 | +**Transfers (actions)** |
| 14 | + |
| 15 | +- **`transferInterface`**: `recipient` is the **recipient wallet** `PublicKey` (not a pre-derived ATA). Signature: |
| 16 | + |
| 17 | + `transferInterface(rpc, payer, source, mint, recipient, owner, authority, amount, programId?, confirmOptions?, options?, decimals?)` |
| 18 | + - **`owner`**: source token-account **owner** pubkey (for ATA derivation / source checks). |
| 19 | + - **`authority`**: **`Signer`** — use **`owner`** for owner-signed flows (`owner.publicKey` + `owner`), or **`delegate`** for delegated flows (`owner.publicKey` + `delegate`). |
| 20 | + |
| 21 | +- **`transferToAccountInterface`**: explicit **`destination`** token account; same **`owner` / `authority`** split: |
| 22 | + |
| 23 | + `transferToAccountInterface(rpc, payer, source, mint, destination, owner, authority, amount, programId?, confirmOptions?, options?, decimals?)` |
| 24 | + |
| 25 | +- **Multiple transactions:** for large cold-input fan-in, these actions may send **parallel load transactions** followed by a **final transfer** (Solana size / proof limits). Instruction builders expose the same as **`TransactionInstruction[][]`**. |
| 26 | + |
| 27 | +**Transfers (instruction builders)** |
| 28 | + |
| 29 | +- **`createTransferInterfaceInstructions`**: returns **`TransactionInstruction[][]`** (one inner array per transaction). Wallet recipient; embeds idempotent recipient ATA creation in the final batch. |
| 30 | + |
| 31 | + `createTransferInterfaceInstructions(rpc, payer, mint, amount, owner, recipient, decimals, options?, programId?)` |
| 32 | + |
| 33 | +- **`createTransferToAccountInterfaceInstructions`**: same batching shape; **`destination`** is the token account address. |
| 34 | + |
| 35 | + `createTransferToAccountInterfaceInstructions(rpc, payer, mint, amount, owner, destination, decimals, options?, programId?)` |
| 36 | + |
| 37 | +- **`InterfaceOptions`**: **`wrap`** and related options are nested here; **`programId`** is **not** inside `InterfaceOptions` (flat parameter, SPL-style). **`InterfaceOptions.owner` was removed** — use flat **`owner`** args and, for delegated **planning**, **`options.delegatePubkey`**. |
| 38 | + |
| 39 | +- **`decimals`** is required on these v3 builders unless you use a higher-level wrapper that resolves decimals for you. |
| 40 | + |
| 41 | +**Load / decompress** |
| 42 | + |
| 43 | +- **`decompressInterface`** removed. Use **`loadAta`** (action) or **`createLoadAtaInstructions`** (builder). **`createLoadAtaInstructions`** returns **`TransactionInstruction[][]`**, not a flat instruction array. |
| 44 | + |
| 45 | +- **Delegated loads:** flat args still pass the token-account **`owner`** pubkey; when the **`Signer`** is a **delegate**, set **`interfaceOptions.delegatePubkey`** to the delegate’s pubkey (do not stuff the owner into removed **`InterfaceOptions.owner`**). |
| 46 | + |
| 47 | +- **`createLoadAtaInstructionsFromInterface`** is **not** exported from the package root; use **`createLoadAtaInstructions`**. |
| 48 | + |
| 49 | +**Renames (CToken → LightToken)** |
| 50 | + |
| 51 | +- Examples: **`CTOKEN_PROGRAM_ID` → `LIGHT_TOKEN_PROGRAM_ID`**, **`createAssociatedCTokenAccountInstruction` → `createAssociatedLightTokenAccountInstruction`**, **`parseCTokenHot` / `parseCTokenCold` → `parseLightTokenHot` / `parseLightTokenCold`**, **`mintToCToken` → `mintToLightToken`**, **`createCTokenTransferInstruction` → `createLightTokenTransferInstruction`**. |
| 52 | + |
| 53 | +**`createLightTokenTransferInstruction`** |
| 54 | + |
| 55 | +- Instruction **data layout** (9-byte) and **account metas** changed: includes **`system_program`** and **`fee_payer`**; **`owner` is writable** (compressible rent top-ups). |
| 56 | + |
| 57 | +**`createDecompressInterfaceInstruction`** |
| 58 | + |
| 59 | +- **`decimals: number`** required after **`splInterfaceInfo`** where applicable for SPL destination decompression. |
| 60 | + |
| 61 | +**Deprecated dispatcher** |
| 62 | + |
| 63 | +- **`createTransferInterfaceInstruction`** (monolithic multi-program helper): deprecated; use **`createLightTokenTransferInstruction`** or SPL **`createTransferCheckedInstruction`** as appropriate. |
| 64 | + |
| 65 | +**Token pool / SPL interface** |
| 66 | + |
| 67 | +- Prefer **`CompressedTokenProgram.createSplInterface`**; **`createTokenPool`** is deprecated. |
| 68 | + |
| 69 | +**Removed exports** |
| 70 | + |
| 71 | +- **`createLoadAccountsParams`**, **`calculateCompressibleLoadComputeUnits`**, and related types — use **`createLoadAtaInstructions`** and **`calculateLoadBatchComputeUnits`**. |
| 72 | + |
| 73 | +**`mintToCompressed`** |
| 74 | + |
| 75 | +- **`maxTopUp`** was inserted **before** optional **`confirmOptions`** — update positional call sites. |
| 76 | + |
| 77 | +**RPC / typing strictness** |
| 78 | + |
| 79 | +- **`getAccountInterface`**, **`getAtaInterface`**, **`getMintInterface`**: unexpected failures and wrong-program owners surface as **errors** instead of being treated like empty/not-found in several cases. |
| 80 | + |
| 81 | +**Synthetic delegate views** |
| 82 | + |
| 83 | +- In **`getAtaInterface` / `getAccountInterface`**, canonical delegate and **`delegatedAmount`** aggregation follow updated rules (hot delegate preferred; cold delegates aligned with hot). |
| 84 | + |
| 85 | +### New APIs (consumer-visible) |
| 86 | + |
| 87 | +- **`approveInterface`**, **`revokeInterface`**; builders **`createApproveInterfaceInstructions`**, **`createRevokeInterfaceInstructions`**; **`createLightTokenApproveInstruction`**, **`createLightTokenRevokeInstruction`**. |
| 88 | +- **`createUnwrapInstructions`**, **`selectInputsForAmount`**. |
| 89 | +- **`createLightTokenFreezeAccountInstruction`**, **`createLightTokenThawAccountInstruction`**. |
| 90 | +- **`MAX_TOP_UP`** and **`maxTopUp`** on compressible instruction builders and selected actions. |
| 91 | +- **`sliceLast`**, **`chunkAccountsByTreeVersion`**, **`assertUniqueInputHashes`** for batch orchestration. |
| 92 | +- **`assertV2Only`** on load/decompress paths — V1 compressed inputs fail fast with a clear error. |
| 93 | +- **`LightTokenProgram`** alias for **`CompressedTokenProgram`**. |
| 94 | +- **`getOrCreateAtaInterface`** / create-mint flows: decompressed mint handling integrated where documented so typical flows do not require a separate **`decompressMint`** before ATAs. |
| 95 | + |
| 96 | +### Changed / fixed (summary) |
| 97 | + |
| 98 | +- **`approveInterface` / `revokeInterface`**: optional **`InterfaceOptions`** (incl. **`wrap`**) and trailing **`decimals`**; unified approve/revoke entrypoints match the same options pattern. |
| 99 | + |
| 100 | +- **`@lightprotocol/compressed-token/unified`**: transfer-related entrypoints keep **`wrap: true`**; use the non-unified exports for explicit **`programId`** / no-wrap SPL Token-2022 style flows. |
| 101 | + |
| 102 | +- **`loadAta`**: may send **parallel** load batches; frozen-source handling and SPL interface error propagation improved. |
| 103 | +- **`maxTopUp`** default **`MAX_TOP_UP` (65535)** so rent top-ups are not silently blocked. |
| 104 | +- **Browser bundles:** minified output keeps **`AccountMeta`** **`isSigner` / `isWritable`** as real **booleans** (Terser; see **`@lightprotocol/stateless.js`** changelog). |
| 105 | +- **`delegatedAmount`** parsed from CompressedOnly TLV where applicable. |
| 106 | + |
| 107 | +--- |
| 108 | + |
1 | 109 | ## [0.23.0-beta.11] |
2 | 110 |
|
3 | 111 | ### Added |
|
0 commit comments