diff --git a/api/client.go b/api/client.go index 62cdb4ed8beb2558ee10a1c035601e1223b5aa84..45528fec72442c72b24822ff113b535553e684ce 100644 --- a/api/client.go +++ b/api/client.go @@ -579,6 +579,13 @@ func (c *Client) GetNetworkInterface() interfaces.NetworkManager { return c.network } +// GetRateLimitParams retrieves the rate limiting parameters. +func (c *Client) GetRateLimitParams() (uint32, uint32, int64) { + rateLimitParams := c.storage.GetBucketParams().Get() + return rateLimitParams.Capacity, rateLimitParams.LeakedTokens, + rateLimitParams.LeakDuration.Nanoseconds() +} + // GetNodeRegistrationStatus gets the current state of node registration. It // returns the total number of nodes in the NDF and the number of those which // are currently registers with. An error is returned if the network is not diff --git a/bindings/client.go b/bindings/client.go index 91293ba3d20f0b98a68f4691e3cb0e2ea589bdcd..7f5dfaeb422969fa12ffcc4ec75a36df0f5a10b4 100644 --- a/bindings/client.go +++ b/bindings/client.go @@ -485,6 +485,11 @@ func (c *Client) GetPreferredBins(countryCode string) (string, error) { return buff.String(), nil } +// GetRateLimitParams retrieves the rate limiting parameters. +func (c *Client) GetRateLimitParams() (uint32, uint32, int64) { + return c.api.GetRateLimitParams() +} + /* // SearchWithHandler is a non-blocking search that also registers // a callback interface for user disovery events.