hydra-node
Safe HaskellSafe-Inferred
LanguageGHC2021

Hydra.API.ServerOutput

Synopsis

Documentation

data ServerOutput tx Source #

Constructors

NetworkConnected 
NetworkDisconnected 
NetworkVersionMismatch 
NetworkClusterIDMismatch 

Fields

PeerConnected 

Fields

PeerDisconnected 

Fields

HeadIsOpen 

Fields

HeadIsClosed 

Fields

  • headId :: HeadId
     
  • snapshotNumber :: SnapshotNumber
     
  • contestationDeadline :: UTCTime

    Nominal deadline until which contest can be submitted and after which fanout is possible. NOTE: Use this only for informational purpose and wait for ReadyToFanout instead before sending Fanout as the ledger of our cardano-node might not have progressed sufficiently in time yet and we do not re-submit transactions (yet).

HeadIsContested 

Fields

  • headId :: HeadId
     
  • snapshotNumber :: SnapshotNumber
     
  • contestationDeadline :: UTCTime

    Nominal deadline until which contest can be submitted and after which fanout is possible. NOTE: Use this only for informational purpose and wait for ReadyToFanout instead before sending Fanout as the ledger of our cardano-node might not have progressed sufficiently in time yet and we do not re-submit transactions (yet).

ReadyToFanout 

Fields

HeadPartiallyFannedOut

A selective partial fanout step has been observed on chain. Reports the UTxO distributed in this step and what remains to be fanned out, so the client can choose the next PartialFanout selection (or fan out the rest). $sel:fanoutMode:NetworkConnected tells the client whether the node will keep draining on its own or is waiting for the next selection, so it can render the right affordance instead of inferring it.

Fields

HeadIsFinalized 

Fields

TxValid

Given transaction has been seen as valid in the Head. It is expected to eventually be part of a SnapshotConfirmed.

Fields

TxInvalid

Given transaction was not not applicable to the given UTxO in time and has been dropped.

Fields

SnapshotConfirmed

Given snapshot was confirmed and included transactions can be considered final.

Fields

IgnoredHeadInitializing 

Fields

DecommitRequested 

Fields

DecommitInvalid 
DecommitApproved 

Fields

DecommitFinalized 

Fields

CommitRecorded 

Fields

DepositActivated 

Fields

DepositExpired 

Fields

CommitApproved 

Fields

CommitFinalized 

Fields

CommitRecovered 

Fields

SnapshotSideLoaded

Snapshot was side-loaded, and the included transactions can be considered final. The local state has been reset, meaning pending transactions were pruned. Any signing round has been discarded, and the snapshot leader has changed accordingly.

Fields

EventLogRotated 

Fields

NodeUnsynced 

Fields

NodeSynced 

Fields

Instances

Instances details
IsChainState tx => FromJSON (ServerOutput tx) Source # 
Instance details

Defined in Hydra.API.ServerOutput

Methods

parseJSON :: Value -> Parser (ServerOutput tx)

parseJSONList :: Value -> Parser [ServerOutput tx]

omittedField :: Maybe (ServerOutput tx)

IsChainState tx => ToJSON (ServerOutput tx) Source # 
Instance details

Defined in Hydra.API.ServerOutput

Methods

toJSON :: ServerOutput tx -> Value

toEncoding :: ServerOutput tx -> Encoding

toJSONList :: [ServerOutput tx] -> Value

toEncodingList :: [ServerOutput tx] -> Encoding

omitField :: ServerOutput tx -> Bool

Generic (ServerOutput tx) Source # 
Instance details

Defined in Hydra.API.ServerOutput

Associated Types

type Rep (ServerOutput tx) :: Type -> Type Source #

IsChainState tx => Show (ServerOutput tx) Source # 
Instance details

Defined in Hydra.API.ServerOutput

IsChainState tx => FromCBOR (ServerOutput tx) Source # 
Instance details

Defined in Hydra.API.ServerOutput

Methods

fromCBOR :: Decoder s (ServerOutput tx)

label :: Proxy (ServerOutput tx) -> Text

IsChainState tx => ToCBOR (ServerOutput tx) Source # 
Instance details

Defined in Hydra.API.ServerOutput

Methods

toCBOR :: ServerOutput tx -> Encoding

encodedSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy (ServerOutput tx) -> Size

encodedListSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy [ServerOutput tx] -> Size

IsChainState tx => Eq (ServerOutput tx) Source # 
Instance details

Defined in Hydra.API.ServerOutput

type Rep (ServerOutput tx) Source # 
Instance details

Defined in Hydra.API.ServerOutput

