Crate switchboard_aggregator[−][src]
Re-exports
pub use structs::AggregatorAccountData;
pub use structs::AggregatorRound;
pub use structs::SwitchboardDecimal;
Modules
Macros
Defines the program’s ID. This should be used at the root of all Anchor based programs.
Print a message to the log
Ensures a condition is true, otherwise returns the given error. Use this with a custom error type.
Structs
Account container that checks ownership on deserialization.
Account information
Account AccountLoader facilitating on demand zero copy deserialization.
Note that using accounts in this way is distinctly different from using,
for example, the ProgramAccount
. Namely,
one must call load
, load_mut
, or load_init
, before reading or writing
to the account. For more details on zero-copy-deserialization, see the
account
attribute.
Account metadata used to define Instructions
Clock represents network time. Members of Clock start from 0 upon network boot. The best way to map Clock to wallclock time is to use current Slot, as Epochs vary in duration (they start short and grow as the network progresses).
Provides non-argument inputs to the program.
Container for any account not owned by the current program.
Context specifying non-argument inputs for cross-program-invocations.
Boxed container for the program state singleton, used when the state is for a program not currently executing.
Context specifying non-argument inputs for cross-program-invocations targeted at program state instructions.
Account loader facilitating on demand zero copy deserialization.
Note that using accounts in this way is distinctly different from using,
for example, the ProgramAccount
. Namely,
one must call load
, load_mut
, or load_init
, before reading or writing
to the account. For more details on zero-copy-deserialization, see the
account
attribute.
Account container that checks ownership on deserialization.
Boxed container for a deserialized account
. Use this to reference any
account owned by the currently executing program.
Boxed container for the program state singleton.
Contains recent block hashes and fee calculators.
Type validating that the account signed the transaction. No other ownership or type checks are done. If this is used, one should not try to access the underlying account data.
Container for sysvars.
Explicit wrapper for AccountInfo types.
Enums
Reasons the program may fail
Statics
The static program ID
Traits
A data structure that can be deserialized and stored into account storage,
i.e. an
AccountInfo
’s
mutable data slice.
A data structure that can be serialized and stored into account storage,
i.e. an
AccountInfo
’s
mutable data slice.
A data structure of validated accounts that can be deserialized from the
input to a Solana program. Implementations of this trait should perform any
and all requisite constraint checks on accounts to ensure the accounts
maintain any invariants required for the program to run securely. In most
cases, it’s recommended to use the Accounts
derive macro to implement this trait.
The exit procedure for an account. Any cleanup or persistence to storage should be done here.
A data-structure that can be de-serialized from binary format by NBOR.
A data-structure that can be serialized into binary format by NBOR.
Defines the id of a program.
Defines the Pubkey of an account.
Defines an address expected to own an account.
Transformation to an AccountInfo
struct.
Transformation to
AccountInfo
structs.
Transformation to
AccountMeta
structs.
Functions
Confirms that a given pubkey is equivalent to the program ID
Returns the program ID
Return the next AccountInfo
or a NotEnoughAccountKeys
error.
Type Definitions
Attribute Macros
Executes the given access control method before running the decorated instruction handler. Any method in scope of the attribute can be invoked with any arguments from the associated instruction handler.
A data structure representing a Solana account, implementing various traits:
Generates Error
and type Result<T> = Result<T, Error>
types to be
used as return types from Anchor instruction handlers. Importantly, the
attribute implements
From
on the
ErrorCode
to support converting from the user defined error enum into
the generated Error
.
The event attribute allows a struct to be used with emit! so that programs can log significant events in their programs that clients can subscribe to. Currently, this macro is for structs only.
The #[interface]
attribute allows one to define an external program
dependency, without having any knowledge about the program, other than
the fact that it implements the given trait.
The #[program]
attribute defines the module containing all instruction
handlers defining all entries into a Solana program.
The #[state]
attribute defines the program’s state struct, i.e., the
program’s global account singleton giving the program the illusion of state.
A data structure that can be used as an internal field for a zero copy
deserialized account, i.e., a struct marked with #[account(zero_copy)]
.
Derive Macros
Implements an Accounts
deserializer on the given
struct, applying any constraints specified via inert #[account(..)]
attributes upon deserialization.