Module: AccountsEndpoints

Extended by:
Params, Request
Included in:
Blockfrostruby::CardanoMainNet
Defined in:
lib/blockfrostruby/endpoints/cardano/accounts_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_account_address(address) ⇒ Hash

Calls get request on (@url)/accounts/(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/accounts_endpoints.rb', line 16

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

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

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

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.



95
96
97
98
# File 'lib/blockfrostruby/endpoints/cardano/accounts_endpoints.rb', line 95

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

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

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

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.



85
86
87
88
# File 'lib/blockfrostruby/endpoints/cardano/accounts_endpoints.rb', line 85

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

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

Calls get request on (@url)/accounts/(address)/delegations.

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.



45
46
47
48
# File 'lib/blockfrostruby/endpoints/cardano/accounts_endpoints.rb', line 45

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

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

Calls get request on (@url)/accounts/(address)/history.

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.



35
36
37
38
# File 'lib/blockfrostruby/endpoints/cardano/accounts_endpoints.rb', line 35

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

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

Calls get request on (@url)/accounts/(address)/mirs.

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.



75
76
77
78
# File 'lib/blockfrostruby/endpoints/cardano/accounts_endpoints.rb', line 75

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

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

Calls get request on (@url)/accounts/(address)/registrations.

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.



55
56
57
58
# File 'lib/blockfrostruby/endpoints/cardano/accounts_endpoints.rb', line 55

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

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

Calls get request on (@url)/accounts/(address)/rewards.

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.



25
26
27
28
# File 'lib/blockfrostruby/endpoints/cardano/accounts_endpoints.rb', line 25

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

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

Calls get request on (@url)/accounts/(address)/withdrawals.

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.



65
66
67
68
# File 'lib/blockfrostruby/endpoints/cardano/accounts_endpoints.rb', line 65

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