Blockfrost.HTTP (Blockfrost v0.1.1) View Source

HTTP requests to Blockfrost APIs.

This module is not meant to be use directly. Use the higher level modules to do calls to the Blockfrost API.

Link to this section Summary

Functions

Builds a request to a Blockfrost API

Builds a request and sends it.

Does a request to a Blockfrost API.

Link to this section Types

Specs

error_response() ::
  {:error,
   :bad_request
   | :unauthenticated
   | :ip_banned
   | :usage_limit_reached
   | :internal_server_error
   | Finch.Error.t()}

Link to this section Functions

Link to this function

build(name, method, path, query_params \\ %{}, opts \\ [])

View Source

Specs

Builds a request to a Blockfrost API

This function only builds the request. You can execute it with request/3.

Link to this function

build_and_send(name, method, path, opts \\ [])

View Source

Specs

build_and_send(atom(), atom(), String.t(), Keyword.t()) ::
  {:ok, term()} | {:error, term()}

Builds a request and sends it.

Supports pagination.

If pagination.page is :all, will fetch all pages concurrently, with retries according to retry options. If some page fails to be fetched, the first error found will be returned.

If you're fetching all pages, maximum concurrency can be configured by using the :max_concurrency option. Default is 10.

Keeps data in the order requested.

Link to this function

request(name, request, opts \\ [])

View Source

Specs

Does a request to a Blockfrost API.

Receives the following options:

  • :retry_enabled?: whether it should retry failing requests
  • :retry_max_attempts: max retry attempts
  • :retry_interval: interval between attempts

All these options fall back to the config. If they're not defined there, they fall back to default values. See Blockfrost.Config for more info.

For additional options, see Finch.request/3

Build requests with build/4.