pub struct FeeConfigUtil {}Implementations§
Source§impl FeeConfigUtil
impl FeeConfigUtil
Sourcepub async fn estimate_kora_fee(
rpc_client: &RpcClient,
transaction: &mut VersionedTransactionResolved,
fee_payer: &Pubkey,
is_payment_required: bool,
price_source: PriceSource,
) -> Result<TotalFeeCalculation, KoraError>
pub async fn estimate_kora_fee( rpc_client: &RpcClient, transaction: &mut VersionedTransactionResolved, fee_payer: &Pubkey, is_payment_required: bool, price_source: PriceSource, ) -> Result<TotalFeeCalculation, KoraError>
Main entry point for fee calculation with Kora’s price model applied
Sourcepub async fn calculate_fee_in_token(
rpc_client: &RpcClient,
fee_in_lamports: u64,
fee_token: Option<&str>,
) -> Result<Option<u64>, KoraError>
pub async fn calculate_fee_in_token( rpc_client: &RpcClient, fee_in_lamports: u64, fee_token: Option<&str>, ) -> Result<Option<u64>, KoraError>
Calculate the fee in a specific token if provided
Sourcepub async fn calculate_fee_payer_outflow(
fee_payer_pubkey: &Pubkey,
transaction: &mut VersionedTransactionResolved,
rpc_client: &RpcClient,
price_source: &PriceSource,
) -> Result<u64, KoraError>
pub async fn calculate_fee_payer_outflow( fee_payer_pubkey: &Pubkey, transaction: &mut VersionedTransactionResolved, rpc_client: &RpcClient, price_source: &PriceSource, ) -> Result<u64, KoraError>
Calculate the total outflow (SOL + SPL token value) that could occur for a fee payer account in a transaction. This includes SOL transfers, account creation, SPL token transfers, and other operations that could drain the fee payer’s balance.
Auto Trait Implementations§
impl Freeze for FeeConfigUtil
impl RefUnwindSafe for FeeConfigUtil
impl Send for FeeConfigUtil
impl Sync for FeeConfigUtil
impl Unpin for FeeConfigUtil
impl UnwindSafe for FeeConfigUtil
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
Mutably borrows from an owned value. Read more
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>
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