Class: ArkEcosystem::Client::API::Two::Blocks

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

Overview

Methods for the Blocks 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 blocks.

Parameters:

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

Returns:

  • (Faraday::Response)


17
18
19
# File 'lib/arkecosystem/client/api/two/blocks.rb', line 17

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

#search(parameters) ⇒ Faraday::Response

Search all blocks.

Parameters:

  • parameters (Hash)

Returns:

  • (Faraday::Response)


45
46
47
# File 'lib/arkecosystem/client/api/two/blocks.rb', line 45

def search(parameters)
  @client.post('blocks/search', parameters)
end

#show(id) ⇒ Faraday::Response

Get the block by the given id.

Parameters:

  • id (String)

Returns:

  • (Faraday::Response)


26
27
28
# File 'lib/arkecosystem/client/api/two/blocks.rb', line 26

def show(id)
  @client.get("blocks/#{id}")
end

#transactions(id, parameters = {}) ⇒ Faraday::Response

Get the transaction for the given block.

Parameters:

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

Returns:

  • (Faraday::Response)


36
37
38
# File 'lib/arkecosystem/client/api/two/blocks.rb', line 36

def transactions(id, parameters = {})
  @client.get("blocks/#{id}/transactions", parameters)
end