Skip to content

Commit

Permalink
Returning waitPeriod info in the authTypes endpoint (#11)
Browse files Browse the repository at this point in the history
Returning waitPeriod info in the authTypes endpoint
  • Loading branch information
nigeon authored Nov 30, 2023
1 parent a3a34b5 commit 506abdd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,10 @@ func (f *faucet) registerHandlers(api *apirest.API) {
// Returns the list of supported auth types
func (f *faucet) authTypesHandler(_ *apirest.APIdata, ctx *httprouter.HTTPContext) error {
data := &AuthTypes{
AuthTypes: f.authTypes,
AuthTypes: f.authTypes,
WaitSeconds: uint64(f.waitPeriod.Seconds()),
}

return ctx.Send(new(HandlerResponse).Set(data).MustMarshall(), apirest.HTTPstatusOK)
}

Expand Down
3 changes: 2 additions & 1 deletion types.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import "fmt"

// AuthTypes is a struct to return the supported authentication types.
type AuthTypes struct {
AuthTypes map[string]uint64 `json:"auth"`
AuthTypes map[string]uint64 `json:"auth"`
WaitSeconds uint64 `json:"waitSeconds"`
}

var errAddressAlreadyFunded = fmt.Errorf("address already funded")
Expand Down

0 comments on commit 506abdd

Please sign in to comment.