Cardano Hydra SDK (Software Development Kit) for PureScript. This library offers various interfaces to facilitate rapid development of Hydra-based applications.
Table of Contents
Please refer to hydra-auction-offchain for a full-fledged example that utilizes this SDK.
The HydraSdk.Process
module provides an interface for spinning up a hydra-node
as a Node.js subprocess.
The HydraSdk.NodeApi
module exports functions for connecting to the Hydra Node
WebSocket API and sending HTTP requests. The primary function provided by this
module is mkHydraNodeApiWebSocket
, which establishes a WebSocket connection to
the hydra-node, attaches specified handlers for incoming messages, and returns a
HydraNodeApiWebSocket
record with type-safe actions for interacting with the
Hydra Node API. It also allows to specify retry strategies for Hydra
transactions that may be silently dropped by cardano-node, particularly for
Close and Contest transactions.
The HydraSdk.Types
module re-exports various Hydra domain-specific types
(such as HydraHeadStatus
and HydraNodeApi_InMessage
), along with other
utility types (e.g., HostPort
and Network
) used by the components of this
library.
HydraSdk.Extra.AppManager
provides an opinionated interface for managing
multiple Hydra application instances, with each instance running a separate
hydra-node process, as implemented in hydra-auction-offchain.
For more information, refer to the AppManager README.
Before executing most of the commands listed below, first enter the Nix
development shell by running nix develop
.
Build the project (requires Nix shell): make build
Format code (requires Nix shell): make format
Build docs and open them in the browser: make docs