Module: AssetsEndpoints

Extended by:
Params, Request
Included in:
Blockfrostruby::CardanoMainNet
Defined in:
lib/blockfrostruby/endpoints/cardano/assets_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_asset_addresses(asset, params = {}) ⇒ Hash

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

Parameters:

  • asset (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/assets_endpoints.rb', line 55

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

#get_asset_history(asset, params = {}) ⇒ Hash

Calls get request on (@url)/assets/(asset)/history.

Parameters:

  • asset (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/assets_endpoints.rb', line 35

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

#get_asset_transactions(asset, params = {}) ⇒ Hash

Calls get request on (@url)/assets/(asset)/transactions.

Parameters:

  • asset (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/assets_endpoints.rb', line 45

def get_asset_transactions(asset, params = {})
  params = Params.define_params(params, @config)
  Request.get_response("#{@url}/assets/#{asset}/transactions", @project_id, params)
end

#get_assets(params = {}) ⇒ Hash

Calls get request on (@url)/assets.

Parameters:

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

Returns:

  • (Hash)

    formatted result with status and body keys.



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

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

#get_assets_of_policy(policy_id, params = {}) ⇒ Hash

Calls get request on (@url)/assets/policy/(policy_id).

Parameters:

  • policy_id (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/assets_endpoints.rb', line 65

def get_assets_of_policy(policy_id, params = {})
  params = Params.define_params(params, @config)
  Request.get_response("#{@url}/assets/policy/#{policy_id}", @project_id, params)
end

#get_specific_asset(asset) ⇒ Hash

Calls get request on (@url)/assets/(asset).

Parameters:

  • asset (String)

    will be added to the url for get request.

  • params (Hash)
    • params passed by user.

Returns:

  • (Hash)

    formatted result with status and body keys.



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

def get_specific_asset(asset)
  Request.get_response("#{@url}/assets/#{asset}", @project_id)
end