cardano-addresses-3.11.0: Library utilities for mnemonic generation and address derivation.
Safe Haskell None
Language Haskell2010

Cardano.Address.Script

Synopsis

Script

data Script (elem :: Type ) Source #

A Script type represents multi signature script. The script embodies conditions that need to be satisfied to make it valid.

Since: 3.0.0

Instances

Instances details
Eq elem => Eq ( Script elem) Source #
Instance details

Defined in Cardano.Address.Script

Show elem => Show ( Script elem) Source #
Instance details

Defined in Cardano.Address.Script

Generic ( Script elem) Source #
Instance details

Defined in Cardano.Address.Script

Associated Types

type Rep ( Script elem) :: Type -> Type Source #

ToJSON elem => ToJSON ( Script elem) Source #
Instance details

Defined in Cardano.Address.Script

FromJSON ( Script KeyHash ) Source #
Instance details

Defined in Cardano.Address.Script

FromJSON ( Script Cosigner ) Source #
Instance details

Defined in Cardano.Address.Script

NFData elem => NFData ( Script elem) Source #
Instance details

Defined in Cardano.Address.Script

Methods

rnf :: Script elem -> () Source #

type Rep ( Script elem) Source #
Instance details

Defined in Cardano.Address.Script

serializeScript :: Script KeyHash -> ByteString Source #

This function realizes what cardano-node's `Api.serialiseToCBOR script` realizes This is basically doing the symbolically following: toCBOR [0,multisigScript]

Since: 3.0.0

foldScript :: (a -> b -> b) -> b -> Script a -> b Source #

Script folding

Since: 3.2.0

Script template

data ScriptTemplate Source #

Represents the script template that show the structure of the script and determines the expected place of verification keys corresponding to given cosigners.

Since: 3.2.0

Instances

Instances details
Eq ScriptTemplate Source #
Instance details

Defined in Cardano.Address.Script

Show ScriptTemplate Source #
Instance details

Defined in Cardano.Address.Script

Generic ScriptTemplate Source #
Instance details

Defined in Cardano.Address.Script

ToJSON ScriptTemplate Source #
Instance details

Defined in Cardano.Address.Script

FromJSON ScriptTemplate Source #
Instance details

Defined in Cardano.Address.Script

NFData ScriptTemplate Source #
Instance details

Defined in Cardano.Address.Script

type Rep ScriptTemplate Source #
Instance details

Defined in Cardano.Address.Script

newtype Cosigner Source #

Represents the cosigner of the script, ie., party that co-shares the script.

Since: 3.2.0

Constructors

Cosigner Word8

Instances

Instances details
Eq Cosigner Source #
Instance details

Defined in Cardano.Address.Script

Ord Cosigner Source #
Instance details

Defined in Cardano.Address.Script

Show Cosigner Source #
Instance details

Defined in Cardano.Address.Script

Generic Cosigner Source #
Instance details

Defined in Cardano.Address.Script

Hashable Cosigner Source #
Instance details

Defined in Cardano.Address.Script

ToJSON Cosigner Source #
Instance details

Defined in Cardano.Address.Script

FromJSON Cosigner Source #
Instance details

Defined in Cardano.Address.Script

NFData Cosigner Source #
Instance details

Defined in Cardano.Address.Script

FromJSON ( Script Cosigner ) Source #
Instance details

Defined in Cardano.Address.Script

type Rep Cosigner Source #
Instance details

Defined in Cardano.Address.Script

type Rep Cosigner = D1 (' MetaData "Cosigner" "Cardano.Address.Script" "cardano-addresses-3.11.0-D40zGSHo3QMFNy9OpWafYI" ' True ) ( C1 (' MetaCons "Cosigner" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 Word8 )))

Validation

prettyErrValidateScript :: ErrValidateScript -> String Source #

Pretty-print a script validation error.

Since: 3.0.0

prettyErrValidateScriptTemplate :: ErrValidateScriptTemplate -> String Source #

Pretty-print a script template validation error.

Since: 3.2.0

Hashing

newtype ScriptHash Source #

A ScriptHash type represents script hash. The hash is expected to have size of 28-byte.

Since: 3.0.0

Instances

Instances details
Eq ScriptHash Source #
Instance details

Defined in Cardano.Address.Script

Ord ScriptHash Source #
Instance details

Defined in Cardano.Address.Script

Show ScriptHash Source #
Instance details

Defined in Cardano.Address.Script

Generic ScriptHash Source #
Instance details

Defined in Cardano.Address.Script

NFData ScriptHash Source #
Instance details

Defined in Cardano.Address.Script

type Rep ScriptHash Source #
Instance details

Defined in Cardano.Address.Script

type Rep ScriptHash = D1 (' MetaData "ScriptHash" "Cardano.Address.Script" "cardano-addresses-3.11.0-D40zGSHo3QMFNy9OpWafYI" ' True ) ( C1 (' MetaCons "ScriptHash" ' PrefixI ' True ) ( S1 (' MetaSel (' Just "unScriptHash") ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 ByteString )))

toScriptHash :: Script KeyHash -> ScriptHash Source #

Computes the hash of a given script, by first serializing it to CBOR.

Since: 3.0.0

data KeyHash Source #

A KeyHash type represents verification key hash that participate in building multi-signature script. The hash is expected to have size of 28-byte.

Since: 3.0.0

Instances

Instances details
Eq KeyHash Source #
Instance details

Defined in Cardano.Address.Script

Ord KeyHash Source #
Instance details

Defined in Cardano.Address.Script

Show KeyHash Source #
Instance details

Defined in Cardano.Address.Script

Generic KeyHash Source #
Instance details

Defined in Cardano.Address.Script

ToJSON KeyHash Source #
Instance details

Defined in Cardano.Address.Script

NFData KeyHash Source #
Instance details

Defined in Cardano.Address.Script

FromJSON ( Script KeyHash ) Source #
Instance details

Defined in Cardano.Address.Script

type Rep KeyHash Source #
Instance details

Defined in Cardano.Address.Script

keyHashFromText :: Text -> Either ErrKeyHashFromText KeyHash Source #

Construct a KeyHash from Text . It should be Bech32 encoded text with one of following hrp: - addr_shared_vkh - stake_shared_vkh - addr_vkh - stake_vkh - policy_vkh - addr_shared_vk - stake_shared_vk - addr_vk - stake_vk - addr_shared_xvk - stake_shared_xvk - addr_xvk - stake_xvk - policy_vk - policy_xvk Raw keys will be hashed on the fly, whereas hash that are directly provided will remain as such.

Since: 3.1.0

keyHashToText :: KeyHash -> Text Source #

Encode a KeyHash to bech32 Text , using script_vkh as a human readable prefix.

Since: 3.0.0