Safe Haskell | None |
---|---|
Language | Haskell2010 |
PlutusTx.Builtins.Internal
Description
This module contains the special Haskell names that are used to map to builtin types or functions in Plutus Core.
Most users should not use this module directly, but rather use
Builtins
.
Synopsis
- error :: BuiltinUnit -> a
- data BuiltinBool = BuiltinBool Bool
- true :: BuiltinBool
- false :: BuiltinBool
- ifThenElse :: BuiltinBool -> a -> a -> a
- data BuiltinUnit = BuiltinUnit ()
- unitval :: BuiltinUnit
- chooseUnit :: BuiltinUnit -> a -> a
- type BuiltinInteger = Integer
- addInteger :: BuiltinInteger -> BuiltinInteger -> BuiltinInteger
- subtractInteger :: BuiltinInteger -> BuiltinInteger -> BuiltinInteger
- multiplyInteger :: BuiltinInteger -> BuiltinInteger -> BuiltinInteger
- divideInteger :: BuiltinInteger -> BuiltinInteger -> BuiltinInteger
- modInteger :: BuiltinInteger -> BuiltinInteger -> BuiltinInteger
- quotientInteger :: BuiltinInteger -> BuiltinInteger -> BuiltinInteger
- remainderInteger :: BuiltinInteger -> BuiltinInteger -> BuiltinInteger
- lessThanInteger :: BuiltinInteger -> BuiltinInteger -> BuiltinBool
- lessThanEqualsInteger :: BuiltinInteger -> BuiltinInteger -> BuiltinBool
- equalsInteger :: BuiltinInteger -> BuiltinInteger -> BuiltinBool
- data BuiltinByteString = BuiltinByteString ByteString
- appendByteString :: BuiltinByteString -> BuiltinByteString -> BuiltinByteString
- consByteString :: BuiltinInteger -> BuiltinByteString -> BuiltinByteString
- sliceByteString :: BuiltinInteger -> BuiltinInteger -> BuiltinByteString -> BuiltinByteString
- lengthOfByteString :: BuiltinByteString -> BuiltinInteger
- indexByteString :: BuiltinByteString -> BuiltinInteger -> BuiltinInteger
- emptyByteString :: BuiltinByteString
- sha2_256 :: BuiltinByteString -> BuiltinByteString
- sha3_256 :: BuiltinByteString -> BuiltinByteString
- blake2b_256 :: BuiltinByteString -> BuiltinByteString
- verifyEd25519Signature :: BuiltinByteString -> BuiltinByteString -> BuiltinByteString -> BuiltinBool
- verifyEcdsaSecp256k1Signature :: BuiltinByteString -> BuiltinByteString -> BuiltinByteString -> BuiltinBool
- verifySchnorrSecp256k1Signature :: BuiltinByteString -> BuiltinByteString -> BuiltinByteString -> BuiltinBool
- traceAll :: forall (a :: Type ) (f :: Type -> Type ). Foldable f => f Text -> a -> a
- equalsByteString :: BuiltinByteString -> BuiltinByteString -> BuiltinBool
- lessThanByteString :: BuiltinByteString -> BuiltinByteString -> BuiltinBool
- lessThanEqualsByteString :: BuiltinByteString -> BuiltinByteString -> BuiltinBool
- decodeUtf8 :: BuiltinByteString -> BuiltinString
- data BuiltinString = BuiltinString Text
- appendString :: BuiltinString -> BuiltinString -> BuiltinString
- emptyString :: BuiltinString
- equalsString :: BuiltinString -> BuiltinString -> BuiltinBool
- trace :: BuiltinString -> a -> a
- encodeUtf8 :: BuiltinString -> BuiltinByteString
- data BuiltinPair a b = BuiltinPair (a, b)
- fst :: BuiltinPair a b -> a
- snd :: BuiltinPair a b -> b
- mkPairData :: BuiltinData -> BuiltinData -> BuiltinPair BuiltinData BuiltinData
- data BuiltinList a = BuiltinList [a]
- null :: BuiltinList a -> BuiltinBool
- head :: BuiltinList a -> a
- tail :: BuiltinList a -> BuiltinList a
- chooseList :: BuiltinList a -> b -> b -> b
- mkNilData :: BuiltinUnit -> BuiltinList BuiltinData
- mkNilPairData :: BuiltinUnit -> BuiltinList ( BuiltinPair BuiltinData BuiltinData )
- mkCons :: a -> BuiltinList a -> BuiltinList a
- data BuiltinData = BuiltinData Data
- builtinDataToData :: BuiltinData -> Data
- dataToBuiltinData :: Data -> BuiltinData
- chooseData :: forall a. BuiltinData -> a -> a -> a -> a -> a -> a
- mkConstr :: BuiltinInteger -> BuiltinList BuiltinData -> BuiltinData
- mkMap :: BuiltinList ( BuiltinPair BuiltinData BuiltinData ) -> BuiltinData
- mkList :: BuiltinList BuiltinData -> BuiltinData
- mkI :: BuiltinInteger -> BuiltinData
- mkB :: BuiltinByteString -> BuiltinData
- unsafeDataAsConstr :: BuiltinData -> BuiltinPair BuiltinInteger ( BuiltinList BuiltinData )
- unsafeDataAsMap :: BuiltinData -> BuiltinList ( BuiltinPair BuiltinData BuiltinData )
- unsafeDataAsList :: BuiltinData -> BuiltinList BuiltinData
- unsafeDataAsI :: BuiltinData -> BuiltinInteger
- unsafeDataAsB :: BuiltinData -> BuiltinByteString
- equalsData :: BuiltinData -> BuiltinData -> BuiltinBool
- serialiseData :: BuiltinData -> BuiltinByteString
Documentation
error :: BuiltinUnit -> a Source #
data BuiltinBool Source #
Constructors
BuiltinBool Bool |
Instances
Data BuiltinBool Source # | |
Defined in PlutusTx.Builtins.Internal Methods gfoldl :: ( forall d b. Data d => c (d -> b) -> d -> c b) -> ( forall g. g -> c g) -> BuiltinBool -> c BuiltinBool Source # gunfold :: ( forall b r. Data b => c (b -> r) -> c r) -> ( forall r. r -> c r) -> Constr -> c BuiltinBool Source # toConstr :: BuiltinBool -> Constr Source # dataTypeOf :: BuiltinBool -> DataType Source # dataCast1 :: Typeable t => ( forall d. Data d => c (t d)) -> Maybe (c BuiltinBool ) Source # dataCast2 :: Typeable t => ( forall d e. ( Data d, Data e) => c (t d e)) -> Maybe (c BuiltinBool ) Source # gmapT :: ( forall b. Data b => b -> b) -> BuiltinBool -> BuiltinBool Source # gmapQl :: (r -> r' -> r) -> r -> ( forall d. Data d => d -> r') -> BuiltinBool -> r Source # gmapQr :: forall r r'. (r' -> r -> r) -> r -> ( forall d. Data d => d -> r') -> BuiltinBool -> r Source # gmapQ :: ( forall d. Data d => d -> u) -> BuiltinBool -> [u] Source # gmapQi :: Int -> ( forall d. Data d => d -> u) -> BuiltinBool -> u Source # gmapM :: Monad m => ( forall d. Data d => d -> m d) -> BuiltinBool -> m BuiltinBool Source # gmapMp :: MonadPlus m => ( forall d. Data d => d -> m d) -> BuiltinBool -> m BuiltinBool Source # gmapMo :: MonadPlus m => ( forall d. Data d => d -> m d) -> BuiltinBool -> m BuiltinBool Source # |
|
ToBuiltin Bool BuiltinBool Source # | |
Defined in PlutusTx.Builtins.Class Methods toBuiltin :: Bool -> BuiltinBool Source # |
|
FromBuiltin BuiltinBool Bool Source # | |
Defined in PlutusTx.Builtins.Class Methods fromBuiltin :: BuiltinBool -> Bool Source # |
true :: BuiltinBool Source #
false :: BuiltinBool Source #
ifThenElse :: BuiltinBool -> a -> a -> a Source #
data BuiltinUnit Source #
Constructors
BuiltinUnit () |
Instances
Data BuiltinUnit Source # | |
Defined in PlutusTx.Builtins.Internal Methods gfoldl :: ( forall d b. Data d => c (d -> b) -> d -> c b) -> ( forall g. g -> c g) -> BuiltinUnit -> c BuiltinUnit Source # gunfold :: ( forall b r. Data b => c (b -> r) -> c r) -> ( forall r. r -> c r) -> Constr -> c BuiltinUnit Source # toConstr :: BuiltinUnit -> Constr Source # dataTypeOf :: BuiltinUnit -> DataType Source # dataCast1 :: Typeable t => ( forall d. Data d => c (t d)) -> Maybe (c BuiltinUnit ) Source # dataCast2 :: Typeable t => ( forall d e. ( Data d, Data e) => c (t d e)) -> Maybe (c BuiltinUnit ) Source # gmapT :: ( forall b. Data b => b -> b) -> BuiltinUnit -> BuiltinUnit Source # gmapQl :: (r -> r' -> r) -> r -> ( forall d. Data d => d -> r') -> BuiltinUnit -> r Source # gmapQr :: forall r r'. (r' -> r -> r) -> r -> ( forall d. Data d => d -> r') -> BuiltinUnit -> r Source # gmapQ :: ( forall d. Data d => d -> u) -> BuiltinUnit -> [u] Source # gmapQi :: Int -> ( forall d. Data d => d -> u) -> BuiltinUnit -> u Source # gmapM :: Monad m => ( forall d. Data d => d -> m d) -> BuiltinUnit -> m BuiltinUnit Source # gmapMp :: MonadPlus m => ( forall d. Data d => d -> m d) -> BuiltinUnit -> m BuiltinUnit Source # gmapMo :: MonadPlus m => ( forall d. Data d => d -> m d) -> BuiltinUnit -> m BuiltinUnit Source # |
|
ToBuiltin () BuiltinUnit Source # | |
Defined in PlutusTx.Builtins.Class Methods toBuiltin :: () -> BuiltinUnit Source # |
|
FromBuiltin BuiltinUnit () Source # | |
Defined in PlutusTx.Builtins.Class Methods fromBuiltin :: BuiltinUnit -> () Source # |
chooseUnit :: BuiltinUnit -> a -> a Source #
type BuiltinInteger = Integer Source #
data BuiltinByteString Source #
An opaque type representing Plutus Core ByteStrings.
Constructors
BuiltinByteString ByteString |
Instances
sliceByteString :: BuiltinInteger -> BuiltinInteger -> BuiltinByteString -> BuiltinByteString Source #
verifyEd25519Signature :: BuiltinByteString -> BuiltinByteString -> BuiltinByteString -> BuiltinBool Source #
verifyEcdsaSecp256k1Signature :: BuiltinByteString -> BuiltinByteString -> BuiltinByteString -> BuiltinBool Source #
verifySchnorrSecp256k1Signature :: BuiltinByteString -> BuiltinByteString -> BuiltinByteString -> BuiltinBool Source #
data BuiltinString Source #
Constructors
BuiltinString Text |
Instances
equalsString :: BuiltinString -> BuiltinString -> BuiltinBool Source #
trace :: BuiltinString -> a -> a Source #
data BuiltinPair a b Source #
Constructors
BuiltinPair (a, b) |
Instances
fst :: BuiltinPair a b -> a Source #
snd :: BuiltinPair a b -> b Source #
data BuiltinList a Source #
Constructors
BuiltinList [a] |
Instances
null :: BuiltinList a -> BuiltinBool Source #
head :: BuiltinList a -> a Source #
tail :: BuiltinList a -> BuiltinList a Source #
chooseList :: BuiltinList a -> b -> b -> b Source #
mkCons :: a -> BuiltinList a -> BuiltinList a Source #
data BuiltinData Source #
A type corresponding to the Plutus Core builtin equivalent of
Data
.
The point of this type is to be an opaque equivalent of
Data
, so as to
ensure that it is only used in ways that the compiler can handle.
As such, you should use this type in your on-chain code, and in any data structures that you want to be representable on-chain.
For off-chain usage, there are conversion functions
builtinDataToData
and
dataToBuiltinData
, but note that these will not work on-chain.
Constructors
BuiltinData Data |
Instances
builtinDataToData :: BuiltinData -> Data Source #
Convert a
BuiltinData
into a
Data
. Only works off-chain.
dataToBuiltinData :: Data -> BuiltinData Source #
Convert a
Data
into a
BuiltinData
. Only works off-chain.
chooseData :: forall a. BuiltinData -> a -> a -> a -> a -> a -> a Source #
mkMap :: BuiltinList ( BuiltinPair BuiltinData BuiltinData ) -> BuiltinData Source #
mkI :: BuiltinInteger -> BuiltinData Source #
mkB :: BuiltinByteString -> BuiltinData Source #
unsafeDataAsConstr :: BuiltinData -> BuiltinPair BuiltinInteger ( BuiltinList BuiltinData ) Source #
equalsData :: BuiltinData -> BuiltinData -> BuiltinBool Source #