Class: ArkEcosystem::Client::API::One::Delegates

Inherits:
Base
  • Object
show all
Defined in:
lib/arkecosystem/client/api/one/delegates.rb

Overview

Methods for the Delegates API

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from ArkEcosystem::Client::API::Base

Instance Method Details

#all(parameters = {}) ⇒ Faraday::Response

Get all delegates.

Parameters:

  • parameters (Hash) (defaults to: {})

Returns:

  • (Faraday::Response)


17
18
19
# File 'lib/arkecosystem/client/api/one/delegates.rb', line 17

def all(parameters = {})
  @client.get('delegates', parameters)
end

#countFaraday::Response

Count all delegates.

Returns:

  • (Faraday::Response)


33
34
35
# File 'lib/arkecosystem/client/api/one/delegates.rb', line 33

def count
  @client.get('delegates/count')
end

#feeFaraday::Response

Get the delegate registration fee.

Parameters:

  • address (String)

Returns:

  • (Faraday::Response)


64
65
66
# File 'lib/arkecosystem/client/api/one/delegates.rb', line 64

def fee
  @client.get('delegates/fee')
end

#forged_by_account(generator_public_key) ⇒ Faraday::Response

Get the total forged for the given delegate.

Parameters:

  • generator_public_key (String)

Returns:

  • (Faraday::Response)


73
74
75
76
# File 'lib/arkecosystem/client/api/one/delegates.rb', line 73

def (generator_public_key)
  parameters = { generatorPublicKey: generator_public_key }
  @client.get('delegates/forging/getForgedByAccount', parameters)
end

#forging_status(public_key, parameters = {}) ⇒ Faraday::Response

Get the forging status for the given delegate.

Parameters:

  • public_key (String)
  • parameters (Hash) (defaults to: {})

Returns:

  • (Faraday::Response)


93
94
95
96
97
# File 'lib/arkecosystem/client/api/one/delegates.rb', line 93

def forging_status(public_key, parameters = {})
  mandatory = { publicKey: public_key }

  @client.get('delegates/forging/status', mandatory.merge(parameters))
end

#next_forgersFaraday::Response

Get a list of the next forgers.

Parameters:

  • address (String)

Returns:

  • (Faraday::Response)


83
84
85
# File 'lib/arkecosystem/client/api/one/delegates.rb', line 83

def next_forgers
  @client.get('delegates/getNextForgers')
end

#search(query, parameters = {}) ⇒ Faraday::Response

Search all delegates.

Parameters:

  • query (String)
  • parameters (Hash) (defaults to: {})

Returns:

  • (Faraday::Response)


43
44
45
# File 'lib/arkecosystem/client/api/one/delegates.rb', line 43

def search(query, parameters = {})
  @client.get('delegates/search', { q: query }.merge(parameters))
end

#show(parameters = {}) ⇒ Faraday::Response

Get the delegate by the given id.

Parameters:

  • parameters (Hash) (defaults to: {})

Returns:

  • (Faraday::Response)


26
27
28
# File 'lib/arkecosystem/client/api/one/delegates.rb', line 26

def show(parameters = {})
  @client.get('delegates/get', parameters)
end

#voters(public_key, parameters = {}) ⇒ Faraday::Response

Get the voters for the given delegate.

Parameters:

  • address (String)
  • parameters (Hash) (defaults to: {})

Returns:

  • (Faraday::Response)


53
54
55
56
57
# File 'lib/arkecosystem/client/api/one/delegates.rb', line 53

def voters(public_key, parameters = {})
  mandatory = { publicKey: public_key }

  @client.get('delegates/voters', mandatory.merge(parameters))
end