Re-exports§
pub use bytemuck;pub use pinocchio;pub use pinocchio_log;pub use pinocchio_system as system;pub use typed_builder;
Modules§
- entrypoint
- Macros and functions for defining the program entrypoint and setting up global handlers.
- prelude
- Make sure all traits are available.
- sysvars
- Provides access to cluster system accounts.
Macros§
- declare_
id - Convenience macro to define a static
Pubkeyvalue representing the program ID. - entrypoint
- Declare the program entrypoint and set up global handlers.
- impl_
int_ conversion - Simple macro for implementing conversion functions between Pod* integers and standard integers.
- into_
discriminator - Wrap an enum to automatically make it into a discriminator.
- log
- nostd_
entrypoint - program_
entrypoint - Declare the program entrypoint.
- pubkey
- Convenience macro to define a static
Pubkeyvalue.
Structs§
- Account
Info - Wrapper struct for an
Account. - Account
Meta - Describes a single account read or written by a program during instruction execution.
- Instruction
- Information about a CPI instruction.
- Logger
- Logger to efficiently format log messages.
- PodBool
- The standard
boolis not aPod, define a replacement that is - PodI16
i16type that can be used in Pods- PodI64
i64type that can be used in Pods- PodU16
u16type that can be used inPods- PodU32
u32type that can be used inPods- PodU64
u64type that can be used in Pods- PodU128
u128type that can be used in Pods- Seed
- Represents a signer seed.
- Signer
- Represents a program derived address (PDA) signer controlled by the calling program.
Enums§
- Pina
Program Error - The internal Pina Errors. To prevent clashes with your own error these
errors work their way backwards from the max
u32. - Program
Error - Reasons the program may fail.
Constants§
- MAX_
DISCRIMINATOR_ SPACE - This is the max number bytes that a discriminator can take to prevent alignment issues. Since the larges alignment size us u64. 8bytes is needed to ensure the alignement does not error.
- MAX_
SEEDS - Maximum number of seeds.
- MAX_
SEED_ LEN - maximum length of derived
Pubkeyseed. - PDA_
MARKER - The marker used to derive program derived addresses.
- PUBKEY_
BYTES - Number of bytes in a pubkey.
Traits§
- Account
Deserialize - Account
Info Validation - Account
Validation - AsAccount
- Performs:
- Close
Account With Recipient - HasDiscriminator
- Into
Discriminator - Lamport
Transfer - Loggable
- Pod
- Marker trait for “plain old data”.
- Process
Account Infos - TryFrom
Account Infos - Zeroable
- Trait for types that can be safely created with
zeroed.
Functions§
- allocate_
account - Allocates space for a new program account, returning the derived
addressand the canonicalbump. - allocate_
account_ with_ bump - Allocates space for a new program account with user-provided bump.
- assert
- checked_
create_ program_ address - Create a valid program derived address without searching for a bump seed.
- close_
account - Closes an account and returns the remaining rent lamports to the provided recipient.
- combine_
seeds_ with_ bump - create_
account - Creates a new non-program account.
- create_
program_ account - Creates a new program account and returns the address and canonical bump.
- create_
program_ account_ with_ bump - Creates a new program account with user-provided bump.
- create_
program_ address - Create a valid program derived address without searching for a bump seed.
- create_
with_ seed - Derive a Pubkey from another Pubkey, seed, and a program id.
- decode_
32_ const - Decode into a 32-byte array. Panic on error.
- derive_
address - Derive a program address from the given seeds, optional bump and program id.
- derive_
address_ const - Derive a program address from the given seeds, optional bump and program id.
- find_
program_ address - Find a valid program derived address and its corresponding bump seed.
- from_
str - Create a
Pubkeyfrom a&str. - log
- Log a
Pubkeyfrom a program. - log_
caller - parse_
instruction - Parses an instruction from the instruction data. Also checks that the program ID matches the provided ID when this instruction was called.
- pod_
from_ bytes - Convert a slice of bytes into a
Pod(zero copy) - pubkey_
eq - Compare two
Pubkeys for equality. - try_
find_ program_ address - Find a valid program derived address and its corresponding bump seed.
Type Aliases§
- Program
Result - The result of a program execution.
- Pubkey
- The address of a Solana account.
Attribute Macros§
- account
- The account macro is used to annotate account data that will exist within a solana account.
- discriminator
- This attribute macro should be used for annotating the globally shared instruction and account discriminators.
- error
#[error]is a lightweight modification to the provided enum acting as syntactic sugar to make it easier to manage your custom program errors.- event
- The event macro is used to annotate event data that will be emitted from a solana program.
- instruction
- The instruction macro is used to annotate instruction data that will exist within a solana instruction.
- log_
cu_ usage - Attribute macro for instrumenting functions with compute unit logging.
Derive Macros§
- Accounts
- Pod
- Derive the
Podtrait for a struct - Typed
Builder - Zeroable
- Derive the
Zeroabletrait for a type.