Enum anchor_cli::IdlCommand

source ·
pub enum IdlCommand {
    Init {
        program_id: Pubkey,
        filepath: String,
        priority_fee: Option<u64>,
    },
    Close {
        program_id: Pubkey,
        idl_address: Option<Pubkey>,
        print_only: bool,
        priority_fee: Option<u64>,
    },
    WriteBuffer {
        program_id: Pubkey,
        filepath: String,
        priority_fee: Option<u64>,
    },
    SetBuffer {
        program_id: Pubkey,
        buffer: Pubkey,
        print_only: bool,
        priority_fee: Option<u64>,
    },
    Upgrade {
        program_id: Pubkey,
        filepath: String,
        priority_fee: Option<u64>,
    },
    SetAuthority {
        address: Option<Pubkey>,
        program_id: Pubkey,
        new_authority: Pubkey,
        print_only: bool,
        priority_fee: Option<u64>,
    },
    EraseAuthority {
        program_id: Pubkey,
        priority_fee: Option<u64>,
    },
    Authority {
        program_id: Pubkey,
    },
    Build {
        program_name: Option<String>,
        out: Option<String>,
        out_ts: Option<String>,
        no_docs: bool,
        skip_lint: bool,
    },
    Fetch {
        address: Pubkey,
        out: Option<String>,
    },
}

Variants§

§

Init

Initializes a program’s IDL account. Can only be run once.

Fields

§program_id: Pubkey
§filepath: String
§priority_fee: Option<u64>
§

Close

Fields

§program_id: Pubkey
§idl_address: Option<Pubkey>

The IDL account to close. If none is given, then the IDL account derived from program_id is used.

§print_only: bool

When used, the content of the instruction will only be printed in base64 form and not executed. Useful for multisig execution when the local wallet keypair is not available.

§priority_fee: Option<u64>
§

WriteBuffer

Writes an IDL into a buffer account. This can be used with SetBuffer to perform an upgrade.

Fields

§program_id: Pubkey
§filepath: String
§priority_fee: Option<u64>
§

SetBuffer

Sets a new IDL buffer for the program.

Fields

§program_id: Pubkey
§buffer: Pubkey

Address of the buffer account to set as the idl on the program.

§print_only: bool

When used, the content of the instruction will only be printed in base64 form and not executed. Useful for multisig execution when the local wallet keypair is not available.

§priority_fee: Option<u64>
§

Upgrade

Upgrades the IDL to the new file. An alias for first writing and then then setting the idl buffer account.

Fields

§program_id: Pubkey
§filepath: String
§priority_fee: Option<u64>
§

SetAuthority

Sets a new authority on the IDL account.

Fields

§address: Option<Pubkey>

The IDL account buffer to set the authority of. If none is given, then the canonical IDL account is used.

§program_id: Pubkey

Program to change the IDL authority.

§new_authority: Pubkey

New authority of the IDL account.

§print_only: bool

When used, the content of the instruction will only be printed in base64 form and not executed. Useful for multisig execution when the local wallet keypair is not available.

§priority_fee: Option<u64>
§

EraseAuthority

Command to remove the ability to modify the IDL account. This should likely be used in conjection with eliminating an “upgrade authority” on the program.

Fields

§program_id: Pubkey
§priority_fee: Option<u64>
§

Authority

Outputs the authority for the IDL account.

Fields

§program_id: Pubkey

The program to view.

§

Build

Generates the IDL for the program using the compilation method.

Fields

§program_name: Option<String>
§out: Option<String>

Output file for the IDL (stdout if not specified)

§out_ts: Option<String>

Output file for the TypeScript IDL

§no_docs: bool

Suppress doc strings in output

§skip_lint: bool

Do not check for safety comments

§

Fetch

Fetches an IDL for the given address from a cluster. The address can be a program, IDL account, or IDL buffer.

Fields

§address: Pubkey
§out: Option<String>

Output file for the idl (stdout if not specified).

Trait Implementations§

source§

impl CommandFactory for IdlCommand

source§

fn command<'b>() -> Command

Build a Command that can instantiate Self. Read more
source§

fn command_for_update<'b>() -> Command

Build a Command that can update self. Read more
source§

impl Debug for IdlCommand

source§

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

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

impl FromArgMatches for IdlCommand

source§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
source§

fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches ) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
source§

fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches ) -> Result<(), Error>

Assign values from ArgMatches to self.
source§

fn update_from_arg_matches_mut<'b>( &mut self, __clap_arg_matches: &mut ArgMatches ) -> Result<(), Error>

Assign values from ArgMatches to self.
source§

impl Parser for IdlCommand

source§

fn parse() -> Self

Parse from std::env::args_os(), exit on error.
source§

fn try_parse() -> Result<Self, Error>

Parse from std::env::args_os(), return Err on error.
source§

fn parse_from<I, T>(itr: I) -> Self
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Parse from iterator, exit on error.
source§

fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Parse from iterator, return Err on error.
source§

fn update_from<I, T>(&mut self, itr: I)
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Update from iterator, exit on error.
source§

fn try_update_from<I, T>(&mut self, itr: I) -> Result<(), Error>
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Update from iterator, return Err on error.
source§

impl Subcommand for IdlCommand

source§

fn augment_subcommands<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate Self. Read more
source§

fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command

Append to Command so it can update self. Read more
source§

fn has_subcommand(__clap_name: &str) -> bool

Test whether Self can parse a specific subcommand

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> AbiExample for T

source§

default fn example() -> T

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<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

source§

fn implicit( self, class: Class, constructed: bool, tag: u32 ) -> TaggedParser<'a, Implicit, Self, E>

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> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

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

§

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>,

§

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.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more