Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spl-token: Add token_program_id parameter to associated token endpoints #456

Merged

Conversation

akashcodes
Copy link
Contributor

Added a new paremeter token_program_id to get_associated_token_address & create_associated_token_account.

This new paremeter should be one of spl.token.constants.TOKEN_PROGRAM_ID or spl.token.constants.TOKEN_2022_PROGRAM_ID. Raises a ValueError otherwise.

It defaults to TOKEN_PROGRAM_ID.

Fixes #439

Copy link

codecov bot commented Oct 15, 2024

Codecov Report

Attention: Patch coverage is 75.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 88.88%. Comparing base (56a7625) to head (d5e0730).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #456      +/-   ##
==========================================
- Coverage   88.95%   88.88%   -0.07%     
==========================================
  Files          28       28              
  Lines        2282     2286       +4     
==========================================
+ Hits         2030     2032       +2     
- Misses        252      254       +2     

Copy link
Owner

@michaelhly michaelhly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thank you!

@michaelhly michaelhly changed the title Add token_program_id parameter to associated token endpoints spl-token: Add token_program_id parameter to associated token endpoints Oct 16, 2024
@michaelhly michaelhly merged commit 890cbbb into michaelhly:master Oct 16, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

create_associated_token_account for Token Program 2022
2 participants