IdlCommand

Enum 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,
        cargo_args: Vec<String>,
    },
    Fetch {
        address: Pubkey,
        out: Option<String>,
    },
    Convert {
        path: String,
        out: Option<String>,
        program_id: Option<Pubkey>,
    },
    Type {
        path: String,
        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

§cargo_args: Vec<String>

Arguments to pass to the underlying cargo test command

§

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).

§

Convert

Convert legacy IDLs (pre Anchor 0.30) to the new IDL spec

Fields

§path: String

Path to the IDL file

§out: Option<String>

Output file for the IDL (stdout if not specified)

§program_id: Option<Pubkey>

Address to use (defaults to metadata.address value)

§

Type

Generate TypeScript type for the IDL

Fields

§path: String

Path to the IDL file

§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. Read more
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 via FromArgMatches::from_arg_matches_mut Read more
Source§

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

Append to Command so it can instantiate self via FromArgMatches::update_from_arg_matches_mut 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> 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> 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> Same for T

Source§

type Output = T

Should always be Self
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.
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
Source§

impl<T> ErasedDestructor for T
where T: 'static,