Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data MetadataError
- renderMetadataError :: MetadataError -> Doc ann
- readFileTxMetadata :: TxMetadataJsonSchema -> MetadataFile -> ExceptT MetadataError IO TxMetadata
- readTxMetadata :: ShelleyBasedEra era -> TxMetadataJsonSchema -> [MetadataFile] -> IO (Either MetadataError (TxMetadataInEra era))
- data ScriptWitnessError
- = ScriptWitnessErrorFile (FileError ScriptDecodeError)
- | ScriptWitnessErrorScriptLanguageNotSupportedInEra AnyScriptLanguage AnyCardanoEra
- | ScriptWitnessErrorExpectedSimple !FilePath !AnyScriptLanguage
- | ScriptWitnessErrorExpectedPlutus !FilePath !AnyScriptLanguage
- | ScriptWitnessErrorReferenceScriptsNotSupportedInEra !AnyShelleyBasedEra
- | ScriptWitnessErrorScriptData ScriptDataError
- renderScriptWitnessError :: ScriptWitnessError -> Doc ann
- readScriptDataOrFile :: forall (m :: Type -> Type). MonadIO m => ScriptDataOrFile -> ExceptT ScriptDataError m HashableScriptData
- readScriptWitness :: ShelleyBasedEra era -> ScriptWitnessFiles witctx -> ExceptT ScriptWitnessError IO (ScriptWitness witctx era)
- readScriptWitnessFiles :: ShelleyBasedEra era -> [(a, Maybe (ScriptWitnessFiles ctx))] -> ExceptT ScriptWitnessError IO [(a, Maybe (ScriptWitness ctx era))]
- readScriptWitnessFilesTuple :: ShelleyBasedEra era -> [(a, b, Maybe (ScriptWitnessFiles ctx))] -> ExceptT ScriptWitnessError IO [(a, b, Maybe (ScriptWitness ctx era))]
- data ScriptDecodeError
- deserialiseScriptInAnyLang :: ByteString -> Either ScriptDecodeError ScriptInAnyLang
- readFileScriptInAnyLang :: forall t (m :: Type -> Type). MonadIOTransError (FileError ScriptDecodeError) t m => FilePath -> t m ScriptInAnyLang
- readFileSimpleScript :: forall t (m :: Type -> Type). MonadIOTransError (FileError ScriptDecodeError) t m => FilePath -> t m (Script SimpleScript')
- data AnyPlutusScript where
- AnyPlutusScript :: forall lang. IsPlutusScriptLanguage lang => PlutusScriptVersion lang -> PlutusScript lang -> AnyPlutusScript
- data PlutusScriptDecodeError
- readFilePlutusScript :: forall t (m :: Type -> Type). MonadIOTransError (FileError PlutusScriptDecodeError) t m => FilePath -> t m AnyPlutusScript
- data ScriptDataError
- = ScriptDataErrorFile (FileError ())
- | ScriptDataErrorJsonParse !FilePath !String
- | ScriptDataErrorConversion !FilePath !ScriptDataJsonError
- | ScriptDataErrorValidation !FilePath !ScriptDataRangeError
- | ScriptDataErrorMetadataDecode !FilePath !DecoderError
- | ScriptDataErrorJsonBytes !ScriptDataJsonBytesError
- readScriptDatumOrFile :: ScriptDatumOrFile witctx -> ExceptT ScriptDataError IO (ScriptDatum witctx)
- readScriptRedeemerOrFile :: ScriptRedeemerOrFile -> ExceptT ScriptDataError IO ScriptRedeemer
- renderScriptDataError :: ScriptDataError -> Doc ann
- data CddlError
- newtype CddlTx = CddlTx {}
- newtype IncompleteCddlTxBody = IncompleteCddlTxBody {}
- readFileTx :: FileOrPipe -> IO (Either (FileError TextEnvelopeCddlError) (InAnyShelleyBasedEra Tx))
- readFileTxBody :: FileOrPipe -> IO (Either (FileError TextEnvelopeCddlError) IncompleteCddlTxBody)
- readCddlTx :: FileOrPipe -> IO (Either (FileError TextEnvelopeCddlError) CddlTx)
- txTextEnvelopeTypes :: [Text]
- data ReadWitnessSigningDataError
- renderReadWitnessSigningDataError :: ReadWitnessSigningDataError -> Doc ann
- data SomeSigningWitness
- = AByronSigningWitness (SigningKey ByronKey) (Maybe (Address ByronAddr))
- | APaymentSigningWitness (SigningKey PaymentKey)
- | APaymentExtendedSigningWitness (SigningKey PaymentExtendedKey)
- | AStakeSigningWitness (SigningKey StakeKey)
- | AStakeExtendedSigningWitness (SigningKey StakeExtendedKey)
- | AStakePoolSigningWitness (SigningKey StakePoolKey)
- | AGenesisSigningWitness (SigningKey GenesisKey)
- | AGenesisExtendedSigningWitness (SigningKey GenesisExtendedKey)
- | AGenesisDelegateSigningWitness (SigningKey GenesisDelegateKey)
- | AGenesisDelegateExtendedSigningWitness (SigningKey GenesisDelegateExtendedKey)
- | AGenesisUTxOSigningWitness (SigningKey GenesisUTxOKey)
- | ADRepSigningWitness (SigningKey DRepKey)
- | ADRepExtendedSigningWitness (SigningKey DRepExtendedKey)
- | ACommitteeColdSigningWitness (SigningKey CommitteeColdKey)
- | ACommitteeColdExtendedSigningWitness (SigningKey CommitteeColdExtendedKey)
- | ACommitteeHotSigningWitness (SigningKey CommitteeHotKey)
- | ACommitteeHotExtendedSigningWitness (SigningKey CommitteeHotExtendedKey)
- data ByronOrShelleyWitness
- data ShelleyBootstrapWitnessSigningKeyData = ShelleyBootstrapWitnessSigningKeyData !(SigningKey ByronKey) !(Maybe (Address ByronAddr))
- data CddlWitnessError
- readFileTxKeyWitness :: FilePath -> IO (Either CddlWitnessError (InAnyShelleyBasedEra KeyWitness))
- readWitnessSigningData :: WitnessSigningData -> IO (Either ReadWitnessSigningDataError SomeSigningWitness)
- txWitnessTextEnvelopeTypes :: [Text]
- data RequiredSignerError
- categoriseSomeSigningWitness :: SomeSigningWitness -> ByronOrShelleyWitness
- readRequiredSigner :: RequiredSigner -> IO (Either RequiredSignerError (Hash PaymentKey))
- data ConstitutionError
- data ProposalError
- data VoteError
- readTxGovernanceActions :: ShelleyBasedEra era -> [(ProposalFile 'In, Maybe (ScriptWitnessFiles WitCtxStake))] -> IO (Either ProposalError [(Proposal era, Maybe (ScriptWitness WitCtxStake era))])
- constitutionHashSourceToHash :: ConstitutionHashSource -> ExceptT ConstitutionError IO (SafeHash StandardCrypto AnchorData)
- readProposal :: ConwayEraOnwards era -> (ProposalFile 'In, Maybe (ScriptWitnessFiles WitCtxStake)) -> IO (Either ProposalError (Proposal era, Maybe (ScriptWitness WitCtxStake era)))
- data CostModelsError
- readCostModels :: File CostModels 'In -> ExceptT CostModelsError IO CostModels
- data FileOrPipe
- fileOrPipe :: FilePath -> IO FileOrPipe
- fileOrPipePath :: FileOrPipe -> FilePath
- fileOrPipeCache :: FileOrPipe -> IO (Maybe ByteString)
- readFileOrPipe :: FileOrPipe -> IO ByteString
- getStakeCredentialFromVerifier :: StakeVerifier -> ExceptT StakeCredentialError IO StakeCredential
- getStakeCredentialFromIdentifier :: StakeIdentifier -> ExceptT StakeCredentialError IO StakeCredential
- getStakeAddressFromVerifier :: NetworkId -> StakeVerifier -> ExceptT StakeCredentialError IO StakeAddress
- readVotingProceduresFiles :: ConwayEraOnwards era -> [(VoteFile 'In, Maybe (ScriptWitnessFiles WitCtxStake))] -> IO (Either VoteError [(VotingProcedures era, Maybe (ScriptWitness WitCtxStake era))])
- readSingleVote :: ConwayEraOnwards era -> (VoteFile 'In, Maybe (ScriptWitnessFiles WitCtxStake)) -> IO (Either VoteError (VotingProcedures era, Maybe (ScriptWitness WitCtxStake era)))
- getDRepCredentialFromVerKeyHashOrFile :: forall t (m :: Type -> Type). MonadIOTransError (FileError InputDecodeError) t m => VerificationKeyOrHashOrFile DRepKey -> t m (Credential 'DRepRole StandardCrypto)
- data ReadSafeHashError
- readHexAsSafeHash :: Text -> Either ReadSafeHashError (SafeHash StandardCrypto AnchorData)
- readSafeHash :: ReadM (SafeHash StandardCrypto AnchorData)
- scriptHashReader :: ReadM ScriptHash
- readTxUpdateProposal :: ShelleyToBabbageEra era -> UpdateProposalFile -> ExceptT (FileError TextEnvelopeError) IO (TxUpdateProposal era)
- readVoteDelegationTarget :: VoteDelegationTarget -> ExceptT DelegationError IO (DRep StandardCrypto)
- readVerificationKeyOrHashOrFileOrScript :: forall t (m :: Type -> Type) keyrole (kr :: KeyRole). (MonadIOTransError (Either (FileError ScriptDecodeError) (FileError InputDecodeError)) t m, Key keyrole) => AsType keyrole -> (Hash keyrole -> KeyHash kr StandardCrypto) -> VerificationKeyOrHashOrFileOrScript keyrole -> t m (Credential kr StandardCrypto)
- readVerificationKeySource :: forall t (m :: Type -> Type) keyrole (kr :: KeyRole). (MonadIOTransError (Either (FileError ScriptDecodeError) (FileError InputDecodeError)) t m, Key keyrole) => AsType keyrole -> (Hash keyrole -> KeyHash kr StandardCrypto) -> VerificationKeySource keyrole -> t m (Credential kr StandardCrypto)
- readShelleyOnwardsGenesisAndHash :: MonadIO m => FilePath -> m (Hash Blake2b_256 ByteString)
Metadata
data MetadataError Source #
Instances
Show MetadataError Source # | |
Defined in Cardano.CLI.Read |
renderMetadataError :: MetadataError -> Doc ann Source #
readFileTxMetadata :: TxMetadataJsonSchema -> MetadataFile -> ExceptT MetadataError IO TxMetadata Source #
readTxMetadata :: ShelleyBasedEra era -> TxMetadataJsonSchema -> [MetadataFile] -> IO (Either MetadataError (TxMetadataInEra era)) Source #
Script
data ScriptWitnessError Source #
Instances
Show ScriptWitnessError Source # | |
Defined in Cardano.CLI.Read |
renderScriptWitnessError :: ScriptWitnessError -> Doc ann Source #
readScriptDataOrFile :: forall (m :: Type -> Type). MonadIO m => ScriptDataOrFile -> ExceptT ScriptDataError m HashableScriptData Source #
readScriptWitness :: ShelleyBasedEra era -> ScriptWitnessFiles witctx -> ExceptT ScriptWitnessError IO (ScriptWitness witctx era) Source #
readScriptWitnessFiles :: ShelleyBasedEra era -> [(a, Maybe (ScriptWitnessFiles ctx))] -> ExceptT ScriptWitnessError IO [(a, Maybe (ScriptWitness ctx era))] Source #
readScriptWitnessFilesTuple :: ShelleyBasedEra era -> [(a, b, Maybe (ScriptWitnessFiles ctx))] -> ExceptT ScriptWitnessError IO [(a, b, Maybe (ScriptWitness ctx era))] Source #
data ScriptDecodeError Source #
ScriptDecodeTextEnvelopeError TextEnvelopeError | |
ScriptDecodeSimpleScriptError JsonDecodeError | |
ScriptDecodeUnknownPlutusScriptVersion Text |
Instances
Show ScriptDecodeError Source # | |
Defined in Cardano.CLI.Types.Errors.ScriptDecodeError | |
Error ScriptDecodeError Source # | |
Defined in Cardano.CLI.Types.Errors.ScriptDecodeError prettyError :: ScriptDecodeError -> Doc ann # |
readFileScriptInAnyLang :: forall t (m :: Type -> Type). MonadIOTransError (FileError ScriptDecodeError) t m => FilePath -> t m ScriptInAnyLang Source #
Read a script file. The file can either be in the text envelope format wrapping the binary representation of any of the supported script languages, or alternatively it can be a JSON format file for one of the simple script language versions.
readFileSimpleScript :: forall t (m :: Type -> Type). MonadIOTransError (FileError ScriptDecodeError) t m => FilePath -> t m (Script SimpleScript') Source #
data AnyPlutusScript where Source #
AnyPlutusScript :: forall lang. IsPlutusScriptLanguage lang => PlutusScriptVersion lang -> PlutusScript lang -> AnyPlutusScript |
data PlutusScriptDecodeError Source #
PlutusScriptDecodeErrorUnknownVersion !Text | |
PlutusScriptJsonDecodeError !JsonDecodeError | |
PlutusScriptDecodeTextEnvelopeError !TextEnvelopeError | |
PlutusScriptDecodeErrorVersionMismatch | |
|
Instances
readFilePlutusScript :: forall t (m :: Type -> Type). MonadIOTransError (FileError PlutusScriptDecodeError) t m => FilePath -> t m AnyPlutusScript Source #
Script data (datums and redeemers)
data ScriptDataError Source #
Instances
readScriptDatumOrFile :: ScriptDatumOrFile witctx -> ExceptT ScriptDataError IO (ScriptDatum witctx) Source #
readScriptRedeemerOrFile :: ScriptRedeemerOrFile -> ExceptT ScriptDataError IO ScriptRedeemer Source #
renderScriptDataError :: ScriptDataError -> Doc ann Source #
Tx
Instances
newtype IncompleteCddlTxBody Source #
readFileTx :: FileOrPipe -> IO (Either (FileError TextEnvelopeCddlError) (InAnyShelleyBasedEra Tx)) Source #
readFileTxBody :: FileOrPipe -> IO (Either (FileError TextEnvelopeCddlError) IncompleteCddlTxBody) Source #
readCddlTx :: FileOrPipe -> IO (Either (FileError TextEnvelopeCddlError) CddlTx) Source #
txTextEnvelopeTypes :: [Text] Source #
Tx witnesses
data ReadWitnessSigningDataError Source #
ReadWitnessSigningDataSigningKeyDecodeError !(FileError InputDecodeError) | |
ReadWitnessSigningDataScriptError !(FileError JsonDecodeError) | |
ReadWitnessSigningDataSigningKeyAndAddressMismatch | A Byron address was specified alongside a non-Byron signing key. |
Instances
Show ReadWitnessSigningDataError Source # | |
Defined in Cardano.CLI.Read |
renderReadWitnessSigningDataError :: ReadWitnessSigningDataError -> Doc ann Source #
Render an error message for a ReadWitnessSigningDataError
.
data SomeSigningWitness Source #
Instances
Show SomeSigningWitness Source # | |
Defined in Cardano.CLI.Read |
data ByronOrShelleyWitness Source #
Some kind of Byron or Shelley witness.
data ShelleyBootstrapWitnessSigningKeyData Source #
Data required for constructing a Shelley bootstrap witness.
ShelleyBootstrapWitnessSigningKeyData | |
|
data CddlWitnessError Source #
CddlWitnessErrorTextEnv (FileError TextEnvelopeError) (FileError TextEnvelopeCddlError) | |
CddlWitnessIOError (FileError TextEnvelopeError) |
Instances
Show CddlWitnessError Source # | |
Defined in Cardano.CLI.Read | |
Error CddlWitnessError Source # | |
Defined in Cardano.CLI.Read prettyError :: CddlWitnessError -> Doc ann # |
readFileTxKeyWitness :: FilePath -> IO (Either CddlWitnessError (InAnyShelleyBasedEra KeyWitness)) Source #
readWitnessSigningData :: WitnessSigningData -> IO (Either ReadWitnessSigningDataError SomeSigningWitness) Source #
Required signer
data RequiredSignerError Source #
RequiredSignerErrorFile (FileError InputDecodeError) | |
RequiredSignerErrorByronKey (SigningKeyFile 'In) |
Instances
Show RequiredSignerError Source # | |
Defined in Cardano.CLI.Read | |
Error RequiredSignerError Source # | |
Defined in Cardano.CLI.Read prettyError :: RequiredSignerError -> Doc ann # |
Governance related
data ConstitutionError Source #
ConstitutionErrorFile (FileError TextEnvelopeError) | |
ConstitutionNotSupportedInEra AnyCardanoEra | |
ConstitutionNotUnicodeError UnicodeException |
Instances
Show ConstitutionError Source # | |
Defined in Cardano.CLI.Read |
data ProposalError Source #
ProposalErrorFile (FileError TextEnvelopeError) | |
ProposalNotSupportedInEra AnyCardanoEra | |
ProposalNotUnicodeError UnicodeException | |
ProposalErrorScriptWitness ScriptWitnessError |
Instances
Show ProposalError Source # | |
Defined in Cardano.CLI.Read |
readTxGovernanceActions :: ShelleyBasedEra era -> [(ProposalFile 'In, Maybe (ScriptWitnessFiles WitCtxStake))] -> IO (Either ProposalError [(Proposal era, Maybe (ScriptWitness WitCtxStake era))]) Source #
constitutionHashSourceToHash :: ConstitutionHashSource -> ExceptT ConstitutionError IO (SafeHash StandardCrypto AnchorData) Source #
readProposal :: ConwayEraOnwards era -> (ProposalFile 'In, Maybe (ScriptWitnessFiles WitCtxStake)) -> IO (Either ProposalError (Proposal era, Maybe (ScriptWitness WitCtxStake era))) Source #
data CostModelsError Source #
CostModelsErrorReadFile (FileError ()) | |
CostModelsErrorJSONDecode FilePath String | |
CostModelsErrorEmpty FilePath |
Instances
Show CostModelsError Source # | |
Defined in Cardano.CLI.Read | |
Error CostModelsError Source # | |
Defined in Cardano.CLI.Read prettyError :: CostModelsError -> Doc ann # |
FileOrPipe
data FileOrPipe Source #
We need a type for handling files that may be actually be things like pipes. Currently the CLI makes no guarantee that a "file" will only be read once. This is a problem for a user who who expects to be able to pass a pipe. To handle this, we have a type for representing either files or pipes where the contents will be saved in memory if what we're reading is a pipe (so it can be re-read later). Unfortunately this means we can't easily stream data from pipes, but at present that's not an issue.
Instances
Show FileOrPipe Source # | |
Defined in Cardano.CLI.Read |
fileOrPipe :: FilePath -> IO FileOrPipe Source #
fileOrPipePath :: FileOrPipe -> FilePath Source #
Get the path backing a FileOrPipe. This should primarily be used when generating error messages for a user. A user should not call directly call a function like readFile on the result of this function
fileOrPipeCache :: FileOrPipe -> IO (Maybe ByteString) Source #
readFileOrPipe :: FileOrPipe -> IO ByteString Source #
Get the contents of a file or pipe. This function reads the entire contents of the file or pipe, and is blocking.
Stake credentials
getStakeCredentialFromVerifier :: StakeVerifier -> ExceptT StakeCredentialError IO StakeCredential Source #
getStakeCredentialFromIdentifier :: StakeIdentifier -> ExceptT StakeCredentialError IO StakeCredential Source #
getStakeAddressFromVerifier :: NetworkId -> StakeVerifier -> ExceptT StakeCredentialError IO StakeAddress Source #
readVotingProceduresFiles :: ConwayEraOnwards era -> [(VoteFile 'In, Maybe (ScriptWitnessFiles WitCtxStake))] -> IO (Either VoteError [(VotingProcedures era, Maybe (ScriptWitness WitCtxStake era))]) Source #
readSingleVote :: ConwayEraOnwards era -> (VoteFile 'In, Maybe (ScriptWitnessFiles WitCtxStake)) -> IO (Either VoteError (VotingProcedures era, Maybe (ScriptWitness WitCtxStake era))) Source #
DRep credentials
getDRepCredentialFromVerKeyHashOrFile :: forall t (m :: Type -> Type). MonadIOTransError (FileError InputDecodeError) t m => VerificationKeyOrHashOrFile DRepKey -> t m (Credential 'DRepRole StandardCrypto) Source #
data ReadSafeHashError Source #
Update proposals
readTxUpdateProposal :: ShelleyToBabbageEra era -> UpdateProposalFile -> ExceptT (FileError TextEnvelopeError) IO (TxUpdateProposal era) Source #
Vote related
readVoteDelegationTarget :: VoteDelegationTarget -> ExceptT DelegationError IO (DRep StandardCrypto) Source #
readVerificationKeyOrHashOrFileOrScript :: forall t (m :: Type -> Type) keyrole (kr :: KeyRole). (MonadIOTransError (Either (FileError ScriptDecodeError) (FileError InputDecodeError)) t m, Key keyrole) => AsType keyrole -> (Hash keyrole -> KeyHash kr StandardCrypto) -> VerificationKeyOrHashOrFileOrScript keyrole -> t m (Credential kr StandardCrypto) Source #
readVerificationKeySource :: forall t (m :: Type -> Type) keyrole (kr :: KeyRole). (MonadIOTransError (Either (FileError ScriptDecodeError) (FileError InputDecodeError)) t m, Key keyrole) => AsType keyrole -> (Hash keyrole -> KeyHash kr StandardCrypto) -> VerificationKeySource keyrole -> t m (Credential kr StandardCrypto) Source #
Genesis hashes
readShelleyOnwardsGenesisAndHash Source #
:: MonadIO m | |
=> FilePath | The file to read |
-> m (Hash Blake2b_256 ByteString) |