Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions src/GeniusYield/Providers/Kupo.hs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,22 @@ Stability : develop
module GeniusYield.Providers.Kupo (
KupoApiEnv,
newKupoApiEnv,
KupoProviderException (..),
handleKupoError,
handleKupoAbsurdResponse,
runKupoClient,
KupoDatum (..),
KupoScriptLanguage (..),
KupoScript (..),
KupoValue (..),
KupoDatumType (..),
KupoCreatedAt (..),
KupoSpentAt (..),
KupoUtxo (..),
findDatumByHash,
findScriptByHash,
fetchUtxosByPattern,
transformUtxo,
kupoLookupDatum,
kupoLookupScript,
kupoQueryUtxo,
Expand Down Expand Up @@ -219,6 +235,12 @@ newtype KupoCreatedAt = KupoCreatedAt
deriving stock (Show, Eq, Ord, Generic)
deriving FromJSON via CustomJSON '[FieldLabelModifier '[CamelToSnake]] KupoCreatedAt

data KupoSpentAt = KupoSpentAt
{ kpaTransactionId :: !GYTxId
}
deriving stock (Show, Eq, Ord, Generic)
deriving FromJSON via CustomJSON '[FieldLabelModifier '[StripPrefix "kpa", LowerFirst, CamelToSnake]] KupoSpentAt

data KupoUtxo = KupoUtxo
{ transactionId :: !GYTxId
, outputIndex :: !Api.TxIx
Expand All @@ -228,6 +250,7 @@ data KupoUtxo = KupoUtxo
, datumType :: !(Maybe KupoDatumType)
, scriptHash :: !(Maybe GYScriptHash)
, createdAt :: !KupoCreatedAt
, spentAt :: !(Maybe KupoSpentAt)
}
deriving stock (Show, Eq, Ord, Generic)
deriving FromJSON via CustomJSON '[FieldLabelModifier '[CamelToSnake]] KupoUtxo
Expand Down
Loading