Expand description
A generator program that will be able to generate solana program code from a much easier starting place.
§How it works
The standard lifecycle of an instruction (standard derive of InstructionListProcessor):
Instruction::Datais deserialized withBorshDeserialize::deserializefrom incoming dataInstruction::Datais split intoInstructionProcessor::FromAccountsData,InstructionProcessor::ValidateData, andInstructionProcessor::InstructionDatawithInstructionProcessor::data_to_instruction_argInstruction::Accountsis created fromInstructionProcessor::FromAccountsDatabyFromAccounts::from_accountsInstructionProcessor::processis called withInstructionProcessor::InstructionDataandInstruction::AccountsInstruction::Accountsis cleaned up by withAccountArgument::write_back
Re-exports§
pub use indexer::AllAny;pub use borsh;pub use solana_program;pub use static_assertions;
Modules§
- account_
argument - TODO: Write big docs here
- account_
list - Account types list of a program.
- account_
types - Standard account types. These are all optional, you can build your own if you don’t like something in one of them.
- compressed_
numbers - Numbers that can be decompressed/compressed on read/write
- entrypoint
- Contains all the entrypoint functions to start a program.
- error
- Custom Error support.
- indexer
- Indexing helpers, specifically for
AllAny. - instruction
- An individual instruction for a program.
- instruction_
list - A list of instructions serving as an interface and entrypoint for the program.
- on_
chain_ size - Automatic size calculation for on-chain data. Derive not created yet, must be done manually for now.
- pda_
seeds - Support for type based PDAs
- program
- Programs as accounts support.
Will eventually support
InstructionLists and interfaces. - types
- Additional serializable types
- util
- Helper utility functions
Macros§
- delegate_
account_ argument - Implements
AccountArgumentfor a type with a certain accessor. - entrypoint
- The entrypoint macro, replaces
solana_program::entrypointmacro. Requires a function that can be passed toentry. - entrypoint_
list - Similar to the
entrypointmacro but only requires passing a type that implementsInstructionList. - impl_
account_ info - Implementations for a type that impls
AccountInfo. - msg
- Print a message to the log.
- verify_
account_ arg_ impl - Verifies a given type implements the proper traits
Structs§
- CPIChecked
- CPI functions that check each account for outstanding usages.
Less efficient than
CPIUncheckedbut will avoid unsafe situations. Suggested to use this for validation and then swap toCPIUnchecked. Usessolana_program::program::invoke_signed - CPIUnchecked
- CPI functions that doesn’t check each account for outstanding usages.
Can result in unsafe situations but is more efficient than
CPIChecked. Usessolana_program::program::invoke_signed_unchecked - Cruiser
Account Info - A custom version of Solana’s
AccountInfothat allows for owner changes. - Pubkey
- The address of a Solana account.
- Solana
Account Info - Account information
- Solana
Account Meta - Describes a single account read or written by a program during instruction execution.
- Solana
Instruction - A directive for a single invocation of a Solana program.
Enums§
- Generic
Error - General errors issued by the generator.
- Generic
Error Discriminants - Auto-generated discriminant enum variants
Traits§
- Account
Info - A trait representing accounts on Solana. Can take many different forms.
- Account
Info Access - A trait representing accounts on Solana. Can take many different forms.
Use
AccountInfo. - CPI
- A way of executing CPI calls
- Safe
Owner Change - Account info can safely assign the owner.
- Safe
Owner Change Access - Account info can safely assign the owner. Use
SafeOwnerChange. - Safe
Realloc - Account info can safely realloc.
- Safe
Realloc Access - Account info can safely realloc. Use
SafeRealloc. - ToSolana
Account Info - Account info can be turned into a
SolanaAccountInfo. - ToSolana
Account Info Access - Account info can be turned into a
SolanaAccountInfo. UseToSolanaAccountInfo.
Type Aliases§
- Cruiser
Result - A version of
Resultreturned by manycruiserfunctions. - Unix
Timestamp - An approximate measure of real-world time.