pub struct PdaBuilder { /* private fields */ }Expand description
§Create a Program Derived Address and it’s Instruction
This struct builds a Solana Program Derived account from the given parameters yielding an instruction.
#[derive(Serialize, Deserialize)]
pub struct PdaBuilder {
from_public_key: PublicKey,
to_public_key: PublicKey,
base: PublicKey,
space: u64,
owner: PublicKey,
seed: String,
lamports: u64,
}Implementations§
Source§impl PdaBuilder
impl PdaBuilder
pub fn new() -> Self
pub fn add_from(&mut self, public_key: PublicKey) -> &mut Self
pub fn add_base(&mut self, public_key: PublicKey) -> &mut Self
pub fn add_space(&mut self, space: u64) -> &mut Self
pub fn add_owner(&mut self, public_key: PublicKey) -> &mut Self
pub fn add_seed(&mut self, seed: &str) -> &mut Self
pub fn add_lamports(&mut self, lamports: u64) -> &mut Self
pub fn derive_public_key(&mut self) -> PoseidonResult<PdaPublicKey>
pub fn pda_pk_base58(&self) -> String
pub fn build(&self) -> PoseidonResult<Instruction>
Trait Implementations§
Source§impl Debug for PdaBuilder
impl Debug for PdaBuilder
Source§impl<'de> Deserialize<'de> for PdaBuilder
impl<'de> Deserialize<'de> for PdaBuilder
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for PdaBuilder
impl RefUnwindSafe for PdaBuilder
impl Send for PdaBuilder
impl Sync for PdaBuilder
impl Unpin for PdaBuilder
impl UnwindSafe for PdaBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more