pub struct CreateSplInterfacePda {
pub fee_payer: Pubkey,
pub mint: Pubkey,
pub token_program: Pubkey,
pub spl_interface_pda: Pubkey,
pub existing_spl_interface_pda: Option<Pubkey>,
pub index: u8,
}Expand description
§Create SPL interface PDA (token pool) instruction builder
Creates or adds an spl interface pda for an SPL mint. Spl interface pdas store spl tokens that are wrapped in ctoken or compressed token accounts.
// Create initial pool (index 0)
let instruction = CreateSplInterfacePda::new(fee_payer, mint, token_program, false)
.instruction();
// Add additional pool (index 1)
let instruction = CreateSplInterfacePda::new_with_index(fee_payer, mint, token_program, 1, false)
.instruction();Fields§
§fee_payer: Pubkey§mint: Pubkey§token_program: Pubkey§spl_interface_pda: Pubkey§existing_spl_interface_pda: Option<Pubkey>§index: u8Implementations§
Source§impl CreateSplInterfacePda
impl CreateSplInterfacePda
Sourcepub fn new(
fee_payer: Pubkey,
mint: Pubkey,
token_program: Pubkey,
restricted: bool,
) -> Self
pub fn new( fee_payer: Pubkey, mint: Pubkey, token_program: Pubkey, restricted: bool, ) -> Self
Derives the spl interface pda for an SPL mint with index 0.
Sourcepub fn new_with_index(
fee_payer: Pubkey,
mint: Pubkey,
token_program: Pubkey,
index: u8,
restricted: bool,
) -> Self
pub fn new_with_index( fee_payer: Pubkey, mint: Pubkey, token_program: Pubkey, index: u8, restricted: bool, ) -> Self
Derives the spl interface pda for an SPL mint with a specific index. For index 0, creates the initial pool. For index > 0, adds an additional pool.
pub fn instruction(self) -> Instruction
Auto Trait Implementations§
impl Freeze for CreateSplInterfacePda
impl RefUnwindSafe for CreateSplInterfacePda
impl Send for CreateSplInterfacePda
impl Sync for CreateSplInterfacePda
impl Unpin for CreateSplInterfacePda
impl UnwindSafe for CreateSplInterfacePda
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more