pub struct FeeHandlerClient<'a> {
pub env: Env,
pub address: Address,
/* private fields */
}Expand description
FeeHandlerClient is a client for calling the contract defined in “FeeHandlerInterface”.
Fields§
§env: Env§address: AddressImplementations§
Source§impl<'a> FeeHandlerClient<'a>
impl<'a> FeeHandlerClient<'a>
Sourcepub fn process_fee(&self, sender_address: &Address) -> bool
pub fn process_fee(&self, sender_address: &Address) -> bool
Processes fees for a cross-chain transaction
This function collects fees from the sender address if fees are enabled and configured. It validates the fee amount, checks authorization and balance, and transfers the fee to the fee handler contract.
§Arguments
env- The Soroban environmentsender_address- The address that sent the cross-chain message
§Returns
Returns true if fee processing was successful or skipped
§Panics
Panics if:
- The source fee exceeds the maximum fee amount
- The fee amount is not authorized
- The sender has insufficient balance
Sourcepub fn try_process_fee(
&self,
sender_address: &Address,
) -> Result<Result<bool, <bool as TryFromVal<Env, Val>>::Error>, Result<Error, InvokeError>>
pub fn try_process_fee( &self, sender_address: &Address, ) -> Result<Result<bool, <bool as TryFromVal<Env, Val>>::Error>, Result<Error, InvokeError>>
Processes fees for a cross-chain transaction
This function collects fees from the sender address if fees are enabled and configured. It validates the fee amount, checks authorization and balance, and transfers the fee to the fee handler contract.
§Arguments
env- The Soroban environmentsender_address- The address that sent the cross-chain message
§Returns
Returns true if fee processing was successful or skipped
§Panics
Panics if:
- The source fee exceeds the maximum fee amount
- The fee amount is not authorized
- The sender has insufficient balance
Sourcepub fn set_fees_offline(&self, status: &bool)
pub fn set_fees_offline(&self, status: &bool)
Sets the fees offline status
§Arguments
env- The Soroban environmentstatus- Whether fees should be offline (disabled)
Sourcepub fn try_set_fees_offline(
&self,
status: &bool,
) -> Result<Result<(), <() as TryFromVal<Env, Val>>::Error>, Result<Error, InvokeError>>
pub fn try_set_fees_offline( &self, status: &bool, ) -> Result<Result<(), <() as TryFromVal<Env, Val>>::Error>, Result<Error, InvokeError>>
Sets the fees offline status
§Arguments
env- The Soroban environmentstatus- Whether fees should be offline (disabled)
Sourcepub fn is_fees_offline(&self) -> bool
pub fn is_fees_offline(&self) -> bool
Sourcepub fn try_is_fees_offline(
&self,
) -> Result<Result<bool, <bool as TryFromVal<Env, Val>>::Error>, Result<Error, InvokeError>>
pub fn try_is_fees_offline( &self, ) -> Result<Result<bool, <bool as TryFromVal<Env, Val>>::Error>, Result<Error, InvokeError>>
Sourcepub fn set_custom_source_fee(&self, client_contract: &Address, amount: &u64)
pub fn set_custom_source_fee(&self, client_contract: &Address, amount: &u64)
Sets a custom source fee for a client contract
§Arguments
env- The Soroban environmentclient_contract- The client contract address being processed for feesamount- The custom fee amount
Sourcepub fn try_set_custom_source_fee(
&self,
client_contract: &Address,
amount: &u64,
) -> Result<Result<(), <() as TryFromVal<Env, Val>>::Error>, Result<Error, InvokeError>>
pub fn try_set_custom_source_fee( &self, client_contract: &Address, amount: &u64, ) -> Result<Result<(), <() as TryFromVal<Env, Val>>::Error>, Result<Error, InvokeError>>
Sets a custom source fee for a client contract
§Arguments
env- The Soroban environmentclient_contract- The client contract address being processed for feesamount- The custom fee amount
Sourcepub fn get_source_fee(&self, client_contract: &Address) -> u64
pub fn get_source_fee(&self, client_contract: &Address) -> u64
Sourcepub fn try_get_source_fee(
&self,
client_contract: &Address,
) -> Result<Result<u64, <u64 as TryFromVal<Env, Val>>::Error>, Result<Error, InvokeError>>
pub fn try_get_source_fee( &self, client_contract: &Address, ) -> Result<Result<u64, <u64 as TryFromVal<Env, Val>>::Error>, Result<Error, InvokeError>>
Sourcepub fn set_max_fee(&self, client_contract: &Address, amount: &u64)
pub fn set_max_fee(&self, client_contract: &Address, amount: &u64)
Sets the maximum fee amount for a client contract
§Arguments
env- The Soroban environmentclient_contract- The client contract address being processed for feesamount- The maximum fee amount
Sourcepub fn try_set_max_fee(
&self,
client_contract: &Address,
amount: &u64,
) -> Result<Result<(), <() as TryFromVal<Env, Val>>::Error>, Result<Error, InvokeError>>
pub fn try_set_max_fee( &self, client_contract: &Address, amount: &u64, ) -> Result<Result<(), <() as TryFromVal<Env, Val>>::Error>, Result<Error, InvokeError>>
Sets the maximum fee amount for a client contract
§Arguments
env- The Soroban environmentclient_contract- The client contract address being processed for feesamount- The maximum fee amount
Sourcepub fn get_max_fee(&self, client_contract: &Address) -> u64
pub fn get_max_fee(&self, client_contract: &Address) -> u64
Sourcepub fn try_get_max_fee(
&self,
client_contract: &Address,
) -> Result<Result<u64, <u64 as TryFromVal<Env, Val>>::Error>, Result<Error, InvokeError>>
pub fn try_get_max_fee( &self, client_contract: &Address, ) -> Result<Result<u64, <u64 as TryFromVal<Env, Val>>::Error>, Result<Error, InvokeError>>
Sourcepub fn set_fee_token_contract(
&self,
client_contract: &Address,
contract: &Address,
)
pub fn set_fee_token_contract( &self, client_contract: &Address, contract: &Address, )
Sets the fee token contract for a client contract
§Arguments
env- The Soroban environmentclient_contract- The client contract address being processed for feescontract- The token contract address for fee payments
Sourcepub fn try_set_fee_token_contract(
&self,
client_contract: &Address,
contract: &Address,
) -> Result<Result<(), <() as TryFromVal<Env, Val>>::Error>, Result<Error, InvokeError>>
pub fn try_set_fee_token_contract( &self, client_contract: &Address, contract: &Address, ) -> Result<Result<(), <() as TryFromVal<Env, Val>>::Error>, Result<Error, InvokeError>>
Sets the fee token contract for a client contract
§Arguments
env- The Soroban environmentclient_contract- The client contract address being processed for feescontract- The token contract address for fee payments
Sourcepub fn get_fee_token_contract(&self, client_contract: &Address) -> Address
pub fn get_fee_token_contract(&self, client_contract: &Address) -> Address
Sourcepub fn try_get_fee_token_contract(
&self,
client_contract: &Address,
) -> Result<Result<Address, <Address as TryFromVal<Env, Val>>::Error>, Result<Error, InvokeError>>
pub fn try_get_fee_token_contract( &self, client_contract: &Address, ) -> Result<Result<Address, <Address as TryFromVal<Env, Val>>::Error>, Result<Error, InvokeError>>
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for FeeHandlerClient<'a>
impl<'a> !Send for FeeHandlerClient<'a>
impl<'a> !Sync for FeeHandlerClient<'a>
impl<'a> !UnwindSafe for FeeHandlerClient<'a>
impl<'a> Freeze for FeeHandlerClient<'a>
impl<'a> Unpin for FeeHandlerClient<'a>
impl<'a> UnsafeUnpin for FeeHandlerClient<'a>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T, U, V, W, E, C> Compare<(T, U, V, W)> for C
impl<T, U, V, W, E, C> Compare<(T, U, V, W)> for C
type Error = E
fn compare( &self, a: &(T, U, V, W), b: &(T, U, V, W), ) -> Result<Ordering, <C as Compare<(T, U, V, W)>>::Error>
Source§impl<T, U, V, W, X, E, C> Compare<(T, U, V, W, X)> for C
impl<T, U, V, W, X, E, C> Compare<(T, U, V, W, X)> for C
type Error = E
fn compare( &self, a: &(T, U, V, W, X), b: &(T, U, V, W, X), ) -> Result<Ordering, <C as Compare<(T, U, V, W, X)>>::Error>
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.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