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

feat: Export create_associated_token_account and create_associated_token_account_idempotent #2999

Merged
merged 6 commits into from
Jun 2, 2024
Merged

Conversation

cryptopapi997
Copy link
Contributor

Currently when working with tokens in anchor client, most of the basic operations can be done because anchor_spl exposes them e.g. we can create a token, mint it, transfer it, etc. The only thing in a "basic" token workflow that cannot be done is create associated token accounts.

I don't know why this is, but I'd imagine it's because at the time that anchor_spl was first written ATAs weren't the default yet and normal token accounts could be created with it on the client side. Nowadays this has changed though, so I believe updating the exports to expose ATA creation is appropriate.

Copy link

vercel bot commented May 31, 2024

@cryptopapi997 is attempting to deploy a commit to the coral-xyz Team on Vercel.

A member of the Team first needs to authorize it.

@cryptopapi997 cryptopapi997 changed the title Export create_associated_token_account and create_associated_token_account_idempotent feat: Export create_associated_token_account and create_associated_token_account_idempotent Jun 1, 2024
Copy link
Collaborator

@acheroncrypto acheroncrypto left a comment

Choose a reason for hiding this comment

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

Currently when working with tokens in anchor client, most of the basic operations can be done because anchor_spl exposes them e.g. we can create a token, mint it, transfer it, etc. The only thing in a "basic" token workflow that cannot be done is create associated token accounts.

I don't know why this is, but I'd imagine it's because at the time that anchor_spl was first written ATAs weren't the default yet and normal token accounts could be created with it on the client side. Nowadays this has changed though, so I believe updating the exports to expose ATA creation is appropriate.

It's most likely because anchor-spl crate was intended for CPI:

description = "CPI clients for SPL programs"

Most of those exports have been added later too.

spl/src/associated_token.rs Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
Copy link
Collaborator

@acheroncrypto acheroncrypto left a comment

Choose a reason for hiding this comment

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

Thanks!

@acheroncrypto acheroncrypto merged commit 8180355 into coral-xyz:master Jun 2, 2024
2 of 3 checks passed
@cryptopapi997 cryptopapi997 deleted the export-create-ix branch June 2, 2024 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants