Crate vipers[][src]

Expand description

Library for writing safer Solana programs.

Re-exports

pub use validate::Validate;

Modules

Various assertions.

Validations for accounts.

Macros

Asserts that the ATA is the one of the given owner/mint.

Asserts that the given anchor_spl::token::TokenAccount is an associated token account.

assert_keysDeprecated

Asserts that two accounts share the same key.

Asserts that two accounts share the same key.

Asserts that two accounts do not share the same key.

Asserts that an account is owned by the given program.

Formats an error as a &str.

Asserts that an invariant holds, otherwise logs the given message. This is a drop-in replacement for require!.

Logs where in the code the macro was invoked.

Returns the given error as a program error.

Throws an error.

Tries to unwrap the Result, otherwise returns the error

Unwraps the result of a checked integer operation.

Attempts to unwrap an Option, and if it fails, prints an error.

Ensures an Option can be unwrapped, otherwise returns the error.

Enums

Vipers validation error.

Statics

The static program ID

Functions

Confirms that a given pubkey is equivalent to the program ID

Returns the program ID

Validates a derived program address.

Type Definitions

Anchor generated Result to be used as the return type for the program.