pub struct CreateBuffers<'a> {
pub program_id: Pubkey,
pub payer: Pubkey,
pub token_program: Pubkey,
pub buffers: &'a [(Pubkey, Pubkey)],
}Expand description
Builder for a CreateBuffer instruction that creates one buffer per
(buffer_pda, mint) pair in buffers.
Each buffer_pda must be the canonical PDA returned by
crate::pda::buffer::find_buffer_pda for its mint; the program derives
the bump itself and rejects any other address. payer funds every new token
account’s rent.
Buffer creation is idempotent: an already-existing buffer_pda is left
unchanged and the instruction still succeeds, so two parties racing to
create the same buffer both succeed.
The token_program supplied to this instruction must be the owner of all mints supplied. Only one token program can be supplied to this instruction at a time. If mints from two separate token programs are required, the client needs to divide it into separate instructions.
Wire format: [discriminator=4], 1 byte. The tokens are implied by the
mint accounts, so no further data is needed.
Required accounts:
[payer (W,S), system_program (R), token_program (R), (buffer_pda (W), mint (R))...].
The three shared accounts come first and are read positionally; the
per-buffer pairs follow. The system program only has to be present so the
CreateAccount CPI can execute; it isn’t read by index.
Fields§
§program_id: Pubkey§payer: Pubkey§token_program: PubkeyThe token program that will own every buffer this instruction creates.
Must be the address of a crate::token_program::TokenProgram, and
must be the program owning every mint in buffers.
buffers: &'a [(Pubkey, Pubkey)]