Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data ExtendedAssetClass
- data PExtendedAssetClass (s :: S)
- = PAnyToken (Term s (PDataRecord '["_0" := PCurrencySymbol]))
- | PFixedToken (Term s (PDataRecord '["_0" := PAssetClassData]))
- extendedAdaClass :: ExtendedAssetClass
- pextendedAdaClass :: forall (s :: S). Term s PExtendedAssetClass
- isExtendedAdaClass :: ExtendedAssetClass -> Bool
- eqClasses :: ExtendedAssetClass -> AssetClass -> Bool
- unsafeToAssetClass :: ExtendedAssetClass -> AssetClass
- pisExtendedAdaClass :: forall (s :: S). Term s (PExtendedAssetClass :--> PBool)
- pextendedAssetClassValueOf :: forall (keys :: KeyGuarantees) (amounts :: AmountGuarantees) (s :: S). Term s (PExtendedAssetClass :--> (PValue keys amounts :--> PInteger))
- pextendedAssetClassValueOf' :: forall (keys :: KeyGuarantees) (amounts :: AmountGuarantees) (s :: S). ExtendedAssetClass -> Term s (PValue keys amounts :--> PInteger)
- peqClasses :: forall (s :: S). Term s (PExtendedAssetClass :--> (PAssetClassData :--> PBool))
- punsafeToAssetClass :: forall (s :: S). Term s (PExtendedAssetClass :--> PAssetClass)
- punsafeToAssetClassData :: forall (s :: S). Term s (PExtendedAssetClass :--> PAssetClassData)
Types
Haskell
data ExtendedAssetClass Source #
An AssetClass
whose TokenName
may or may not be relevant.
Since: 3.14.2
AnyToken CurrencySymbol |
|
FixedToken AssetClass |
|
Instances
Plutarch
data PExtendedAssetClass (s :: S) Source #
Plutarch equivalent to ExtendedAssetClass
.
Since: 3.14.2
PAnyToken (Term s (PDataRecord '["_0" := PCurrencySymbol])) | |
PFixedToken (Term s (PDataRecord '["_0" := PAssetClassData])) |
Instances
Constants
Haskell
extendedAdaClass :: ExtendedAssetClass Source #
A FixedToken
wrapper around adaClass
. Provided mostly for convenience.
Since: 3.15.1
Plutarch
pextendedAdaClass :: forall (s :: S). Term s PExtendedAssetClass Source #
Plutarch equivalent to extendedAdaClass
.
Since: 3.15.1
Functions
Haskell
isExtendedAdaClass :: ExtendedAssetClass -> Bool Source #
Verify whether an ExtendedAssetClass
is the ADA extended asset class.
Since: 3.15.1
eqClasses :: ExtendedAssetClass -> AssetClass -> Bool Source #
Compare an ExtendedAssetClass
to an AssetClass
.
Since: 3.15.3
unsafeToAssetClass :: ExtendedAssetClass -> AssetClass Source #
Convert to an AssetClass
. We do this by either 'unwrapping' a
FixedToken
, or 'stubbing in' an empty TokenName
for an AnyToken
.
Note
This is not a safe conversion in general (hence its name). For example:
cls = AnyTokenType sym v = assetClassValueOf (unsafeToAssetClass cls) (singleton x "" 1 <> singleton x "a" 1)
Then v
would equal 1
, when it's supposed to be 2
.
There are some legitimate uses for this conversion, which is why it exists, but it should be used with care.
Since: 3.15.3
Plutarch
pisExtendedAdaClass :: forall (s :: S). Term s (PExtendedAssetClass :--> PBool) Source #
As isExtendedAdaClass
, but for Plutarch.
Since: 3.15.1
pextendedAssetClassValueOf :: forall (keys :: KeyGuarantees) (amounts :: AmountGuarantees) (s :: S). Term s (PExtendedAssetClass :--> (PValue keys amounts :--> PInteger)) Source #
As passetClassValueOf
, but for PExtendedAssetClass
.
Since: 3.14.2
pextendedAssetClassValueOf' :: forall (keys :: KeyGuarantees) (amounts :: AmountGuarantees) (s :: S). ExtendedAssetClass -> Term s (PValue keys amounts :--> PInteger) Source #
As pextendedAssetClassValueOf
, but using a Haskell-level
ExtendedAssetClass
.
Since: 3.14.6
peqClasses :: forall (s :: S). Term s (PExtendedAssetClass :--> (PAssetClassData :--> PBool)) Source #
Compare a PExtendedAssetClass
to a PAssetClass
.
Since: 3.14.2
punsafeToAssetClass :: forall (s :: S). Term s (PExtendedAssetClass :--> PAssetClass) Source #
Convert to a PAssetClass
. We do this by either 'unwrapping' a
PFixedToken
, or 'stubbing in' an empty PTokenName
for PAnyToken
.
Note
This is not a safe conversion in general (hence its name). For example:
cls = pcon $ PAnyTokenType sym v = passetClassValueOf # (punsafeToAssetClass cls) # pconstant (singleton x "" 1 <> singleton x "a" 1)
Then v
would equal 1
, when it's supposed to be 2
.
There are some legitimate uses for this conversion (specifically for creating
Value
s), which is why it exists, but it should be used with care.
Since: 3.15.0
punsafeToAssetClassData :: forall (s :: S). Term s (PExtendedAssetClass :--> PAssetClassData) Source #
Convert to a PAssetClassData
.
Note
This is not a safe conversion in general, for the same reasons as
punsafeToAssetClass
. All caveats on the use of punsafeToAssetClass
also
apply to this function.
Since: 3.15.0