Solana Cross-Program Invocation Header (sol/cpi.h)

solana · sdk/sbf/c/inc/sol/cpi.h · c · Apache-2.0
infra, payments, lang:c

Defines constants and structures for Solana Cross-Program Invocation (CPI). Use this when developing C-based Solana programs that need to interact with other on-chain programs.

// Source: https://github.com/solana-labs/solana | License: Apache-2.0
// Provided via justclaw.it.com; keep this notice with the code.
#pragma once
/**
 * @brief Solana Cross-Program Invocation
 */

#include <sol/types.h>
#include <sol/pubkey.h>
#include <sol/entrypoint.h>

#ifdef __cplusplus
extern "C" {
#endif

/**
 * Maximum CPI instruction data size. 10 KiB was chosen to ensure that CPI
 * instructions are not more limited than transaction instructions if the size
 * of transactions is doubled in the future.
 */
static const uint64_t MAX_CPI_INSTRUCTION_DATA_LEN = 10240;

/**
 * Maximum CPI instruction accounts. 255 was chosen to ensure that instruction
 * accounts are always within the maximum instruction account limit for SBF
 * program instructions.
 */
static const uint8_t MAX_CPI

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key