Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add PostValidatorDashboardValidatorsRequest for frontend #1270

Merged
merged 1 commit into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion backend/pkg/api/handlers/public.go
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ func (h *HandlerService) PublicDeleteValidatorDashboardGroupValidators(w http.Re
func (h *HandlerService) PublicPostValidatorDashboardValidators(w http.ResponseWriter, r *http.Request) {
var v validationError
dashboardId := v.checkPrimaryDashboardId(mux.Vars(r)["dashboard_id"])
type request struct {
type request struct { // this must align with PostValidatorDashboardValidatorsRequest
GroupId uint64 `json:"group_id,omitempty" x-nullable:"true"`
Validators []intOrString `json:"validators,omitempty"`
DepositAddress string `json:"deposit_address,omitempty"`
Expand Down
9 changes: 9 additions & 0 deletions backend/pkg/api/types/validator_dashboard.go
Original file line number Diff line number Diff line change
Expand Up @@ -365,3 +365,12 @@ type VDBPostValidatorsData struct {
Index uint64 `json:"index"`
GroupId uint64 `json:"group_id"`
}

// helper for frontend
type PostValidatorDashboardValidatorsRequest struct {
GroupId uint64 `json:"group_id,omitempty" x-nullable:"true"`
Validators []interface{} `json:"validators,omitempty" tstype:"(number | string)[]"`
DepositAddress string `json:"deposit_address,omitempty"`
WithdrawalCredential string `json:"withdrawal_credential,omitempty"`
Graffiti string `json:"graffiti,omitempty"`
}
10 changes: 10 additions & 0 deletions frontend/types/api/validator_dashboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -321,3 +321,13 @@ export interface VDBPostValidatorsData {
index: number /* uint64 */;
group_id: number /* uint64 */;
}
/**
* helper for frontend
*/
export interface PostValidatorDashboardValidatorsRequest {
group_id?: number /* uint64 */;
validators?: (number | string)[];
deposit_address?: string;
withdrawal_credential?: string;
graffiti?: string;
}
Loading