Expand description
The Solana host and client SDK.
This is the base library for all off-chain programs that interact with
Solana or otherwise operate on Solana data structures. On-chain programs
instead use the solana-program
crate, the modules of which are
re-exported by this crate, like the relationship between the Rust
core
and std
crates. As much of the functionality of this crate is
provided by solana-program
, see that crate’s documentation for an
overview.
Many of the modules in this crate are primarily of use to the Solana runtime
itself. Additional crates provide capabilities built on solana-sdk
, and
many programs will need to link to those crates as well, particularly for
clients communicating with Solana nodes over RPC.
Such crates include:
solana-client
- For interacting with a Solana node via the JSON-RPC API.solana-cli-config
- Loading and saving the Solana CLI configuration file.solana-clap-utils
- Routines for setting up the CLI usingclap
, as used by the Solana CLI. Includes functions for loading all types of signers supported by the CLI.
Re-exports§
pub extern crate bs58;
pub use solana_program::account_info;
pub use solana_program::big_mod_exp;
pub use solana_program::blake3;
pub use solana_program::clock;
pub use solana_program::epoch_rewards;
pub use solana_program::fee_calculator;
pub use solana_program::keccak;
pub use solana_program::native_token;
pub use solana_program::program_option;
pub use solana_program::program_pack;
pub use solana_program::rent;
pub use solana_program::serialize_utils;
pub use solana_program::stable_layout;
pub use solana_message as message;
pub use solana_shred_version as shred_version;
full
pub use solana_account as account;
pub use solana_epoch_info as epoch_info;
pub use solana_epoch_rewards_hasher as epoch_rewards_hasher;
pub use solana_fee_structure as fee;
pub use solana_inflation as inflation;
pub use solana_offchain_message as offchain_message;
full
pub use solana_program_memory as program_memory;
pub use solana_sanitize as sanitize;
pub use solana_serde as deserialize_utils;
pub use solana_serde_varint as serde_varint;
pub use solana_short_vec as short_vec;
pub use solana_time_utils as timing;
Modules§
- account_
utils - Useful extras for
Account
state. - address_
lookup_ table Deprecated - alt_
bn128 Deprecated - borsh
borsh
- Utilities for the borsh serialization format.
- borsh0_
10 borsh
- Utilities for the borsh serialization format, version 0.10.
- borsh1
borsh
- Utilities for the borsh serialization format, version 1.
- bpf_
loader - The latest BPF loader native program.
- bpf_
loader_ deprecated - The original and now deprecated Solana BPF loader.
- bpf_
loader_ upgradeable Deprecated - client
Deprecated full
- commitment_
config Deprecated full
- compute_
budget Deprecated full
- config
- The config native program.
- debug_
account_ data - Debug-formatting of account data.
- decode_
error Deprecated - derivation_
path Deprecated - ed25519_
instruction Deprecated full
- ed25519_
program - The ed25519 native program.
- entrypoint
- The Rust-based BPF program entrypoint supported by the latest BPF loader.
- entrypoint_
deprecated - The Rust-based BPF program entrypoint supported by the original BPF loader.
- epoch_
schedule - exit
Deprecated - feature
Deprecated - feature_
set Deprecated - genesis_
config Deprecated full
- hard_
forks Deprecated full
- hash
- Hashing with the SHA-256 hash function, and a general
Hash
type. - incinerator
- inner_
instruction - instruction
- lamports
- Re-exports the
LamportsError
type for backwards compatibility. - loader_
instruction Deprecated - loader_
upgradeable_ instruction Deprecated - loader_
v4 Deprecated - loader_
v4_ instruction Deprecated - log
program
- native_
loader - The native loader native program.
- net
- nonce
Deprecated - nonce_
account Deprecated - packet
Deprecated - poh_
config Deprecated - precompiles
Deprecated full
- Solana precompiled programs.
- program
- Wrappers around
solana-cpi
with support for overwriting syscall stubs - program_
error - program_
stubs Non- target_os="solana"
- Implementations of syscalls used when
solana-program
is built for non-SBF targets. - program_
utils - Contains a single utility function for deserializing from bincode.
- pubkey
- quic
Deprecated full
- rent_
collector Deprecated full
- rent_
debits Deprecated - reserved_
account_ keys Deprecated full
- reward_
info Deprecated - reward_
type Deprecated - rpc_
port Deprecated - RPC default port numbers.
- sdk_ids
Deprecated - secp256k1_
instruction Deprecated full
- secp256k1_
program - The secp256k1 native program.
- secp256k1_
recover Deprecated - signature
full
- Functionality for public and private keys.
- signer
full
- signers
full
- simple_
vote_ transaction_ checker full
- slot_
hashes - slot_
history - stake
Deprecated - stake_
history Deprecated - syscalls
- Declarations of Solana program syscalls.
- system_
instruction Deprecated - system_
program Deprecated - system_
transaction Deprecated full
- sysvar
- transaction
full
- transaction_
context Deprecated - transport
full
- Defines the
TransportError
type. - vote
Deprecated
Macros§
- custom_
heap_ default - Define the default global allocator.
- custom_
panic_ default - Define the default global panic handler.
- declare_
deprecated_ id - Same as
declare_id
except report that this id has been deprecated. - declare_
deprecated_ sysvar_ id - Same as
declare_sysvar_id
except that it reports that this ID has been deprecated. - declare_
id - Convenience macro to declare a static public key and functions to interact with it.
- declare_
sysvar_ id - Declares an ID that implements
SysvarId
. - impl_
sysvar_ get - Implements the
Sysvar::get
method for both SBF and host targets. - msg
- Print a message to the log.
- pubkey
- Convenience macro to define a static public key.
- pubkeys
- Convenience macro to define multiple static public keys.
- saturating_
add_ assign Deprecated - Convenience macro for
AddAssign
with saturating arithmetic. - unchecked_
div_ by_ const - Convenience macro for doing integer division where the operation’s safety can be checked at compile-time.