Skip to content
This repository has been archived by the owner on Jan 10, 2025. It is now read-only.

API crate(s) for token2022 #6466

Open
kevinheavey opened this issue Mar 20, 2024 · 2 comments
Open

API crate(s) for token2022 #6466

kevinheavey opened this issue Mar 20, 2024 · 2 comments

Comments

@kevinheavey
Copy link
Contributor

kevinheavey commented Mar 20, 2024

Currently if you want to build a token2022 instruction, parse an account etc, you import the whole program.

Problem 1: this forces you to compile the whole program and bring in dependencies that are only used in internal program code.
Problem 2: token2022 is a huge program with multiple responsibilities so we probably need multiple API crates. For example, only some users of token2022 would need to use anything involving the zk token sdk.

Solution:

Rip a bunch of code out of the program crate and into various API crates. Re-export in spl-token-2022 for backwards compatibility

@zilayo
Copy link

zilayo commented Mar 22, 2024

Agreed - this would help massively.

Currently a simple use case like parsing an account leads to a bloated crate + introduces dependency hell.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@kevinheavey @zilayo and others