ประเภทหนัง
ตัวอย่างหนัง Solana: Module ‘”@solana/spl-token”‘ has no exported member ‘createAssociatedTokenAccountInstruction’
Error: Module ‘@Solana/Spl-Token’ has no exported Member ‘createasSociatedTokenaccountinstruction’
When working with Solana, it is essential to understand the module structure and ensure that In this article,
The Issue
In your import statement, you’re using the following Code:
`Typescript
import {
Token_program_id,
Associated_token_program_id,
…
`
Notice that both token_program_id
andAssociated_token program id
are imported as token_program_id
. This might see
The Solution
`@Solana/Spl-Token
Module. Specifically
Here’s What You Can Modify:
`Typescript
// @Solana/Spl-Token Module (As Exported)
Export Declare Const Create_associated_token_account_instructions: [
/ … Other Exports … /
createasSociatedTokenaccountinstruction,
];
`
In
Additional Tips
.
. The @Solana/Spl-Token
module to match your specific requirements.
The CreateasSociatedToKenaccenaccountinstruction
Function in yourtransactionService.TS
File.