fn swap_btc(
        &mut self,
        trader: &Addr,
        btc: u128,
        belief_price: impl Into<Option<Decimal>>,
        max_spread: impl Into<Option<Decimal>>,
        to: impl Into<Option<Addr>>,
    ) -> Result<&mut Self> {
        self.app
            .execute_contract(
                trader.clone(),
                self.pair.clone(),
                &ExecuteMsg::Swap {
                    offer_asset: Asset {
                        info: AssetInfo::Native("btc".to_owned()),
                        amount: Uint128::new(btc),
                    },
                    belief_price: belief_price.into(),
                    max_spread: max_spread.into(),
                    to: to.into().as_ref().map(ToString::to_string),
                },
                &coins(btc, "btc"),
            )
            .map_err(|err| anyhow!(err))?;

        Ok(self)
    }
/// Helper swapping btc for cash on pair
///
/// Executes `Swap` message on pair
Helper swapping btc for cash on pair
Executes `Swap` message on pair
Helper swapping btc for cash on pair Executes ` Swap ` message on pair
fn swap_btc(
        &mut self,
        trader: &Addr,
        btc: u128,
        belief_price: impl Into<Option<Decimal>>,
        max_spread: impl Into<Option<Decimal>>,
        to: impl Into<Option<Addr>>,
    ) -> Result<&mut Self> {
        self.app
            .execute_contract(
                trader.clone(),
                self.pair.clone(),
                &ExecuteMsg::Swap {
                    offer_asset: Asset {
                        info: AssetInfo::Native("btc".to_owned()),
                        amount: Uint128::new(btc),
                    },
                    belief_price: belief_price.into(),
                    max_spread: max_spread.into(),
                    to: to.into().as_ref().map(ToString::to_string),
                },
                &coins(btc, "btc"),
            )
            .map_err(|err| anyhow!(err))?;
        Ok(self)
    }
fn swap_btc ( & mut self , trader : & Addr , btc : u128 , belief_price : impl Into < Option < Decimal > > , max_spread : impl Into < Option < Decimal > > , to : impl Into < Option < Addr > > , ) -> Result < & mut Self > { self . app . execute_contract ( trader . clone ( ) , self . pair . clone ( ) , & ExecuteMsg :: Swap { offer_asset : Asset { info : AssetInfo :: Native ( " " . to_owned ( ) ) , amount : Uint128 :: new ( btc ) , } , belief_price : belief_price . into ( ) , max_spread : max_spread . into ( ) , to : to . into ( ) . as_ref ( ) . map ( ToString :: to_string ) , } , & coins ( btc , " " ) , ) . map_err ( | err | anyhow ! ( err ) ) ? ; Ok ( self ) }
Helper swapping btc for cash on pair
Executes `Swap` message on pair
Helper swapping btc for cash on pair Executes ` Swap ` message on pair
&mut self
trader
&Addr
btc
u128
belief_price
impl Into<Option<Decimal>>
max_spread
impl Into<Option<Decimal>>
to
impl Into<Option<Addr>>
&mut self
trader
&Addr
btc
u128
belief_price
impl Into<Option<Decimal>>
max_spread
impl Into<Option<Decimal>>
to
impl Into<Option<Addr>>