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

Method CovenantCoinBalance

sqlchain/adapter/api/account.go:57–72  ·  view source on GitHub ↗

CovenantCoinBalance defines query for covenant coin balance.

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

Source from the content-addressed store, hash-verified

55
56// CovenantCoinBalance defines query for covenant coin balance.
57func (a *accountAPI) CovenantCoinBalance(rw http.ResponseWriter, r *http.Request) {
58 var balance uint64
59 var err error
60
61 if balance, err = client.GetTokenBalance(types.Wave); err != nil {
62 sendResponse(http.StatusInternalServerError, false, err, nil, rw)
63 } else {
64 sendResponse(http.StatusOK, true, nil, map[string]interface{}{
65 "balance": balance,
66 }, rw)
67 }
68
69 log.WithField("covenantBalance", balance).WithError(err).Debug("get covenant coin balance")
70
71 return
72}

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