Crate pina

Crate pina 

Source

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 Pubkey value 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 Pubkey value.

Structs§

AccountInfo
Wrapper struct for an Account.
AccountMeta
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 bool is not a Pod, define a replacement that is
PodI16
i16 type that can be used in Pods
PodI64
i64 type that can be used in Pods
PodU16
u16 type that can be used in Pods
PodU32
u32 type that can be used in Pods
PodU64
u64 type that can be used in Pods
PodU128
u128 type 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§

PinaProgramError
The internal Pina Errors. To prevent clashes with your own error these errors work their way backwards from the max u32.
ProgramError
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 Pubkey seed.
PDA_MARKER
The marker used to derive program derived addresses.
PUBKEY_BYTES
Number of bytes in a pubkey.

Traits§

AccountDeserialize
AccountInfoValidation
AccountValidation
AsAccount
Performs:
CloseAccountWithRecipient
HasDiscriminator
IntoDiscriminator
LamportTransfer
Loggable
Pod
Marker trait for “plain old data”.
ProcessAccountInfos
TryFromAccountInfos
Zeroable
Trait for types that can be safely created with zeroed.

Functions§

allocate_account
Allocates space for a new program account, returning the derived address and the canonical bump.
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 Pubkey from a &str.
log
Log a Pubkey from 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§

ProgramResult
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 Pod trait for a struct
TypedBuilder
Zeroable
Derive the Zeroable trait for a type.