loom_types_entities

Trait AbiSwapEncoder

Source
pub trait AbiSwapEncoder {
    // Provided methods
    fn encode_swap_in_amount_provided(
        &self,
        _token_from_address: Address,
        _token_to_address: Address,
        _amount: U256,
        _recipient: Address,
        _payload: Bytes,
    ) -> Result<Bytes> { ... }
    fn encode_swap_out_amount_provided(
        &self,
        _token_from_address: Address,
        _token_to_address: Address,
        _amount: U256,
        _recipient: Address,
        _payload: Bytes,
    ) -> Result<Bytes> { ... }
    fn preswap_requirement(&self) -> PreswapRequirement { ... }
    fn is_native(&self) -> bool { ... }
    fn swap_in_amount_offset(
        &self,
        _token_from_address: Address,
        _token_to_address: Address,
    ) -> Option<u32> { ... }
    fn swap_out_amount_offset(
        &self,
        _token_from_address: Address,
        _token_to_address: Address,
    ) -> Option<u32> { ... }
    fn swap_out_amount_return_offset(
        &self,
        _token_from_address: Address,
        _token_to_address: Address,
    ) -> Option<u32> { ... }
    fn swap_in_amount_return_offset(
        &self,
        _token_from_address: Address,
        _token_to_address: Address,
    ) -> Option<u32> { ... }
    fn swap_out_amount_return_script(
        &self,
        _token_from_address: Address,
        _token_to_address: Address,
    ) -> Option<Bytes> { ... }
    fn swap_in_amount_return_script(
        &self,
        _token_from_address: Address,
        _token_to_address: Address,
    ) -> Option<Bytes> { ... }
}

Provided Methods§

Source

fn encode_swap_in_amount_provided( &self, _token_from_address: Address, _token_to_address: Address, _amount: U256, _recipient: Address, _payload: Bytes, ) -> Result<Bytes>

Source

fn encode_swap_out_amount_provided( &self, _token_from_address: Address, _token_to_address: Address, _amount: U256, _recipient: Address, _payload: Bytes, ) -> Result<Bytes>

Source

fn preswap_requirement(&self) -> PreswapRequirement

Source

fn is_native(&self) -> bool

Source

fn swap_in_amount_offset( &self, _token_from_address: Address, _token_to_address: Address, ) -> Option<u32>

Source

fn swap_out_amount_offset( &self, _token_from_address: Address, _token_to_address: Address, ) -> Option<u32>

Source

fn swap_out_amount_return_offset( &self, _token_from_address: Address, _token_to_address: Address, ) -> Option<u32>

Source

fn swap_in_amount_return_offset( &self, _token_from_address: Address, _token_to_address: Address, ) -> Option<u32>

Source

fn swap_out_amount_return_script( &self, _token_from_address: Address, _token_to_address: Address, ) -> Option<Bytes>

Source

fn swap_in_amount_return_script( &self, _token_from_address: Address, _token_to_address: Address, ) -> Option<Bytes>

Implementors§