| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Plutarch.LedgerApi.Value
Synopsis
- newtype PRawValue (s :: S) = PRawValue (Term s (PUnsortedMap PCurrencySymbol (PUnsortedMap PTokenName PInteger)))
- data PSortedValue (s :: S)
- data PLedgerValue (s :: S)
- newtype PCurrencySymbol (s :: S) = PCurrencySymbol (Term s PByteString)
- newtype PTokenName (s :: S) = PTokenName (Term s PByteString)
- newtype PLovelace (s :: S) = PLovelace (Term s PInteger)
- newtype PAssetClass (s :: S) = PAssetClass (Term s (PBuiltinPair (PAsData PCurrencySymbol) (PAsData PTokenName)))
- pemptyRawValue :: forall (s :: S). Term s PRawValue
- psingletonRawValue :: forall (s :: S). Term s (PCurrencySymbol :--> (PTokenName :--> (PInteger :--> PRawValue)))
- psingletonRawValueData :: forall (s :: S). Term s (PAsData PCurrencySymbol :--> (PAsData PTokenName :--> (PAsData PInteger :--> PRawValue)))
- pemptySortedValue :: forall (s :: S). Term s PSortedValue
- psingletonSortedValue :: forall (s :: S). Term s (PCurrencySymbol :--> (PTokenName :--> (PInteger :--> PSortedValue)))
- psingletonSortedValueData :: forall (s :: S). Term s (PAsData PCurrencySymbol :--> (PAsData PTokenName :--> (PAsData PInteger :--> PSortedValue)))
- pemptyLedgerValue :: forall (s :: S). Term s PLedgerValue
- psingletonLedgerValue :: forall (s :: S). Term s (PCurrencySymbol :--> (PTokenName :--> (PInteger :--> PLedgerValue)))
- psingletonLedgerValueData :: forall (s :: S). Term s (PAsData PCurrencySymbol :--> (PAsData PTokenName :--> (PAsData PInteger :--> PLedgerValue)))
- padaSymbol :: forall (s :: S). Term s PCurrencySymbol
- padaSymbolData :: forall (s :: S). Term s (PAsData PCurrencySymbol)
- padaToken :: forall (s :: S). Term s PTokenName
- passertSorted :: forall (s :: S). Term s (PRawValue :--> PSortedValue)
- ppromoteToSortedValue :: forall (s :: S). Term s (PRawValue :--> PSortedValue)
- pforgetSorted :: forall (s :: S). Term s PSortedValue -> Term s PRawValue
- ptoLedgerValue :: forall (s :: S). Term s (PSortedValue :--> PLedgerValue)
- plt :: forall (s :: S). Term s PSortedValue -> Term s PSortedValue -> Term s PBool
- pleq :: forall (s :: S). Term s PSortedValue -> Term s PSortedValue -> Term s PBool
- pcheckBinRel :: forall (s :: S). Term s ((PInteger :--> (PInteger :--> PBool)) :--> (PSortedValue :--> (PSortedValue :--> PBool)))
- pleftBiasedCurrencyUnion :: forall (s :: S). Term s (PSortedValue :--> (PSortedValue :--> PSortedValue))
- pleftBiasedTokenUnion :: forall (s :: S). Term s (PSortedValue :--> (PSortedValue :--> PSortedValue))
- punionWith :: forall (s :: S). Term s ((PInteger :--> (PInteger :--> PInteger)) :--> (PSortedValue :--> (PSortedValue :--> PSortedValue)))
- punionWithData :: forall (s :: S). Term s ((PAsData PInteger :--> (PAsData PInteger :--> PAsData PInteger)) :--> (PSortedValue :--> (PSortedValue :--> PSortedValue)))
- pvalueOf :: forall (s :: S). Term s (PSortedValue :--> (PCurrencySymbol :--> (PTokenName :--> PInteger)))
- plovelaceValueOf :: forall (s :: S). Term s (PSortedValue :--> PInteger)
- pisAdaOnlyValue :: forall (s :: S). Term s (PSortedValue :--> PBool)
- phasZeroTokenQuantities :: forall (s :: S). Term s (PRawValue :--> PBool)
- phasAdaEntry :: forall (s :: S). Term s (PSortedValue :--> PBool)
- phasZeroAdaEntry :: forall (s :: S). Term s (PSortedValue :--> PBool)
- pinsertAdaEntry :: forall (s :: S). Term s (PSortedValue :--> PSortedValue)
- pnormalizeNoAdaNonZeroTokens :: forall (s :: S). Term s (PSortedValue :--> PSortedValue)
- pmapAmounts :: forall (s :: S). Term s ((PInteger :--> PInteger) :--> (PRawValue :--> PRawValue))
Types
newtype PRawValue (s :: S) Source #
Represents Values without any guarantees.
Values of this type may be unsorted, have duplicate keys, contain empty token maps, and include entries with zero token quantities.
Since: 3.5.0
Constructors
| PRawValue (Term s (PUnsortedMap PCurrencySymbol (PUnsortedMap PTokenName PInteger))) |
Instances
| PIsData PRawValue Source # | Since: 3.5.0 | ||||||||
Defined in Plutarch.LedgerApi.Value Methods pfromDataImpl :: forall (s :: S). Term s (PAsData PRawValue) -> Term s PRawValue pdataImpl :: forall (s :: S). Term s PRawValue -> Term s PData | |||||||||
| PLiftable PRawValue Source # | |||||||||
Defined in Plutarch.LedgerApi.Value Associated Types
Methods haskToRepr :: AsHaskell PRawValue -> PlutusRepr PRawValue reprToHask :: PlutusRepr PRawValue -> Either LiftError (AsHaskell PRawValue) reprToPlut :: forall (s :: S). PlutusRepr PRawValue -> PLifted s PRawValue plutToRepr :: (forall (s :: S). PLifted s PRawValue) -> Either LiftError (PlutusRepr PRawValue) | |||||||||
| PValidateData PRawValue Source # | Since: 3.6.0 | ||||||||
Defined in Plutarch.LedgerApi.Value Methods pwithValidated :: forall (s :: S). Term s PData -> forall (r :: S -> Type). Term s r -> Term s r | |||||||||
| PlutusType PRawValue Source # | |||||||||
Defined in Plutarch.LedgerApi.Value Associated Types
| |||||||||
| PShow PRawValue Source # | Since: 3.5.0 | ||||||||
Defined in Plutarch.LedgerApi.Value | |||||||||
| PTryFrom PData (PAsData PRawValue) Source # | Since: 3.5.0 | ||||||||
Defined in Plutarch.LedgerApi.Value Associated Types
| |||||||||
| Generic (PRawValue s) Source # | |||||||||
Defined in Plutarch.LedgerApi.Value Associated Types
| |||||||||
| Generic (PRawValue s) Source # | |||||||||
| type AsHaskell PRawValue Source # | Since: 3.5.0 | ||||||||
Defined in Plutarch.LedgerApi.Value | |||||||||
| type PlutusRepr PRawValue Source # | |||||||||
Defined in Plutarch.LedgerApi.Value | |||||||||
| type PInner PRawValue Source # | Since: 3.5.0 | ||||||||
Defined in Plutarch.LedgerApi.Value | |||||||||
| type PTryFromExcess PData (PAsData PRawValue) Source # | |||||||||
Defined in Plutarch.LedgerApi.Value | |||||||||
| type Rep (PRawValue s) Source # | Since: 3.5.0 | ||||||||
Defined in Plutarch.LedgerApi.Value type Rep (PRawValue s) = D1 ('MetaData "PRawValue" "Plutarch.LedgerApi.Value" "plutarch-ledger-api-3.6.0-JzNzlZYfKM24p3vIfYHfrb" 'True) (C1 ('MetaCons "PRawValue" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Term s (PUnsortedMap PCurrencySymbol (PUnsortedMap PTokenName PInteger)))))) | |||||||||
| type Code (PRawValue s) Source # | Since: 3.5.0 | ||||||||
Defined in Plutarch.LedgerApi.Value | |||||||||
data PSortedValue (s :: S) Source #
Represents sorted, well-formed Values without empty token maps.
Duplicate currency symbols or duplicate token names within the same token map are not allowed (since wip).
Compared to PRawValue, this type provides stronger guarantees, though
PSortedValues may still contain entries with zero token quantities.
Since: 3.5.0
Instances
| PEq PSortedValue Source # | Since: 3.5.0 | ||||
Defined in Plutarch.LedgerApi.Value Methods (#==) :: forall (s :: S). Term s PSortedValue -> Term s PSortedValue -> Term s PBool | |||||
| PIsData PSortedValue Source # | Since: 3.5.0 | ||||
Defined in Plutarch.LedgerApi.Value Methods pfromDataImpl :: forall (s :: S). Term s (PAsData PSortedValue) -> Term s PSortedValue pdataImpl :: forall (s :: S). Term s PSortedValue -> Term s PData | |||||
| PValidateData PSortedValue Source # | Checks that we have a valid Since: 3.6.0 | ||||
Defined in Plutarch.LedgerApi.Value Methods pwithValidated :: forall (s :: S). Term s PData -> forall (r :: S -> Type). Term s r -> Term s r | |||||
| PlutusType PSortedValue Source # | |||||
Defined in Plutarch.LedgerApi.Value Associated Types
Methods pcon' :: forall (s :: S). PSortedValue s -> Term s (PInner PSortedValue) pmatch' :: forall (s :: S) (b :: S -> Type). Term s (PInner PSortedValue) -> (PSortedValue s -> Term s b) -> Term s b | |||||
| PMonoid PSortedValue Source # | Since: 3.5.0 | ||||
Defined in Plutarch.LedgerApi.Value Methods pmempty :: forall (s :: S). Term s PSortedValue pmtimes :: forall (s :: S). Term s PNatural -> Term s PSortedValue -> Term s PSortedValue | |||||
| PSemigroup PSortedValue Source # | Since: 3.5.0 | ||||
Defined in Plutarch.LedgerApi.Value Methods (#<>) :: forall (s :: S). Term s PSortedValue -> Term s PSortedValue -> Term s PSortedValue pstimes :: forall (s :: S). Term s PPositive -> Term s PSortedValue -> Term s PSortedValue | |||||
| PShow PSortedValue Source # | Since: 3.5.0 | ||||
Defined in Plutarch.LedgerApi.Value Methods pshow' :: forall (s :: S). Bool -> Term s PSortedValue -> Term s PString | |||||
| PTryFrom PData (PAsData PSortedValue) Source # | Since: 3.5.0 | ||||
Defined in Plutarch.LedgerApi.Value Associated Types
Methods ptryFrom' :: forall (s :: S) (r :: S -> Type). Term s PData -> ((Term s (PAsData PSortedValue), Reduce (PTryFromExcess PData (PAsData PSortedValue) s)) -> Term s r) -> Term s r | |||||
| Generic (PSortedValue s) Source # | |||||
Defined in Plutarch.LedgerApi.Value Associated Types
Methods from :: PSortedValue s -> Rep (PSortedValue s) x Source # to :: Rep (PSortedValue s) x -> PSortedValue s Source # | |||||
| Generic (PSortedValue s) Source # | |||||
Defined in Plutarch.LedgerApi.Value Associated Types
| |||||
| Monoid (Term s PSortedValue) Source # | Since: 3.5.0 | ||||
Defined in Plutarch.LedgerApi.Value Methods mempty :: Term s PSortedValue Source # mappend :: Term s PSortedValue -> Term s PSortedValue -> Term s PSortedValue Source # mconcat :: [Term s PSortedValue] -> Term s PSortedValue Source # | |||||
| Semigroup (Term s PSortedValue) Source # | Since: 3.5.0 | ||||
Defined in Plutarch.LedgerApi.Value Methods (<>) :: Term s PSortedValue -> Term s PSortedValue -> Term s PSortedValue Source # sconcat :: NonEmpty (Term s PSortedValue) -> Term s PSortedValue Source # stimes :: Integral b => b -> Term s PSortedValue -> Term s PSortedValue Source # | |||||
| Group (Term s PSortedValue) Source # | Since: 3.5.0 | ||||
Defined in Plutarch.LedgerApi.Value Methods inv :: Term s PSortedValue -> Term s PSortedValue | |||||
| Monoid (Term s PSortedValue) Source # | Since: 3.5.0 | ||||
Defined in Plutarch.LedgerApi.Value Methods mempty :: Term s PSortedValue | |||||
| Semigroup (Term s PSortedValue) Source # | Since: 3.5.0 | ||||
Defined in Plutarch.LedgerApi.Value Methods (<>) :: Term s PSortedValue -> Term s PSortedValue -> Term s PSortedValue | |||||
| type PInner PSortedValue Source # | Since: 3.5.0 | ||||
Defined in Plutarch.LedgerApi.Value | |||||
| type PTryFromExcess PData (PAsData PSortedValue) Source # | |||||
Defined in Plutarch.LedgerApi.Value type PTryFromExcess PData (PAsData PSortedValue) = PTryFromExcess PData (PInner (PAsData PSortedValue)) | |||||
| type Rep (PSortedValue s) Source # | Since: 3.5.0 | ||||
Defined in Plutarch.LedgerApi.Value type Rep (PSortedValue s) = D1 ('MetaData "PSortedValue" "Plutarch.LedgerApi.Value" "plutarch-ledger-api-3.6.0-JzNzlZYfKM24p3vIfYHfrb" 'True) (C1 ('MetaCons "PSortedValue" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Term s (PSortedMap PCurrencySymbol (PSortedMap PTokenName PInteger)))))) | |||||
| type Code (PSortedValue s) Source # | Since: 3.5.0 | ||||
Defined in Plutarch.LedgerApi.Value | |||||
data PLedgerValue (s :: S) Source #
Represents sorted, well-formed Values with a mandatory Ada entry.
Duplicate currency symbols or duplicate token names within the same token map are not allowed (since wip).
Like PSortedValue, but requires the presence of an Ada entry, which may have a
zero quantity. Values of this type may still contain entries with zero token
quantities.
Since: 3.5.0
Instances
| PEq PLedgerValue Source # | Since: 3.5.0 | ||||
Defined in Plutarch.LedgerApi.Value Methods (#==) :: forall (s :: S). Term s PLedgerValue -> Term s PLedgerValue -> Term s PBool | |||||
| PIsData PLedgerValue Source # | Since: 3.5.0 | ||||
Defined in Plutarch.LedgerApi.Value Methods pfromDataImpl :: forall (s :: S). Term s (PAsData PLedgerValue) -> Term s PLedgerValue pdataImpl :: forall (s :: S). Term s PLedgerValue -> Term s PData | |||||
| PValidateData PLedgerValue Source # | Checks that we have a valid Since: 3.6.0 | ||||
Defined in Plutarch.LedgerApi.Value Methods pwithValidated :: forall (s :: S). Term s PData -> forall (r :: S -> Type). Term s r -> Term s r | |||||
| PlutusType PLedgerValue Source # | |||||
Defined in Plutarch.LedgerApi.Value Associated Types
Methods pcon' :: forall (s :: S). PLedgerValue s -> Term s (PInner PLedgerValue) pmatch' :: forall (s :: S) (b :: S -> Type). Term s (PInner PLedgerValue) -> (PLedgerValue s -> Term s b) -> Term s b | |||||
| PMonoid PLedgerValue Source # | Since: 3.5.0 | ||||
Defined in Plutarch.LedgerApi.Value Methods pmempty :: forall (s :: S). Term s PLedgerValue pmtimes :: forall (s :: S). Term s PNatural -> Term s PLedgerValue -> Term s PLedgerValue | |||||
| PSemigroup PLedgerValue Source # | Since: 3.5.0 | ||||
Defined in Plutarch.LedgerApi.Value Methods (#<>) :: forall (s :: S). Term s PLedgerValue -> Term s PLedgerValue -> Term s PLedgerValue pstimes :: forall (s :: S). Term s PPositive -> Term s PLedgerValue -> Term s PLedgerValue | |||||
| PShow PLedgerValue Source # | Since: 3.5.0 | ||||
Defined in Plutarch.LedgerApi.Value Methods pshow' :: forall (s :: S). Bool -> Term s PLedgerValue -> Term s PString | |||||
| PTryFrom PData (PAsData PLedgerValue) Source # | Since: 3.5.0 | ||||
Defined in Plutarch.LedgerApi.Value Associated Types
Methods ptryFrom' :: forall (s :: S) (r :: S -> Type). Term s PData -> ((Term s (PAsData PLedgerValue), Reduce (PTryFromExcess PData (PAsData PLedgerValue) s)) -> Term s r) -> Term s r | |||||
| Generic (PLedgerValue s) Source # | |||||
Defined in Plutarch.LedgerApi.Value Associated Types
Methods from :: PLedgerValue s -> Rep (PLedgerValue s) x Source # to :: Rep (PLedgerValue s) x -> PLedgerValue s Source # | |||||
| Generic (PLedgerValue s) Source # | |||||
Defined in Plutarch.LedgerApi.Value Associated Types
| |||||
| Monoid (Term s PLedgerValue) Source # | Since: 3.5.0 | ||||
Defined in Plutarch.LedgerApi.Value Methods mempty :: Term s PLedgerValue Source # mappend :: Term s PLedgerValue -> Term s PLedgerValue -> Term s PLedgerValue Source # mconcat :: [Term s PLedgerValue] -> Term s PLedgerValue Source # | |||||
| Semigroup (Term s PLedgerValue) Source # | Since: 3.5.0 | ||||
Defined in Plutarch.LedgerApi.Value Methods (<>) :: Term s PLedgerValue -> Term s PLedgerValue -> Term s PLedgerValue Source # sconcat :: NonEmpty (Term s PLedgerValue) -> Term s PLedgerValue Source # stimes :: Integral b => b -> Term s PLedgerValue -> Term s PLedgerValue Source # | |||||
| Group (Term s PLedgerValue) Source # | Since: 3.5.0 | ||||
Defined in Plutarch.LedgerApi.Value Methods inv :: Term s PLedgerValue -> Term s PLedgerValue | |||||
| Monoid (Term s PLedgerValue) Source # | Since: 3.5.0 | ||||
Defined in Plutarch.LedgerApi.Value Methods mempty :: Term s PLedgerValue | |||||
| Semigroup (Term s PLedgerValue) Source # | Since: 3.5.0 | ||||
Defined in Plutarch.LedgerApi.Value Methods (<>) :: Term s PLedgerValue -> Term s PLedgerValue -> Term s PLedgerValue | |||||
| type PInner PLedgerValue Source # | Since: 3.5.0 | ||||
Defined in Plutarch.LedgerApi.Value | |||||
| type PTryFromExcess PData (PAsData PLedgerValue) Source # | |||||
Defined in Plutarch.LedgerApi.Value type PTryFromExcess PData (PAsData PLedgerValue) = PTryFromExcess PData (PInner (PAsData PLedgerValue)) | |||||
| type Rep (PLedgerValue s) Source # | Since: 3.5.0 | ||||
Defined in Plutarch.LedgerApi.Value type Rep (PLedgerValue s) = D1 ('MetaData "PLedgerValue" "Plutarch.LedgerApi.Value" "plutarch-ledger-api-3.6.0-JzNzlZYfKM24p3vIfYHfrb" 'True) (C1 ('MetaCons "PLedgerValue" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Term s PSortedValue)))) | |||||
| type Code (PLedgerValue s) Source # | Since: 3.5.0 | ||||
Defined in Plutarch.LedgerApi.Value | |||||
newtype PCurrencySymbol (s :: S) Source #
Since: 2.0.0
Constructors
| PCurrencySymbol (Term s PByteString) |
Instances
| PEq PCurrencySymbol Source # | Since: 2.0.0 | ||||||||
Defined in Plutarch.LedgerApi.Value.CurrencySymbol Methods (#==) :: forall (s :: S). Term s PCurrencySymbol -> Term s PCurrencySymbol -> Term s PBool | |||||||||
| PIsData PCurrencySymbol Source # | Since: 2.0.0 | ||||||||
Defined in Plutarch.LedgerApi.Value.CurrencySymbol Methods pfromDataImpl :: forall (s :: S). Term s (PAsData PCurrencySymbol) -> Term s PCurrencySymbol pdataImpl :: forall (s :: S). Term s PCurrencySymbol -> Term s PData | |||||||||
| PLiftable PCurrencySymbol Source # | Since: 3.3.0 | ||||||||
Defined in Plutarch.LedgerApi.Value.CurrencySymbol Associated Types
Methods haskToRepr :: AsHaskell PCurrencySymbol -> PlutusRepr PCurrencySymbol reprToHask :: PlutusRepr PCurrencySymbol -> Either LiftError (AsHaskell PCurrencySymbol) reprToPlut :: forall (s :: S). PlutusRepr PCurrencySymbol -> PLifted s PCurrencySymbol plutToRepr :: (forall (s :: S). PLifted s PCurrencySymbol) -> Either LiftError (PlutusRepr PCurrencySymbol) | |||||||||
| POrd PCurrencySymbol Source # | Since: 2.0.0 | ||||||||
Defined in Plutarch.LedgerApi.Value.CurrencySymbol Methods (#<=) :: forall (s :: S). Term s PCurrencySymbol -> Term s PCurrencySymbol -> Term s PBool (#<) :: forall (s :: S). Term s PCurrencySymbol -> Term s PCurrencySymbol -> Term s PBool pmax :: forall (s :: S). Term s PCurrencySymbol -> Term s PCurrencySymbol -> Term s PCurrencySymbol pmin :: forall (s :: S). Term s PCurrencySymbol -> Term s PCurrencySymbol -> Term s PCurrencySymbol | |||||||||
| PValidateData PCurrencySymbol Source # | Checks that we have a Since: 3.6.0 | ||||||||
Defined in Plutarch.LedgerApi.Value.CurrencySymbol Methods pwithValidated :: forall (s :: S). Term s PData -> forall (r :: S -> Type). Term s r -> Term s r | |||||||||
| PlutusType PCurrencySymbol Source # | |||||||||
Defined in Plutarch.LedgerApi.Value.CurrencySymbol Associated Types
Methods pcon' :: forall (s :: S). PCurrencySymbol s -> Term s (PInner PCurrencySymbol) pmatch' :: forall (s :: S) (b :: S -> Type). Term s (PInner PCurrencySymbol) -> (PCurrencySymbol s -> Term s b) -> Term s b | |||||||||
| PShow PCurrencySymbol Source # | Since: 2.0.0 | ||||||||
Defined in Plutarch.LedgerApi.Value.CurrencySymbol Methods pshow' :: forall (s :: S). Bool -> Term s PCurrencySymbol -> Term s PString | |||||||||
| PTryFrom PData (PAsData PCurrencySymbol) Source # | Since: 3.4.0 | ||||||||
Defined in Plutarch.LedgerApi.Value.CurrencySymbol Associated Types
Methods ptryFrom' :: forall (s :: S) (r :: S -> Type). Term s PData -> ((Term s (PAsData PCurrencySymbol), Reduce (PTryFromExcess PData (PAsData PCurrencySymbol) s)) -> Term s r) -> Term s r | |||||||||
| Generic (PCurrencySymbol s) Source # | |||||||||
Defined in Plutarch.LedgerApi.Value.CurrencySymbol Associated Types
Methods from :: PCurrencySymbol s -> Rep (PCurrencySymbol s) x Source # to :: Rep (PCurrencySymbol s) x -> PCurrencySymbol s Source # | |||||||||
| Generic (PCurrencySymbol s) Source # | |||||||||
Defined in Plutarch.LedgerApi.Value.CurrencySymbol Associated Types
Methods from :: PCurrencySymbol s -> Rep (PCurrencySymbol s) to :: Rep (PCurrencySymbol s) -> PCurrencySymbol s | |||||||||
| type AsHaskell PCurrencySymbol Source # | |||||||||
Defined in Plutarch.LedgerApi.Value.CurrencySymbol type AsHaskell PCurrencySymbol = CurrencySymbol | |||||||||
| type PlutusRepr PCurrencySymbol Source # | |||||||||
Defined in Plutarch.LedgerApi.Value.CurrencySymbol | |||||||||
| type PInner PCurrencySymbol Source # | Since: 3.3.0 | ||||||||
Defined in Plutarch.LedgerApi.Value.CurrencySymbol | |||||||||
| type PTryFromExcess PData (PAsData PCurrencySymbol) Source # | |||||||||
Defined in Plutarch.LedgerApi.Value.CurrencySymbol type PTryFromExcess PData (PAsData PCurrencySymbol) = PTryFromExcess PData (PInner (PAsData PCurrencySymbol)) | |||||||||
| type Rep (PCurrencySymbol s) Source # | Since: 2.0.0 | ||||||||
Defined in Plutarch.LedgerApi.Value.CurrencySymbol type Rep (PCurrencySymbol s) = D1 ('MetaData "PCurrencySymbol" "Plutarch.LedgerApi.Value.CurrencySymbol" "plutarch-ledger-api-3.6.0-JzNzlZYfKM24p3vIfYHfrb" 'True) (C1 ('MetaCons "PCurrencySymbol" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Term s PByteString)))) | |||||||||
| type Code (PCurrencySymbol s) Source # | Since: 3.3.0 | ||||||||
Defined in Plutarch.LedgerApi.Value.CurrencySymbol | |||||||||
newtype PTokenName (s :: S) Source #
Since: 2.0.0
Constructors
| PTokenName (Term s PByteString) |
Instances
| PEq PTokenName Source # | Since: 2.0.0 | ||||||||
Defined in Plutarch.LedgerApi.Value.TokenName Methods (#==) :: forall (s :: S). Term s PTokenName -> Term s PTokenName -> Term s PBool | |||||||||
| PIsData PTokenName Source # | Since: 2.0.0 | ||||||||
Defined in Plutarch.LedgerApi.Value.TokenName Methods pfromDataImpl :: forall (s :: S). Term s (PAsData PTokenName) -> Term s PTokenName pdataImpl :: forall (s :: S). Term s PTokenName -> Term s PData | |||||||||
| PLiftable PTokenName Source # | Since: 3.3.0 | ||||||||
Defined in Plutarch.LedgerApi.Value.TokenName Associated Types
Methods haskToRepr :: AsHaskell PTokenName -> PlutusRepr PTokenName reprToHask :: PlutusRepr PTokenName -> Either LiftError (AsHaskell PTokenName) reprToPlut :: forall (s :: S). PlutusRepr PTokenName -> PLifted s PTokenName plutToRepr :: (forall (s :: S). PLifted s PTokenName) -> Either LiftError (PlutusRepr PTokenName) | |||||||||
| POrd PTokenName Source # | Since: 2.0.0 | ||||||||
Defined in Plutarch.LedgerApi.Value.TokenName Methods (#<=) :: forall (s :: S). Term s PTokenName -> Term s PTokenName -> Term s PBool (#<) :: forall (s :: S). Term s PTokenName -> Term s PTokenName -> Term s PBool pmax :: forall (s :: S). Term s PTokenName -> Term s PTokenName -> Term s PTokenName pmin :: forall (s :: S). Term s PTokenName -> Term s PTokenName -> Term s PTokenName | |||||||||
| PValidateData PTokenName Source # | Checks that we have a Since: 3.6.0 | ||||||||
Defined in Plutarch.LedgerApi.Value.TokenName Methods pwithValidated :: forall (s :: S). Term s PData -> forall (r :: S -> Type). Term s r -> Term s r | |||||||||
| PlutusType PTokenName Source # | |||||||||
Defined in Plutarch.LedgerApi.Value.TokenName Associated Types
Methods pcon' :: forall (s :: S). PTokenName s -> Term s (PInner PTokenName) pmatch' :: forall (s :: S) (b :: S -> Type). Term s (PInner PTokenName) -> (PTokenName s -> Term s b) -> Term s b | |||||||||
| PShow PTokenName Source # | Since: 2.0.0 | ||||||||
Defined in Plutarch.LedgerApi.Value.TokenName Methods pshow' :: forall (s :: S). Bool -> Term s PTokenName -> Term s PString | |||||||||
| PTryFrom PData (PAsData PTokenName) Source # | Since: 3.4.0 | ||||||||
Defined in Plutarch.LedgerApi.Value.TokenName Associated Types
Methods ptryFrom' :: forall (s :: S) (r :: S -> Type). Term s PData -> ((Term s (PAsData PTokenName), Reduce (PTryFromExcess PData (PAsData PTokenName) s)) -> Term s r) -> Term s r | |||||||||
| Generic (PTokenName s) Source # | |||||||||
Defined in Plutarch.LedgerApi.Value.TokenName Associated Types
Methods from :: PTokenName s -> Rep (PTokenName s) x Source # to :: Rep (PTokenName s) x -> PTokenName s Source # | |||||||||
| Generic (PTokenName s) Source # | |||||||||
Defined in Plutarch.LedgerApi.Value.TokenName Associated Types
| |||||||||
| type AsHaskell PTokenName Source # | |||||||||
Defined in Plutarch.LedgerApi.Value.TokenName type AsHaskell PTokenName = TokenName | |||||||||
| type PlutusRepr PTokenName Source # | |||||||||
Defined in Plutarch.LedgerApi.Value.TokenName | |||||||||
| type PInner PTokenName Source # | Since: 3.3.0 | ||||||||
Defined in Plutarch.LedgerApi.Value.TokenName | |||||||||
| type PTryFromExcess PData (PAsData PTokenName) Source # | |||||||||
Defined in Plutarch.LedgerApi.Value.TokenName | |||||||||
| type Rep (PTokenName s) Source # | Since: 2.0.0 | ||||||||
Defined in Plutarch.LedgerApi.Value.TokenName type Rep (PTokenName s) = D1 ('MetaData "PTokenName" "Plutarch.LedgerApi.Value.TokenName" "plutarch-ledger-api-3.6.0-JzNzlZYfKM24p3vIfYHfrb" 'True) (C1 ('MetaCons "PTokenName" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Term s PByteString)))) | |||||||||
| type Code (PTokenName s) Source # | Since: 3.3.0 | ||||||||
Defined in Plutarch.LedgerApi.Value.TokenName | |||||||||
newtype PLovelace (s :: S) Source #
Since: 2.2.0
Constructors
| PLovelace (Term s PInteger) |
Instances
| PEq PLovelace Source # | Since: 2.2.0 | ||||||||
Defined in Plutarch.LedgerApi.Value.Lovelace | |||||||||
| PIsData PLovelace Source # | Since: 2.2.0 | ||||||||
Defined in Plutarch.LedgerApi.Value.Lovelace Methods pfromDataImpl :: forall (s :: S). Term s (PAsData PLovelace) -> Term s PLovelace pdataImpl :: forall (s :: S). Term s PLovelace -> Term s PData | |||||||||
| PLiftable PLovelace Source # | |||||||||
Defined in Plutarch.LedgerApi.Value.Lovelace Associated Types
Methods haskToRepr :: AsHaskell PLovelace -> PlutusRepr PLovelace reprToHask :: PlutusRepr PLovelace -> Either LiftError (AsHaskell PLovelace) reprToPlut :: forall (s :: S). PlutusRepr PLovelace -> PLifted s PLovelace plutToRepr :: (forall (s :: S). PLifted s PLovelace) -> Either LiftError (PlutusRepr PLovelace) | |||||||||
| POrd PLovelace Source # | Since: 3.3.0 | ||||||||
Defined in Plutarch.LedgerApi.Value.Lovelace Methods (#<=) :: forall (s :: S). Term s PLovelace -> Term s PLovelace -> Term s PBool (#<) :: forall (s :: S). Term s PLovelace -> Term s PLovelace -> Term s PBool pmax :: forall (s :: S). Term s PLovelace -> Term s PLovelace -> Term s PLovelace pmin :: forall (s :: S). Term s PLovelace -> Term s PLovelace -> Term s PLovelace | |||||||||
| PValidateData PLovelace Source # | Since: 3.6.0 | ||||||||
Defined in Plutarch.LedgerApi.Value.Lovelace Methods pwithValidated :: forall (s :: S). Term s PData -> forall (r :: S -> Type). Term s r -> Term s r | |||||||||
| PlutusType PLovelace Source # | |||||||||
Defined in Plutarch.LedgerApi.Value.Lovelace Associated Types
| |||||||||
| PShow PLovelace Source # | Since: 2.2.0 | ||||||||
Defined in Plutarch.LedgerApi.Value.Lovelace | |||||||||
| PTryFrom PData (PAsData PLovelace) Source # | Since: 3.4.0 | ||||||||
Defined in Plutarch.LedgerApi.Value.Lovelace Associated Types
| |||||||||
| Generic (PLovelace s) Source # | |||||||||
Defined in Plutarch.LedgerApi.Value.Lovelace Associated Types
| |||||||||
| Generic (PLovelace s) Source # | |||||||||
| type AsHaskell PLovelace Source # | Since: 3.3.0 | ||||||||
Defined in Plutarch.LedgerApi.Value.Lovelace | |||||||||
| type PlutusRepr PLovelace Source # | |||||||||
Defined in Plutarch.LedgerApi.Value.Lovelace | |||||||||
| type PInner PLovelace Source # | Since: 3.3.0 | ||||||||
Defined in Plutarch.LedgerApi.Value.Lovelace | |||||||||
| type PTryFromExcess PData (PAsData PLovelace) Source # | |||||||||
Defined in Plutarch.LedgerApi.Value.Lovelace | |||||||||
| type Rep (PLovelace s) Source # | Since: 2.2.0 | ||||||||
Defined in Plutarch.LedgerApi.Value.Lovelace type Rep (PLovelace s) = D1 ('MetaData "PLovelace" "Plutarch.LedgerApi.Value.Lovelace" "plutarch-ledger-api-3.6.0-JzNzlZYfKM24p3vIfYHfrb" 'True) (C1 ('MetaCons "PLovelace" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Term s PInteger)))) | |||||||||
| type Code (PLovelace s) Source # | Since: 3.3.0 | ||||||||
Defined in Plutarch.LedgerApi.Value.Lovelace | |||||||||
newtype PAssetClass (s :: S) Source #
Since: 3.3.0
Constructors
| PAssetClass (Term s (PBuiltinPair (PAsData PCurrencySymbol) (PAsData PTokenName))) |
Instances
| PEq PAssetClass Source # | Since: 3.3.0 | ||||||||
Defined in Plutarch.LedgerApi.Value.AssetClass Methods (#==) :: forall (s :: S). Term s PAssetClass -> Term s PAssetClass -> Term s PBool | |||||||||
| PIsData PAssetClass Source # | Since: 3.3.0 | ||||||||
Defined in Plutarch.LedgerApi.Value.AssetClass Methods pfromDataImpl :: forall (s :: S). Term s (PAsData PAssetClass) -> Term s PAssetClass pdataImpl :: forall (s :: S). Term s PAssetClass -> Term s PData | |||||||||
| PLiftable PAssetClass Source # | |||||||||
Defined in Plutarch.LedgerApi.Value.AssetClass Associated Types
Methods haskToRepr :: AsHaskell PAssetClass -> PlutusRepr PAssetClass reprToHask :: PlutusRepr PAssetClass -> Either LiftError (AsHaskell PAssetClass) reprToPlut :: forall (s :: S). PlutusRepr PAssetClass -> PLifted s PAssetClass plutToRepr :: (forall (s :: S). PLifted s PAssetClass) -> Either LiftError (PlutusRepr PAssetClass) | |||||||||
| POrd PAssetClass Source # | Since: 3.3.0 | ||||||||
Defined in Plutarch.LedgerApi.Value.AssetClass Methods (#<=) :: forall (s :: S). Term s PAssetClass -> Term s PAssetClass -> Term s PBool (#<) :: forall (s :: S). Term s PAssetClass -> Term s PAssetClass -> Term s PBool pmax :: forall (s :: S). Term s PAssetClass -> Term s PAssetClass -> Term s PAssetClass pmin :: forall (s :: S). Term s PAssetClass -> Term s PAssetClass -> Term s PAssetClass | |||||||||
| PValidateData PAssetClass Source # | Since: 3.6.0 | ||||||||
Defined in Plutarch.LedgerApi.Value.AssetClass Methods pwithValidated :: forall (s :: S). Term s PData -> forall (r :: S -> Type). Term s r -> Term s r | |||||||||
| PlutusType PAssetClass Source # | |||||||||
Defined in Plutarch.LedgerApi.Value.AssetClass Associated Types
Methods pcon' :: forall (s :: S). PAssetClass s -> Term s (PInner PAssetClass) pmatch' :: forall (s :: S) (b :: S -> Type). Term s (PInner PAssetClass) -> (PAssetClass s -> Term s b) -> Term s b | |||||||||
| PShow PAssetClass Source # | Since: 3.3.0 | ||||||||
Defined in Plutarch.LedgerApi.Value.AssetClass Methods pshow' :: forall (s :: S). Bool -> Term s PAssetClass -> Term s PString | |||||||||
| PTryFrom PData (PAsData PAssetClass) Source # | Since: 3.4.0 | ||||||||
Defined in Plutarch.LedgerApi.Value.AssetClass Associated Types
Methods ptryFrom' :: forall (s :: S) (r :: S -> Type). Term s PData -> ((Term s (PAsData PAssetClass), Reduce (PTryFromExcess PData (PAsData PAssetClass) s)) -> Term s r) -> Term s r | |||||||||
| Generic (PAssetClass s) Source # | |||||||||
Defined in Plutarch.LedgerApi.Value.AssetClass Associated Types
Methods from :: PAssetClass s -> Rep (PAssetClass s) x Source # to :: Rep (PAssetClass s) x -> PAssetClass s Source # | |||||||||
| Generic (PAssetClass s) Source # | |||||||||
Defined in Plutarch.LedgerApi.Value.AssetClass Associated Types
| |||||||||
| type AsHaskell PAssetClass Source # | Since: 3.3.0 | ||||||||
Defined in Plutarch.LedgerApi.Value.AssetClass | |||||||||
| type PlutusRepr PAssetClass Source # | |||||||||
Defined in Plutarch.LedgerApi.Value.AssetClass | |||||||||
| type PInner PAssetClass Source # | Since: 3.3.0 | ||||||||
Defined in Plutarch.LedgerApi.Value.AssetClass | |||||||||
| type PTryFromExcess PData (PAsData PAssetClass) Source # | |||||||||
Defined in Plutarch.LedgerApi.Value.AssetClass type PTryFromExcess PData (PAsData PAssetClass) = PTryFromExcess PData (PInner (PAsData PAssetClass)) | |||||||||
| type Rep (PAssetClass s) Source # | Since: 3.3.0 | ||||||||
Defined in Plutarch.LedgerApi.Value.AssetClass type Rep (PAssetClass s) = D1 ('MetaData "PAssetClass" "Plutarch.LedgerApi.Value.AssetClass" "plutarch-ledger-api-3.6.0-JzNzlZYfKM24p3vIfYHfrb" 'True) (C1 ('MetaCons "PAssetClass" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Term s (PBuiltinPair (PAsData PCurrencySymbol) (PAsData PTokenName)))))) | |||||||||
| type Code (PAssetClass s) Source # | Since: 3.3.0 | ||||||||
Defined in Plutarch.LedgerApi.Value.AssetClass | |||||||||
Functions
Creation
PRawValue
pemptyRawValue :: forall (s :: S). Term s PRawValue Source #
Construct an empty PRawValue.
Since: 3.5.0
psingletonRawValue :: forall (s :: S). Term s (PCurrencySymbol :--> (PTokenName :--> (PInteger :--> PRawValue))) Source #
Construct a singleton PRawValue containing only the given quantity of the
given currency.
Since: 3.5.0
psingletonRawValueData :: forall (s :: S). Term s (PAsData PCurrencySymbol :--> (PAsData PTokenName :--> (PAsData PInteger :--> PRawValue))) Source #
Construct a singleton PRawValue containing only the given quantity of the
given currency, taking data-encoded parameters.
Since: 3.5.0
PSortedValue
pemptySortedValue :: forall (s :: S). Term s PSortedValue Source #
Construct an empty PSortedValue.
Since: 3.5.0
psingletonSortedValue :: forall (s :: S). Term s (PCurrencySymbol :--> (PTokenName :--> (PInteger :--> PSortedValue))) Source #
Construct a singleton PSortedValue containing only the given quantity of
the given currency.
Since: 3.5.0
psingletonSortedValueData :: forall (s :: S). Term s (PAsData PCurrencySymbol :--> (PAsData PTokenName :--> (PAsData PInteger :--> PSortedValue))) Source #
Like psingletonSortedValue, but accepts data-encoded arguments.
Since: 3.5.0
PLedgerValue
pemptyLedgerValue :: forall (s :: S). Term s PLedgerValue Source #
Construct an empty PLedgerValue with a mandatory zero Ada entry.
Since: 3.5.0
psingletonLedgerValue :: forall (s :: S). Term s (PCurrencySymbol :--> (PTokenName :--> (PInteger :--> PLedgerValue))) Source #
Construct a singleton PLedgerValue containing the given quantity of the
given currency, together with a mandatory Ada entry (which may be zero).
Since: 3.5.0
psingletonLedgerValueData :: forall (s :: S). Term s (PAsData PCurrencySymbol :--> (PAsData PTokenName :--> (PAsData PInteger :--> PLedgerValue))) Source #
Like psingletonLedgerValue, but accepts data-encoded arguments.
Since: 3.5.0
PCurrencySymbol
padaSymbol :: forall (s :: S). Term s PCurrencySymbol Source #
The PCurrencySymbol of the Ada currency.
Since: 2.1.1
padaSymbolData :: forall (s :: S). Term s (PAsData PCurrencySymbol) Source #
Data-encoded PCurrencySymbol of the Ada currency.
Since: 2.1.1
PTokenName
padaToken :: forall (s :: S). Term s PTokenName Source #
The PTokenName of the Ada currency.
Since: 2.1.1
Transformation
passertSorted :: forall (s :: S). Term s (PRawValue :--> PSortedValue) Source #
Deprecated: Use ppromoteToSortedValue instead
Attempt to promote a PRawValue to PSortedValue.
The conversion succeeds only if the input Value is already sorted and does not contain empty token maps. Otherwise, the function fails with an error.
Since: 2.1.1
ppromoteToSortedValue :: forall (s :: S). Term s (PRawValue :--> PSortedValue) Source #
Attempt to promote a PRawValue to PSortedValue.
The conversion succeeds only if the input Value is already sorted and does not contain empty token maps. Otherwise, the function fails with an error.
Since: 3.6.0
pforgetSorted :: forall (s :: S). Term s PSortedValue -> Term s PRawValue Source #
Safely demote a PSortedValue to a PRawValue.
Since: 3.5.0
ptoLedgerValue :: forall (s :: S). Term s (PSortedValue :--> PLedgerValue) Source #
Convert a PSortedValue to a PLedgerValue, inserting the mandatory Ada
entry if missing.
Since: 3.5.0
Partial ordering
plt :: forall (s :: S). Term s PSortedValue -> Term s PSortedValue -> Term s PBool Source #
Mimics the lt operation on plutus-ledger-api's Value.
Since: 3.5.0
pleq :: forall (s :: S). Term s PSortedValue -> Term s PSortedValue -> Term s PBool Source #
Mimics the leq operation on plutus-ledger-api's Value.
Since: 3.5.0
pcheckBinRel :: forall (s :: S). Term s ((PInteger :--> (PInteger :--> PBool)) :--> (PSortedValue :--> (PSortedValue :--> PBool))) Source #
Given a description of a relation on amounts, check whether that relation
holds over PSortedValues.
Important note
This is intended for use with boolean comparison functions, which must define at least a partial order (total orders and equivalences are acceptable as well). Use of this with anything else is not guaranteed to give anything resembling a sensible answer. Use with extreme care.
Since: 2.0.0
Combination
pleftBiasedCurrencyUnion :: forall (s :: S). Term s (PSortedValue :--> (PSortedValue :--> PSortedValue)) Source #
Combine two PSortedValues, taking the tokens from the left only, if a
currency occurs on both sides.
Since: 2.1.1
pleftBiasedTokenUnion :: forall (s :: S). Term s (PSortedValue :--> (PSortedValue :--> PSortedValue)) Source #
Combine two PSortedValues, taking the tokens from the left only, if a
token name of the same currency occurs on both sides.
Since: 2.1.1
punionWith :: forall (s :: S). Term s ((PInteger :--> (PInteger :--> PInteger)) :--> (PSortedValue :--> (PSortedValue :--> PSortedValue))) Source #
Combine two PSortedValues applying the given function to any pair of
quantities with the same asset class.
Since: 3.5.0
punionWithData :: forall (s :: S). Term s ((PAsData PInteger :--> (PAsData PInteger :--> PAsData PInteger)) :--> (PSortedValue :--> (PSortedValue :--> PSortedValue))) Source #
Combine two PSortedValues applying the given function to any pair of
data-encoded quantities with the same asset class.
Since: 3.5.0
Queries
pvalueOf :: forall (s :: S). Term s (PSortedValue :--> (PCurrencySymbol :--> (PTokenName :--> PInteger))) Source #
Get the quantity of the given currency in the PSortedValue.
Since: 3.6.0
plovelaceValueOf :: forall (s :: S). Term s (PSortedValue :--> PInteger) Source #
Get the amount of Lovelace in the PSortedValue.
Since: 2.1.1
pisAdaOnlyValue :: forall (s :: S). Term s (PSortedValue :--> PBool) Source #
Test if the PSortedValue contains nothing except an Ada entry.
Note
This function does not verify that Ada is positive and may return PTrue
for zero or negative Ada amounts.
Since: 2.1.1
phasZeroTokenQuantities :: forall (s :: S). Term s (PRawValue :--> PBool) Source #
Check if the given Value contains zero token quantities.
Since: 3.6.0
phasAdaEntry :: forall (s :: S). Term s (PSortedValue :--> PBool) Source #
Check if the given PSortedValue contains an ADA entry (can be zero).
Since: 3.6.0
phasZeroAdaEntry :: forall (s :: S). Term s (PSortedValue :--> PBool) Source #
Check if the given PSortedValue has a zero ADA entry.
Since: 3.6.0
Misc (internal use)
pinsertAdaEntry :: forall (s :: S). Term s (PSortedValue :--> PSortedValue) Source #
Ensure that the given PSortedValue contains an Ada entry.
If missing, a zero Ada entry is inserted at the head of the underlying sorted map.
pnormalizeNoAdaNonZeroTokens :: forall (s :: S). Term s (PSortedValue :--> PSortedValue) Source #
Normalize the argument to contain no Ada entries and no zero token quantities.
pmapAmounts :: forall (s :: S). Term s ((PInteger :--> PInteger) :--> (PRawValue :--> PRawValue)) Source #