pub fn swap_btc(&mut self, pair: &Addr, trader: &Addr, btc: u128) -> Result<&mut Self> {
        self.app
            .execute_contract(
                trader.clone(),
                pair.clone(),
                &PairExecuteMsg::Swap {
                    offer_asset: Asset {
                        info: AssetInfo::Native("btc".to_owned()),
                        amount: Uint128::new(btc),
                    },
                    belief_price: None,
                    max_spread: None,
                    to: None,
                },
                &coins(btc, "btc"),
            )
            .map_err(|err| anyhow!(err))?;

        Ok(self)
    }
/// Swaps btc for cash using given pair
Swaps btc for cash using given pair
Swaps btc for cash using given pair
pub fn swap_btc(&mut self, pair: &Addr, trader: &Addr, btc: u128) -> Result<&mut Self> {
        self.app
            .execute_contract(
                trader.clone(),
                pair.clone(),
                &PairExecuteMsg::Swap {
                    offer_asset: Asset {
                        info: AssetInfo::Native("btc".to_owned()),
                        amount: Uint128::new(btc),
                    },
                    belief_price: None,
                    max_spread: None,
                    to: None,
                },
                &coins(btc, "btc"),
            )
            .map_err(|err| anyhow!(err))?;
        Ok(self)
    }
pub fn swap_btc ( & mut self , pair : & Addr , trader : & Addr , btc : u128 ) -> Result < & mut Self > { self . app . execute_contract ( trader . clone ( ) , pair . clone ( ) , & PairExecuteMsg :: Swap { offer_asset : Asset { info : AssetInfo :: Native ( " " . to_owned ( ) ) , amount : Uint128 :: new ( btc ) , } , belief_price : None , max_spread : None , to : None , } , & coins ( btc , " " ) , ) . map_err ( | err | anyhow ! ( err ) ) ? ; Ok ( self ) }
Swaps btc for cash using given pair
Swaps btc for cash using given pair
&mut self
pair
&Addr
trader
&Addr
btc
u128
&mut self
pair
&Addr
trader
&Addr
btc
u128