pub struct CreateAccountAllowPrefund<'a, 'b> {
pub to: &'a AccountView<'a>,
pub funding: Option<(&'a AccountView<'a>, u64)>,
pub space: u64,
pub owner: &'b Address,
}Expand description
Builder for the system program’s CreateAccountAllowPrefund instruction
(tag 13).
Unlike CreateAccount, the target may already hold lamports: the
System Program allocates, assigns, and then transfers lamports from the
funding account as a delta on top of the existing balance, so callers pass
required.saturating_sub(current). The account order is [to, from],
the reverse of CreateAccount. A funding account is sent whenever one is
given, even with a zero delta (the System Program checks for one account
and ignores the second then), so hopper_init!, which always names the
payer, links one CPI body instead of a funded and a pre-funded copy (1.4
KiB of .text per program, measured 2026-09-21); from is left out only
when funding is None. to must sign (or be a PDA in signers) and
must be System-owned with no data. The feature gate is active on mainnet-beta, devnet, and
testnet; the System Program rejects the tag with
InvalidInstructionData where it is not.
Fields§
§to: &'a AccountView<'a>§funding: Option<(&'a AccountView<'a>, u64)>Funding account and lamport delta. None omits the payer from the
instruction; a zero delta keeps it (ignored by the System Program).
space: u64§owner: &'b Address