Skip to content
Draft
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
16 changes: 16 additions & 0 deletions routes/admin_transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,22 @@ func (fes *APIServer) GetGlobalParams(ww http.ResponseWriter, req *http.Request)
}
}

func (fes *APIServer) GetAllGlobalParams(ww http.ResponseWriter, req *http.Request) {
// Get a view
utxoView, err := fes.backendServer.GetMempool().GetAugmentedUniversalView()
if err != nil {
_AddBadRequestError(ww, fmt.Sprintf("GetAllGlobalParams: Error getting utxoView: %v", err))
return
}
globalParamsEntry := utxoView.GetCurrentGlobalParamsEntry()
// Return all the data associated with the transaction in the response
res := globalParamsEntry
if err = json.NewEncoder(ww).Encode(res); err != nil {
_AddBadRequestError(ww, fmt.Sprintf("GetAllGlobalParams: Problem encoding response as JSON: %v", err))
return
}
}

// UpdateGlobalParamsRequest ...
type UpdateGlobalParamsRequest struct {
UpdaterPublicKeyBase58Check string `safeForLogging:"true"`
Expand Down
8 changes: 8 additions & 0 deletions routes/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ const (

// admin_transaction.go
RoutePathGetGlobalParams = "/api/v0/get-global-params"
RoutePathGetAllGlobalParams = "/api/v0/get-all-global-params"
RoutePathTestSignTransactionWithDerivedKey = "/api/v0/admin/test-sign-transaction-with-derived-key"

// Eventually we will deprecate the admin endpoint since it does not need to be protected.
Expand Down Expand Up @@ -667,6 +668,13 @@ func (fes *APIServer) NewRouter() *muxtrace.Router {
fes.GetGlobalParams,
PublicAccess,
},
{
"GetAllGlobalParams",
[]string{"GET"},
RoutePathGetAllGlobalParams,
fes.GetAllGlobalParams,
PublicAccess,
},
// Route for sending DeSo
{
"SendDeSo",
Expand Down