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

Code Snippet doesn't assign this object: #497

Open
cinojosa0705 opened this issue Jan 11, 2023 · 1 comment
Open

Code Snippet doesn't assign this object: #497

cinojosa0705 opened this issue Jan 11, 2023 · 1 comment

Comments

@cinojosa0705
Copy link

Hey, so I am following this right here: https://solanacookbook.com/references/basic-transactions.html#how-to-send-spl-tokens
to learn how to send a transaction from one wallet to another, but the code in there doesn't specify what the splToken object is and it's not assigned, can someone help?

@tranminhquanq
Copy link
Contributor

tranminhquanq commented Apr 22, 2023

Hi, @cinojosa0705.
Sorry for the problem you are having. First you need to edit your code to
const splToken = require("@solana/spl-token"); instead of const { Token } = require("@solana/spl-token");. Because the createMint, createTransferInstruction functions that the example code is using are all exported from the @solana/spl-token module.

tranminhquanq added a commit to tranminhquanq/solana-cookbook that referenced this issue Apr 22, 2023
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