Trait Pool
Source pub trait Pool: Sync + Send {
Show 18 methods
// Required methods
fn as_any(&self) -> &dyn Any;
fn get_class(&self) -> PoolClass;
fn get_protocol(&self) -> PoolProtocol;
fn get_address(&self) -> PoolId;
fn get_pool_id(&self) -> PoolId;
fn get_fee(&self) -> U256;
fn get_tokens(&self) -> Vec<Address>;
fn get_swap_directions(&self) -> Vec<SwapDirection>;
fn calculate_out_amount(
&self,
db: &dyn DatabaseRef<Error = KabuDBError>,
token_address_from: &Address,
token_address_to: &Address,
in_amount: U256,
) -> Result<(U256, u64), ErrReport>;
fn calculate_in_amount(
&self,
db: &dyn DatabaseRef<Error = KabuDBError>,
token_address_from: &Address,
token_address_to: &Address,
out_amount: U256,
) -> Result<(U256, u64), ErrReport>;
fn can_flash_swap(&self) -> bool;
fn can_calculate_in_amount(&self) -> bool;
fn get_abi_encoder(&self) -> Option<&dyn PoolAbiEncoder>;
fn get_read_only_cell_vec(&self) -> Vec<U256> ⓘ;
fn get_state_required(&self) -> Result<RequiredState>;
fn is_native(&self) -> bool;
fn preswap_requirement(&self) -> PreswapRequirement;
// Provided method
fn get_pool_manager_cells(&self) -> Vec<(Address, Vec<U256>)> { ... }
}
Converts this type into a shared reference of the (usually inferred) input type.