Quantcast
Channel: Recent Questions - Solana Stack Exchange
Viewing all articles
Browse latest Browse all 7906

Batch Transfer SPL Token that has Token transfer extension enabled

$
0
0

Is it even possible to batch transfer an SPL token that has a Token transfer(token fee) extension enabled?

I would Like to create a program which takes the destination wallet from a JSON file and iterates through each address to create or check the associated token for the mint token and then transfer the token with the right fee amount and batch them all into one transaction.

I have a working typescript to "transferCheckWithFee" that sends a single transaction to send the token to one destination wallet,

const sourceAccount = await createAssociatedTokenAccountIdempotent(connection, payer, mint, owner.publicKey, {}, TOKEN_2022_PROGRAM_ID);const destinationAccount = await createAssociatedTokenAccountIdempotent(connection, payer, mint, destinationOwner.publicKey, {}, TOKEN_2022_PROGRAM_ID);const transferSig = await transferCheckedWithFee(    connection,    payer,    sourceAccount,    mint,    destinationAccount,    owner,    transferAmount,    decimals,    fee,    [],    undefined,    TOKEN_2022_PROGRAM_ID);

but not sure how to batch for multiple destination wallets in a single transaction.

Can you guys help develop such a typescript program?

Thanks


Viewing all articles
Browse latest Browse all 7906

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>