Skip to content

Commit

Permalink
fix(eventindexer): missing swap route (#14126)
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberhorsey committed Jul 7, 2023
1 parent 9c6d918 commit dc7edce
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions packages/eventindexer/http/user_swapped_on_taiko.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package http

import (
"net/http"

"github.com/cyberhorsey/webutils"
"github.com/labstack/echo/v4"
"github.com/taikoxyz/taiko-mono/packages/eventindexer"
)

func (srv *Server) UserSwappedOnTaiko(c echo.Context) error {
event, err := srv.eventRepo.FirstByAddressAndEventName(
c.Request().Context(),
c.QueryParam("address"),
eventindexer.EventNameSwap,
)
if err != nil {
return webutils.LogAndRenderErrors(c, http.StatusUnprocessableEntity, err)
}

var found bool = false

if event != nil {
found = true
}

return c.JSON(http.StatusOK, &galaxeAPIResponse{
Data: galaxeData{
IsOK: found,
},
})
}

0 comments on commit dc7edce

Please sign in to comment.