diff --git a/api.go b/api.go index 59cc6a44..ec456e13 100644 --- a/api.go +++ b/api.go @@ -532,6 +532,16 @@ func (api *API) GetCurrencyBalance(account AccountName, symbol string, code Acco return } +func (api *API) GetCurrencyStats(code AccountName, symbol string) (out *GetCurrencyStatsResp, err error) { + params := M{"code": code, "symbol": symbol} + + outWrapper := make(map[string]*GetCurrencyStatsResp) + err = api.call("chain", "get_currency_stats", params, &outWrapper) + out = outWrapper[symbol] + + return +} + // See more here: libraries/chain/contracts/abi_serializer.cpp:58... func (api *API) call(baseAPI string, endpoint string, body interface{}, out interface{}) error { diff --git a/responses.go b/responses.go index 318bc2dd..43239075 100644 --- a/responses.go +++ b/responses.go @@ -400,3 +400,9 @@ type ActionsResp struct { Actions []ActionResp `json:"actions"` LastIrreversibleBlock uint32 `json:"last_irreversible_block"` } + +type GetCurrencyStatsResp struct { + Supply Asset `json:"supply"` + MaxSupply Asset `json:"max_supply"` + Issuer AccountName `json:"issuer"` +}