Open krishnawinit opened 2 years ago
@krishnawinit can you please send in your code or a transaction example
async function airdropToken() {
let i= 0;
let instr = [];
let mint = {publicKey: new PublicKey("8LBhhVDsAWbH4WN11Qg2DMc9GTFszLyTbpVEZnCGGi5F")};
await connection.requestAirdrop(distributionBot.publicKey,2*LAMPORTS_PER_SOL);
while(i<5) {
let distributeToMember1 = await fanoutSdk.distributeWalletMemberInstructions(
{
distributeForMint: true,
member: wallets[i],
fanout: initvar.fanout, // From initialization
payer: authority.publicKey,
fanoutMint: mint.publicKey,
},
);
instr.push(...distributeToMember1.instructions);
i++;
}
const tx = await fanoutSdk.sendInstructions(
instr,
[authority],
authority.publicKey
);
const txdetails = await connection.confirmTransaction(tx.TransactionSignature)
console.log(txdetails, tx.RpcResponseAndContext.value.err);
setBalance(await connection.getBalance(distributionBot.publicKey)/LAMPORTS_PER_SOL);
}
Here is the code thanks for reply
I don't think either devnet or testnet allows you to airdrop anything >1, haven't for awhile
which line errors?
const tx = await fanoutSdk.sendInstructions(
instr,
[authority],
authority.publicKey
);
it is giving error 6012
are you in cli pr browser? I forget what the error I had earlier was but if you're in browser
[authority],
not need this, it'll inject signature if you do
[],
instead
6012 13th error
IncorrectOwner,
dunno that doesn't help all that much
didnt get you with authority still getting incorrect owner
array of 1 one instruction
sorry for the delay here looking into this
you are airdropping to the distrobution bot not the authority check to make sure these things are true about your code
what is your membership model?
assert_owned_by(&fanout_for_mint, &crate::ID)?;
assert_owned_by(&fanout_mint_member_token_account_info, &Token::id())?;
assert_owned_by(holding_account, &anchor_spl::token::Token::id())?;
Hi technical geeks, I need help in calling hydra SDK. I am able to sucessfully send airdrop of SOL but when I try using sending SPl20 token with the below given reference code I get error:
{InstructionError: Array(2)}InstructionError: Array(2)0: 11: {Custom: 6012}length: 2[[Prototype]]: Array(0)[[Prototype]]: Object