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 ignores it then), so a
caller that always names a payer links one CPI body; from is left out
of the instruction only when funding is None. The to account must
sign (or be a PDA in signers) and must be System-owned with no data. Feature gate 6sPDzwyARRExKH52LECxcGoqziH8G7SZofwuxi8Ja331,
active on mainnet-beta since slot 422,928,004 (2026-05-29) and on devnet
and testnet; the System Program rejects the tag where it is inactive.
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 AddressImplementations§
Source§impl CreateAccountAllowPrefund<'_, '_>
impl CreateAccountAllowPrefund<'_, '_>
Sourcepub fn invoke(&self) -> ProgramResult
pub fn invoke(&self) -> ProgramResult
Invoke without PDA signers.
Sourcepub fn invoke_signed(&self, signers: &[Signer<'_, '_>]) -> ProgramResult
pub fn invoke_signed(&self, signers: &[Signer<'_, '_>]) -> ProgramResult
Invoke with PDA signers.