{-# LANGUAGE DataKinds                  #-}
{-# LANGUAGE DeriveAnyClass             #-}
{-# LANGUAGE DeriveDataTypeable         #-}
{-# LANGUAGE DeriveGeneric              #-}
{-# LANGUAGE DerivingStrategies         #-}
{-# LANGUAGE FlexibleContexts           #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE MultiParamTypeClasses      #-}
{-# LANGUAGE NoImplicitPrelude          #-}
{-# LANGUAGE OverloadedStrings          #-}
{-# LANGUAGE RecordWildCards            #-}
{-# LANGUAGE TemplateHaskell            #-}
{-# LANGUAGE TypeFamilies               #-}
{-# LANGUAGE TypeOperators              #-}
{-# options_ghc -Wno-redundant-constraints #-}
{-# options_ghc -fno-specialise            #-}
{-# OPTIONS_GHC -Wno-orphans #-}

module Plutus.Contracts.Uniswap.Types
  where

import Data.Aeson (FromJSON, ToJSON)
import Data.Data
import Data.OpenApi qualified as OpenApi
import GHC.Generics (Generic)
import Ledger.Value.Orphans ()
import Plutus.Script.Utils.Value (AssetClass (..), CurrencySymbol (..), TokenName (..), Value, assetClass,
                                  assetClassValue, assetClassValueOf)
import PlutusTx qualified
import PlutusTx.Prelude
import Prelude qualified as Haskell
import Text.Printf (PrintfArg)

-- | Uniswap coin token
data U = U deriving (Int -> U -> ShowS
[U] -> ShowS
U -> String
(Int -> U -> ShowS) -> (U -> String) -> ([U] -> ShowS) -> Show U
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [U] -> ShowS
$cshowList :: [U] -> ShowS
show :: U -> String
$cshow :: U -> String
showsPrec :: Int -> U -> ShowS
$cshowsPrec :: Int -> U -> ShowS
Haskell.Show, U -> U -> Bool
(U -> U -> Bool) -> (U -> U -> Bool) -> Eq U
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: U -> U -> Bool
$c/= :: U -> U -> Bool
== :: U -> U -> Bool
$c== :: U -> U -> Bool
Haskell.Eq, (forall x. U -> Rep U x) -> (forall x. Rep U x -> U) -> Generic U
forall x. Rep U x -> U
forall x. U -> Rep U x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep U x -> U
$cfrom :: forall x. U -> Rep U x
Generic, Typeable U
DataType
Constr
Typeable U
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> U -> c U)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c U)
-> (U -> Constr)
-> (U -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c U))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c U))
-> ((forall b. Data b => b -> b) -> U -> U)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> U -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> U -> r)
-> (forall u. (forall d. Data d => d -> u) -> U -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> U -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> U -> m U)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> U -> m U)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> U -> m U)
-> Data U
U -> DataType
U -> Constr
(forall b. Data b => b -> b) -> U -> U
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> U -> c U
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c U
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> U -> u
forall u. (forall d. Data d => d -> u) -> U -> [u]
forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> U -> r
forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> U -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> U -> m U
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> U -> m U
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c U
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> U -> c U
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c U)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c U)
$cU :: Constr
$tU :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> U -> m U
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> U -> m U
gmapMp :: (forall d. Data d => d -> m d) -> U -> m U
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> U -> m U
gmapM :: (forall d. Data d => d -> m d) -> U -> m U
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> U -> m U
gmapQi :: Int -> (forall d. Data d => d -> u) -> U -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> U -> u
gmapQ :: (forall d. Data d => d -> u) -> U -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> U -> [u]
gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> U -> r
$cgmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> U -> r
gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> U -> r
$cgmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> U -> r
gmapT :: (forall b. Data b => b -> b) -> U -> U
$cgmapT :: (forall b. Data b => b -> b) -> U -> U
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c U)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c U)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c U)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c U)
dataTypeOf :: U -> DataType
$cdataTypeOf :: U -> DataType
toConstr :: U -> Constr
$ctoConstr :: U -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c U
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c U
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> U -> c U
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> U -> c U
$cp1Data :: Typeable U
Data)
PlutusTx.makeIsDataIndexed ''U [('U, 0)]
PlutusTx.makeLift ''U

-- | "A"-side coin token
data A = A deriving Typeable A
DataType
Constr
Typeable A
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> A -> c A)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c A)
-> (A -> Constr)
-> (A -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c A))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c A))
-> ((forall b. Data b => b -> b) -> A -> A)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> A -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> A -> r)
-> (forall u. (forall d. Data d => d -> u) -> A -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> A -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> A -> m A)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> A -> m A)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> A -> m A)
-> Data A
A -> DataType
A -> Constr
(forall b. Data b => b -> b) -> A -> A
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> A -> c A
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c A
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> A -> u
forall u. (forall d. Data d => d -> u) -> A -> [u]
forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> A -> r
forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> A -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> A -> m A
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> A -> m A
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c A
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> A -> c A
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c A)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c A)
$cA :: Constr
$tA :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> A -> m A
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> A -> m A
gmapMp :: (forall d. Data d => d -> m d) -> A -> m A
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> A -> m A
gmapM :: (forall d. Data d => d -> m d) -> A -> m A
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> A -> m A
gmapQi :: Int -> (forall d. Data d => d -> u) -> A -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> A -> u
gmapQ :: (forall d. Data d => d -> u) -> A -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> A -> [u]
gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> A -> r
$cgmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> A -> r
gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> A -> r
$cgmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> A -> r
gmapT :: (forall b. Data b => b -> b) -> A -> A
$cgmapT :: (forall b. Data b => b -> b) -> A -> A
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c A)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c A)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c A)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c A)
dataTypeOf :: A -> DataType
$cdataTypeOf :: A -> DataType
toConstr :: A -> Constr
$ctoConstr :: A -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c A
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c A
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> A -> c A
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> A -> c A
$cp1Data :: Typeable A
Data
PlutusTx.makeIsDataIndexed ''A [('A, 0)]
PlutusTx.makeLift ''A

-- | "B"-side coin token
data B = B deriving Typeable B
DataType
Constr
Typeable B
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> B -> c B)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c B)
-> (B -> Constr)
-> (B -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c B))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c B))
-> ((forall b. Data b => b -> b) -> B -> B)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> B -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> B -> r)
-> (forall u. (forall d. Data d => d -> u) -> B -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> B -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> B -> m B)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> B -> m B)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> B -> m B)
-> Data B
B -> DataType
B -> Constr
(forall b. Data b => b -> b) -> B -> B
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> B -> c B
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c B
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> B -> u
forall u. (forall d. Data d => d -> u) -> B -> [u]
forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> B -> r
forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> B -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> B -> m B
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> B -> m B
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c B
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> B -> c B
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c B)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c B)
$cB :: Constr
$tB :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> B -> m B
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> B -> m B
gmapMp :: (forall d. Data d => d -> m d) -> B -> m B
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> B -> m B
gmapM :: (forall d. Data d => d -> m d) -> B -> m B
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> B -> m B
gmapQi :: Int -> (forall d. Data d => d -> u) -> B -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> B -> u
gmapQ :: (forall d. Data d => d -> u) -> B -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> B -> [u]
gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> B -> r
$cgmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> B -> r
gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> B -> r
$cgmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> B -> r
gmapT :: (forall b. Data b => b -> b) -> B -> B
$cgmapT :: (forall b. Data b => b -> b) -> B -> B
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c B)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c B)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c B)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c B)
dataTypeOf :: B -> DataType
$cdataTypeOf :: B -> DataType
toConstr :: B -> Constr
$ctoConstr :: B -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c B
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c B
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> B -> c B
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> B -> c B
$cp1Data :: Typeable B
Data
PlutusTx.makeIsDataIndexed ''B [('B, 0)]
PlutusTx.makeLift ''B

-- | Pool-state coin token
data PoolState = PoolState deriving Typeable PoolState
DataType
Constr
Typeable PoolState
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> PoolState -> c PoolState)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c PoolState)
-> (PoolState -> Constr)
-> (PoolState -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c PoolState))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c PoolState))
-> ((forall b. Data b => b -> b) -> PoolState -> PoolState)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> PoolState -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> PoolState -> r)
-> (forall u. (forall d. Data d => d -> u) -> PoolState -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> PoolState -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> PoolState -> m PoolState)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> PoolState -> m PoolState)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> PoolState -> m PoolState)
-> Data PoolState
PoolState -> DataType
PoolState -> Constr
(forall b. Data b => b -> b) -> PoolState -> PoolState
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> PoolState -> c PoolState
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c PoolState
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> PoolState -> u
forall u. (forall d. Data d => d -> u) -> PoolState -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> PoolState -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> PoolState -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> PoolState -> m PoolState
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> PoolState -> m PoolState
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c PoolState
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> PoolState -> c PoolState
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c PoolState)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c PoolState)
$cPoolState :: Constr
$tPoolState :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> PoolState -> m PoolState
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> PoolState -> m PoolState
gmapMp :: (forall d. Data d => d -> m d) -> PoolState -> m PoolState
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> PoolState -> m PoolState
gmapM :: (forall d. Data d => d -> m d) -> PoolState -> m PoolState
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> PoolState -> m PoolState
gmapQi :: Int -> (forall d. Data d => d -> u) -> PoolState -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> PoolState -> u
gmapQ :: (forall d. Data d => d -> u) -> PoolState -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> PoolState -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> PoolState -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> PoolState -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> PoolState -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> PoolState -> r
gmapT :: (forall b. Data b => b -> b) -> PoolState -> PoolState
$cgmapT :: (forall b. Data b => b -> b) -> PoolState -> PoolState
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c PoolState)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c PoolState)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c PoolState)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c PoolState)
dataTypeOf :: PoolState -> DataType
$cdataTypeOf :: PoolState -> DataType
toConstr :: PoolState -> Constr
$ctoConstr :: PoolState -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c PoolState
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c PoolState
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> PoolState -> c PoolState
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> PoolState -> c PoolState
$cp1Data :: Typeable PoolState
Data
PlutusTx.makeIsDataIndexed ''PoolState [('PoolState, 0)]
PlutusTx.makeLift ''PoolState

-- | Liquidity-state coin token
data Liquidity = Liquidity deriving Typeable Liquidity
DataType
Constr
Typeable Liquidity
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> Liquidity -> c Liquidity)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c Liquidity)
-> (Liquidity -> Constr)
-> (Liquidity -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c Liquidity))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Liquidity))
-> ((forall b. Data b => b -> b) -> Liquidity -> Liquidity)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> Liquidity -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> Liquidity -> r)
-> (forall u. (forall d. Data d => d -> u) -> Liquidity -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> Liquidity -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Liquidity -> m Liquidity)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Liquidity -> m Liquidity)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Liquidity -> m Liquidity)
-> Data Liquidity
Liquidity -> DataType
Liquidity -> Constr
(forall b. Data b => b -> b) -> Liquidity -> Liquidity
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Liquidity -> c Liquidity
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Liquidity
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> Liquidity -> u
forall u. (forall d. Data d => d -> u) -> Liquidity -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Liquidity -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Liquidity -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Liquidity -> m Liquidity
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Liquidity -> m Liquidity
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Liquidity
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Liquidity -> c Liquidity
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Liquidity)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Liquidity)
$cLiquidity :: Constr
$tLiquidity :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> Liquidity -> m Liquidity
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Liquidity -> m Liquidity
gmapMp :: (forall d. Data d => d -> m d) -> Liquidity -> m Liquidity
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Liquidity -> m Liquidity
gmapM :: (forall d. Data d => d -> m d) -> Liquidity -> m Liquidity
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Liquidity -> m Liquidity
gmapQi :: Int -> (forall d. Data d => d -> u) -> Liquidity -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Liquidity -> u
gmapQ :: (forall d. Data d => d -> u) -> Liquidity -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> Liquidity -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Liquidity -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Liquidity -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Liquidity -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Liquidity -> r
gmapT :: (forall b. Data b => b -> b) -> Liquidity -> Liquidity
$cgmapT :: (forall b. Data b => b -> b) -> Liquidity -> Liquidity
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Liquidity)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Liquidity)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c Liquidity)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Liquidity)
dataTypeOf :: Liquidity -> DataType
$cdataTypeOf :: Liquidity -> DataType
toConstr :: Liquidity -> Constr
$ctoConstr :: Liquidity -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Liquidity
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Liquidity
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Liquidity -> c Liquidity
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Liquidity -> c Liquidity
$cp1Data :: Typeable Liquidity
Data
PlutusTx.makeIsDataIndexed ''Liquidity [('Liquidity, 0)]
PlutusTx.makeLift ''Liquidity

instance OpenApi.ToSchema BuiltinByteString where
    declareNamedSchema :: Proxy BuiltinByteString -> Declare (Definitions Schema) NamedSchema
declareNamedSchema Proxy BuiltinByteString
_ = NamedSchema -> Declare (Definitions Schema) NamedSchema
forall (f :: * -> *) a. Applicative f => a -> f a
Haskell.pure (NamedSchema -> Declare (Definitions Schema) NamedSchema)
-> NamedSchema -> Declare (Definitions Schema) NamedSchema
forall a b. (a -> b) -> a -> b
$ Maybe Text -> Schema -> NamedSchema
OpenApi.NamedSchema (Text -> Maybe Text
forall a. a -> Maybe a
Just Text
"Bytes") Schema
forall a. Monoid a => a
Haskell.mempty

deriving newtype instance OpenApi.ToSchema TokenName
deriving newtype instance OpenApi.ToSchema CurrencySymbol
deriving newtype instance OpenApi.ToSchema AssetClass

-- | A single 'AssetClass'. Because we use three coins, we use a phantom type to track
-- which one is which.
newtype Coin a = Coin { Coin a -> AssetClass
unCoin :: AssetClass }
  deriving stock   (Int -> Coin a -> ShowS
[Coin a] -> ShowS
Coin a -> String
(Int -> Coin a -> ShowS)
-> (Coin a -> String) -> ([Coin a] -> ShowS) -> Show (Coin a)
forall a. Int -> Coin a -> ShowS
forall a. [Coin a] -> ShowS
forall a. Coin a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Coin a] -> ShowS
$cshowList :: forall a. [Coin a] -> ShowS
show :: Coin a -> String
$cshow :: forall a. Coin a -> String
showsPrec :: Int -> Coin a -> ShowS
$cshowsPrec :: forall a. Int -> Coin a -> ShowS
Haskell.Show, (forall x. Coin a -> Rep (Coin a) x)
-> (forall x. Rep (Coin a) x -> Coin a) -> Generic (Coin a)
forall x. Rep (Coin a) x -> Coin a
forall x. Coin a -> Rep (Coin a) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall a x. Rep (Coin a) x -> Coin a
forall a x. Coin a -> Rep (Coin a) x
$cto :: forall a x. Rep (Coin a) x -> Coin a
$cfrom :: forall a x. Coin a -> Rep (Coin a) x
Generic, Typeable (Coin a)
DataType
Constr
Typeable (Coin a)
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> Coin a -> c (Coin a))
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c (Coin a))
-> (Coin a -> Constr)
-> (Coin a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c (Coin a)))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Coin a)))
-> ((forall b. Data b => b -> b) -> Coin a -> Coin a)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> Coin a -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> Coin a -> r)
-> (forall u. (forall d. Data d => d -> u) -> Coin a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> Coin a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Coin a -> m (Coin a))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Coin a -> m (Coin a))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Coin a -> m (Coin a))
-> Data (Coin a)
Coin a -> DataType
Coin a -> Constr
(forall d. Data d => c (t d)) -> Maybe (c (Coin a))
(forall b. Data b => b -> b) -> Coin a -> Coin a
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Coin a -> c (Coin a)
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Coin a)
forall a. Data a => Typeable (Coin a)
forall a. Data a => Coin a -> DataType
forall a. Data a => Coin a -> Constr
forall a.
Data a =>
(forall b. Data b => b -> b) -> Coin a -> Coin a
forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> Coin a -> u
forall a u. Data a => (forall d. Data d => d -> u) -> Coin a -> [u]
forall a r r'.
Data a =>
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Coin a -> r
forall a r r'.
Data a =>
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Coin a -> r
forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d) -> Coin a -> m (Coin a)
forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> Coin a -> m (Coin a)
forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Coin a)
forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Coin a -> c (Coin a)
forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (Coin a))
forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Coin a))
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> Coin a -> u
forall u. (forall d. Data d => d -> u) -> Coin a -> [u]
forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Coin a -> r
forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Coin a -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Coin a -> m (Coin a)
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Coin a -> m (Coin a)
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Coin a)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Coin a -> c (Coin a)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (Coin a))
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Coin a))
$cCoin :: Constr
$tCoin :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> Coin a -> m (Coin a)
$cgmapMo :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> Coin a -> m (Coin a)
gmapMp :: (forall d. Data d => d -> m d) -> Coin a -> m (Coin a)
$cgmapMp :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> Coin a -> m (Coin a)
gmapM :: (forall d. Data d => d -> m d) -> Coin a -> m (Coin a)
$cgmapM :: forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d) -> Coin a -> m (Coin a)
gmapQi :: Int -> (forall d. Data d => d -> u) -> Coin a -> u
$cgmapQi :: forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> Coin a -> u
gmapQ :: (forall d. Data d => d -> u) -> Coin a -> [u]
$cgmapQ :: forall a u. Data a => (forall d. Data d => d -> u) -> Coin a -> [u]
gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Coin a -> r
$cgmapQr :: forall a r r'.
Data a =>
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Coin a -> r
gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Coin a -> r
$cgmapQl :: forall a r r'.
Data a =>
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Coin a -> r
gmapT :: (forall b. Data b => b -> b) -> Coin a -> Coin a
$cgmapT :: forall a.
Data a =>
(forall b. Data b => b -> b) -> Coin a -> Coin a
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Coin a))
$cdataCast2 :: forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Coin a))
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c (Coin a))
$cdataCast1 :: forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (Coin a))
dataTypeOf :: Coin a -> DataType
$cdataTypeOf :: forall a. Data a => Coin a -> DataType
toConstr :: Coin a -> Constr
$ctoConstr :: forall a. Data a => Coin a -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Coin a)
$cgunfold :: forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Coin a)
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Coin a -> c (Coin a)
$cgfoldl :: forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Coin a -> c (Coin a)
$cp1Data :: forall a. Data a => Typeable (Coin a)
Data)
  deriving newtype ([Coin a] -> Encoding
[Coin a] -> Value
Coin a -> Encoding
Coin a -> Value
(Coin a -> Value)
-> (Coin a -> Encoding)
-> ([Coin a] -> Value)
-> ([Coin a] -> Encoding)
-> ToJSON (Coin a)
forall a. [Coin a] -> Encoding
forall a. [Coin a] -> Value
forall a. Coin a -> Encoding
forall a. Coin a -> Value
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [Coin a] -> Encoding
$ctoEncodingList :: forall a. [Coin a] -> Encoding
toJSONList :: [Coin a] -> Value
$ctoJSONList :: forall a. [Coin a] -> Value
toEncoding :: Coin a -> Encoding
$ctoEncoding :: forall a. Coin a -> Encoding
toJSON :: Coin a -> Value
$ctoJSON :: forall a. Coin a -> Value
ToJSON, Value -> Parser [Coin a]
Value -> Parser (Coin a)
(Value -> Parser (Coin a))
-> (Value -> Parser [Coin a]) -> FromJSON (Coin a)
forall a. Value -> Parser [Coin a]
forall a. Value -> Parser (Coin a)
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [Coin a]
$cparseJSONList :: forall a. Value -> Parser [Coin a]
parseJSON :: Value -> Parser (Coin a)
$cparseJSON :: forall a. Value -> Parser (Coin a)
FromJSON, Coin a -> Coin a -> Bool
(Coin a -> Coin a -> Bool) -> Eq (Coin a)
forall a. Coin a -> Coin a -> Bool
forall a. (a -> a -> Bool) -> Eq a
== :: Coin a -> Coin a -> Bool
$c== :: forall a. Coin a -> Coin a -> Bool
Eq, Coin a -> Coin a -> Bool
(Coin a -> Coin a -> Bool)
-> (Coin a -> Coin a -> Bool) -> Eq (Coin a)
forall a. Coin a -> Coin a -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Coin a -> Coin a -> Bool
$c/= :: forall a. Coin a -> Coin a -> Bool
== :: Coin a -> Coin a -> Bool
$c== :: forall a. Coin a -> Coin a -> Bool
Haskell.Eq, Eq (Coin a)
Eq (Coin a)
-> (Coin a -> Coin a -> Ordering)
-> (Coin a -> Coin a -> Bool)
-> (Coin a -> Coin a -> Bool)
-> (Coin a -> Coin a -> Bool)
-> (Coin a -> Coin a -> Bool)
-> (Coin a -> Coin a -> Coin a)
-> (Coin a -> Coin a -> Coin a)
-> Ord (Coin a)
Coin a -> Coin a -> Bool
Coin a -> Coin a -> Ordering
Coin a -> Coin a -> Coin a
forall a. Eq (Coin a)
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
forall a. Coin a -> Coin a -> Bool
forall a. Coin a -> Coin a -> Ordering
forall a. Coin a -> Coin a -> Coin a
min :: Coin a -> Coin a -> Coin a
$cmin :: forall a. Coin a -> Coin a -> Coin a
max :: Coin a -> Coin a -> Coin a
$cmax :: forall a. Coin a -> Coin a -> Coin a
>= :: Coin a -> Coin a -> Bool
$c>= :: forall a. Coin a -> Coin a -> Bool
> :: Coin a -> Coin a -> Bool
$c> :: forall a. Coin a -> Coin a -> Bool
<= :: Coin a -> Coin a -> Bool
$c<= :: forall a. Coin a -> Coin a -> Bool
< :: Coin a -> Coin a -> Bool
$c< :: forall a. Coin a -> Coin a -> Bool
compare :: Coin a -> Coin a -> Ordering
$ccompare :: forall a. Coin a -> Coin a -> Ordering
$cp1Ord :: forall a. Eq (Coin a)
Haskell.Ord, Typeable (Coin a)
Typeable (Coin a)
-> (Proxy (Coin a) -> Declare (Definitions Schema) NamedSchema)
-> ToSchema (Coin a)
Proxy (Coin a) -> Declare (Definitions Schema) NamedSchema
forall a. Typeable a => Typeable (Coin a)
forall a.
Typeable a =>
Proxy (Coin a) -> Declare (Definitions Schema) NamedSchema
forall a.
Typeable a
-> (Proxy a -> Declare (Definitions Schema) NamedSchema)
-> ToSchema a
declareNamedSchema :: Proxy (Coin a) -> Declare (Definitions Schema) NamedSchema
$cdeclareNamedSchema :: forall a.
Typeable a =>
Proxy (Coin a) -> Declare (Definitions Schema) NamedSchema
$cp1ToSchema :: forall a. Typeable a => Typeable (Coin a)
OpenApi.ToSchema)
PlutusTx.makeIsDataIndexed ''Coin [('Coin, 0)]
PlutusTx.makeLift ''Coin

-- | Likewise for 'Integer'; the corresponding amount we have of the
-- particular 'Coin'.
newtype Amount a = Amount { Amount a -> Integer
unAmount :: Integer }
  deriving stock   (Int -> Amount a -> ShowS
[Amount a] -> ShowS
Amount a -> String
(Int -> Amount a -> ShowS)
-> (Amount a -> String) -> ([Amount a] -> ShowS) -> Show (Amount a)
forall a. Int -> Amount a -> ShowS
forall a. [Amount a] -> ShowS
forall a. Amount a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Amount a] -> ShowS
$cshowList :: forall a. [Amount a] -> ShowS
show :: Amount a -> String
$cshow :: forall a. Amount a -> String
showsPrec :: Int -> Amount a -> ShowS
$cshowsPrec :: forall a. Int -> Amount a -> ShowS
Haskell.Show, (forall x. Amount a -> Rep (Amount a) x)
-> (forall x. Rep (Amount a) x -> Amount a) -> Generic (Amount a)
forall x. Rep (Amount a) x -> Amount a
forall x. Amount a -> Rep (Amount a) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall a x. Rep (Amount a) x -> Amount a
forall a x. Amount a -> Rep (Amount a) x
$cto :: forall a x. Rep (Amount a) x -> Amount a
$cfrom :: forall a x. Amount a -> Rep (Amount a) x
Generic, Typeable (Amount a)
DataType
Constr
Typeable (Amount a)
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> Amount a -> c (Amount a))
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c (Amount a))
-> (Amount a -> Constr)
-> (Amount a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c (Amount a)))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c (Amount a)))
-> ((forall b. Data b => b -> b) -> Amount a -> Amount a)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> Amount a -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> Amount a -> r)
-> (forall u. (forall d. Data d => d -> u) -> Amount a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> Amount a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Amount a -> m (Amount a))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Amount a -> m (Amount a))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Amount a -> m (Amount a))
-> Data (Amount a)
Amount a -> DataType
Amount a -> Constr
(forall d. Data d => c (t d)) -> Maybe (c (Amount a))
(forall b. Data b => b -> b) -> Amount a -> Amount a
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Amount a -> c (Amount a)
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Amount a)
forall a. Data a => Typeable (Amount a)
forall a. Data a => Amount a -> DataType
forall a. Data a => Amount a -> Constr
forall a.
Data a =>
(forall b. Data b => b -> b) -> Amount a -> Amount a
forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> Amount a -> u
forall a u.
Data a =>
(forall d. Data d => d -> u) -> Amount a -> [u]
forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Amount a -> r
forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Amount a -> r
forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d) -> Amount a -> m (Amount a)
forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> Amount a -> m (Amount a)
forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Amount a)
forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Amount a -> c (Amount a)
forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (Amount a))
forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Amount a))
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> Amount a -> u
forall u. (forall d. Data d => d -> u) -> Amount a -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Amount a -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Amount a -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Amount a -> m (Amount a)
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Amount a -> m (Amount a)
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Amount a)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Amount a -> c (Amount a)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (Amount a))
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Amount a))
$cAmount :: Constr
$tAmount :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> Amount a -> m (Amount a)
$cgmapMo :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> Amount a -> m (Amount a)
gmapMp :: (forall d. Data d => d -> m d) -> Amount a -> m (Amount a)
$cgmapMp :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> Amount a -> m (Amount a)
gmapM :: (forall d. Data d => d -> m d) -> Amount a -> m (Amount a)
$cgmapM :: forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d) -> Amount a -> m (Amount a)
gmapQi :: Int -> (forall d. Data d => d -> u) -> Amount a -> u
$cgmapQi :: forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> Amount a -> u
gmapQ :: (forall d. Data d => d -> u) -> Amount a -> [u]
$cgmapQ :: forall a u.
Data a =>
(forall d. Data d => d -> u) -> Amount a -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Amount a -> r
$cgmapQr :: forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Amount a -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Amount a -> r
$cgmapQl :: forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Amount a -> r
gmapT :: (forall b. Data b => b -> b) -> Amount a -> Amount a
$cgmapT :: forall a.
Data a =>
(forall b. Data b => b -> b) -> Amount a -> Amount a
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Amount a))
$cdataCast2 :: forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Amount a))
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c (Amount a))
$cdataCast1 :: forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (Amount a))
dataTypeOf :: Amount a -> DataType
$cdataTypeOf :: forall a. Data a => Amount a -> DataType
toConstr :: Amount a -> Constr
$ctoConstr :: forall a. Data a => Amount a -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Amount a)
$cgunfold :: forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Amount a)
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Amount a -> c (Amount a)
$cgfoldl :: forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Amount a -> c (Amount a)
$cp1Data :: forall a. Data a => Typeable (Amount a)
Data)
  deriving newtype ([Amount a] -> Encoding
[Amount a] -> Value
Amount a -> Encoding
Amount a -> Value
(Amount a -> Value)
-> (Amount a -> Encoding)
-> ([Amount a] -> Value)
-> ([Amount a] -> Encoding)
-> ToJSON (Amount a)
forall a. [Amount a] -> Encoding
forall a. [Amount a] -> Value
forall a. Amount a -> Encoding
forall a. Amount a -> Value
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [Amount a] -> Encoding
$ctoEncodingList :: forall a. [Amount a] -> Encoding
toJSONList :: [Amount a] -> Value
$ctoJSONList :: forall a. [Amount a] -> Value
toEncoding :: Amount a -> Encoding
$ctoEncoding :: forall a. Amount a -> Encoding
toJSON :: Amount a -> Value
$ctoJSON :: forall a. Amount a -> Value
ToJSON, Value -> Parser [Amount a]
Value -> Parser (Amount a)
(Value -> Parser (Amount a))
-> (Value -> Parser [Amount a]) -> FromJSON (Amount a)
forall a. Value -> Parser [Amount a]
forall a. Value -> Parser (Amount a)
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [Amount a]
$cparseJSONList :: forall a. Value -> Parser [Amount a]
parseJSON :: Value -> Parser (Amount a)
$cparseJSON :: forall a. Value -> Parser (Amount a)
FromJSON, Amount a -> Amount a -> Bool
(Amount a -> Amount a -> Bool) -> Eq (Amount a)
forall a. Amount a -> Amount a -> Bool
forall a. (a -> a -> Bool) -> Eq a
== :: Amount a -> Amount a -> Bool
$c== :: forall a. Amount a -> Amount a -> Bool
Eq, Eq (Amount a)
Eq (Amount a)
-> (Amount a -> Amount a -> Ordering)
-> (Amount a -> Amount a -> Bool)
-> (Amount a -> Amount a -> Bool)
-> (Amount a -> Amount a -> Bool)
-> (Amount a -> Amount a -> Bool)
-> (Amount a -> Amount a -> Amount a)
-> (Amount a -> Amount a -> Amount a)
-> Ord (Amount a)
Amount a -> Amount a -> Bool
Amount a -> Amount a -> Ordering
Amount a -> Amount a -> Amount a
forall a. Eq (Amount a)
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
forall a. Amount a -> Amount a -> Bool
forall a. Amount a -> Amount a -> Ordering
forall a. Amount a -> Amount a -> Amount a
min :: Amount a -> Amount a -> Amount a
$cmin :: forall a. Amount a -> Amount a -> Amount a
max :: Amount a -> Amount a -> Amount a
$cmax :: forall a. Amount a -> Amount a -> Amount a
>= :: Amount a -> Amount a -> Bool
$c>= :: forall a. Amount a -> Amount a -> Bool
> :: Amount a -> Amount a -> Bool
$c> :: forall a. Amount a -> Amount a -> Bool
<= :: Amount a -> Amount a -> Bool
$c<= :: forall a. Amount a -> Amount a -> Bool
< :: Amount a -> Amount a -> Bool
$c< :: forall a. Amount a -> Amount a -> Bool
compare :: Amount a -> Amount a -> Ordering
$ccompare :: forall a. Amount a -> Amount a -> Ordering
$cp1Ord :: forall a. Eq (Amount a)
Ord, Amount a -> ModifierParser
Amount a -> FieldFormatter
(Amount a -> FieldFormatter)
-> (Amount a -> ModifierParser) -> PrintfArg (Amount a)
forall a. Amount a -> ModifierParser
forall a. Amount a -> FieldFormatter
forall a.
(a -> FieldFormatter) -> (a -> ModifierParser) -> PrintfArg a
parseFormat :: Amount a -> ModifierParser
$cparseFormat :: forall a. Amount a -> ModifierParser
formatArg :: Amount a -> FieldFormatter
$cformatArg :: forall a. Amount a -> FieldFormatter
PrintfArg)
  deriving newtype (Amount a -> Amount a -> Bool
(Amount a -> Amount a -> Bool)
-> (Amount a -> Amount a -> Bool) -> Eq (Amount a)
forall a. Amount a -> Amount a -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Amount a -> Amount a -> Bool
$c/= :: forall a. Amount a -> Amount a -> Bool
== :: Amount a -> Amount a -> Bool
$c== :: forall a. Amount a -> Amount a -> Bool
Haskell.Eq, Eq (Amount a)
Eq (Amount a)
-> (Amount a -> Amount a -> Ordering)
-> (Amount a -> Amount a -> Bool)
-> (Amount a -> Amount a -> Bool)
-> (Amount a -> Amount a -> Bool)
-> (Amount a -> Amount a -> Bool)
-> (Amount a -> Amount a -> Amount a)
-> (Amount a -> Amount a -> Amount a)
-> Ord (Amount a)
Amount a -> Amount a -> Bool
Amount a -> Amount a -> Ordering
Amount a -> Amount a -> Amount a
forall a. Eq (Amount a)
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
forall a. Amount a -> Amount a -> Bool
forall a. Amount a -> Amount a -> Ordering
forall a. Amount a -> Amount a -> Amount a
min :: Amount a -> Amount a -> Amount a
$cmin :: forall a. Amount a -> Amount a -> Amount a
max :: Amount a -> Amount a -> Amount a
$cmax :: forall a. Amount a -> Amount a -> Amount a
>= :: Amount a -> Amount a -> Bool
$c>= :: forall a. Amount a -> Amount a -> Bool
> :: Amount a -> Amount a -> Bool
$c> :: forall a. Amount a -> Amount a -> Bool
<= :: Amount a -> Amount a -> Bool
$c<= :: forall a. Amount a -> Amount a -> Bool
< :: Amount a -> Amount a -> Bool
$c< :: forall a. Amount a -> Amount a -> Bool
compare :: Amount a -> Amount a -> Ordering
$ccompare :: forall a. Amount a -> Amount a -> Ordering
$cp1Ord :: forall a. Eq (Amount a)
Haskell.Ord, Integer -> Amount a
Amount a -> Amount a
Amount a -> Amount a -> Amount a
(Amount a -> Amount a -> Amount a)
-> (Amount a -> Amount a -> Amount a)
-> (Amount a -> Amount a -> Amount a)
-> (Amount a -> Amount a)
-> (Amount a -> Amount a)
-> (Amount a -> Amount a)
-> (Integer -> Amount a)
-> Num (Amount a)
forall a. Integer -> Amount a
forall a. Amount a -> Amount a
forall a. Amount a -> Amount a -> Amount a
forall a.
(a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a)
-> (a -> a)
-> (a -> a)
-> (Integer -> a)
-> Num a
fromInteger :: Integer -> Amount a
$cfromInteger :: forall a. Integer -> Amount a
signum :: Amount a -> Amount a
$csignum :: forall a. Amount a -> Amount a
abs :: Amount a -> Amount a
$cabs :: forall a. Amount a -> Amount a
negate :: Amount a -> Amount a
$cnegate :: forall a. Amount a -> Amount a
* :: Amount a -> Amount a -> Amount a
$c* :: forall a. Amount a -> Amount a -> Amount a
- :: Amount a -> Amount a -> Amount a
$c- :: forall a. Amount a -> Amount a -> Amount a
+ :: Amount a -> Amount a -> Amount a
$c+ :: forall a. Amount a -> Amount a -> Amount a
Haskell.Num)
  deriving newtype (AdditiveMonoid (Amount a)
AdditiveMonoid (Amount a)
-> (Amount a -> Amount a -> Amount a) -> AdditiveGroup (Amount a)
Amount a -> Amount a -> Amount a
forall a. AdditiveMonoid (Amount a)
forall a. AdditiveMonoid a -> (a -> a -> a) -> AdditiveGroup a
forall a. Amount a -> Amount a -> Amount a
- :: Amount a -> Amount a -> Amount a
$c- :: forall a. Amount a -> Amount a -> Amount a
$cp1AdditiveGroup :: forall a. AdditiveMonoid (Amount a)
AdditiveGroup, AdditiveSemigroup (Amount a)
Amount a
AdditiveSemigroup (Amount a)
-> Amount a -> AdditiveMonoid (Amount a)
forall a. AdditiveSemigroup (Amount a)
forall a. Amount a
forall a. AdditiveSemigroup a -> a -> AdditiveMonoid a
zero :: Amount a
$czero :: forall a. Amount a
$cp1AdditiveMonoid :: forall a. AdditiveSemigroup (Amount a)
AdditiveMonoid, Amount a -> Amount a -> Amount a
(Amount a -> Amount a -> Amount a) -> AdditiveSemigroup (Amount a)
forall a. Amount a -> Amount a -> Amount a
forall a. (a -> a -> a) -> AdditiveSemigroup a
+ :: Amount a -> Amount a -> Amount a
$c+ :: forall a. Amount a -> Amount a -> Amount a
AdditiveSemigroup, Amount a -> Amount a -> Amount a
(Amount a -> Amount a -> Amount a)
-> MultiplicativeSemigroup (Amount a)
forall a. Amount a -> Amount a -> Amount a
forall a. (a -> a -> a) -> MultiplicativeSemigroup a
* :: Amount a -> Amount a -> Amount a
$c* :: forall a. Amount a -> Amount a -> Amount a
MultiplicativeSemigroup)
PlutusTx.makeIsDataIndexed ''Amount [('Amount, 0)]
PlutusTx.makeLift ''Amount

{-# INLINABLE valueOf #-}
valueOf :: Coin a -> Amount a -> Value
valueOf :: Coin a -> Amount a -> Value
valueOf Coin a
c Amount a
a = AssetClass -> Integer -> Value
assetClassValue (Coin a -> AssetClass
forall a. Coin a -> AssetClass
unCoin Coin a
c) (Amount a -> Integer
forall a. Amount a -> Integer
unAmount Amount a
a)

{-# INLINABLE unitValue #-}
unitValue :: Coin a -> Value
unitValue :: Coin a -> Value
unitValue Coin a
c = Coin a -> Amount a -> Value
forall a. Coin a -> Amount a -> Value
valueOf Coin a
c Amount a
1

{-# INLINABLE isUnity #-}
isUnity :: Value -> Coin a -> Bool
isUnity :: Value -> Coin a -> Bool
isUnity Value
v Coin a
c = Value -> Coin a -> Amount a
forall a. Value -> Coin a -> Amount a
amountOf Value
v Coin a
c Amount a -> Amount a -> Bool
forall a. Eq a => a -> a -> Bool
== Amount a
1

{-# INLINABLE amountOf #-}
amountOf :: Value -> Coin a -> Amount a
amountOf :: Value -> Coin a -> Amount a
amountOf Value
v = Integer -> Amount a
forall a. Integer -> Amount a
Amount (Integer -> Amount a) -> (Coin a -> Integer) -> Coin a -> Amount a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Value -> AssetClass -> Integer
assetClassValueOf Value
v (AssetClass -> Integer)
-> (Coin a -> AssetClass) -> Coin a -> Integer
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Coin a -> AssetClass
forall a. Coin a -> AssetClass
unCoin

{-# INLINABLE mkCoin #-}
mkCoin:: CurrencySymbol -> TokenName -> Coin a
mkCoin :: CurrencySymbol -> TokenName -> Coin a
mkCoin CurrencySymbol
c = AssetClass -> Coin a
forall a. AssetClass -> Coin a
Coin (AssetClass -> Coin a)
-> (TokenName -> AssetClass) -> TokenName -> Coin a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CurrencySymbol -> TokenName -> AssetClass
assetClass CurrencySymbol
c

newtype Uniswap = Uniswap
    { Uniswap -> Coin U
usCoin :: Coin U
    } deriving stock    (Int -> Uniswap -> ShowS
[Uniswap] -> ShowS
Uniswap -> String
(Int -> Uniswap -> ShowS)
-> (Uniswap -> String) -> ([Uniswap] -> ShowS) -> Show Uniswap
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Uniswap] -> ShowS
$cshowList :: [Uniswap] -> ShowS
show :: Uniswap -> String
$cshow :: Uniswap -> String
showsPrec :: Int -> Uniswap -> ShowS
$cshowsPrec :: Int -> Uniswap -> ShowS
Haskell.Show, (forall x. Uniswap -> Rep Uniswap x)
-> (forall x. Rep Uniswap x -> Uniswap) -> Generic Uniswap
forall x. Rep Uniswap x -> Uniswap
forall x. Uniswap -> Rep Uniswap x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Uniswap x -> Uniswap
$cfrom :: forall x. Uniswap -> Rep Uniswap x
Generic, Typeable Uniswap
DataType
Constr
Typeable Uniswap
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> Uniswap -> c Uniswap)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c Uniswap)
-> (Uniswap -> Constr)
-> (Uniswap -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c Uniswap))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Uniswap))
-> ((forall b. Data b => b -> b) -> Uniswap -> Uniswap)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> Uniswap -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> Uniswap -> r)
-> (forall u. (forall d. Data d => d -> u) -> Uniswap -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> Uniswap -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Uniswap -> m Uniswap)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Uniswap -> m Uniswap)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Uniswap -> m Uniswap)
-> Data Uniswap
Uniswap -> DataType
Uniswap -> Constr
(forall b. Data b => b -> b) -> Uniswap -> Uniswap
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Uniswap -> c Uniswap
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Uniswap
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> Uniswap -> u
forall u. (forall d. Data d => d -> u) -> Uniswap -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Uniswap -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Uniswap -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Uniswap -> m Uniswap
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Uniswap -> m Uniswap
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Uniswap
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Uniswap -> c Uniswap
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Uniswap)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Uniswap)
$cUniswap :: Constr
$tUniswap :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> Uniswap -> m Uniswap
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Uniswap -> m Uniswap
gmapMp :: (forall d. Data d => d -> m d) -> Uniswap -> m Uniswap
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Uniswap -> m Uniswap
gmapM :: (forall d. Data d => d -> m d) -> Uniswap -> m Uniswap
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Uniswap -> m Uniswap
gmapQi :: Int -> (forall d. Data d => d -> u) -> Uniswap -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Uniswap -> u
gmapQ :: (forall d. Data d => d -> u) -> Uniswap -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> Uniswap -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Uniswap -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Uniswap -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Uniswap -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Uniswap -> r
gmapT :: (forall b. Data b => b -> b) -> Uniswap -> Uniswap
$cgmapT :: (forall b. Data b => b -> b) -> Uniswap -> Uniswap
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Uniswap)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Uniswap)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c Uniswap)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Uniswap)
dataTypeOf :: Uniswap -> DataType
$cdataTypeOf :: Uniswap -> DataType
toConstr :: Uniswap -> Constr
$ctoConstr :: Uniswap -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Uniswap
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Uniswap
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Uniswap -> c Uniswap
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Uniswap -> c Uniswap
$cp1Data :: Typeable Uniswap
Data)
      deriving anyclass ([Uniswap] -> Encoding
[Uniswap] -> Value
Uniswap -> Encoding
Uniswap -> Value
(Uniswap -> Value)
-> (Uniswap -> Encoding)
-> ([Uniswap] -> Value)
-> ([Uniswap] -> Encoding)
-> ToJSON Uniswap
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [Uniswap] -> Encoding
$ctoEncodingList :: [Uniswap] -> Encoding
toJSONList :: [Uniswap] -> Value
$ctoJSONList :: [Uniswap] -> Value
toEncoding :: Uniswap -> Encoding
$ctoEncoding :: Uniswap -> Encoding
toJSON :: Uniswap -> Value
$ctoJSON :: Uniswap -> Value
ToJSON, Value -> Parser [Uniswap]
Value -> Parser Uniswap
(Value -> Parser Uniswap)
-> (Value -> Parser [Uniswap]) -> FromJSON Uniswap
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [Uniswap]
$cparseJSONList :: Value -> Parser [Uniswap]
parseJSON :: Value -> Parser Uniswap
$cparseJSON :: Value -> Parser Uniswap
FromJSON, Typeable Uniswap
Typeable Uniswap
-> (Proxy Uniswap -> Declare (Definitions Schema) NamedSchema)
-> ToSchema Uniswap
Proxy Uniswap -> Declare (Definitions Schema) NamedSchema
forall a.
Typeable a
-> (Proxy a -> Declare (Definitions Schema) NamedSchema)
-> ToSchema a
declareNamedSchema :: Proxy Uniswap -> Declare (Definitions Schema) NamedSchema
$cdeclareNamedSchema :: Proxy Uniswap -> Declare (Definitions Schema) NamedSchema
$cp1ToSchema :: Typeable Uniswap
OpenApi.ToSchema)
      deriving newtype  (Uniswap -> Uniswap -> Bool
(Uniswap -> Uniswap -> Bool)
-> (Uniswap -> Uniswap -> Bool) -> Eq Uniswap
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Uniswap -> Uniswap -> Bool
$c/= :: Uniswap -> Uniswap -> Bool
== :: Uniswap -> Uniswap -> Bool
$c== :: Uniswap -> Uniswap -> Bool
Haskell.Eq, Eq Uniswap
Eq Uniswap
-> (Uniswap -> Uniswap -> Ordering)
-> (Uniswap -> Uniswap -> Bool)
-> (Uniswap -> Uniswap -> Bool)
-> (Uniswap -> Uniswap -> Bool)
-> (Uniswap -> Uniswap -> Bool)
-> (Uniswap -> Uniswap -> Uniswap)
-> (Uniswap -> Uniswap -> Uniswap)
-> Ord Uniswap
Uniswap -> Uniswap -> Bool
Uniswap -> Uniswap -> Ordering
Uniswap -> Uniswap -> Uniswap
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: Uniswap -> Uniswap -> Uniswap
$cmin :: Uniswap -> Uniswap -> Uniswap
max :: Uniswap -> Uniswap -> Uniswap
$cmax :: Uniswap -> Uniswap -> Uniswap
>= :: Uniswap -> Uniswap -> Bool
$c>= :: Uniswap -> Uniswap -> Bool
> :: Uniswap -> Uniswap -> Bool
$c> :: Uniswap -> Uniswap -> Bool
<= :: Uniswap -> Uniswap -> Bool
$c<= :: Uniswap -> Uniswap -> Bool
< :: Uniswap -> Uniswap -> Bool
$c< :: Uniswap -> Uniswap -> Bool
compare :: Uniswap -> Uniswap -> Ordering
$ccompare :: Uniswap -> Uniswap -> Ordering
$cp1Ord :: Eq Uniswap
Haskell.Ord)
PlutusTx.makeIsDataIndexed ''Uniswap [('Uniswap, 0)]
PlutusTx.makeLift ''Uniswap

data LiquidityPool = LiquidityPool
    { LiquidityPool -> Coin A
lpCoinA :: Coin A
    , LiquidityPool -> Coin B
lpCoinB :: Coin B
    }
    deriving (Int -> LiquidityPool -> ShowS
[LiquidityPool] -> ShowS
LiquidityPool -> String
(Int -> LiquidityPool -> ShowS)
-> (LiquidityPool -> String)
-> ([LiquidityPool] -> ShowS)
-> Show LiquidityPool
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LiquidityPool] -> ShowS
$cshowList :: [LiquidityPool] -> ShowS
show :: LiquidityPool -> String
$cshow :: LiquidityPool -> String
showsPrec :: Int -> LiquidityPool -> ShowS
$cshowsPrec :: Int -> LiquidityPool -> ShowS
Haskell.Show, (forall x. LiquidityPool -> Rep LiquidityPool x)
-> (forall x. Rep LiquidityPool x -> LiquidityPool)
-> Generic LiquidityPool
forall x. Rep LiquidityPool x -> LiquidityPool
forall x. LiquidityPool -> Rep LiquidityPool x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LiquidityPool x -> LiquidityPool
$cfrom :: forall x. LiquidityPool -> Rep LiquidityPool x
Generic, [LiquidityPool] -> Encoding
[LiquidityPool] -> Value
LiquidityPool -> Encoding
LiquidityPool -> Value
(LiquidityPool -> Value)
-> (LiquidityPool -> Encoding)
-> ([LiquidityPool] -> Value)
-> ([LiquidityPool] -> Encoding)
-> ToJSON LiquidityPool
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [LiquidityPool] -> Encoding
$ctoEncodingList :: [LiquidityPool] -> Encoding
toJSONList :: [LiquidityPool] -> Value
$ctoJSONList :: [LiquidityPool] -> Value
toEncoding :: LiquidityPool -> Encoding
$ctoEncoding :: LiquidityPool -> Encoding
toJSON :: LiquidityPool -> Value
$ctoJSON :: LiquidityPool -> Value
ToJSON, Value -> Parser [LiquidityPool]
Value -> Parser LiquidityPool
(Value -> Parser LiquidityPool)
-> (Value -> Parser [LiquidityPool]) -> FromJSON LiquidityPool
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [LiquidityPool]
$cparseJSONList :: Value -> Parser [LiquidityPool]
parseJSON :: Value -> Parser LiquidityPool
$cparseJSON :: Value -> Parser LiquidityPool
FromJSON, Typeable LiquidityPool
DataType
Constr
Typeable LiquidityPool
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> LiquidityPool -> c LiquidityPool)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c LiquidityPool)
-> (LiquidityPool -> Constr)
-> (LiquidityPool -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c LiquidityPool))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c LiquidityPool))
-> ((forall b. Data b => b -> b) -> LiquidityPool -> LiquidityPool)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> LiquidityPool -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> LiquidityPool -> r)
-> (forall u. (forall d. Data d => d -> u) -> LiquidityPool -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> LiquidityPool -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> LiquidityPool -> m LiquidityPool)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> LiquidityPool -> m LiquidityPool)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> LiquidityPool -> m LiquidityPool)
-> Data LiquidityPool
LiquidityPool -> DataType
LiquidityPool -> Constr
(forall b. Data b => b -> b) -> LiquidityPool -> LiquidityPool
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> LiquidityPool -> c LiquidityPool
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c LiquidityPool
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> LiquidityPool -> u
forall u. (forall d. Data d => d -> u) -> LiquidityPool -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> LiquidityPool -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> LiquidityPool -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> LiquidityPool -> m LiquidityPool
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> LiquidityPool -> m LiquidityPool
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c LiquidityPool
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> LiquidityPool -> c LiquidityPool
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c LiquidityPool)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c LiquidityPool)
$cLiquidityPool :: Constr
$tLiquidityPool :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> LiquidityPool -> m LiquidityPool
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> LiquidityPool -> m LiquidityPool
gmapMp :: (forall d. Data d => d -> m d) -> LiquidityPool -> m LiquidityPool
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> LiquidityPool -> m LiquidityPool
gmapM :: (forall d. Data d => d -> m d) -> LiquidityPool -> m LiquidityPool
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> LiquidityPool -> m LiquidityPool
gmapQi :: Int -> (forall d. Data d => d -> u) -> LiquidityPool -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> LiquidityPool -> u
gmapQ :: (forall d. Data d => d -> u) -> LiquidityPool -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> LiquidityPool -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> LiquidityPool -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> LiquidityPool -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> LiquidityPool -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> LiquidityPool -> r
gmapT :: (forall b. Data b => b -> b) -> LiquidityPool -> LiquidityPool
$cgmapT :: (forall b. Data b => b -> b) -> LiquidityPool -> LiquidityPool
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c LiquidityPool)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c LiquidityPool)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c LiquidityPool)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c LiquidityPool)
dataTypeOf :: LiquidityPool -> DataType
$cdataTypeOf :: LiquidityPool -> DataType
toConstr :: LiquidityPool -> Constr
$ctoConstr :: LiquidityPool -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c LiquidityPool
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c LiquidityPool
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> LiquidityPool -> c LiquidityPool
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> LiquidityPool -> c LiquidityPool
$cp1Data :: Typeable LiquidityPool
Data)
PlutusTx.makeIsDataIndexed ''LiquidityPool [('LiquidityPool, 0)]
PlutusTx.makeLift ''LiquidityPool

instance Eq LiquidityPool where
    {-# INLINABLE (==) #-}
    LiquidityPool
x == :: LiquidityPool -> LiquidityPool -> Bool
== LiquidityPool
y = (LiquidityPool -> Coin A
lpCoinA LiquidityPool
x Coin A -> Coin A -> Bool
forall a. Eq a => a -> a -> Bool
== LiquidityPool -> Coin A
lpCoinA LiquidityPool
y Bool -> Bool -> Bool
&& LiquidityPool -> Coin B
lpCoinB LiquidityPool
x Coin B -> Coin B -> Bool
forall a. Eq a => a -> a -> Bool
== LiquidityPool -> Coin B
lpCoinB LiquidityPool
y) Bool -> Bool -> Bool
||
              -- Make sure the underlying coins aren't equal.
             (Coin A -> AssetClass
forall a. Coin a -> AssetClass
unCoin (LiquidityPool -> Coin A
lpCoinA LiquidityPool
x) AssetClass -> AssetClass -> Bool
forall a. Eq a => a -> a -> Bool
== Coin B -> AssetClass
forall a. Coin a -> AssetClass
unCoin (LiquidityPool -> Coin B
lpCoinB LiquidityPool
y) Bool -> Bool -> Bool
&& Coin B -> AssetClass
forall a. Coin a -> AssetClass
unCoin (LiquidityPool -> Coin B
lpCoinB LiquidityPool
x) AssetClass -> AssetClass -> Bool
forall a. Eq a => a -> a -> Bool
== Coin A -> AssetClass
forall a. Coin a -> AssetClass
unCoin (LiquidityPool -> Coin A
lpCoinA LiquidityPool
y))

data UniswapAction = Create LiquidityPool | Close | Swap | Remove | Add
    deriving Int -> UniswapAction -> ShowS
[UniswapAction] -> ShowS
UniswapAction -> String
(Int -> UniswapAction -> ShowS)
-> (UniswapAction -> String)
-> ([UniswapAction] -> ShowS)
-> Show UniswapAction
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UniswapAction] -> ShowS
$cshowList :: [UniswapAction] -> ShowS
show :: UniswapAction -> String
$cshow :: UniswapAction -> String
showsPrec :: Int -> UniswapAction -> ShowS
$cshowsPrec :: Int -> UniswapAction -> ShowS
Haskell.Show
PlutusTx.makeIsDataIndexed ''UniswapAction [ ('Create , 0)
                                           , ('Close,   1)
                                           , ('Swap,    2)
                                           , ('Remove,  3)
                                           , ('Add,     4)
                                           ]
PlutusTx.makeLift ''UniswapAction

data UniswapDatum =
      Factory [LiquidityPool]
    | Pool LiquidityPool (Amount Liquidity)
    deriving stock (Int -> UniswapDatum -> ShowS
[UniswapDatum] -> ShowS
UniswapDatum -> String
(Int -> UniswapDatum -> ShowS)
-> (UniswapDatum -> String)
-> ([UniswapDatum] -> ShowS)
-> Show UniswapDatum
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UniswapDatum] -> ShowS
$cshowList :: [UniswapDatum] -> ShowS
show :: UniswapDatum -> String
$cshow :: UniswapDatum -> String
showsPrec :: Int -> UniswapDatum -> ShowS
$cshowsPrec :: Int -> UniswapDatum -> ShowS
Haskell.Show)
PlutusTx.makeIsDataIndexed ''UniswapDatum [ ('Factory, 0)
                                          , ('Pool,    1)
                                          ]
PlutusTx.makeLift ''UniswapDatum