Struct orao_solana_vrf::InitBuilder
source · pub struct InitBuilder { /* private fields */ }
sdk
only.Expand description
crate::InitNetwork
instruction builder.
Note:
- prioritization fees here are handled automatically based on the recent
prioritization fees — use
InitBuilder::with_compute_unit_price
to opt-out. - this builder is added for convenience — use
InitBuilder::into_raw_instruction
to get the raw instruction, or build it yourself (see theInitBuilder::into_raw_instruction
source).
Implementations§
source§impl InitBuilder
impl InitBuilder
sourcepub fn new(
config_authority: Pubkey,
fee: u64,
treasury: Pubkey,
fulfillment_authorities: Vec<Pubkey>,
) -> Self
pub fn new( config_authority: Pubkey, fee: u64, treasury: Pubkey, fulfillment_authorities: Vec<Pubkey>, ) -> Self
Creates a new builder with empty token fee configuration.
sourcepub fn with_token_fee_config(self, token_fee_config: OraoTokenFeeConfig) -> Self
pub fn with_token_fee_config(self, token_fee_config: OraoTokenFeeConfig) -> Self
Updates the token fee configuration.
sourcepub fn with_compute_unit_price(self, compute_unit_price: u64) -> Self
pub fn with_compute_unit_price(self, compute_unit_price: u64) -> Self
Defines a prioritization fee in micro-lamports (applied per compute unit).
Adds ComputeBudgetInstruction::SetComputeUnitPrice
to the request builder.
- if not specified, then median fee of the last 150 confirmed slots is used (this is by default)
- if zero, then compute unit price is not applied at all.
sourcepub fn with_compute_unit_price_multiplier(self, multiplier: f64) -> Self
pub fn with_compute_unit_price_multiplier(self, multiplier: f64) -> Self
Defines a multiplier that is applied to a median compute unit price.
This is only applied if no compute_unit_price specified, i.e. if compute unit price is measured as a median fee of the last 150 confirmed slots.
- if not specified, then no multiplier is applied (this is by default)
- if specified, then applied as follows:
compute_unit_price = median * multiplier
sourcepub fn with_compute_unit_limit(self, compute_unit_limit: u32) -> Self
pub fn with_compute_unit_limit(self, compute_unit_limit: u32) -> Self
Defines a specific compute unit limit that the transaction is allowed to consume.
Adds ComputeBudgetInstruction::SetComputeUnitLimit
to the request builder.
- if not specified, then compute unit limit is not applied at all (this is by default)
- if specified, then applied as is
sourcepub fn into_raw_instruction(self, id: Pubkey, payer: Pubkey) -> Instruction
pub fn into_raw_instruction(self, id: Pubkey, payer: Pubkey) -> Instruction
Builds the raw crate::InitNetwork
instruction based on this builder.
This is a low-level function, consider using InitBuilder::build
.
id
— the VRF program id (usually thecrate::id
)payer
— transaction fee payer that will sign the tx
Compute Budget Program configuration is ignored.
sourcepub async fn build<C: Deref<Target = impl Signer> + Clone>(
self,
orao_vrf: &Program<C>,
) -> Result<RequestBuilder<'_, C>, ClientError>
pub async fn build<C: Deref<Target = impl Signer> + Clone>( self, orao_vrf: &Program<C>, ) -> Result<RequestBuilder<'_, C>, ClientError>
Builds the request.
Note that this function returns an anchor_client::RequestBuilder
instance,
so feel free to put more instructions into the request.
Trait Implementations§
source§impl Clone for InitBuilder
impl Clone for InitBuilder
source§fn clone(&self) -> InitBuilder
fn clone(&self) -> InitBuilder
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl Freeze for InitBuilder
impl RefUnwindSafe for InitBuilder
impl Send for InitBuilder
impl Sync for InitBuilder
impl Unpin for InitBuilder
impl UnwindSafe for InitBuilder
Blanket Implementations§
source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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