github.com/fibonacci-chain/fbc@v0.0.0-20231124064014-c7636198c1e9/x/ammswap/types/querier.go (about)

     1  package types
     2  
     3  import (
     4  	sdk "github.com/fibonacci-chain/fbc/libs/cosmos-sdk/types"
     5  )
     6  
     7  // nolint
     8  type QuerySwapBuyInfoParams struct {
     9  	SellTokenAmount string `json:"sell_token_amount"`
    10  	BuyToken        string `json:"buy_token"`
    11  }
    12  
    13  // NewQuerySwapBuyInfoParams creates a new instance of QuerySwapBuyInfoParams
    14  func NewQuerySwapBuyInfoParams(sellTokenAmount string, buyToken string) QuerySwapBuyInfoParams {
    15  	return QuerySwapBuyInfoParams{
    16  		SellTokenAmount: sellTokenAmount,
    17  		BuyToken:        buyToken,
    18  	}
    19  }
    20  
    21  // nolint
    22  type QuerySwapAddInfoParams struct {
    23  	QuoteTokenAmount string `json:"quote_token_amount"`
    24  	BaseToken        string `json:"base_token"`
    25  }
    26  
    27  // NewQuerySwapAddInfoParams creates a new instance of QuerySwapAddInfoParams
    28  func NewQuerySwapAddInfoParams(quoteTokenAmount string, baseToken string) QuerySwapAddInfoParams {
    29  	return QuerySwapAddInfoParams{
    30  		QuoteTokenAmount: quoteTokenAmount,
    31  		BaseToken:        baseToken,
    32  	}
    33  }
    34  
    35  type SwapBuyInfo struct {
    36  	BuyAmount   sdk.Dec `json:"buy_amount"`
    37  	Price       sdk.Dec `json:"price"`
    38  	PriceImpact sdk.Dec `json:"price_impact"`
    39  	Fee         string  `json:"fee"`
    40  	Route       string  `json:"route"`
    41  }
    42  
    43  type SwapAddInfo struct {
    44  	BaseTokenAmount sdk.Dec `json:"base_token_amount"`
    45  	PoolShare       sdk.Dec `json:"pool_share"`
    46  	Liquidity       sdk.Dec `json:"liquidity"`
    47  }
    48  
    49  type QueryBuyAmountParams struct {
    50  	SoldToken  sdk.SysCoin
    51  	TokenToBuy string
    52  }