Skip to main content

ProgramWhitelistInstruction

Enum ProgramWhitelistInstruction 

Source
#[repr(C)]
pub enum ProgramWhitelistInstruction { InitiateAuthorityTransfer { new_authority: Pubkey, }, AcceptAuthorityTransfer, CancelAuthorityTransfer {}, RequestWhitelistEntry, ApproveWhitelistEntry { deploy_authority: Pubkey, }, RejectWhitelistEntry { deploy_authority: Pubkey, }, RemoveWhitelistEntry { deploy_authority: Pubkey, }, }
Expand description

Instructions supported by the program whitelist program.

Variants§

§

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
§

RequestWhitelistEntry

Requests a new entry on the program whitelist. Permissionless: the deploy_authority being requested must sign, proving control of the key. Creates a Pending entry that the whitelist_authority must later approve (via ApproveWhitelistEntry) before it grants deploy access.

Accounts expected by this instruction:

  1. [signer, writable] Payer (funds the new entry account)
  2. [signer] The deploy authority being requested (proves key control)
  3. [] The whitelist account (used for validation/derivation)
  4. [writable] The whitelist entry account to be created (Pending)
  5. [] System program
§

ApproveWhitelistEntry

Approves a pending whitelist entry, promoting it from Pending to Approved (active — the deploy gate then passes for that authority). The whitelist_authority must sign this instruction.

Accounts expected by this instruction:

  1. [signer] Payer
  2. [signer] The whitelist authority
  3. [] The whitelist account (used for validation)
  4. [writable] The whitelist entry account to approve

Fields

§deploy_authority: Pubkey
§

RejectWhitelistEntry

Rejects a pending whitelist entry, closing it and reclaiming its rent lamports to the payer. Only a Pending entry may be rejected (an active Approved entry is removed via RemoveWhitelistEntry). The whitelist_authority must sign this instruction.

Accounts expected by this instruction:

  1. [signer, writable] Payer (receives reclaimed rent)
  2. [signer] The whitelist authority
  3. [] The whitelist account (used for validation)
  4. [writable] The whitelist entry account to reject

Fields

§deploy_authority: Pubkey
§

RemoveWhitelistEntry

Closes a whitelist entry account, reclaiming its rent lamports to the payer. The whitelist_authority must sign this instruction.

Accounts expected by this instruction:

  1. [signer, writable] Payer (receives reclaimed rent)
  2. [signer] The whitelist authority
  3. [] The whitelist account (used for validation)
  4. [writable] The whitelist entry account to close

Fields

§deploy_authority: Pubkey

Implementations§

Source§

impl ProgramWhitelistInstruction

Source

pub const INITIATE_AUTHORITY_TRANSFER_TAG: u8 = 0

Instruction discriminant tags — the single source of truth for the leading byte of each instruction’s data. Both unpack (below) and the onchain CPI builders reference these, so a renumber happens in exactly one place. Values MUST match the enum’s positional order: the shank IDL and the generated clients derive their discriminants positionally.

Source

pub const ACCEPT_AUTHORITY_TRANSFER_TAG: u8 = 1

Source

pub const CANCEL_AUTHORITY_TRANSFER_TAG: u8 = 2

Source

pub const REQUEST_WHITELIST_ENTRY_TAG: u8 = 3

Source

pub const APPROVE_WHITELIST_ENTRY_TAG: u8 = 4

Source

pub const REJECT_WHITELIST_ENTRY_TAG: u8 = 5

Source

pub const REMOVE_WHITELIST_ENTRY_TAG: u8 = 6

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
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.