pub struct Client<'a> {
pub env: Env,
pub address: Address,
/* private fields */
}Expand description
Client is a client for calling the contract defined in “Contract”.
Fields§
§env: Env§address: AddressImplementations§
Source§impl<'a> Client<'a>
impl<'a> Client<'a>
pub fn propose_admin(&self, new_admin: &Address)
pub fn try_propose_admin( &self, new_admin: &Address, ) -> Result<Result<(), <() as TryFromVal<Env, Val>>::Error>, Result<Error, InvokeError>>
pub fn accept_admin(&self)
pub fn try_accept_admin( &self, ) -> Result<Result<(), <() as TryFromVal<Env, Val>>::Error>, Result<Error, InvokeError>>
pub fn update_pool( &self, backstop_take_rate: &u32, max_positions: &u32, min_collateral: &i128, )
pub fn try_update_pool( &self, backstop_take_rate: &u32, max_positions: &u32, min_collateral: &i128, ) -> Result<Result<(), <() as TryFromVal<Env, Val>>::Error>, Result<Error, InvokeError>>
pub fn queue_set_reserve(&self, asset: &Address, metadata: &ReserveConfig)
pub fn try_queue_set_reserve( &self, asset: &Address, metadata: &ReserveConfig, ) -> Result<Result<(), <() as TryFromVal<Env, Val>>::Error>, Result<Error, InvokeError>>
pub fn cancel_set_reserve(&self, asset: &Address)
pub fn try_cancel_set_reserve( &self, asset: &Address, ) -> Result<Result<(), <() as TryFromVal<Env, Val>>::Error>, Result<Error, InvokeError>>
pub fn set_reserve(&self, asset: &Address) -> u32
pub fn try_set_reserve( &self, asset: &Address, ) -> Result<Result<u32, <u32 as TryFromVal<Env, Val>>::Error>, Result<Error, InvokeError>>
pub fn get_config(&self) -> PoolConfig
pub fn try_get_config( &self, ) -> Result<Result<PoolConfig, <PoolConfig as TryFromVal<Env, Val>>::Error>, Result<Error, InvokeError>>
pub fn get_admin(&self) -> Address
pub fn try_get_admin( &self, ) -> Result<Result<Address, <Address as TryFromVal<Env, Val>>::Error>, Result<Error, InvokeError>>
pub fn get_reserve_list(&self) -> Vec<Address>
pub fn try_get_reserve_list( &self, ) -> Result<Result<Vec<Address>, <Vec<Address> as TryFromVal<Env, Val>>::Error>, Result<Error, InvokeError>>
pub fn get_reserve(&self, asset: &Address) -> Reserve
pub fn try_get_reserve( &self, asset: &Address, ) -> Result<Result<Reserve, <Reserve as TryFromVal<Env, Val>>::Error>, Result<Error, InvokeError>>
pub fn get_positions(&self, address: &Address) -> Positions
pub fn try_get_positions( &self, address: &Address, ) -> Result<Result<Positions, <Positions as TryFromVal<Env, Val>>::Error>, Result<Error, InvokeError>>
pub fn submit( &self, from: &Address, spender: &Address, to: &Address, requests: &Vec<Request>, ) -> Positions
pub fn try_submit( &self, from: &Address, spender: &Address, to: &Address, requests: &Vec<Request>, ) -> Result<Result<Positions, <Positions as TryFromVal<Env, Val>>::Error>, Result<Error, InvokeError>>
pub fn submit_with_allowance( &self, from: &Address, spender: &Address, to: &Address, requests: &Vec<Request>, ) -> Positions
pub fn try_submit_with_allowance( &self, from: &Address, spender: &Address, to: &Address, requests: &Vec<Request>, ) -> Result<Result<Positions, <Positions as TryFromVal<Env, Val>>::Error>, Result<Error, InvokeError>>
pub fn flash_loan( &self, from: &Address, flash_loan: &FlashLoan, requests: &Vec<Request>, ) -> Positions
pub fn try_flash_loan( &self, from: &Address, flash_loan: &FlashLoan, requests: &Vec<Request>, ) -> Result<Result<Positions, <Positions as TryFromVal<Env, Val>>::Error>, Result<Error, InvokeError>>
pub fn update_status(&self) -> u32
pub fn try_update_status( &self, ) -> Result<Result<u32, <u32 as TryFromVal<Env, Val>>::Error>, Result<Error, InvokeError>>
pub fn set_status(&self, pool_status: &u32)
pub fn try_set_status( &self, pool_status: &u32, ) -> Result<Result<(), <() as TryFromVal<Env, Val>>::Error>, Result<Error, InvokeError>>
pub fn gulp(&self, asset: &Address) -> i128
pub fn try_gulp( &self, asset: &Address, ) -> Result<Result<i128, <i128 as TryFromVal<Env, Val>>::Error>, Result<Error, InvokeError>>
pub fn gulp_emissions(&self) -> i128
pub fn try_gulp_emissions( &self, ) -> Result<Result<i128, <i128 as TryFromVal<Env, Val>>::Error>, Result<Error, InvokeError>>
pub fn set_emissions_config( &self, res_emission_metadata: &Vec<ReserveEmissionMetadata>, )
pub fn try_set_emissions_config( &self, res_emission_metadata: &Vec<ReserveEmissionMetadata>, ) -> Result<Result<(), <() as TryFromVal<Env, Val>>::Error>, Result<Error, InvokeError>>
pub fn claim( &self, from: &Address, reserve_token_ids: &Vec<u32>, to: &Address, ) -> i128
pub fn try_claim( &self, from: &Address, reserve_token_ids: &Vec<u32>, to: &Address, ) -> Result<Result<i128, <i128 as TryFromVal<Env, Val>>::Error>, Result<Error, InvokeError>>
pub fn get_reserve_emissions( &self, reserve_token_index: &u32, ) -> Option<ReserveEmissionData>
pub fn try_get_reserve_emissions( &self, reserve_token_index: &u32, ) -> Result<Result<Option<ReserveEmissionData>, <Option<ReserveEmissionData> as TryFromVal<Env, Val>>::Error>, Result<Error, InvokeError>>
pub fn get_user_emissions( &self, user: &Address, reserve_token_index: &u32, ) -> Option<UserEmissionData>
pub fn try_get_user_emissions( &self, user: &Address, reserve_token_index: &u32, ) -> Result<Result<Option<UserEmissionData>, <Option<UserEmissionData> as TryFromVal<Env, Val>>::Error>, Result<Error, InvokeError>>
pub fn new_auction( &self, auction_type: &u32, user: &Address, bid: &Vec<Address>, lot: &Vec<Address>, percent: &u32, ) -> AuctionData
pub fn try_new_auction( &self, auction_type: &u32, user: &Address, bid: &Vec<Address>, lot: &Vec<Address>, percent: &u32, ) -> Result<Result<AuctionData, <AuctionData as TryFromVal<Env, Val>>::Error>, Result<Error, InvokeError>>
pub fn get_auction(&self, auction_type: &u32, user: &Address) -> AuctionData
pub fn try_get_auction( &self, auction_type: &u32, user: &Address, ) -> Result<Result<AuctionData, <AuctionData as TryFromVal<Env, Val>>::Error>, Result<Error, InvokeError>>
pub fn del_auction(&self, auction_type: &u32, user: &Address)
pub fn try_del_auction( &self, auction_type: &u32, user: &Address, ) -> Result<Result<(), <() as TryFromVal<Env, Val>>::Error>, Result<Error, InvokeError>>
pub fn bad_debt(&self, user: &Address)
pub fn try_bad_debt( &self, user: &Address, ) -> Result<Result<(), <() as TryFromVal<Env, Val>>::Error>, Result<Error, InvokeError>>
Auto Trait Implementations§
impl<'a> Freeze for Client<'a>
impl<'a> !RefUnwindSafe for Client<'a>
impl<'a> !Send for Client<'a>
impl<'a> !Sync for Client<'a>
impl<'a> Unpin for Client<'a>
impl<'a> !UnwindSafe for Client<'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
Mutably borrows from an owned value. Read more
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>
Convert
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>
Convert
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)
Convert
&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)
Convert
&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>
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