Documentation ¶
Index ¶
- func QueryDelegationDistInfoHandlerFn(storeName string, cliCtx context.CLIContext) http.HandlerFunc
- func QueryDelegatorDistInfoHandlerFn(storeName string, cliCtx context.CLIContext) http.HandlerFunc
- func QueryValidatorDistInfoHandlerFn(storeName string, cliCtx context.CLIContext) http.HandlerFunc
- func RegisterRoutes(cliCtx context.CLIContext, r *mux.Router, cdc *codec.Codec)
- func WithdrawRewardsHandlerFn(cdc *codec.Codec, cliCtx context.CLIContext) http.HandlerFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func QueryDelegationDistInfoHandlerFn ¶
func QueryDelegationDistInfoHandlerFn(storeName string, cliCtx context.CLIContext) http.HandlerFunc
QueryDelegationDistInfoHandlerFn query delegation distribution info
func QueryDelegatorDistInfoHandlerFn ¶
func QueryDelegatorDistInfoHandlerFn(storeName string, cliCtx context.CLIContext) http.HandlerFunc
// QueryWithdrawAddressHandlerFn performs withdraw address query
func QueryWithdrawAddressHandlerFn(storeName string, cliCtx context.CLIContext) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { vars := mux.Vars(r) bech32addr := vars["delegatorAddr"] delAddr, err := sdk.AccAddressFromBech32(bech32addr) if err != nil { utils.WriteErrorResponse(w, http.StatusBadRequest, err.Error()) return } key := distribution.GetDelegatorWithdrawAddrKey(delAddr) res, err := cliCtx.QueryStore(key, storeName) if err != nil { utils.WriteErrorResponse(w, http.StatusInternalServerError, err.Error()) return } if len(res) == 0 { utils.WriteErrorResponse(w, http.StatusNoContent, "") return } withdrawAddress := sdk.AccAddress(res) w.Write([]byte(withdrawAddress.String())) } }
QueryDelegatorDistInfoHandlerFn query all delegation distribution info of the specified delegator
func QueryValidatorDistInfoHandlerFn ¶
func QueryValidatorDistInfoHandlerFn(storeName string, cliCtx context.CLIContext) http.HandlerFunc
QueryValidatorDistInfoHandlerFn query validator distribution info
func RegisterRoutes ¶
RegisterRoutes - Central function to define routes that get registered by the main application
func WithdrawRewardsHandlerFn ¶
func WithdrawRewardsHandlerFn(cdc *codec.Codec, cliCtx context.CLIContext) http.HandlerFunc
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.