module Blockfrost
Included Modules
- Habitat::SettingsHelpers
- Habitat::TempConfig
Extended Modules
Defined in:
blockfrost/converters/int128_from_string.crblockfrost/converters/int32_from_string.cr
blockfrost/converters/time_from_int.cr
blockfrost/converters/time_ms_from_int.cr
blockfrost/exception.cr
blockfrost/macros.cr
blockfrost/settings.cr:1
blockfrost/settings.cr:22
blockfrost/types.cr
blockfrost/version.cr
Constant Summary
-
DEFAULT_API_COUNT_PER_PAGE =
100
-
DEFAULT_API_ORDER =
Blockfrost::QueryOrder::ASC
-
HABITAT_SETTINGS =
[{decl: cardano_api_key : String | ::Nil, example: nil, validation: :validate_cardano_api_key}, {decl: cardano_api_version : String = "v0", example: nil, validation: :validate_api_version}, {decl: ipfs_api_key : String | ::Nil, example: nil, validation: :validate_ipfs_api_key}, {decl: ipfs_api_version : String = "v0", example: nil, validation: :validate_api_version}, {decl: default_order : QueryOrder | ::Nil = nil, example: nil, validation: nil}, {decl: default_count_per_page : Int32 | ::Nil = nil, example: nil, validation: :validate_count_per_page}, {decl: retries_in_concurrent_requests : Int32 = 5, example: nil, validation: :validate_retries_in_concurrent_requests}, {decl: sleep_between_retries_ms : Int32 = 500, example: nil, validation: :validate_sleep_between_retries_ms}] of Nil
-
MAX_COUNT_PER_PAGE =
100
-
MAX_NUMBER_OF_CONCURRENT_REQUESTS =
200
-
MAX_PAGINATION_PAGES =
21474836
-
MAX_RETRIES_IN_CONCURRENT_REQUESTS =
10
-
VERSION =
{{ (`shards version \"/srv/crystaldoc.info/github-blockfrost-blockfrost-crystal-v0.4.1/src/blockfrost\"`).chomp.stringify }}
Class Method Summary
Macro Summary
- enum_castable_from_string(name, types, stringify = underscore)
- gets_all_scoped_with_order_and_pagination(method_name, return_type, resource_path, argument_type_declaration, scope_argument_type_declaration)
- gets_all_scoped_with_pagination(method_name, return_type, resource_path, argument_type_declaration, scope_argument_type_declaration)
- gets_all_with_order_and_pagination(method_name, return_type, resource_path, argument_type_declaration = nil)
- gets_all_with_order_and_pagination_and_from_to(method_name, return_type, resource_path, argument_type_declaration = nil)
- gets_all_with_pagination(method_name, return_type, resource_path, argument_type_declaration)
-
within_page_range(pages, return_type, method_name, method_arguments)
The Blockfrost API imposes a limit of 100 records per page for a single request.
Instance Method Summary
- #api_key_for_path(path : String) : String
- #api_version_for_path(path : String) : String
- #cardano_mainnet? : Bool
- #cardano_network : String
- #cardano_preprod? : Bool
- #cardano_preview? : Bool
- #cardano_testnet? : Bool
- #host_for_path(path : String) : String
- #settings
- #validate_api_version(value : String)
- #validate_cardano_api_key(value : String | Nil)
- #validate_count_per_page(value : Int32 | Nil)
- #validate_default_order(value : QueryOrder | String | Nil)
- #validate_ipfs_api_key(value : String | Nil)
- #validate_retries_in_concurrent_requests(value : Int32)
- #validate_sleep_between_retries_ms(value : Int32)
Class Method Detail
Macro Detail
macro gets_all_scoped_with_order_and_pagination(method_name, return_type, resource_path, argument_type_declaration, scope_argument_type_declaration)
#
macro gets_all_scoped_with_pagination(method_name, return_type, resource_path, argument_type_declaration, scope_argument_type_declaration)
#
macro gets_all_with_order_and_pagination(method_name, return_type, resource_path, argument_type_declaration = nil)
#
macro gets_all_with_order_and_pagination_and_from_to(method_name, return_type, resource_path, argument_type_declaration = nil)
#
macro gets_all_with_pagination(method_name, return_type, resource_path, argument_type_declaration)
#
macro within_page_range(pages, return_type, method_name, method_arguments)
#
The Blockfrost API imposes a limit of 100 records per page for a single request. This macro allows fetching multiple pages concurrently. It then concatenates all results in the correct order and returns an array of records as if fetched in one go.
It also handles all possible exceptions. If the account is temporarily
rate-limited, it will retry several times, as defined by the
retries_in_concurrent_requests
setting. All other exceptions will cause
immediate failure by raising the first encountered exception.