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

update swagger doc to replace wormscan with wormholescan #643

Merged
merged 1 commit into from
Aug 18, 2023
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
1,022 changes: 498 additions & 524 deletions api/docs/docs.go

Large diffs are not rendered by default.

1,018 changes: 495 additions & 523 deletions api/docs/swagger.json

Large diffs are not rendered by default.

838 changes: 415 additions & 423 deletions api/docs/swagger.yaml

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions api/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ var swagger []byte

// GetSwagger godoc
// @Description Returns the swagger specification for this API.
// @Tags Wormscan
// @Tags wormholescan
// @ID swagger
// @Success 200 {object} object
// @Failure 400
Expand All @@ -72,18 +72,18 @@ func GetSwagger(ctx *fiber.Ctx) error {
return err
}

// @title Wormhole Guardian API
// @title Wormholescan API
// @version 1.0
// @description Wormhole Guardian API
// @description This is the API for the Wormhole Guardian and Explorer.
// @description The API has two namespaces: wormscan and guardian.
// @description wormscan is the namespace for the explorer and the new endpoints. The prefix is /api/v1.
// @description The API has two namespaces: wormholescan and guardian.
// @description wormholescan is the namespace for the explorer and the new endpoints. The prefix is /api/v1.
// @description guardian is the legacy namespace backguard compatible with guardian node API. The prefix is /v1.
// @description This API is public and does not require authentication although some endpoints are rate limited.
// @description Check each endpoint documentation for more information.
// @termsOfService https://wormhole.com/
// @contact.name API Support
// @contact.url http://wormhole.com/support
// @contact.url https://discord.com/invite/wormholecrypto
// @contact.email info@wormhole.com
// @license.name Apache 2.0
// @license.url http://www.apache.org/licenses/LICENSE-2.0.html
Expand Down
2 changes: 1 addition & 1 deletion api/routes/guardian/governor/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ func (c *Controller) IsVaaEnqueued(ctx *fiber.Ctx) error {
// @Description the price that has most occurrences in all the nodes for an originChainId and originAddress is returned.
// @Tags Guardian
// @ID guardians-token-list
// @Success 200 {object} []TokenList
// @Success 200 {object} []governor.TokenList
// @Failure 400
// @Failure 500
// @Router /v1/governor/token_list [get]
Expand Down
2 changes: 1 addition & 1 deletion api/routes/wormscan/address/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func NewController(srv *address.Service, logger *zap.Logger) *Controller {

// FindById godoc
// @Description Lookup an address
// @Tags Wormscan
// @Tags wormholescan
// @ID find-address-by-id
// @Param address path string true "address"
// @Param page query integer false "Page number. Starts at 0."
Expand Down
48 changes: 24 additions & 24 deletions api/routes/wormscan/governor/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ func NewController(serv *governor.Service, logger *zap.Logger) *Controller {

// FindGovernorConfigurations godoc
// @Description Returns governor configuration for all guardians.
// @Tags Wormscan
// @Tags wormholescan
// @ID governor-config
// @Param page query integer false "Page number."
// @Param pageSize query integer false "Number of elements per page."
// @Success 200 {object} response.Response[GovConfig]
// @Success 200 {object} response.Response[governor.GovConfig]
// @Failure 400
// @Failure 500
// @Router /api/v1/governor/config [get]
Expand All @@ -50,9 +50,9 @@ func (c *Controller) FindGovernorConfigurations(ctx *fiber.Ctx) error {

// FindGovernorConfigurationByGuardianAddress godoc
// @Description Returns governor configuration for a given guardian.
// @Tags Wormscan
// @Tags wormholescan
// @ID governor-config-by-guardian-address
// @Success 200 {object} response.Response[GovConfig]
// @Success 200 {object} response.Response[governor.GovConfig]
// @Failure 400
// @Failure 500
// @Router /api/v1/governor/config/:guardian_address [get]
Expand Down Expand Up @@ -82,11 +82,11 @@ func (c *Controller) FindGovernorConfigurationByGuardianAddress(ctx *fiber.Ctx)

// FindGovernorStatus godoc
// @Description Returns the governor status for all guardians.
// @Tags Wormscan
// @Tags wormholescan
// @ID governor-status
// @Param page query integer false "Page number."
// @Param pageSize query integer false "Number of elements per page."
// @Success 200 {object} response.Response[[]GovStatus]
// @Success 200 {object} response.Response[[]governor.GovStatus]
// @Failure 400
// @Failure 500
// @Router /api/v1/governor/status [get]
Expand All @@ -107,11 +107,11 @@ func (c *Controller) FindGovernorStatus(ctx *fiber.Ctx) error {

// FindGovernorStatusByGuardianAddress godoc
// @Description Returns the governor status for a given guardian.
// @Tags Wormscan
// @Tags wormholescan
// @ID governor-status-by-guardian-address
// @Param page query integer false "Page number."
// @Param pageSize query integer false "Number of elements per page."
// @Success 200 {object} response.Response[GovStatus]
// @Success 200 {object} response.Response[governor.GovStatus]
// @Failure 400
// @Failure 500
// @Router /api/v1/governor/status/:guardian_address [get]
Expand All @@ -137,11 +137,11 @@ func (c *Controller) FindGovernorStatusByGuardianAddress(ctx *fiber.Ctx) error {

// GetGovernorLimit godoc
// @Description Returns the governor limit for all blockchains.
// @Tags Wormscan
// @Tags wormholescan
// @ID governor-notional-limit
// @Param page query integer false "Page number."
// @Param pageSize query integer false "Number of elements per page."
// @Success 200 {object} response.Response[[]GovernorLimit]
// @Success 200 {object} response.Response[[]governor.GovernorLimit]
// @Failure 400
// @Failure 500
// @Router /api/v1/governor/limit [get]
Expand All @@ -162,11 +162,11 @@ func (c *Controller) GetGovernorLimit(ctx *fiber.Ctx) error {

// FindNotionalLimit godoc
// @Description Returns the detailed notional limit for all blockchains.
// @Tags Wormscan
// @Tags wormholescan
// @ID governor-notional-limit-detail
// @Param page query integer false "Page number."
// @Param pageSize query integer false "Number of elements per page."
// @Success 200 {object} response.Response[[]NotionalLimitDetail]
// @Success 200 {object} response.Response[[]governor.NotionalLimitDetail]
// @Failure 400
// @Failure 500
// @Router /api/v1/governor/notional/limit [get]
Expand All @@ -187,11 +187,11 @@ func (c *Controller) FindNotionalLimit(ctx *fiber.Ctx) error {

// GetNotionalLimitByChainID godoc
// @Description Returns the detailed notional limit available for a given blockchain.
// @Tags Wormscan
// @Tags wormholescan
// @ID governor-notional-limit-detail-by-chain
// @Param page query integer false "Page number."
// @Param pageSize query integer false "Number of elements per page."
// @Success 200 {object} response.Response[[]NotionalLimitDetail]
// @Success 200 {object} response.Response[[]governor.NotionalLimitDetail]
// @Failure 400
// @Failure 500
// @Router /api/v1/governor/notional/limit/:chain [get]
Expand All @@ -217,12 +217,12 @@ func (c *Controller) GetNotionalLimitByChainID(ctx *fiber.Ctx) error {

// GetAvailableNotional godoc
// @Description Returns the amount of notional value available for each blockchain.
// @Tags Wormscan
// @Tags wormholescan
// @ID governor-notional-available
// @Param page query integer false "Page number."
// @Param pageSize query integer false "Number of elements per page."
// @Param sortOrder query string false "Sort results in ascending or descending order." Enums(ASC, DESC)
// @Success 200 {object} response.Response[[]NotionalAvailable]
// @Success 200 {object} response.Response[[]governor.NotionalAvailable]
// @Failure 400
// @Failure 500
// @Router /api/v1/governor/notional/available [get]
Expand All @@ -243,11 +243,11 @@ func (c *Controller) GetAvailableNotional(ctx *fiber.Ctx) error {

// GetAvailableNotionalByChainID godoc
// @Description Returns the amount of notional value available for a given blockchain.
// @Tags Wormscan
// @Tags wormholescan
// @ID governor-notional-available-by-chain
// @Param page query integer false "Page number."
// @Param pageSize query integer false "Number of elements per page."
// @Success 200 {object} response.Response[[]NotionalAvailableDetail]
// @Success 200 {object} response.Response[[]governor.NotionalAvailableDetail]
// @Failure 400
// @Failure 500
// @Router /api/v1/governor/notional/available/:chain [get]
Expand All @@ -273,9 +273,9 @@ func (c *Controller) GetAvailableNotionalByChainID(ctx *fiber.Ctx) error {

// GetMaxNotionalAvailableByChainID godoc
// @Description Returns the maximum amount of notional value available for a given blockchain.
// @Tags Wormscan
// @Tags wormholescan
// @ID governor-max-notional-available-by-chain
// @Success 200 {object} response.Response[MaxNotionalAvailableRecord]
// @Success 200 {object} response.Response[governor.MaxNotionalAvailableRecord]
// @Failure 400
// @Failure 500
// @Router /api/v1/governor/notional/max_available/:chain [get]
Expand All @@ -296,12 +296,12 @@ func (c *Controller) GetMaxNotionalAvailableByChainID(ctx *fiber.Ctx) error {

// GetEnqueuedVaas godoc
// @Description Returns enqueued VAAs for each blockchain.
// @Tags Wormscan
// @Tags wormholescan
// @ID governor-enqueued-vaas
// @Param page query integer false "Page number."
// @Param pageSize query integer false "Number of elements per page."
// @Param sortOrder query string false "Sort results in ascending or descending order." Enums(ASC, DESC)
// @Success 200 {object} response.Response[[]EnqueuedVaas]
// @Success 200 {object} response.Response[[]governor.EnqueuedVaas]
// @Failure 400
// @Failure 500
// @Router /api/v1/governor/enqueued_vaas/ [get]
Expand All @@ -322,12 +322,12 @@ func (c *Controller) GetEnqueuedVaas(ctx *fiber.Ctx) error {

// GetEnqueuedVaasByChainID godoc
// @Description Returns all enqueued VAAs for a given blockchain.
// @Tags Wormscan
// @Tags wormholescan
// @ID guardians-enqueued-vaas-by-chain
// @Param page query integer false "Page number."
// @Param pageSize query integer false "Number of elements per page."
// @Param sortOrder query string false "Sort results in ascending or descending order." Enums(ASC, DESC)
// @Success 200 {object} response.Response[[]EnqueuedVaaDetail]
// @Success 200 {object} response.Response[[]governor.EnqueuedVaaDetail]
// @Failure 400
// @Failure 500
// @Router /api/v1/governor/enqueued_vaas/:chain [get]
Expand Down
6 changes: 3 additions & 3 deletions api/routes/wormscan/infrastructure/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func NewController(serv *infrastructure.Service) *Controller {
// HealthCheck is the HTTP route handler for the endpoint `GET /api/v1/health`.
// HealthCheck godoc
// @Description Health check
// @Tags Wormscan
// @Tags wormholescan
// @ID health-check
// @Success 200 {object} object{status=string}
// @Failure 400
Expand All @@ -34,7 +34,7 @@ func (c *Controller) HealthCheck(ctx *fiber.Ctx) error {
// ReadyCheck is the HTTP handler for the endpoint `GET /api/v1/ready`.
// ReadyCheck godoc
// @Description Ready check
// @Tags Wormscan
// @Tags wormholescan
// @ID ready-check
// @Success 200 {object} object{ready=string}
// @Failure 400
Expand Down Expand Up @@ -64,7 +64,7 @@ type VersionResponse struct {
// Version is the HTTP route handler for the endpoint `GET /api/v1/version`.
// Version godoc
// @Description Get version/release information.
// @Tags Wormscan
// @Tags wormholescan
// @ID get-version
// @Success 200 {object} VersionResponse
// @Failure 400
Expand Down
20 changes: 10 additions & 10 deletions api/routes/wormscan/observations/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ func NewController(srv *observations.Service, logger *zap.Logger) *Controller {

// FindAll godoc
// @Description Returns all observations, sorted in descending timestamp order.
// @Tags Wormscan
// @Tags wormholescan
// @ID find-observations
// @Param page query integer false "Page number."
// @Param pageSize query integer false "Number of elements per page."
// @Param sortOrder query string false "Sort results in ascending or descending order." Enums(ASC, DESC)
// @Success 200 {object} []ObservationDoc
// @Success 200 {object} []observations.ObservationDoc
// @Failure 400
// @Failure 500
// @Router /api/v1/observations [get]
Expand All @@ -52,12 +52,12 @@ func (c *Controller) FindAll(ctx *fiber.Ctx) error {

// FindAllByChain godoc
// @Description Returns all observations for a given blockchain, sorted in descending timestamp order.
// @Tags Wormscan
// @Tags wormholescan
// @ID find-observations-by-chain
// @Param page query integer false "Page number."
// @Param pageSize query integer false "Number of elements per page."
// @Param sortOrder query string false "Sort results in ascending or descending order." Enums(ASC, DESC)
// @Success 200 {object} []ObservationDoc
// @Success 200 {object} []observations.ObservationDoc
// @Failure 400
// @Failure 500
// @Router /api/v1/observations/:chain [get]
Expand All @@ -83,12 +83,12 @@ func (c *Controller) FindAllByChain(ctx *fiber.Ctx) error {

// FindAllByEmitter godoc
// @Description Returns all observations for a specific emitter address, sorted in descending timestamp order.
// @Tags Wormscan
// @Tags wormholescan
// @ID find-observations-by-emitter
// @Param page query integer false "Page number."
// @Param pageSize query integer false "Number of elements per page."
// @Param sortOrder query string false "Sort results in ascending or descending order." Enums(ASC, DESC)
// @Success 200 {object} []ObservationDoc
// @Success 200 {object} []observations.ObservationDoc
// @Failure 400
// @Failure 500
// @Router /api/v1/observations/:chain/:emitter [get]
Expand All @@ -114,12 +114,12 @@ func (c *Controller) FindAllByEmitter(ctx *fiber.Ctx) error {

// FindAllByVAA godoc
// @Description Find observations identified by emitter chain, emitter address and sequence.
// @Tags Wormscan
// @Tags wormholescan
// @ID find-observations-by-sequence
// @Param page query integer false "Page number."
// @Param pageSize query integer false "Number of elements per page."
// @Param sortOrder query string false "Sort results in ascending or descending order." Enums(ASC, DESC)
// @Success 200 {object} []ObservationDoc
// @Success 200 {object} []observations.ObservationDoc
// @Failure 400
// @Failure 500
// @Router /api/v1/observations/:chain/:emitter/:sequence [get]
Expand All @@ -145,12 +145,12 @@ func (c *Controller) FindAllByVAA(ctx *fiber.Ctx) error {

// FindOne godoc
// @Description Find a specific observation.
// @Tags Wormscan
// @Tags wormholescan
// @ID find-observations-by-id
// @Param page query integer false "Page number."
// @Param pageSize query integer false "Number of elements per page."
// @Param sortOrder query string false "Sort results in ascending or descending order." Enums(ASC, DESC)
// @Success 200 {object} []ObservationDoc
// @Success 200 {object} []observations.ObservationDoc
// @Failure 400
// @Failure 500
// @Router /api/v1/observations/:chain/:emitter/:sequence/:signer/:hash [get]
Expand Down
Loading
Loading