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

Docs incorrectly uses system.transfer for token transfers #171

Open
tosynthegeek opened this issue Jun 18, 2024 · 1 comment
Open

Docs incorrectly uses system.transfer for token transfers #171

tosynthegeek opened this issue Jun 18, 2024 · 1 comment

Comments

@tosynthegeek
Copy link

tosynthegeek commented Jun 18, 2024

The docs at https://yihau.gitbook.io/solana-go/tour/transfer-1 currently demonstrates token transfers using system.transfer, which is incorrect for token transfers. This method is appropriate for SOL transfers but not for other tokens.

Current Behavior

The docs shows:

sysprog.Transfer(sysprog.TransferParam{
    From:   alice.PublicKey,
    To:     common.PublicKeyFromString("2xNweLHLqrbx4zo1waDvgWJHgsUpPj8Y8icbAFeR4a8i"),
    Amount: 1e9,
})

Expected Behaviour

token.Transfer(token.TransferParam{
    From:    fromTokenAccount,
    To:      toTokenAccount,
    Auth:    alice.PublicKey,
    Signers: []common.PublicKey{},
    Amount:  amount,
})
@yihau
Copy link
Collaborator

yihau commented Jun 18, 2024

thank you for pointing this out. that one is outdated and deprecated! could you check the docs on https://blocto.github.io/solana-go-sdk

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

No branches or pull requests

2 participants