Documentation
¶
Index ¶
- Constants
- func HandleError(w http.ResponseWriter, logger *slog.Logger, code int, err error)
- func HandleSuccess(w http.ResponseWriter, logger *slog.Logger, data any)
- func NewBaseHandler(sp swcommon.IStakeWiseServiceProvider, logger *slog.Logger, ...) *baseHandler
- func ProcessApiRequest(logger *slog.Logger, w http.ResponseWriter, r *http.Request, requestBody any) (url.Values, map[string]string)
- type InfoResponse
- type RelayServer
- type ValidatorInfo
- type ValidatorsRequest
- type ValidatorsResponse
Constants ¶
const ( ValidatorsPath string = "validators" InfoPath string = "info" )
Variables ¶
This section is empty.
Functions ¶
func HandleError ¶
Handles an error
func HandleSuccess ¶
func HandleSuccess(w http.ResponseWriter, logger *slog.Logger, data any)
Handles a success
func NewBaseHandler ¶
func NewBaseHandler(sp swcommon.IStakeWiseServiceProvider, logger *slog.Logger, ctx context.Context) *baseHandler
Create a new base handler
Types ¶
type InfoResponse ¶ added in v1.3.0
type InfoResponse struct {
Network string `json:"network"`
}
Response to the StakeWise Operator for an info reqest See https://docs.stakewise.io/operator/alternative-key-management/api-mode
type RelayServer ¶
type RelayServer struct {
// contains filtered or unexported fields
}
func NewRelayServer ¶
func NewRelayServer(sp swcommon.IStakeWiseServiceProvider, ip string, port uint16) (*RelayServer, error)
func (*RelayServer) GetLogPath ¶
func (s *RelayServer) GetLogPath() string
Get the path to the log file
func (*RelayServer) GetPort ¶
func (s *RelayServer) GetPort() uint16
Get the port the server is listening on
type ValidatorInfo ¶
type ValidatorInfo struct {
// The public key of the validator
PublicKey beacon.ValidatorPubkey `json:"public_key"`
// The signature of the validator's deposit data
DepositSignature string `json:"deposit_signature"`
// The amount of Gwei to send for the deposit
AmountGwei uint64 `json:"amount_gwei"`
// The signature of the validator's exit message
ExitSignature string `json:"exit_signature"`
}
Info about a validator that can be deposited See https://docs.stakewise.io/for-operators/operator-service/running-as-api-service
type ValidatorsRequest ¶
type ValidatorsRequest struct {
// The address of the vault that validators will be created for
Vault common.Address `json:"vault"`
// The validator index to start from when creating signed exit messages
ValidatorsStartIndex int `json:"validators_start_index"`
// Number of validators in current batch. Maximum batch size is determined by prococol config, currently 10.
ValidatorsBatchSize int `json:"validators_batch_size"`
// Total number of validators supplied by vault assets.
// validators_total should be more than or equal to validators_count.
// Relayer may use this value to allocate larger portions of validators in background.
ValidatorsTotal int `json:"validators_total"`
}
Request from the StakeWise Operator to get validators See https://docs.stakewise.io/for-operators/operator-service/running-as-api-service
type ValidatorsResponse ¶
type ValidatorsResponse struct {
// List of validator deposit info that can be used
Validators []ValidatorInfo `json:"validators"`
// The signature from NodeSet for the validators
ValidatorsManagerSignature string `json:"validators_manager_signature"`
}
Response to the StakeWise Operator for a request to get validators See https://docs.stakewise.io/for-operators/operator-service/running-as-api-service