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

     1  package types
     2  
     3  import sdk "github.com/fibonacci-chain/fbc/libs/cosmos-sdk/types"
     4  
     5  const (
     6  	QueryPool             = "pool"
     7  	QueryPools            = "pools"
     8  	QueryEarnings         = "earnings"
     9  	QueryLockInfo         = "lock-info"
    10  	QueryParameters       = "parameters"
    11  	QueryWhitelist        = "whitelist"
    12  	QueryAccount          = "account"
    13  	QueryAccountsLockedTo = "accounts-locked-to"
    14  	QueryPoolNum          = "pool-num"
    15  )
    16  
    17  // QueryPoolParams defines the params for the following queries:
    18  // - 'custom/farm/pool'
    19  type QueryPoolParams struct {
    20  	PoolName string
    21  }
    22  
    23  // NewQueryPoolParams creates a new instance of QueryPoolParams
    24  func NewQueryPoolParams(poolName string) QueryPoolParams {
    25  	return QueryPoolParams{
    26  		PoolName: poolName,
    27  	}
    28  }
    29  
    30  // QueryPoolsParams defines the params for the following queries:
    31  // - 'custom/farm/pools'
    32  type QueryPoolsParams struct {
    33  	Page, Limit int
    34  }
    35  
    36  // NewQueryPoolsParams creates a new instance of QueryPoolsParams
    37  func NewQueryPoolsParams(page, limit int) QueryPoolsParams {
    38  	return QueryPoolsParams{
    39  		Page:  page,
    40  		Limit: limit,
    41  	}
    42  }
    43  
    44  // QueryPoolAccountParams defines the params for the following queries:
    45  // - 'custom/farm/earnings'
    46  // - 'custom/farm/lock-info'
    47  type QueryPoolAccountParams struct {
    48  	PoolName   string
    49  	AccAddress sdk.AccAddress
    50  }
    51  
    52  // NewQueryPoolAccountParams creates a new instance of QueryPoolAccountParams
    53  func NewQueryPoolAccountParams(poolName string, accAddr sdk.AccAddress) QueryPoolAccountParams {
    54  	return QueryPoolAccountParams{
    55  		PoolName:   poolName,
    56  		AccAddress: accAddr,
    57  	}
    58  }
    59  
    60  // QueryAccountParams defines the params for the following queries:
    61  // - 'custom/farm/account'
    62  type QueryAccountParams struct {
    63  	AccAddress sdk.AccAddress
    64  }
    65  
    66  // NewQueryAccountParams creates a new instance of QueryAccountParams
    67  func NewQueryAccountParams(accAddr sdk.AccAddress) QueryAccountParams {
    68  	return QueryAccountParams{
    69  		AccAddress: accAddr,
    70  	}
    71  }