diff --git a/tzkt/api/accounts.go b/tzkt/api/accounts.go index 043511c..4993188 100644 --- a/tzkt/api/accounts.go +++ b/tzkt/api/accounts.go @@ -7,5 +7,10 @@ import ( // AccountCounter - Returns account counter func (tzkt *API) AccountCounter(ctx context.Context, address string) (uint64, error) { - return tzkt.count(ctx, fmt.Sprintf("/v1/accounts/%s/counter", address)) + return tzkt.count(ctx, fmt.Sprintf("/v1/accounts/%s/counter", address), nil) +} + +// AccountCounter - Returns a number of accounts. +func (tzkt *API) AccountsCount(ctx context.Context, filters map[string]string) (uint64, error) { + return tzkt.count(ctx, "/v1/accounts/count", filters) } diff --git a/tzkt/api/api.go b/tzkt/api/api.go index d6bce66..3d7160b 100644 --- a/tzkt/api/api.go +++ b/tzkt/api/api.go @@ -127,8 +127,8 @@ func (tzkt *API) json(ctx context.Context, endpoint string, args map[string]stri } } -func (tzkt *API) count(ctx context.Context, endpoint string) (uint64, error) { - resp, err := tzkt.get(ctx, endpoint, nil, false) +func (tzkt *API) count(ctx context.Context, endpoint string, args map[string]string) (uint64, error) { + resp, err := tzkt.get(ctx, endpoint, args, false) if err != nil { return 0, err } diff --git a/tzkt/api/bigmaps.go b/tzkt/api/bigmaps.go index b4e818d..93a7827 100644 --- a/tzkt/api/bigmaps.go +++ b/tzkt/api/bigmaps.go @@ -9,7 +9,7 @@ import ( // GetBigmapsCount - func (tzkt *API) GetBigmapsCount(ctx context.Context) (uint64, error) { - return tzkt.count(ctx, "/v1/bigmaps/count") + return tzkt.count(ctx, "/v1/bigmaps/count", nil) } // GetBigmaps - diff --git a/tzkt/api/delegates.go b/tzkt/api/delegates.go index 9cd0236..b82e32f 100644 --- a/tzkt/api/delegates.go +++ b/tzkt/api/delegates.go @@ -15,7 +15,7 @@ func (tzkt *API) GetDelegates(ctx context.Context, filters map[string]string) (d // GetDelegatesCount - func (tzkt *API) GetDelegatesCount(ctx context.Context) (uint64, error) { - return tzkt.count(ctx, "/v1/delegates/count") + return tzkt.count(ctx, "/v1/delegates/count", nil) } // GetDelegateByAddress -