type Rep (ServerOutput tx) = D1 ('MetaData "ServerOutput" "Hydra.API.ServerOutput" "hydra-node-2.3.0-1cgalYNmLJQC1YXlYVq7mp" 'False) ((((C1 ('MetaCons "NetworkConnected" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "NetworkDisconnected" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "NetworkVersionMismatch" 'PrefixI 'True) (S1 ('MetaSel ('Just "ourVersion") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ProtocolVersion) :*: S1 ('MetaSel ('Just "theirVersion") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe ProtocolVersion))))) :+: ((C1 ('MetaCons "NetworkClusterIDMismatch" 'PrefixI 'True) (S1 ('MetaSel ('Just "clusterPeers") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "misconfiguredPeers") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text)) :+: C1 ('MetaCons "PeerConnected" 'PrefixI 'True) (S1 ('MetaSel ('Just "peer") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Host))) :+: (C1 ('MetaCons "PeerDisconnected" 'PrefixI 'True) (S1 ('MetaSel ('Just "peer") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Host)) :+: C1 ('MetaCons "HeadIsOpen" 'PrefixI 'True) (S1 ('MetaSel ('Just "headId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 HeadId) :*: S1 ('MetaSel ('Just "parties") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [Party]))))) :+: (((C1 ('MetaCons "HeadIsClosed" 'PrefixI 'True) (S1 ('MetaSel ('Just "headId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 HeadId) :*: (S1 ('MetaSel ('Just "snapshotNumber") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 SnapshotNumber) :*: S1 ('MetaSel ('Just "contestationDeadline") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 UTCTime))) :+: C1 ('MetaCons "HeadIsContested" 'PrefixI 'True) (S1 ('MetaSel ('Just "headId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 HeadId) :*: (S1 ('MetaSel ('Just "snapshotNumber") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 SnapshotNumber) :*: S1 ('MetaSel ('Just "contestationDeadline") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 UTCTime)))) :+: (C1 ('MetaCons "ReadyToFanout" 'PrefixI 'True) (S1 ('MetaSel ('Just "headId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 HeadId)) :+: C1 ('MetaCons "HeadPartiallyFannedOut" 'PrefixI 'True) ((S1 ('MetaSel ('Just "headId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 HeadId) :*: S1 ('MetaSel ('Just "distributedUTxO") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (UTxOType tx))) :*: (S1 ('MetaSel ('Just "remainingUTxO") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (UTxOType tx)) :*: S1 ('MetaSel ('Just "fanoutMode") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 FanoutProgressMode))))) :+: ((C1 ('MetaCons "HeadIsFinalized" 'PrefixI 'True) (S1 ('MetaSel ('Just "headId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 HeadId) :*: S1 ('MetaSel ('Just "finalizedUTxO") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (UTxOType tx))) :+: C1 ('MetaCons "TxValid" 'PrefixI 'True) (S1 ('MetaSel ('Just "headId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 HeadId) :*: S1 ('MetaSel ('Just "transactionId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (TxIdType tx)))) :+: (C1 ('MetaCons "TxInvalid" 'PrefixI 'True) ((S1 ('MetaSel ('Just "headId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 HeadId) :*: S1 ('MetaSel ('Just "utxo") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (UTxOType tx))) :*: (S1 ('MetaSel ('Just "transaction") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 tx) :*: S1 ('MetaSel ('Just "validationError") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ValidationError))) :+: C1 ('MetaCons "SnapshotConfirmed" 'PrefixI 'True) (S1 ('MetaSel ('Just "headId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 HeadId) :*: (S1 ('MetaSel ('Just "snapshot") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Snapshot tx)) :*: S1 ('MetaSel ('Just "signatures") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (MultiSignature (Snapshot tx))))))))) :+: (((C1 ('MetaCons "IgnoredHeadInitializing" 'PrefixI 'True) ((S1 ('MetaSel ('Just "headId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 HeadId) :*: S1 ('MetaSel ('Just "contestationPeriod") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ContestationPeriod)) :*: (S1 ('MetaSel ('Just "parties") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [Party]) :*: S1 ('MetaSel ('Just "participants") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [OnChainId]))) :+: (C1 ('MetaCons "DecommitRequested" 'PrefixI 'True) (S1 ('MetaSel ('Just "headId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 HeadId) :*: (S1 ('MetaSel ('Just "decommitTx") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 tx) :*: S1 ('MetaSel ('Just "utxoToDecommit") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (UTxOType tx)))) :+: C1 ('MetaCons "DecommitInvalid" 'PrefixI 'True) (S1 ('MetaSel ('Just "headId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 HeadId) :*: (S1 ('MetaSel ('Just "decommitTx") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 tx) :*: S1 ('MetaSel ('Just "decommitInvalidReason") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (DecommitInvalidReason tx)))))) :+: ((C1 ('MetaCons "DecommitApproved" 'PrefixI 'True) (S1 ('MetaSel ('Just "headId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 HeadId) :*: (S1 ('MetaSel ('Just "decommitTxId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (TxIdType tx)) :*: S1 ('MetaSel ('Just "utxoToDecommit") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (UTxOType tx)))) :+: C1 ('MetaCons "DecommitFinalized" 'PrefixI 'True) (S1 ('MetaSel ('Just "headId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 HeadId) :*: S1 ('MetaSel ('Just "distributedUTxO") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (UTxOType tx)))) :+: (C1 ('MetaCons "CommitRecorded" 'PrefixI 'True) ((S1 ('MetaSel ('Just "headId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 HeadId) :*: S1 ('MetaSel ('Just "utxoToCommit") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (UTxOType tx))) :*: (S1 ('MetaSel ('Just "pendingDeposit") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (TxIdType tx)) :*: S1 ('MetaSel ('Just "deadline") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 UTCTime))) :+: C1 ('MetaCons "DepositActivated" 'PrefixI 'True) ((S1 ('MetaSel ('Just "headId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 HeadId) :*: S1 ('MetaSel ('Just "depositTxId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (TxIdType tx))) :*: (S1 ('MetaSel ('Just "deadline") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 UTCTime) :*: S1 ('MetaSel ('Just "chainTime") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 UTCTime)))))) :+: (((C1 ('MetaCons "DepositExpired" 'PrefixI 'True) ((S1 ('MetaSel ('Just "headId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 HeadId) :*: S1 ('MetaSel ('Just "depositTxId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (TxIdType tx))) :*: (S1 ('MetaSel ('Just "deadline") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 UTCTime) :*: S1 ('MetaSel ('Just "chainTime") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 UTCTime))) :+: C1 ('MetaCons "CommitApproved" 'PrefixI 'True) (S1 ('MetaSel ('Just "headId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 HeadId) :*: S1 ('MetaSel ('Just "utxoToCommit") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (UTxOType tx)))) :+: (C1 ('MetaCons "CommitFinalized" 'PrefixI 'True) (S1 ('MetaSel ('Just "headId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 HeadId) :*: S1 ('MetaSel ('Just "depositTxId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (TxIdType tx))) :+: C1 ('MetaCons "CommitRecovered" 'PrefixI 'True) (S1 ('MetaSel ('Just "headId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 HeadId) :*: (S1 ('MetaSel ('Just "recoveredUTxO") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (UTxOType tx)) :*: S1 ('MetaSel ('Just "recoveredTxId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (TxIdType tx)))))) :+: ((C1 ('MetaCons "SnapshotSideLoaded" 'PrefixI 'True) (S1 ('MetaSel ('Just "headId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 HeadId) :*: S1 ('MetaSel ('Just "snapshotNumber") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 SnapshotNumber)) :+: C1 ('MetaCons "EventLogRotated" 'PrefixI 'True) (S1 ('MetaSel ('Just "checkpoint") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (NodeState tx)))) :+: (C1 ('MetaCons "NodeUnsynced" 'PrefixI 'True) (S1 ('MetaSel ('Just "chainSlot") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ChainSlot) :*: (S1 ('MetaSel ('Just "chainTime") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 UTCTime) :*: S1 ('MetaSel ('Just "drift") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 NominalDiffTime))) :+: C1 ('MetaCons "NodeSynced" 'PrefixI 'True) (S1 ('MetaSel ('Just "chainSlot") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ChainSlot) :*: (S1 ('MetaSel ('Just "chainTime") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 UTCTime) :*: S1 ('MetaSel ('Just "drift") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 NominalDiffTime))))))))

data ClientMessage tx Source #

Individual messages as produced by the HeadLogic in the ClientEffect.

Instances

Instances details
IsChainState tx => FromJSON (ClientMessage tx) Source # 
Instance details

Defined in Hydra.API.ServerOutput

Methods

parseJSON :: Value -> Parser (ClientMessage tx)

parseJSONList :: Value -> Parser [ClientMessage tx]

omittedField :: Maybe (ClientMessage tx)

IsChainState tx => ToJSON (ClientMessage tx) Source # 
Instance details

Defined in Hydra.API.ServerOutput

Methods

toJSON :: ClientMessage tx -> Value

toEncoding :: ClientMessage tx -> Encoding

toJSONList :: [ClientMessage tx] -> Value

toEncodingList :: [ClientMessage tx] -> Encoding

omitField :: ClientMessage tx -> Bool

Generic (ClientMessage tx) Source # 
Instance details

Defined in Hydra.API.ServerOutput

Associated Types

type Rep (ClientMessage tx) :: Type -> Type Source #

IsChainState tx => Show (ClientMessage tx) Source # 
Instance details

Defined in Hydra.API.ServerOutput

IsChainState tx => FromCBOR (ClientMessage tx) Source # 
Instance details

Defined in Hydra.API.ServerOutput

Methods

fromCBOR :: Decoder s (ClientMessage tx)

label :: Proxy (ClientMessage tx) -> Text

IsChainState tx => ToCBOR (ClientMessage tx) Source # 
Instance details

Defined in Hydra.API.ServerOutput

Methods

toCBOR :: ClientMessage tx -> Encoding

encodedSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy (ClientMessage tx) -> Size

encodedListSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy [ClientMessage tx] -> Size

IsChainState tx => Eq (ClientMessage tx) Source # 
Instance details

Defined in Hydra.API.ServerOutput

type Rep (ClientMessage tx) Source # 
Instance details

Defined in Hydra.API.ServerOutput

type Rep (ClientMessage tx) = D1 ('MetaData "ClientMessage" "Hydra.API.ServerOutput" "hydra-node-2.3.0-1cgalYNmLJQC1YXlYVq7mp" 'False) ((C1 ('MetaCons "CommandFailed" 'PrefixI 'True) (S1 ('MetaSel ('Just "clientInput") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (ClientInput tx)) :*: S1 ('MetaSel ('Just "state") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (HeadState tx))) :+: C1 ('MetaCons "PostTxOnChainFailed" 'PrefixI 'True) (S1 ('MetaSel ('Just "postChainTx") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (PostChainTx tx)) :*: S1 ('MetaSel ('Just "postTxError") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (PostTxError tx)))) :+: (C1 ('MetaCons "RejectedInputBecauseUnsynced" 'PrefixI 'True) (S1 ('MetaSel ('Just "clientInput") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (ClientInput tx)) :*: S1 ('MetaSel ('Just "drift") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 NominalDiffTime)) :+: C1 ('MetaCons "SideLoadSnapshotRejected" 'PrefixI 'True) (S1 ('MetaSel ('Just "clientInput") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (ClientInput tx)) :*: S1 ('MetaSel ('Just "requirementFailure") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (SideLoadRequirementFailure tx)))))

data CommitInfo Source #

All information needed to distinguish behavior of the commit endpoint.

Constructors

CannotCommit 
IncrementalCommit HeadId 

data TimedServerOutput tx Source #

The type of messages sent to clients by the Server.

NOTE: The field order is the CBOR wire format (see ToCBOR below), so reordering fields is a breaking format change.

Constructors

TimedServerOutput 

Fields

Instances

Instances details
IsChainState tx => FromJSON (TimedServerOutput tx) Source # 
Instance details

Defined in Hydra.API.ServerOutput

Methods

parseJSON :: Value -> Parser (TimedServerOutput tx)

parseJSONList :: Value -> Parser [TimedServerOutput tx]

omittedField :: Maybe (TimedServerOutput tx)

IsChainState tx => ToJSON (TimedServerOutput tx) Source # 
Instance details

Defined in Hydra.API.ServerOutput

Methods

toJSON :: TimedServerOutput tx -> Value

toEncoding :: TimedServerOutput tx -> Encoding

toJSONList :: [TimedServerOutput tx] -> Value

toEncodingList :: [TimedServerOutput tx] -> Encoding

omitField :: TimedServerOutput tx -> Bool

Generic (TimedServerOutput tx) Source # 
Instance details

Defined in Hydra.API.ServerOutput

Associated Types

type Rep (TimedServerOutput tx) :: Type -> Type Source #

IsChainState tx => Show (TimedServerOutput tx) Source # 
Instance details

Defined in Hydra.API.ServerOutput

IsChainState tx => FromCBOR (TimedServerOutput tx) Source # 
Instance details

Defined in Hydra.API.ServerOutput

Methods

fromCBOR :: Decoder s (TimedServerOutput tx)

label :: Proxy (TimedServerOutput tx) -> Text

IsChainState tx => ToCBOR (TimedServerOutput tx) Source # 
Instance details

Defined in Hydra.API.ServerOutput

Methods

toCBOR :: TimedServerOutput tx -> Encoding

encodedSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy (TimedServerOutput tx) -> Size

encodedListSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy [TimedServerOutput tx] -> Size

IsChainState tx => Eq (TimedServerOutput tx) Source # 
Instance details

Defined in Hydra.API.ServerOutput

type Rep (TimedServerOutput tx) Source # 
Instance details

Defined in Hydra.API.ServerOutput

type Rep (TimedServerOutput tx) = D1 ('MetaData "TimedServerOutput" "Hydra.API.ServerOutput" "hydra-node-2.3.0-1cgalYNmLJQC1YXlYVq7mp" 'False) (C1 ('MetaCons "TimedServerOutput" 'PrefixI 'True) (S1 ('MetaSel ('Just "seq") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Natural) :*: (S1 ('MetaSel ('Just "time") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 UTCTime) :*: S1 ('MetaSel ('Just "output") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (ServerOutput tx)))))

data NetworkInfo Source #

L2 Hydra network status information.

Constructors

NetworkInfo 

Instances

Instances details
FromJSON NetworkInfo Source # 
Instance details

Defined in Hydra.API.ServerOutput

Methods

parseJSON :: Value -> Parser NetworkInfo

parseJSONList :: Value -> Parser [NetworkInfo]

omittedField :: Maybe NetworkInfo

ToJSON NetworkInfo Source # 
Instance details

Defined in Hydra.API.ServerOutput

Methods

toJSON :: NetworkInfo -> Value

toEncoding :: NetworkInfo -> Encoding

toJSONList :: [NetworkInfo] -> Value

toEncodingList :: [NetworkInfo] -> Encoding

omitField :: NetworkInfo -> Bool

Generic NetworkInfo Source # 
Instance details

Defined in Hydra.API.ServerOutput

Associated Types

type Rep NetworkInfo :: Type -> Type Source #

Show NetworkInfo Source # 
Instance details

Defined in Hydra.API.ServerOutput

FromCBOR NetworkInfo Source # 
Instance details

Defined in Hydra.API.ServerOutput

Methods

fromCBOR :: Decoder s NetworkInfo

label :: Proxy NetworkInfo -> Text

ToCBOR NetworkInfo Source # 
Instance details

Defined in Hydra.API.ServerOutput

Methods

toCBOR :: NetworkInfo -> Encoding

encodedSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy NetworkInfo -> Size

encodedListSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy [NetworkInfo] -> Size

Eq NetworkInfo Source # 
Instance details

Defined in Hydra.API.ServerOutput

type Rep NetworkInfo Source # 
Instance details

Defined in Hydra.API.ServerOutput

type Rep NetworkInfo = D1 ('MetaData "NetworkInfo" "Hydra.API.ServerOutput" "hydra-node-2.3.0-1cgalYNmLJQC1YXlYVq7mp" 'False) (C1 ('MetaCons "NetworkInfo" 'PrefixI 'True) (S1 ('MetaSel ('Just "networkConnected") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Bool) :*: S1 ('MetaSel ('Just "peersInfo") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Map Host Bool))))

data Greetings tx Source #

A friendly welcome message which tells a client something about the node. Currently used for knowing what signing key the server uses (it only knows one), HeadStatus and optionally (if HeadIsOpen or SnapshotConfirmed message is emitted) UTxO's present in the Hydra Head.

Constructors

Greetings 

Instances

Instances details
IsChainState tx => FromJSON (Greetings tx) Source # 
Instance details

Defined in Hydra.API.ServerOutput

Methods

parseJSON :: Value -> Parser (Greetings tx)

parseJSONList :: Value -> Parser [Greetings tx]

omittedField :: Maybe (Greetings tx)

IsChainState tx => ToJSON (Greetings tx) Source # 
Instance details

Defined in Hydra.API.ServerOutput

Methods

toJSON :: Greetings tx -> Value

toEncoding :: Greetings tx -> Encoding

toJSONList :: [Greetings tx] -> Value

toEncodingList :: [Greetings tx] -> Encoding

omitField :: Greetings tx -> Bool

Generic (Greetings tx) Source # 
Instance details

Defined in Hydra.API.ServerOutput

Associated Types

type Rep (Greetings tx) :: Type -> Type Source #

Methods

from :: Greetings tx -> Rep (Greetings tx) x Source #

to :: Rep (Greetings tx) x -> Greetings tx Source #

IsChainState tx => Show (Greetings tx) Source # 
Instance details

Defined in Hydra.API.ServerOutput

IsChainState tx => FromCBOR (Greetings tx) Source # 
Instance details

Defined in Hydra.API.ServerOutput

Methods

fromCBOR :: Decoder s (Greetings tx)

label :: Proxy (Greetings tx) -> Text

IsChainState tx => ToCBOR (Greetings tx) Source # 
Instance details

Defined in Hydra.API.ServerOutput

Methods

toCBOR :: Greetings tx -> Encoding

encodedSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy (Greetings tx) -> Size

encodedListSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy [Greetings tx] -> Size

IsChainState tx => Eq (Greetings tx) Source # 
Instance details

Defined in Hydra.API.ServerOutput

Methods

(==) :: Greetings tx -> Greetings tx -> Bool Source #

(/=) :: Greetings tx -> Greetings tx -> Bool Source #

type Rep (Greetings tx) Source # 
Instance details

Defined in Hydra.API.ServerOutput

data HeadStatus Source #

All possible Hydra states displayed in the API server outputs.

Constructors

Idle 
Open 
Closed 
FanoutPossible 
FanningOut

A closed head whose UTxO is being distributed across multiple selective partial fanout transactions.

Instances

Instances details
FromJSON HeadStatus Source # 
Instance details

Defined in Hydra.API.ServerOutput

Methods

parseJSON :: Value -> Parser HeadStatus

parseJSONList :: Value -> Parser [HeadStatus]

omittedField :: Maybe HeadStatus

ToJSON HeadStatus Source # 
Instance details

Defined in Hydra.API.ServerOutput

Methods

toJSON :: HeadStatus -> Value

toEncoding :: HeadStatus -> Encoding

toJSONList :: [HeadStatus] -> Value

toEncodingList :: [HeadStatus] -> Encoding

omitField :: HeadStatus -> Bool

Generic HeadStatus Source # 
Instance details

Defined in Hydra.API.ServerOutput

Associated Types

type Rep HeadStatus :: Type -> Type Source #

Show HeadStatus Source # 
Instance details

Defined in Hydra.API.ServerOutput

FromCBOR HeadStatus Source # 
Instance details

Defined in Hydra.API.ServerOutput

Methods

fromCBOR :: Decoder s HeadStatus

label :: Proxy HeadStatus -> Text

ToCBOR HeadStatus Source # 
Instance details

Defined in Hydra.API.ServerOutput

Methods

toCBOR :: HeadStatus -> Encoding

encodedSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy HeadStatus -> Size

encodedListSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy [HeadStatus] -> Size

Eq HeadStatus Source # 
Instance details

Defined in Hydra.API.ServerOutput

type Rep HeadStatus Source # 
Instance details

Defined in Hydra.API.ServerOutput

type Rep HeadStatus = D1 ('MetaData "HeadStatus" "Hydra.API.ServerOutput" "hydra-node-2.3.0-1cgalYNmLJQC1YXlYVq7mp" 'False) ((C1 ('MetaCons "Idle" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Open" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Closed" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "FanoutPossible" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "FanningOut" 'PrefixI 'False) (U1 :: Type -> Type))))

data InvalidInput Source #

Constructors

InvalidInput 

Fields

Instances

Instances details
FromJSON InvalidInput Source # 
Instance details

Defined in Hydra.API.ServerOutput

Methods

parseJSON :: Value -> Parser InvalidInput

parseJSONList :: Value -> Parser [InvalidInput]

omittedField :: Maybe InvalidInput

ToJSON InvalidInput Source # 
Instance details

Defined in Hydra.API.ServerOutput

Methods

toJSON :: InvalidInput -> Value

toEncoding :: InvalidInput -> Encoding

toJSONList :: [InvalidInput] -> Value

toEncodingList :: [InvalidInput] -> Encoding

omitField :: InvalidInput -> Bool

Generic InvalidInput Source # 
Instance details

Defined in Hydra.API.ServerOutput

Associated Types

type Rep InvalidInput :: Type -> Type Source #

Show InvalidInput Source # 
Instance details

Defined in Hydra.API.ServerOutput

FromCBOR InvalidInput Source # 
Instance details

Defined in Hydra.API.ServerOutput

Methods

fromCBOR :: Decoder s InvalidInput

label :: Proxy InvalidInput -> Text

ToCBOR InvalidInput Source # 
Instance details

Defined in Hydra.API.ServerOutput

Methods

toCBOR :: InvalidInput -> Encoding

encodedSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy InvalidInput -> Size

encodedListSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy [InvalidInput] -> Size

Eq InvalidInput Source # 
Instance details

Defined in Hydra.API.ServerOutput

type Rep InvalidInput Source # 
Instance details

Defined in Hydra.API.ServerOutput

type Rep InvalidInput = D1 ('MetaData "InvalidInput" "Hydra.API.ServerOutput" "hydra-node-2.3.0-1cgalYNmLJQC1YXlYVq7mp" 'False) (C1 ('MetaCons "InvalidInput" 'PrefixI 'True) (S1 ('MetaSel ('Just "reason") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 String) :*: S1 ('MetaSel ('Just "input") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text)))

data WithAddressedTx Source #

Whether or not to filter transaction server outputs by given address.

data WithUTxO Source #

Whether or not to include full UTxO in server outputs.

Constructors

WithUTxO 
WithoutUTxO 

Instances

Instances details
Show WithUTxO Source # 
Instance details

Defined in Hydra.API.ServerOutput

Eq WithUTxO Source # 
Instance details

Defined in Hydra.API.ServerOutput

data DecommitInvalidReason tx Source #

Constructors

DecommitTxInvalid 

Fields

DecommitAlreadyInFlight 

Fields

DepositInFlight

A deposit (commit) is in flight: the decommit cannot be recorded until it finalises or is recovered. Clients may need to recover the deposit before another decommit is possible (currentDepositTxId clears on CommitFinalized and DepositRecovered).

Fields

Instances

Instances details
(FromJSON (TxIdType tx), FromJSON (UTxOType tx)) => FromJSON (DecommitInvalidReason tx) Source # 
Instance details

Defined in Hydra.API.ServerOutput

(ToJSON (TxIdType tx), ToJSON (UTxOType tx)) => ToJSON (DecommitInvalidReason tx) Source # 
Instance details

Defined in Hydra.API.ServerOutput

Generic (DecommitInvalidReason tx) Source # 
Instance details

Defined in Hydra.API.ServerOutput

Associated Types

type Rep (DecommitInvalidReason tx) :: Type -> Type Source #

(Show (TxIdType tx), Show (UTxOType tx)) => Show (DecommitInvalidReason tx) Source # 
Instance details

Defined in Hydra.API.ServerOutput

IsTx tx => FromCBOR (DecommitInvalidReason tx) Source # 
Instance details

Defined in Hydra.API.ServerOutput

Methods

fromCBOR :: Decoder s (DecommitInvalidReason tx)

label :: Proxy (DecommitInvalidReason tx) -> Text

IsTx tx => ToCBOR (DecommitInvalidReason tx) Source # 
Instance details

Defined in Hydra.API.ServerOutput

Methods

toCBOR :: DecommitInvalidReason tx -> Encoding

encodedSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy (DecommitInvalidReason tx) -> Size

encodedListSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy [DecommitInvalidReason tx] -> Size

(Eq (TxIdType tx), Eq (UTxOType tx)) => Eq (DecommitInvalidReason tx) Source # 
Instance details

Defined in Hydra.API.ServerOutput

type Rep (DecommitInvalidReason tx) Source # 
Instance details

Defined in Hydra.API.ServerOutput

type Rep (DecommitInvalidReason tx) = D1 ('MetaData "DecommitInvalidReason" "Hydra.API.ServerOutput" "hydra-node-2.3.0-1cgalYNmLJQC1YXlYVq7mp" 'False) (C1 ('MetaCons "DecommitTxInvalid" 'PrefixI 'True) (S1 ('MetaSel ('Just "localUTxO") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (UTxOType tx)) :*: S1 ('MetaSel ('Just "validationError") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ValidationError)) :+: (C1 ('MetaCons "DecommitAlreadyInFlight" 'PrefixI 'True) (S1 ('MetaSel ('Just "otherDecommitTxId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (TxIdType tx))) :+: C1 ('MetaCons "DepositInFlight" 'PrefixI 'True) (S1 ('MetaSel ('Just "depositTxId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (TxIdType tx)) :*: S1 ('MetaSel ('Just "commitUTxO") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (UTxOType tx)))))

data ApiMessage tx Source #

Union of all messages the hydra-node sends to clients. Only used for decoding on the client side; the server encodes and sends the individual types directly (their encodings are the same as the union's).

In CBOR, every server-sent message starts with a text tag that is unique across the whole API surface, so a single tag read suffices to dispatch.

Instances

Instances details
IsChainState tx => FromJSON (ApiMessage tx) Source # 
Instance details

Defined in Hydra.API.ServerOutput

Methods

parseJSON :: Value -> Parser (ApiMessage tx)

parseJSONList :: Value -> Parser [ApiMessage tx]

omittedField :: Maybe (ApiMessage tx)

IsChainState tx => ToJSON (ApiMessage tx) Source # 
Instance details

Defined in Hydra.API.ServerOutput

Methods

toJSON :: ApiMessage tx -> Value

toEncoding :: ApiMessage tx -> Encoding

toJSONList :: [ApiMessage tx] -> Value

toEncodingList :: [ApiMessage tx] -> Encoding

omitField :: ApiMessage tx -> Bool

Generic (ApiMessage tx) Source # 
Instance details

Defined in Hydra.API.ServerOutput

Associated Types

type Rep (ApiMessage tx) :: Type -> Type Source #

Methods

from :: ApiMessage tx -> Rep (ApiMessage tx) x Source #

to :: Rep (ApiMessage tx) x -> ApiMessage tx Source #

IsChainState tx => Show (ApiMessage tx) Source # 
Instance details

Defined in Hydra.API.ServerOutput

IsChainState tx => FromCBOR (ApiMessage tx) Source # 
Instance details

Defined in Hydra.API.ServerOutput

Methods

fromCBOR :: Decoder s (ApiMessage tx)

label :: Proxy (ApiMessage tx) -> Text

IsChainState tx => ToCBOR (ApiMessage tx) Source # 
Instance details

Defined in Hydra.API.ServerOutput

Methods

toCBOR :: ApiMessage tx -> Encoding

encodedSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy (ApiMessage tx) -> Size

encodedListSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy [ApiMessage tx] -> Size

IsChainState tx => Eq (ApiMessage tx) Source # 
Instance details

Defined in Hydra.API.ServerOutput

Methods

(==) :: ApiMessage tx -> ApiMessage tx -> Bool Source #

(/=) :: ApiMessage tx -> ApiMessage tx -> Bool Source #

type Rep (ApiMessage tx) Source # 
Instance details

Defined in Hydra.API.ServerOutput

type Rep (ApiMessage tx) = D1 ('MetaData "ApiMessage" "Hydra.API.ServerOutput" "hydra-node-2.3.0-1cgalYNmLJQC1YXlYVq7mp" 'False) ((C1 ('MetaCons "ApiTimedServerOutput" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (TimedServerOutput tx))) :+: C1 ('MetaCons "ApiClientMessage" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (ClientMessage tx)))) :+: (C1 ('MetaCons "ApiGreetings" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Greetings tx))) :+: C1 ('MetaCons "ApiInvalidInput" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 InvalidInput))))

data FanoutProgressMode Source #

Client-facing projection of the node's fanout FanoutMode: whether a fanning-out head will continue draining on its own or is waiting for the client to choose the next PartialFanout. Surfacing this lets clients render the correct affordance without inferring it from local actions.

Constructors

AutoFanningOut

The node keeps draining automatically (a full Fanout, or working through a user selection). The client should wait, not prompt for input.

AwaitingFanoutSelection

The node has drained the current selection and is waiting for the next PartialFanout from the client.

Instances

Instances details
FromJSON FanoutProgressMode Source # 
Instance details

Defined in Hydra.API.ServerOutput

ToJSON FanoutProgressMode Source # 
Instance details

Defined in Hydra.API.ServerOutput

Generic FanoutProgressMode Source # 
Instance details

Defined in Hydra.API.ServerOutput

Associated Types

type Rep FanoutProgressMode :: Type -> Type Source #

Show FanoutProgressMode Source # 
Instance details

Defined in Hydra.API.ServerOutput

FromCBOR FanoutProgressMode Source # 
Instance details

Defined in Hydra.API.ServerOutput

ToCBOR FanoutProgressMode Source # 
Instance details

Defined in Hydra.API.ServerOutput

Methods

toCBOR :: FanoutProgressMode -> Encoding

encodedSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy FanoutProgressMode -> Size

encodedListSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy [FanoutProgressMode] -> Size

Eq FanoutProgressMode Source # 
Instance details

Defined in Hydra.API.ServerOutput

type Rep FanoutProgressMode Source # 
Instance details

Defined in Hydra.API.ServerOutput

type Rep FanoutProgressMode = D1 ('MetaData "FanoutProgressMode" "Hydra.API.ServerOutput" "hydra-node-2.3.0-1cgalYNmLJQC1YXlYVq7mp" 'False) (C1 ('MetaCons "AutoFanningOut" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "AwaitingFanoutSelection" 'PrefixI 'False) (U1 :: Type -> Type))

getConfirmedSnapshot :: HeadState tx -> Maybe (ConfirmedSnapshot tx) Source #

Get latest confirmed snapshot from HeadState.

getSeenSnapshot :: IsTx tx => HeadState tx -> SeenSnapshot tx Source #

Get latest seen snapshot from HeadState.

getSnapshotUtxo :: IsTx tx => HeadState tx -> Maybe (UTxOType tx) Source #

Get latest confirmed snapshot UTxO from HeadState.

fanoutProgressMode :: FanoutMode tx -> FanoutProgressMode Source #

Project the internal FanoutMode to its client-facing FanoutProgressMode. Both auto-drain and mid-selection draining present as AutoFanningOut (the node advances by itself); only an exhausted selection awaits client input.

handleUtxoInclusionTyped :: IsTx tx => ServerOutputConfig -> TimedServerOutput tx -> TimedServerOutput tx Source #

Typed snapshot-utxo filter: with WithoutUTxO, the snapshot's utxo is replaced by mempty before encoding. Used directly on CBOR connections (which keep the empty utxo set on the wire) and on the JSON path combined with removeSnapshotUTxO (which then drops the residual empty key).

NOTE: These are display-only filters and not meant to round-trip back into a valid Snapshot.

prepareServerOutput Source #

Arguments

:: IsChainState tx 
=> ServerOutputConfig

Decide on tx representation

-> TimedServerOutput tx

Server output

-> ByteString

Final output

Replaces the json encoded tx field with it's cbor representation.

NOTE: we deliberately pattern match on all ServerOutput constructors in handleTxOutput so that we don't forget to update this function if they change.

decodeClientMessageBody :: IsChainState tx => Text -> Decoder s (ClientMessage tx) Source #

Decode a ClientMessage given its already-decoded constructor tag (used for tag-based dispatch in ApiMessage).

decodeGreetingsBody :: IsChainState tx => Decoder s (Greetings tx) Source #

Decode a Greetings after its Greetings tag has already been consumed (used for tag-based dispatch in ApiMessage).

decodeInvalidInputBody :: Decoder s InvalidInput Source #

Decode an InvalidInput after its InvalidInput tag has already been consumed (used for tag-based dispatch in ApiMessage).

removeSnapshotUTxO :: Value -> Value Source #

Drop the snapshot utxo key from an already-converted JSON Value. Working on the Value (rather than encoded bytes) avoids a full re-parse and re-encode of the message.

data ApiEncoding Source #

Which wire encoding a client negotiated: JSON (the default) or native CBOR. WebSocket clients opt in via the ?encoding=cbor query parameter, HTTP clients via Accept @Content-Type: applicationcbor@ headers.

Constructors

JsonEncoding 
CborEncoding 

Instances

Instances details
Show ApiEncoding Source # 
Instance details

Defined in Hydra.API.WireFormat

Eq ApiEncoding Source # 
Instance details

Defined in Hydra.API.WireFormat