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

Inherits:
Base
  • Object
show all
Defined in:
lib/arkecosystem/client/api/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)


13
14
15
# File 'lib/arkecosystem/client/api/blocks.rb', line 13

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

#search(parameters) ⇒ Faraday::Response

Search all blocks.

Parameters:

  • parameters (Hash)

Returns:

  • (Faraday::Response)


41
42
43
# File 'lib/arkecosystem/client/api/blocks.rb', line 41

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)


22
23
24
# File 'lib/arkecosystem/client/api/blocks.rb', line 22

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)


32
33
34
# File 'lib/arkecosystem/client/api/blocks.rb', line 32

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