Skip to content

Commit 7866817

Browse files
committed
feat: add ZeroCopyMut enum support
1 parent 96c2faa commit 7866817

18 files changed

+647
-216
lines changed

js/compressed-token/CHANGELOG.md

Lines changed: 33 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
## [0.22.0]
22

3-
- `CreateMint` action now allows passing a non-payer mint and freeze authority.
4-
- More efficient computebudgets for actions.
5-
- Better DX: Parameter lookup in call signatures of CompressedTokenProgram instructions
6-
- QoL: improved typedocs.
3+
- `CreateMint` action now allows passing a non-payer mint and freeze authority.
4+
- More efficient computebudgets for actions.
5+
- Better DX: Parameter lookup in call signatures of CompressedTokenProgram instructions
6+
- QoL: improved typedocs.
77

88
## [0.21.0]
99

@@ -58,23 +58,25 @@ const ix = await CompressedTokenProgram.decompress({
5858

5959
### Overview
6060

61-
- new type: TokenPoolInfo
62-
- Instruction Changes:
63-
- `compress`, `mintTo`, `approveAndMintTo`, `compressSplTokenAccount` now require valid TokenPoolInfo
64-
- `decompress` now requires an array of one or more TokenPoolInfos.
65-
- `decompress`, `transfer` now do not allow state tree overrides.
61+
- new type: TokenPoolInfo
62+
- Instruction Changes:
6663

67-
- Action Changes:
68-
- Removed optional tokenProgramId: PublicKey
69-
- removed optional merkleTree: PublicKey
70-
- removed optional outputStateTree: PublicKey
71-
- added optional stateTreeInfo: StateTreeInfo
72-
- added optional tokenPoolInfo: TokenPoolInfo
64+
- `compress`, `mintTo`, `approveAndMintTo`, `compressSplTokenAccount` now require valid TokenPoolInfo
65+
- `decompress` now requires an array of one or more TokenPoolInfos.
66+
- `decompress`, `transfer` now do not allow state tree overrides.
7367

74-
- new instructions:
75-
- `approve`, `revoke`: delegated transfer support.
76-
- `addTokenPools`: you can now register additional token pool pdas. Use
77-
this if you need very high concurrency.
68+
- Action Changes:
69+
70+
- Removed optional tokenProgramId: PublicKey
71+
- removed optional merkleTree: PublicKey
72+
- removed optional outputStateTree: PublicKey
73+
- added optional stateTreeInfo: StateTreeInfo
74+
- added optional tokenPoolInfo: TokenPoolInfo
75+
76+
- new instructions:
77+
- `approve`, `revoke`: delegated transfer support.
78+
- `addTokenPools`: you can now register additional token pool pdas. Use
79+
this if you need very high concurrency.
7880

7981
### Why the Changes are helpful
8082

@@ -94,32 +96,32 @@ accounts.
9496

9597
### Changed
9698

97-
- improved documentation and error messages.
99+
- improved documentation and error messages.
98100

99101
## [0.20.4] - 2025-02-19
100102

101103
### Breaking Changes
102104

103-
- `selectMinCompressedTokenAccountsForTransfer` and
104-
`selectSmartCompressedTokenAccountsForTransfer` now throw an error
105-
if not enough accounts are found. In most cases this is not a breaking
106-
change, because a proof request would fail anyway. This just makes the error
107-
message more informative.
105+
- `selectMinCompressedTokenAccountsForTransfer` and
106+
`selectSmartCompressedTokenAccountsForTransfer` now throw an error
107+
if not enough accounts are found. In most cases this is not a breaking
108+
change, because a proof request would fail anyway. This just makes the error
109+
message more informative.
108110

109111
### Added
110112

111-
- `selectSmartCompressedTokenAccountsForTransfer` and
112-
`selectSmartCompressedTokenAccountsForTransferOrPartial`
113+
- `selectSmartCompressedTokenAccountsForTransfer` and
114+
`selectSmartCompressedTokenAccountsForTransferOrPartial`
113115

114116
### Changed
115117

116-
- `selectMinCompressedTokenAccountsForTransfer` and
117-
`selectMinCompressedTokenAccountsForTransferorPartial` now accept an optional
118-
`maxInputs` parameter, defaulting to 4.
118+
- `selectMinCompressedTokenAccountsForTransfer` and
119+
`selectMinCompressedTokenAccountsForTransferorPartial` now accept an optional
120+
`maxInputs` parameter, defaulting to 4.
119121

120122
### Security
121123

122-
- N/A
124+
- N/A
123125

124126
For previous release notes, check:
125127
https://www.zkcompression.com/release-notes/1.0.0-mainnet-beta

js/compressed-token/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ npm install --save \
2828

2929
### Documentation and examples
3030

31-
- [Latest Source code](https://github.com/lightprotocol/light-protocol/tree/main/js/compressed-token)
32-
- [Creating and sending compressed tokens](https://www.zkcompression.com/developers/typescript-client#creating-minting-and-transferring-a-compressed-token)
31+
- [Latest Source code](https://github.com/lightprotocol/light-protocol/tree/main/js/compressed-token)
32+
- [Creating and sending compressed tokens](https://www.zkcompression.com/developers/typescript-client#creating-minting-and-transferring-a-compressed-token)
3333

3434
### Getting help
3535

@@ -38,9 +38,9 @@ Check out the [Light](https://discord.gg/CYvjBgzRFP) and [Helius](https://discor
3838

3939
When asking for help, please include:
4040

41-
- A detailed description of what you're trying to achieve
42-
- Source code, if possible
43-
- The text of any errors you encountered, with stacktraces if available
41+
- A detailed description of what you're trying to achieve
42+
- Source code, if possible
43+
- The text of any errors you encountered, with stacktraces if available
4444

4545
### Contributing
4646

js/stateless.js/CHANGELOG.md

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,15 @@ migrating.
3636

3737
### Breaking changes
3838

39-
- Renamed `ActiveTreeBundle` to `StateTreeInfo`
40-
- Updated `StateTreeInfo` internal structure: `{ tree: PublicKey, queue: PublicKey, cpiContext: PublicKey | null, treeType: TreeType }`
41-
- Replaced `pickRandomTreeAndQueue` with `selectStateTreeInfo`
42-
- Use `selectStateTreeInfo` for tree selection instead of `pickRandomTreeAndQueue`
39+
- Renamed `ActiveTreeBundle` to `StateTreeInfo`
40+
- Updated `StateTreeInfo` internal structure: `{ tree: PublicKey, queue: PublicKey, cpiContext: PublicKey | null, treeType: TreeType }`
41+
- Replaced `pickRandomTreeAndQueue` with `selectStateTreeInfo`
42+
- Use `selectStateTreeInfo` for tree selection instead of `pickRandomTreeAndQueue`
4343

4444
### Deprecations
4545

46-
- `rpc.getValidityProof` is now deprecated, use `rpc.getValidityProofV0` instead.
47-
- `CompressedProof` and `CompressedProofWithContext` were renamed to `ValidityProof` and `ValidityProofWithContext`
46+
- `rpc.getValidityProof` is now deprecated, use `rpc.getValidityProofV0` instead.
47+
- `CompressedProof` and `CompressedProofWithContext` were renamed to `ValidityProof` and `ValidityProofWithContext`
4848

4949
### Migration Guide
5050

@@ -163,43 +163,44 @@ Fixed a bug where we lose precision on token amounts if compressed token account
163163
164164
### Breaking Changes
165165
166-
- ActiveTreeBundle is now a tuple of `tree`, `queue`, `cpiContext`, and `treeType`. `treeType` is a new enum ensuring forward compatibility.
167-
- Updated LUT addresses for Mainnet and Devnet:
168-
- stateTreeLookupTableMainnet = '7i86eQs3GSqHjN47WdWLTCGMW6gde1q96G2EVnUyK2st';
169-
- nullifiedStateTreeLookupTableMainnet = 'H9QD4u1fG7KmkAzn2tDXhheushxFe1EcrjGGyEFXeMqT';
170-
- stateTreeLookupTableDevnet = '8n8rH2bFRVA6cSGNDpgqcKHCndbFCT1bXxAQG89ejVsh';
171-
- nullifiedStateTreeLookupTableDevnet = '5dhaJLBjnVBQFErr8oiCJmcVsx3Zj6xDekGB2zULPsnP';
166+
- ActiveTreeBundle is now a tuple of `tree`, `queue`, `cpiContext`, and `treeType`. `treeType` is a new enum ensuring forward compatibility.
167+
- Updated LUT addresses for Mainnet and Devnet:
168+
- stateTreeLookupTableMainnet = '7i86eQs3GSqHjN47WdWLTCGMW6gde1q96G2EVnUyK2st';
169+
- nullifiedStateTreeLookupTableMainnet = 'H9QD4u1fG7KmkAzn2tDXhheushxFe1EcrjGGyEFXeMqT';
170+
- stateTreeLookupTableDevnet = '8n8rH2bFRVA6cSGNDpgqcKHCndbFCT1bXxAQG89ejVsh';
171+
- nullifiedStateTreeLookupTableDevnet = '5dhaJLBjnVBQFErr8oiCJmcVsx3Zj6xDekGB2zULPsnP';
172172
173173
### Changed
174174
175-
- `createRpc` can now also be called with only the `rpcEndpoint` parameter. In
176-
this case, `compressionApiEndpoint` and `proverEndpoint` will default to the
177-
same value. If no parameters are provided, default localnet values are used.
175+
- `createRpc` can now also be called with only the `rpcEndpoint` parameter. In
176+
this case, `compressionApiEndpoint` and `proverEndpoint` will default to the
177+
same value. If no parameters are provided, default localnet values are used.
178178
179179
## [0.19.0] - 2025-01-20
180180
181181
### Breaking Changes
182182
183-
- Instruction methods (eg `LightSystemProgram.createAccount` and `CompressedTokenProgram.mintTo`) now require an explicit output state tree pubkey or input account, otherwise they will throw an error.
183+
- Instruction methods (eg `LightSystemProgram.createAccount` and `CompressedTokenProgram.mintTo`) now require an explicit output state tree pubkey or input account, otherwise they will throw an error.
184184
185185
### Added
186186
187-
- Multiple State Tree support. Allows you to pass non-default state tree pubkeys to actions and instructions. Comes out of the box with public state trees.
188-
- `pickRandomStateTreeAndQueue`
189-
- `getLightStateTreeInfo`
187+
- Multiple State Tree support. Allows you to pass non-default state tree pubkeys to actions and instructions. Comes out of the box with public state trees.
190188
191-
- createMint allows passing of freezeAuthority in action
189+
- `pickRandomStateTreeAndQueue`
190+
- `getLightStateTreeInfo`
191+
192+
- createMint allows passing of freezeAuthority in action
192193
193194
### Changed
194195
195-
- `createMint`action now lets you pass tokenprogramId explicitly. is backward compatible with boolean flag for t22.
196+
- `createMint`action now lets you pass tokenprogramId explicitly. is backward compatible with boolean flag for t22.
196197
197198
### Deprecated
198199
199-
- `rpc.getValidityProof`. Now does another rpc round trip to fetch tree info. use `rpc.getValidityProofV0` and pass tree info explicitly instead.
200+
- `rpc.getValidityProof`. Now does another rpc round trip to fetch tree info. use `rpc.getValidityProofV0` and pass tree info explicitly instead.
200201
201202
### Security
202203
203-
- N/A
204+
- N/A
204205
205206
For previous release notes, check: https://www.zkcompression.com/release-notes/1.0.0-mainnet-beta

js/stateless.js/README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,18 @@ For a more detailed documentation on usage, please check [the respective section
3232

3333
For example implementations, including web and Node, refer to the respective repositories:
3434

35-
- [Web application example implementation](https://github.com/Lightprotocol/example-web-client)
35+
- [Web application example implementation](https://github.com/Lightprotocol/example-web-client)
3636

37-
- [Node server example implementation](https://github.com/Lightprotocol/example-nodejs-client)
37+
- [Node server example implementation](https://github.com/Lightprotocol/example-nodejs-client)
3838

3939
## Troubleshooting
4040

4141
Have a question or a problem?
4242
Feel free to ask in the [Light](https://discord.gg/CYvjBgzRFP) and [Helius](https://discord.gg/Uzzf6a7zKr) developer Discord servers. Please, include the following information:
4343

44-
- A detailed description or context of the issue or what you are trying to achieve.
45-
- A code example that we can use to test and debug (if possible). Use [CodeSandbox](https://codesandbox.io/p/sandbox/vanilla-ts) or any other live environment provider.
46-
- A description or context of any errors you are encountering with stacktraces if available.
44+
- A detailed description or context of the issue or what you are trying to achieve.
45+
- A code example that we can use to test and debug (if possible). Use [CodeSandbox](https://codesandbox.io/p/sandbox/vanilla-ts) or any other live environment provider.
46+
- A description or context of any errors you are encountering with stacktraces if available.
4747

4848
### Source Maps
4949

@@ -57,14 +57,14 @@ We provide `index.js.map` for debugging. Exclude in production:
5757

5858
Light and ZK Compression are open source protocols and very much welcome contributions. If you have a contribution, do not hesitate to send a PR to the respective repository or discuss in the linked developer Discord servers.
5959

60-
- 🐞 For bugs or feature requests, please open an
61-
[issue](https://github.com/lightprotocol/light-protocol/issues/new).
62-
- 🔒 For security vulnerabilities, please follow the [security policy](https://github.com/Lightprotocol/light-protocol/blob/main/SECURITY.md).
60+
- 🐞 For bugs or feature requests, please open an
61+
[issue](https://github.com/lightprotocol/light-protocol/issues/new).
62+
- 🔒 For security vulnerabilities, please follow the [security policy](https://github.com/Lightprotocol/light-protocol/blob/main/SECURITY.md).
6363

6464
## Additional Resources
6565

66-
- [Light Protocol Repository](https://github.com/Lightprotocol/light-protocol)
67-
- [ZK Compression Official Documentation](https://www.zkcompression.com/)
66+
- [Light Protocol Repository](https://github.com/Lightprotocol/light-protocol)
67+
- [ZK Compression Official Documentation](https://www.zkcompression.com/)
6868

6969
## Disclaimer
7070

program-libs/zero-copy-derive/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Procedural macros for borsh compatible zero copy serialization.
4848
- **Empty structs**: Not supported - structs must have at least one field for zero-copy serialization
4949
- **Enum support**:
5050
- `ZeroCopy` supports enums with unit variants or single unnamed field variants
51-
- `ZeroCopyMut` does NOT support enums (structs only)
51+
- `ZeroCopyMut` supports enums with unit variants or single unnamed field variants
5252
- `ZeroCopyEq` does NOT support enums (structs only)
5353

5454
### Special Type Handling

program-libs/zero-copy-derive/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
//! - **Empty structs**: Not supported - structs must have at least one field for zero-copy serialization
4949
//! - **Enum support**:
5050
//! - `ZeroCopy` supports enums with unit variants or single unnamed field variants
51-
//! - `ZeroCopyMut` does NOT support enums
51+
//! - `ZeroCopyMut` supports enums with unit variants or single unnamed field variants
5252
//! - `ZeroCopyEq` does NOT support enums
5353
//! - `ZeroCopyEq` does NOT support enums, vectors, arrays)
5454
//!

0 commit comments

Comments
 (0)