MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / StableCoinBalance

Method StableCoinBalance

sqlchain/adapter/api/account.go:39–54  ·  view source on GitHub ↗

StableCoinBalance defines query for stable coin balance.

(rw http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

37
38// StableCoinBalance defines query for stable coin balance.
39func (a *accountAPI) StableCoinBalance(rw http.ResponseWriter, r *http.Request) {
40 var balance uint64
41 var err error
42
43 if balance, err = client.GetTokenBalance(types.Particle); err != nil {
44 sendResponse(http.StatusInternalServerError, false, err, nil, rw)
45 } else {
46 sendResponse(http.StatusOK, true, nil, map[string]interface{}{
47 "balance": balance,
48 }, rw)
49 }
50
51 log.WithField("stableBalance", balance).WithError(err).Debug("get stable coin balance")
52
53 return
54}
55
56// CovenantCoinBalance defines query for covenant coin balance.
57func (a *accountAPI) CovenantCoinBalance(rw http.ResponseWriter, r *http.Request) {

Callers

nothing calls this directly

Calls 5

GetTokenBalanceFunction · 0.92
WithFieldFunction · 0.92
DebugMethod · 0.80
WithErrorMethod · 0.80
sendResponseFunction · 0.70

Tested by

no test coverage detected