Skip to main content

ProgramWhitelistInstruction

Enum ProgramWhitelistInstruction 

Source
#[repr(C)]
pub enum ProgramWhitelistInstruction { CreateWhitelist {}, InitiateAuthorityTransfer { new_authority: Pubkey, }, AcceptAuthorityTransfer, CancelAuthorityTransfer {}, AddEntry { program_authority: Pubkey, }, RemoveEntry { program_authority: Pubkey, }, }
Expand description

Instructions supported by the program whitelist program.

Variants§

§

CreateWhitelist

Initializes the program whitelist account, setting its initial state with the initial authority.

Accounts expected by this instruction:

  1. [writable] The whitelist account to initialize
  2. [signer] The authority that will control the whitelist
  3. [signer] Account that will pay for the account creation
  4. [] The system program
§

InitiateAuthorityTransfer

Proposes a new authority for the program whitelist. The current whitelist_authority must sign this instruction. The proposed new_authority must then sign an AcceptAuthorityTransfer instruction to finalize the transfer.

Accounts expected by this instruction:

  1. [writable] The whitelist account
  2. [signer] The current whitelist authority

Fields

§new_authority: Pubkey
§

AcceptAuthorityTransfer

Accepts the pending authority transfer for the program whitelist. The pending_whitelist_authority must sign this instruction to assume authority over the whitelist.

Accounts expected by this instruction:

  1. [writable] The whitelist account
  2. [signer] The pending whitelist authority
§

CancelAuthorityTransfer

Cancels a pending authority transfer for the program whitelist. The current whitelist_authority must sign this instruction.

Accounts expected by this instruction:

  1. [writable] The whitelist account
  2. [signer] The current whitelist authority
§

AddEntry

Adds an address to the program whitelist or unrevokes a previously revoked address. If the whitelist_entry_account does not exist, this instruction creates and initializes it. If the account already exists and is marked as revoked, this instruction marks it as active again. The whitelist_authority must sign.

Accounts expected by this instruction:

  1. [] The whitelist account (Used for validation/derivation)
  2. [signer] The whitelist authority
  3. [writable] The whitelist entry account to be created/initialized or updated
  4. [writable, signer] Payer account (must be a system account)
  5. [] System program

Fields

§program_authority: Pubkey
§

RemoveEntry

Closes a specific whitelist entry account, transferring its rent lamports to a designated destination account. The whitelist_authority must sign this instruction.

Accounts expected by this instruction:

  1. [] The whitelist account (Used for validation)
  2. [signer] The whitelist authority
  3. [writable] The whitelist entry account to close
  4. [writable] The destination account for reclaimed lamports
  5. [] System program

Fields

§program_authority: Pubkey

Implementations§

Source§

impl ProgramWhitelistInstruction

Source

pub fn unpack(input: &[u8]) -> Result<Self, ProgramError>

Unpack a program whitelist instruction from a byte slice.

Trait Implementations§

Source§

impl Clone for ProgramWhitelistInstruction

Source§

fn clone(&self) -> ProgramWhitelistInstruction

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ProgramWhitelistInstruction

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for ProgramWhitelistInstruction

Source§

fn eq(&self, other: &ProgramWhitelistInstruction) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for ProgramWhitelistInstruction

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.