Crate bolt_lang

Source

Re-exports§

pub use anchor_lang;
pub use anchor_lang::error::ErrorCode::AccountDidNotDeserialize as AccountDidNotDeserializeErrorCode;
pub use session_keys;
pub use bolt_system;
pub use world;
pub use serde;

Modules§

borsh
error
prelude
solana_program
Export of the solana_program crate.
thiserror
githubcrates-iodocs-rs

Macros§

declare_id
Defines the program’s ID. This should be used at the root of all Anchor based programs.
declare_program
Declare an external program based on its IDL.
emit
Logs an event that can be subscribed to by clients. Uses the sol_log_data syscall which results in the following log:
err
Returns with the given error. Use this with a custom error type.
error
Generates an Error::AnchorError that includes file and line information.
msg
Print a message to the log.
pubkey
require
Ensures a condition is true, otherwise returns with the given error. Use this with or without a custom error type.
require_eq
Ensures two NON-PUBKEY values are equal.
require_gt
Ensures the first NON-PUBKEY value is greater than the second NON-PUBKEY value.
require_gte
Ensures the first NON-PUBKEY value is greater than or equal to the second NON-PUBKEY value.
require_keys_eq
Ensures two pubkeys values are equal.
require_keys_neq
Ensures two pubkeys are not equal.
require_neq
Ensures two NON-PUBKEY values are not equal.
source
Creates a Source

Structs§

Account
Wrapper around AccountInfo that verifies program ownership and deserializes underlying data into a Rust type.
AccountInfo
Account information
AccountLoader
Type facilitating on demand zero copy deserialization.
AccountMeta
Describes a single account read or written by a program during instruction execution.
AnchorError
BoltMetadata
Metadata for the component.
Clock
A representation of network time.
Context
Provides non-argument inputs to the program.
CpiContext
Context specifying non-argument inputs for cross-program-invocations.
DelegateAccounts
DelegateConfig
DelegationProgram
Entity
EpochSchedule
Instructions
Instructions sysvar, dummy type.
Interface
Type validating that the account is one of a set of given Programs
InterfaceAccount
Wrapper around AccountInfo that verifies program ownership and deserializes underlying data into a Rust type.
MagicProgram
Program
Type validating that the account is the given Program
ProgramData
ProgramErrorWithOrigin
Pubkey
The address of a Solana account.
Rent
Configuration of network rent.
Rewards
Signer
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.
SlotHashes
SlotHistory
A bitvector indicating which slots are present in the past epoch.
Source
StakeHistory
System
SystemAccount
Type validating that the account is owned by the system program
Sysvar
Type validating that the account is a sysvar and deserializing it.
UncheckedAccount
Explicit wrapper for AccountInfo types to emphasize that no checks are performed
World
Type representing the program.

Enums§

BoltError
ComparedValues
Error
ErrorCode
Error codes that can be returned by internal framework code.
ErrorOrigin
ProgramError
Reasons the program may fail
UpgradeableLoaderState
Upgradeable loader account states

Constants§

ERROR_CODE_OFFSET
The starting point for user defined error codes.
MAGIC_CONTEXT_ID
The magic context ID.
MAGIC_PROGRAM_ID
The magic program ID.

Traits§

AccountDeserialize
A data structure that can be deserialized and stored into account storage, i.e. an AccountInfo’s mutable data slice.
AccountSerialize
A data structure that can be serialized and stored into account storage, i.e. an AccountInfo’s mutable data slice.
Accounts
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.
AccountsClose
The close procedure to initiate garabage collection of an account, allowing one to retrieve the rent exemption.
AccountsExit
The exit procedure for an account. Any cleanup or persistence to storage should be done here.
AnchorDeserialize
A data-structure that can be de-serialized from binary format by NBOR.
AnchorSerialize
A data-structure that can be serialized into binary format by NBOR.
Bumps
Associated bump seeds for Accounts.
ComponentDeserialize
Allows to deserialize a component AccountInfo into a struct.
ComponentTraits
Trait used to add the seed and size functions to the component.
Discriminator
Unique identifier for a type.
Id
Defines the id of a program.
Key
Defines the Pubkey of an account.
Lamports
Lamports related utility methods for accounts.
Owner
Defines an address expected to own an account.
SolanaSysvar
A type that holds sysvar data.
Space
Defines the space of an account for initialization.
ToAccountInfo
Transformation to an AccountInfo struct.
ToAccountInfos
Transformation to AccountInfo structs.
ToAccountMetas
Transformation to AccountMeta structs.

Functions§

commit_and_undelegate_accounts
CPI to trigger a commit and undelegate one or more accounts in the ER
delegate_account
next_account_info
Convenience function for accessing the next item in an AccountInfo iterator.
parse_args
Parses the arguments from a byte array.
pubkey_from_str
Wrapper method to create a pubkey from a string
undelegate_account
Undelegate an account

Type Aliases§

Result

Attribute Macros§

access_control
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.
account
An attribute for a data structure representing a Solana account.
arguments
bolt_program
This macro attribute is used to define a BOLT component.
component
This Component attribute is used to automatically generate the seed and size functions
component_deserialize
This macro is used to defined a struct as a BOLT component and automatically implements the ComponentDeserialize and AccountDeserialize traits for the struct.
component_id
Macro to specify the on-chain ID of a component.
constant
A marker attribute used to mark const values that should be included in the generated IDL but functionally does nothing.
delegate
This macro attribute is used to inject instructions and struct needed to delegate BOLT component.
error_code
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.
event
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.
extra_accounts
This macro attribute is used to define a BOLT system extra accounts.
instruction
This attribute is used to override the Anchor defaults of program instructions.
program
The #[program] attribute defines the module containing all instruction handlers defining all entries into a Solana program.
system
This macro attribute is used to define a BOLT system.
system_input
This macro attribute is used to define a BOLT system input.
zero_copy
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§

Accounts
Implements an Accounts deserializer on the given struct. Can provide further functionality through the use of attributes.
AnchorDeserialize
AnchorSerialize
InitSpace
Implements a Space trait on the given struct or enum.