Module: AddressesEndpoints

Extended by:
Params, Request
Included in:
Blockfrostruby::CardanoMainNet
Defined in:
lib/blockfrostruby/endpoints/cardano/addresses_endpoints.rb

Constant Summary

Constants included from Blockfrostruby

Blockfrostruby::VERSION

Instance Method Summary collapse

Methods included from Request

get_response, post_file, post_request_cbor, post_request_raw

Methods included from Params

define_params

Methods included from Validator

validate_init_params, validate_params

Methods included from Configuration

default_config, define_config

Instance Method Details

#get_address(address) ⇒ Hash

Calls get request on (@url)/addresses/(address).

Parameters:

  • address (String)

    will be added to the url for get request.

Returns:

  • (Hash)

    formatted result with status and body keys.



16
17
18
# File 'lib/blockfrostruby/endpoints/cardano/addresses_endpoints.rb', line 16

def get_address(address)
  Request.get_response("#{@url}/addresses/#{address}", @project_id)
end

#get_address_details(address) ⇒ Hash

Calls get request on (@url)/addresses/(address)/total.

Parameters:

  • address (String)

    will be added to the url for get request.

Returns:

  • (Hash)

    formatted result with status and body keys.



24
25
26
# File 'lib/blockfrostruby/endpoints/cardano/addresses_endpoints.rb', line 24

def get_address_details(address)
  Request.get_response("#{@url}/addresses/#{address}/total", @project_id)
end

#get_address_transactions(address, params = {}) ⇒ Hash

Calls get request on (@url)/addresses/(address)/transactions.

Parameters:

  • address (String)

    will be added to the url for get request.

  • params (Hash) (defaults to: {})
    • params passed by user.

Returns:

  • (Hash)

    formatted result with status and body keys.



43
44
45
46
# File 'lib/blockfrostruby/endpoints/cardano/addresses_endpoints.rb', line 43

def get_address_transactions(address, params = {})
  params = Params.define_params(params, @config)
  Request.get_response("#{@url}/addresses/#{address}/transactions", @project_id, params)
end

#get_address_utxos(address, params = {}) ⇒ Hash

Calls get request on (@url)/addresses/(address)/utxos.

Parameters:

  • address (String)

    will be added to the url for get request.

  • params (Hash) (defaults to: {})
    • params passed by user.

Returns:

  • (Hash)

    formatted result with status and body keys.



33
34
35
36
# File 'lib/blockfrostruby/endpoints/cardano/addresses_endpoints.rb', line 33

def get_address_utxos(address, params = {})
  params = Params.define_params(params, @config)
  Request.get_response("#{@url}/addresses/#{address}/utxos", @project_id, params)
end