Skip to content

txbody-org/maestro

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Maestro

A modern Elixir client library for the Maestro Cardano API.

Installation

Add maestro to your list of dependencies in mix.exs:

def deps do
  [
    {:maestro, "~> 0.1.0"}
  ]
end

Configuration

Configure your Maestro API key and network in config/config.exs:

config :maestro,
  api_key: "your_maestro_api_key_here",
  network: :mainnet  # :mainnet, :preprod, or :preview

Or set via environment variable:

export MAESTRO_API_KEY="your_maestro_api_key_here"

Usage

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.

Basic Usage

# Build a request and execute it
req = Maestro.Addresses.decode("addr1...")
{:ok, response} = Req.request(req)

# Access response data
address_data = response.body

Why Return Req Structs?

This approach provides several advantages:

  1. Flexibility: Add custom plugins, interceptors, and middleware
  2. Testing: Easy to mock and test without network calls
  3. Retry Logic: Implement custom retry strategies
  4. Logging: Add request/response logging as needed
  5. Error Handling: Handle errors in your application's preferred way
  6. Performance: Reuse configured requests, add connection pooling
  7. Extensibility: Compose requests with additional Req plugins

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages