A modern Elixir client library for the Maestro Cardano API.
Add maestro to your list of dependencies in mix.exs:
def deps do
[
{:maestro, "~> 0.1.0"}
]
endConfigure your Maestro API key and network in config/config.exs:
config :maestro,
api_key: "your_maestro_api_key_here",
network: :mainnet # :mainnet, :preprod, or :previewOr set via environment variable:
export MAESTRO_API_KEY="your_maestro_api_key_here"This library returns configured Req.Request structs instead of executing HTTP requests directly. This gives developer full control over request execution and allows to add custom plugins, interceptors, and response handling.
# Build a request and execute it
req = Maestro.Addresses.decode("addr1...")
{:ok, response} = Req.request(req)
# Access response data
address_data = response.bodyThis approach provides several advantages:
- Flexibility: Add custom plugins, interceptors, and middleware
- Testing: Easy to mock and test without network calls
- Retry Logic: Implement custom retry strategies
- Logging: Add request/response logging as needed
- Error Handling: Handle errors in your application's preferred way
- Performance: Reuse configured requests, add connection pooling
- Extensibility: Compose requests with additional Req plugins
- Fork the repository
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request