Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/soroban-transactions' into sorob…
Browse files Browse the repository at this point in the history
…an-transactions
  • Loading branch information
lucasmagnus committed Oct 31, 2023
2 parents fc50c5f + 7632080 commit cb6383c
Show file tree
Hide file tree
Showing 4 changed files with 96 additions and 0 deletions.
29 changes: 29 additions & 0 deletions backend/docs/docs.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 29 additions & 0 deletions backend/docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -2134,6 +2134,35 @@
}
}
}
},
"/wallets/sponsor_pk/": {
"get": {
"description": "Get Sponsor Public Key",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Wallets"
],
"summary": "Get Sponsor Public Key",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "string"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/v1.response"
}
}
}
}
}
},
"definitions": {
Expand Down
19 changes: 19 additions & 0 deletions backend/docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2125,4 +2125,23 @@ paths:
summary: Fund Wallet
tags:
- Wallets
/wallets/sponsor_pk/:
get:
consumes:
- application/json
description: Get Sponsor Public Key
produces:
- application/json
responses:
"200":
description: OK
schema:
type: string
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/v1.response'
summary: Get Sponsor Public Key
tags:
- Wallets
swagger: "2.0"
19 changes: 19 additions & 0 deletions backend/internal/controller/http/v1/wallets.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ func newWalletsRoutes(handler *gin.RouterGroup, w usecase.WalletUseCase, m HTTPC
h.GET("", r.list)
h.POST("", r.create)
h.POST("fund/", r.fundWallet)
h.GET("sponsor_pk/", r.getSponsorPublicKey)
}
}

Expand Down Expand Up @@ -147,3 +148,21 @@ func (r *walletsRoutes) fundWallet(c *gin.Context) {

c.JSON(http.StatusOK, wallet)
}

// @Summary Get Sponsor Public Key
// @Description Get Sponsor Public Key
// @Tags Wallets
// @Accept json
// @Produce json
// @Success 200 {object} string
// @Failure 500 {object} response
// @Router /wallets/sponsor_pk/ [get]
func (r *walletsRoutes) getSponsorPublicKey(c *gin.Context) {
sponsor, err := r.w.Get(_sponsorId)
if err != nil {
errorResponse(c, http.StatusInternalServerError, "database problems", err)
return
}

c.JSON(http.StatusOK, sponsor.Key.PublicKey)
}

0 comments on commit cb6383c

Please sign in to comment.