Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data Secret a
- data SecretArgument a
- = UserSide a
- | EndpointSide (Secret a)
- mkSecret :: a -> Secret a
- secretArg :: a -> SecretArgument a
- extractSecret :: SecretArgument a -> Secret a
- escape_sha2_256 :: Secret BuiltinByteString -> BuiltinByteString
- unsafe_escape_secret :: Secret a -> a
Documentation
A secret value. A value of type `Secret a` can't leak onto
the blockchain in plain-text unless you use an unsafe function.
However, a value of type `Secret a` can end up on the blockchain
via one of the escape hatches like escape_sha2_256
.
Instances
Monad Secret Source # | |
Functor Secret Source # | |
Applicative Secret Source # | |
Applicative Secret Source # | |
Functor Secret Source # | |
Defined in Plutus.Contract.Secrets | |
Show (Secret a) Source # | |
IsString s => IsString (Secret s) Source # | |
Defined in Plutus.Contract.Secrets fromString :: String -> Secret s Source # |
data SecretArgument a Source #
Secret argments are provided in the endpoint argument types.
This type guarantees that a `SecretArgument a` that is seen by the endpoint code is a `Secret a` in a way that can not be bypassed by safe code.
UserSide a | |
EndpointSide (Secret a) |
Instances
Show a => Show (SecretArgument a) Source # | |
Defined in Plutus.Contract.Secrets | |
IsString s => IsString (SecretArgument s) Source # | |
Defined in Plutus.Contract.Secrets fromString :: String -> SecretArgument s Source # | |
FromJSON a => FromJSON (SecretArgument a) Source # | |
Defined in Plutus.Contract.Secrets parseJSON :: Value -> Parser (SecretArgument a) parseJSONList :: Value -> Parser [SecretArgument a] | |
ToJSON a => ToJSON (SecretArgument a) Source # | |
Defined in Plutus.Contract.Secrets toJSON :: SecretArgument a -> Value toEncoding :: SecretArgument a -> Encoding toJSONList :: [SecretArgument a] -> Value toEncodingList :: [SecretArgument a] -> Encoding |
secretArg :: a -> SecretArgument a Source #
Construct a secret argument
extractSecret :: SecretArgument a -> Secret a Source #
Extract a secret value from a secret argument
escape_sha2_256 :: Secret BuiltinByteString -> BuiltinByteString Source #
Take the sha2_256 hash of a secret value. The result of this function can be used on the blockchain.
unsafe_escape_secret :: Secret a -> a Source #
Warning: [Requires Review] An escape hatch is being created. This should only be used in trusted code.