pub struct InitializeTransferHookData<'a> {
pub authority: Option<&'a Pubkey>,
pub program_id: &'a Pubkey,
}Expand description
Data required to initialize the transfer hook extension, which is used to execute custom logic when transferring tokens.
Fields§
Who has authority to update the program ID. If None, the program ID cannot be modified.
Some(&Pubkey::default()) is analogous to None in this context.
program_id: &'a PubkeyProgram for transfer hook CPI.
Some(&Pubkey::default()) is analogous to None in this context.
§Notes
The initialize transfer hook instruction actually takes an optional program ID, where if both the authority and program ID pubkeys are None, then the Token program will revert because at least one of these values must be present. So if you want to initialize the transfer hook extension, this data must be specified.
Trait Implementations§
Source§impl<'a> Clone for InitializeTransferHookData<'a>
impl<'a> Clone for InitializeTransferHookData<'a>
Source§impl<'a> Debug for InitializeTransferHookData<'a>
impl<'a> Debug for InitializeTransferHookData<'a>
impl<'a> Eq for InitializeTransferHookData<'a>
Source§impl<'a> PartialEq for InitializeTransferHookData<'a>
impl<'a> PartialEq for InitializeTransferHookData<'a>
impl<'a> StructuralPartialEq for InitializeTransferHookData<'a>
Auto Trait Implementations§
impl<'a> Freeze for InitializeTransferHookData<'a>
impl<'a> RefUnwindSafe for InitializeTransferHookData<'a>
impl<'a> Send for InitializeTransferHookData<'a>
impl<'a> Sync for InitializeTransferHookData<'a>
impl<'a> Unpin for InitializeTransferHookData<'a>
impl<'a> UnsafeUnpin for InitializeTransferHookData<'a>
impl<'a> UnwindSafe for InitializeTransferHookData<'a>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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