RPC connection
Fee payer public key
Mint address
Amount to transfer
Sender public key (must sign all transactions)
Recipient public key
Optionaloptions: TransferOptionsOptional configuration
TransactionInstruction[][] -- send [0..n-2] in parallel, then [n-1]
Create instructions for a light-token transfer.
Returns
TransactionInstruction[][]-- an array of transaction instruction arrays. Each inner array is one transaction to sign and send.Use
sliceLastto separate the parallel prefix from the final transfer:When
ensureRecipientAtais true (the default), an idempotent associated token account creation instruction is included in the transfer (last) transaction. No extra RPC fetch -- the instruction is a no-op on-chain if the associated token account already exists. SetensureRecipientAta: falseif you manage recipient associated token accounts yourself.All transactions require payer + sender as signers.
Hash uniqueness guarantee: all compressed accounts for the sender are fetched once, then partitioned into non-overlapping chunks by tree version. Each hash appears in exactly one batch. This is enforced at runtime by
assertUniqueInputHashesinside_buildLoadBatches.