pub struct Fee {
pub num_signatures: u16,
pub price_per_signature: Lamports,
pub compute_unit_limit: u32,
pub prioritization_fee_rate: MicroLamports,
pub blob_account_size: usize,
}
Expand description
The expected fees for a blob upload, broken down by source.
Fields§
§num_signatures: u16
The number of signatures required, summed across all transactions.
price_per_signature: Lamports
The price per signature, in lamports. 5000 lamports by default.
compute_unit_limit: u32
The compute unit limit, summed across all transactions.
prioritization_fee_rate: MicroLamports
The prioritization fee rate, in micro-lamports.
blob_account_size: usize
The required size of the blober account, in bytes.
Implementations§
Source§impl Fee
impl Fee
pub const ZERO: Fee
Sourcepub fn static_fee(&self) -> Lamports
pub fn static_fee(&self) -> Lamports
Calculate the static part of the fee for a blob upload. It is proportional to the number of signatures.
Sourcepub fn prioritization_fee(&self) -> Lamports
pub fn prioritization_fee(&self) -> Lamports
Calculate the recommended prioritization fee for a blob upload at the given priority. It is proportional to the compute unit limit, not the actual consumed compute units. The value is rounded up to the nearest lamport.
Sourcepub fn total_fee(&self) -> Lamports
pub fn total_fee(&self) -> Lamports
Calculate the total fee for a blob upload, including the static fee and the prioritization fee. Does not include rent.
Sourcepub fn rent(&self) -> Lamports
pub fn rent(&self) -> Lamports
Calculate the required rent used as a deposit for the blober account. Solana programs must hold on to a certain amount of lamports (SOL) in order to exist on-chain. This rent is paid upfront whenever an account is created or resized, and is proportional to the size of the account.
Sourcepub fn set_compute_unit_price(&self) -> Instruction
pub fn set_compute_unit_price(&self) -> Instruction
Creates a transaction for setting the compute unit price for a transaction.
Trait Implementations§
Source§impl From<Fee> for FeeStrategy
impl From<Fee> for FeeStrategy
impl Copy for Fee
Auto Trait Implementations§
impl Freeze for Fee
impl RefUnwindSafe for Fee
impl Send for Fee
impl Sync for Fee
impl Unpin for Fee
impl UnwindSafe for Fee
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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