Skip to main content
3 votes

I get error at step: createAssociatedTokenAccountInstruction, failed: incorrect program id for instruction

This is a shot in the dark, but GetAccountDataSize on SPL Token only takes in the mint. If it's giving an IncorrectProgramId error, then the mint account you're providing is not an SPL Token mint. Be ...
Jon C's user avatar
  • 15.6k
3 votes
Accepted

Improve performance of getParsedProgramAccounts for StakeAccount

The call is trying to filter through all stake accounts, which is on the order of 1 million accounts. Unfortunately, this will take a long time no matter what using the standard RPC node. If you want ...
Jon C's user avatar
  • 15.6k
3 votes

Interoperability/Bridging with Solana and other chains

If you're looking for interoperability/bridging options, you can look at the following: Wormhole: https://wormhole.com/ DeBridge: https://debridge.finance/
Joey Meere's user avatar
  • 1,412
3 votes

Getting 'cannot find value' in Accounts struct for Anchor 0.30

You've found a 0.30.0 bug, so for now there's nothing you can really do about this except for downgrading to 0.29.0. Alternatively, you can work around this by: In your account definition switch /// ...
Ahri's user avatar
  • 4,100
2 votes

Referencing an account from another within #[derive(Accounts)]

This is a known breaking change from Anchor 0.30.0. This means you have 3 options: Use Anchor 0.29.0 Use one of the two workarounds I suggested here where I answered someone who had a similar issue ...
Ahri's user avatar
  • 4,100
1 vote

Reference to mint is not recognized in Struct creation while trying to create an NFT in Anchor

This tutorial uses an outdated version of mpl_token_metadata. Switch to a Metaplex version >0.4.0 e.g mpl-token-metadata = "4.1.2" Update your Solana version to 1.18.8. You'll face some ...
Jimii's user avatar
  • 3,260
1 vote

Initiate by signing Solana Transaction through EVM provider

Solana uses a different signature scheme than Ethereum, so you cannot use an Ethereum signature as one of the transaction signatures in a Solana transaction. You'll need to generate an Ed25519 ...
Jon C's user avatar
  • 15.6k
1 vote

Solana call mint token from pda program: Cross-program invocation with unauthorized

The reason why CreateToken is probably because you are using different seeds. The mint seeds will be your program ID + your mint seeds const [mintAccount, mintAccountBum] = anchor....
Jimii's user avatar
  • 3,260
1 vote
Accepted

Decoding solana transaction data

Im using this repo: https://github.com/rckprtr/pumpdotfun-sdk import bs58 from "bs58"; import idl from "../../src/IDL/pump-fun.json"; import { BorshCoder, } from "@coral-xyz/...
rckprtr's user avatar
  • 41
1 vote

Does token-2022 allow selling tax instead of a basic transfer fee?

Your approach of adding transfer fees and then returning some amount of the fees back to the user is probably the easiest one to implement. You could do the fee return logic entirely on-chain through ...
Jon C's user avatar
  • 15.6k
1 vote

Streaming pending transactions

There is three states transactions can be in: Processed, Confirmed, and Finalized, with Processed being the earliest in the lifecycle of a transaction. More info on what these mean exactly can be ...
Ahri's user avatar
  • 4,100
1 vote

Error: failed to send transaction: Transaction simulation failed: Error processing Instruction 0: custom program error: 0x2

The error means invalid mint as you can see here: https://github.com/solana-labs/solana-program-library/blob/master/token/program/src/error.rs So im not sure how you created the USDC mint, but maybe ...
Jonas H.'s user avatar
  • 5,777
1 vote

I got an Error: InvalidAccountData when I mint token

It looks like you've commented out the line which confirms the transaction to create the ATA, which means that the chain hasn't confirmed that your ATA is created. When you try to mint to it, it will ...
Jon C's user avatar
  • 15.6k
1 vote

Issue with .env file

If you've added key like this SECRET_KEY="[(179, 94, 10, 171, 165, 165, 59)]" just remove parentheses and leave only square brackets.
slavugan's user avatar
  • 111

Only top scored, non community-wiki answers of a minimum length are eligible