Safe Haskell | None |
---|---|
Language | Haskell2010 |
Complete, signed transactions
Synopsis
- data Tx era where
- ShelleyTx :: forall era. ShelleyBasedEra era -> Tx (ShelleyLedgerEra era) -> Tx era
- pattern Tx :: TxBody era -> [KeyWitness era] -> Tx era
- data ATxAux a = ATxAux {
- aTaTx :: !(Annotated Tx a)
- aTaWitness :: !(Annotated TxWitness a)
- aTaAnnotation :: !a
- getTxBody :: Tx era -> TxBody era
- getByronTxBody :: ATxAux ByteString -> Annotated Tx ByteString
- getTxWitnesses :: Tx era -> [KeyWitness era]
- getTxWitnessesByron :: ATxAux ByteString -> [KeyWitness ByronEra]
- data ScriptValidity
- data ShelleySigningKey
- toShelleySigningKey :: ShelleyWitnessSigningKey -> ShelleySigningKey
- signByronTransaction :: NetworkId -> Annotated Tx ByteString -> [SigningKey ByronKey] -> ATxAux ByteString
- signShelleyTransaction :: ShelleyBasedEra era -> TxBody era -> [ShelleyWitnessSigningKey] -> Tx era
- makeSignedByronTransaction :: [KeyWitness era] -> Annotated Tx ByteString -> ATxAux ByteString
- makeSignedTransaction :: [KeyWitness era] -> TxBody era -> Tx era
- makeSignedTransaction' :: CardanoEra era -> [KeyWitness era] -> TxBody era -> Tx era
- data KeyWitness era where
- ByronKeyWitness :: TxInWitness -> KeyWitness ByronEra
- ShelleyBootstrapWitness :: forall era. ShelleyBasedEra era -> BootstrapWitness StandardCrypto -> KeyWitness era
- ShelleyKeyWitness :: forall era. ShelleyBasedEra era -> WitVKey 'Witness StandardCrypto -> KeyWitness era
- makeByronKeyWitness :: IsByronKey key => NetworkId -> Annotated Tx ByteString -> SigningKey key -> KeyWitness ByronEra
- data ShelleyWitnessSigningKey
- = WitnessPaymentKey (SigningKey PaymentKey)
- | WitnessPaymentExtendedKey (SigningKey PaymentExtendedKey)
- | WitnessStakeKey (SigningKey StakeKey)
- | WitnessStakeExtendedKey (SigningKey StakeExtendedKey)
- | WitnessStakePoolKey (SigningKey StakePoolKey)
- | WitnessGenesisKey (SigningKey GenesisKey)
- | WitnessGenesisExtendedKey (SigningKey GenesisExtendedKey)
- | WitnessGenesisDelegateKey (SigningKey GenesisDelegateKey)
- | WitnessGenesisDelegateExtendedKey (SigningKey GenesisDelegateExtendedKey)
- | WitnessGenesisUTxOKey (SigningKey GenesisUTxOKey)
- | WitnessCommitteeColdKey (SigningKey CommitteeColdKey)
- | WitnessCommitteeColdExtendedKey (SigningKey CommitteeColdExtendedKey)
- | WitnessCommitteeHotKey (SigningKey CommitteeHotKey)
- | WitnessCommitteeHotExtendedKey (SigningKey CommitteeHotExtendedKey)
- | WitnessDRepKey (SigningKey DRepKey)
- | WitnessDRepExtendedKey (SigningKey DRepExtendedKey)
- makeShelleyKeyWitness :: ShelleyBasedEra era -> TxBody era -> ShelleyWitnessSigningKey -> KeyWitness era
- data WitnessNetworkIdOrByronAddress
- makeShelleyBootstrapWitness :: ShelleyBasedEra era -> WitnessNetworkIdOrByronAddress -> TxBody era -> SigningKey ByronKey -> KeyWitness era
- makeShelleySignature :: SignableRepresentation tosign => tosign -> ShelleySigningKey -> SignedDSIGN StandardCrypto tosign
- getShelleyKeyWitnessVerificationKey :: ShelleySigningKey -> VKey 'Witness StandardCrypto
- getTxBodyAndWitnesses :: Tx era -> (TxBody era, [KeyWitness era])
- data family AsType t
- data TxBody era where
- ShelleyTxBody :: forall era. ShelleyBasedEra era -> TxBody (ShelleyLedgerEra era) -> [Script (ShelleyLedgerEra era)] -> TxBodyScriptData era -> Maybe (TxAuxData (ShelleyLedgerEra era)) -> TxScriptValidity era -> TxBody era
- data TxScriptValidity era where
- TxScriptValidityNone :: forall era. TxScriptValidity era
- TxScriptValidity :: forall era. AlonzoEraOnwards era -> ScriptValidity -> TxScriptValidity era
- scriptValidityToIsValid :: ScriptValidity -> IsValid
- isValidToScriptValidity :: IsValid -> ScriptValidity
- txScriptValidityToIsValid :: TxScriptValidity era -> IsValid
- txScriptValidityToScriptValidity :: TxScriptValidity era -> ScriptValidity
- data TxBodyScriptData era where
- TxBodyNoScriptData :: forall era. TxBodyScriptData era
- TxBodyScriptData :: forall era. AlonzoEraOnwardsConstraints era => AlonzoEraOnwards era -> TxDats (ShelleyLedgerEra era) -> Redeemers (ShelleyLedgerEra era) -> TxBodyScriptData era
Signing transactions
Creating transaction witnesses one by one, or all in one go.
ShelleyTx :: forall era. ShelleyBasedEra era -> Tx (ShelleyLedgerEra era) -> Tx era |
pattern Tx :: TxBody era -> [KeyWitness era] -> Tx era |
Instances
ATxAux | |
|
Instances
getTxWitnesses :: Tx era -> [KeyWitness era] Source #
data ScriptValidity Source #
Indicates whether a script is expected to fail or pass validation.
ScriptInvalid | Script is expected to fail validation. Transactions marked as such can include scripts that fail validation. Such transactions may be submitted to the chain, in which case the collateral will be taken upon on chain script validation failure. |
ScriptValid | Script is expected to pass validation. Transactions marked as such cannot include scripts that fail validation. |
Instances
Show ScriptValidity Source # | |
Defined in Cardano.Api.Tx.Sign | |
DecCBOR ScriptValidity Source # | |
Defined in Cardano.Api.Tx.Sign | |
EncCBOR ScriptValidity Source # | |
Defined in Cardano.Api.Tx.Sign encCBOR :: ScriptValidity -> Encoding Source # encodedSizeExpr :: (forall t. EncCBOR t => Proxy t -> Size) -> Proxy ScriptValidity -> Size Source # encodedListSizeExpr :: (forall t. EncCBOR t => Proxy t -> Size) -> Proxy [ScriptValidity] -> Size Source # | |
Eq ScriptValidity Source # | |
Defined in Cardano.Api.Tx.Sign (==) :: ScriptValidity -> ScriptValidity -> Bool Source # (/=) :: ScriptValidity -> ScriptValidity -> Bool Source # |
Signing in one go
data ShelleySigningKey Source #
We support making key witnesses with both normal and extended signing keys.
ShelleyNormalSigningKey (SignKeyDSIGN StandardCrypto) | A normal ed25519 signing key |
ShelleyExtendedSigningKey XPrv | An extended ed25519 signing key |
signByronTransaction :: NetworkId -> Annotated Tx ByteString -> [SigningKey ByronKey] -> ATxAux ByteString Source #
signShelleyTransaction :: ShelleyBasedEra era -> TxBody era -> [ShelleyWitnessSigningKey] -> Tx era Source #
Incremental signing and separate witnesses
makeSignedByronTransaction :: [KeyWitness era] -> Annotated Tx ByteString -> ATxAux ByteString Source #
makeSignedTransaction :: [KeyWitness era] -> TxBody era -> Tx era Source #
makeSignedTransaction' :: CardanoEra era -> [KeyWitness era] -> TxBody era -> Tx era Source #
data KeyWitness era where Source #
ByronKeyWitness :: TxInWitness -> KeyWitness ByronEra | |
ShelleyBootstrapWitness :: forall era. ShelleyBasedEra era -> BootstrapWitness StandardCrypto -> KeyWitness era | |
ShelleyKeyWitness :: forall era. ShelleyBasedEra era -> WitVKey 'Witness StandardCrypto -> KeyWitness era |
Instances
Show (KeyWitness era) Source # | |||||
Defined in Cardano.Api.Tx.Sign | |||||
HasTypeProxy era => HasTypeProxy (KeyWitness era) Source # | |||||
Defined in Cardano.Api.Tx.Sign
proxyToAsType :: Proxy (KeyWitness era) -> AsType (KeyWitness era) Source # | |||||
IsCardanoEra era => SerialiseAsCBOR (KeyWitness era) Source # | |||||
Defined in Cardano.Api.Tx.Sign serialiseToCBOR :: KeyWitness era -> ByteString Source # deserialiseFromCBOR :: AsType (KeyWitness era) -> ByteString -> Either DecoderError (KeyWitness era) Source # | |||||
IsCardanoEra era => HasTextEnvelope (KeyWitness era) Source # | |||||
Defined in Cardano.Api.Tx.Sign textEnvelopeType :: AsType (KeyWitness era) -> TextEnvelopeType Source # textEnvelopeDefaultDescr :: KeyWitness era -> TextEnvelopeDescr Source # | |||||
Eq (KeyWitness era) Source # | |||||
Defined in Cardano.Api.Tx.Sign (==) :: KeyWitness era -> KeyWitness era -> Bool Source # (/=) :: KeyWitness era -> KeyWitness era -> Bool Source # | |||||
data AsType (KeyWitness era) Source # | |||||
Defined in Cardano.Api.Tx.Sign |
makeByronKeyWitness :: IsByronKey key => NetworkId -> Annotated Tx ByteString -> SigningKey key -> KeyWitness ByronEra Source #
data ShelleyWitnessSigningKey Source #
WitnessPaymentKey (SigningKey PaymentKey) | |
WitnessPaymentExtendedKey (SigningKey PaymentExtendedKey) | |
WitnessStakeKey (SigningKey StakeKey) | |
WitnessStakeExtendedKey (SigningKey StakeExtendedKey) | |
WitnessStakePoolKey (SigningKey StakePoolKey) | |
WitnessGenesisKey (SigningKey GenesisKey) | |
WitnessGenesisExtendedKey (SigningKey GenesisExtendedKey) | |
WitnessGenesisDelegateKey (SigningKey GenesisDelegateKey) | |
WitnessGenesisDelegateExtendedKey (SigningKey GenesisDelegateExtendedKey) | |
WitnessGenesisUTxOKey (SigningKey GenesisUTxOKey) | |
WitnessCommitteeColdKey (SigningKey CommitteeColdKey) | |
WitnessCommitteeColdExtendedKey (SigningKey CommitteeColdExtendedKey) | |
WitnessCommitteeHotKey (SigningKey CommitteeHotKey) | |
WitnessCommitteeHotExtendedKey (SigningKey CommitteeHotExtendedKey) | |
WitnessDRepKey (SigningKey DRepKey) | |
WitnessDRepExtendedKey (SigningKey DRepExtendedKey) |
makeShelleyKeyWitness :: ShelleyBasedEra era -> TxBody era -> ShelleyWitnessSigningKey -> KeyWitness era Source #
data WitnessNetworkIdOrByronAddress Source #
Either a network ID or a Byron address to be used in constructing a Shelley bootstrap witness.
WitnessNetworkId !NetworkId | Network ID. If this value is used in the construction of a Shelley bootstrap witness,
the result will not consist of a derivation path. If that is required,
specify a |
WitnessByronAddress !(Address ByronAddr) | Byron address. If this value is used in the construction of a Shelley bootstrap witness, both the network ID and derivation path will be extracted from the address and used in the construction of the witness. |
makeShelleyBootstrapWitness :: ShelleyBasedEra era -> WitnessNetworkIdOrByronAddress -> TxBody era -> SigningKey ByronKey -> KeyWitness era Source #
makeShelleySignature :: SignableRepresentation tosign => tosign -> ShelleySigningKey -> SignedDSIGN StandardCrypto tosign Source #
getTxBodyAndWitnesses :: Tx era -> (TxBody era, [KeyWitness era]) Source #
Data family instances
A family of singleton types used in this API to indicate which type to use where it would otherwise be ambiguous or merely unclear.
Values of this type are passed to deserialisation functions for example.
Instances
data AsType AddressAny Source # | |
Defined in Cardano.Api.Address | |
data AsType ByronAddr Source # | |
Defined in Cardano.Api.Address | |
data AsType ShelleyAddr Source # | |
Defined in Cardano.Api.Address | |
data AsType StakeAddress Source # | |
Defined in Cardano.Api.Address | |
data AsType BlockHeader Source # | |
Defined in Cardano.Api.Block | |
data AsType DRepMetadata Source # | |
Defined in Cardano.Api.DRepMetadata | |
data AsType AllegraEra Source # | |
Defined in Cardano.Api.Eras.Core | |
data AsType AlonzoEra Source # | |
Defined in Cardano.Api.Eras.Core | |
data AsType BabbageEra Source # | |
Defined in Cardano.Api.Eras.Core | |
data AsType ByronEra Source # | |
Defined in Cardano.Api.Eras.Core | |
data AsType ConwayEra Source # | |
Defined in Cardano.Api.Eras.Core | |
data AsType MaryEra Source # | |
Defined in Cardano.Api.Eras.Core | |
data AsType ShelleyEra Source # | |
Defined in Cardano.Api.Eras.Core | |
data AsType GovernancePoll Source # | |
Defined in Cardano.Api.Governance.Poll | |
data AsType GovernancePollAnswer Source # | |
Defined in Cardano.Api.Governance.Poll | |
data AsType ByronKey Source # | |
Defined in Cardano.Api.Keys.Byron | |
data AsType ByronKeyLegacy Source # | |
Defined in Cardano.Api.Keys.Byron | |
data AsType KesKey Source # | |
Defined in Cardano.Api.Keys.Praos | |
data AsType VrfKey Source # | |
Defined in Cardano.Api.Keys.Praos | |
data AsType CommitteeColdExtendedKey Source # | |
Defined in Cardano.Api.Keys.Shelley | |
data AsType CommitteeColdKey Source # | |
Defined in Cardano.Api.Keys.Shelley | |
data AsType CommitteeHotExtendedKey Source # | |
Defined in Cardano.Api.Keys.Shelley | |
data AsType CommitteeHotKey Source # | |
Defined in Cardano.Api.Keys.Shelley | |
data AsType DRepExtendedKey Source # | |
Defined in Cardano.Api.Keys.Shelley | |
data AsType DRepKey Source # | |
Defined in Cardano.Api.Keys.Shelley | |
data AsType GenesisDelegateExtendedKey Source # | |
Defined in Cardano.Api.Keys.Shelley | |
data AsType GenesisDelegateKey Source # | |
Defined in Cardano.Api.Keys.Shelley | |
data AsType GenesisExtendedKey Source # | |
Defined in Cardano.Api.Keys.Shelley | |
data AsType GenesisKey Source # | |
Defined in Cardano.Api.Keys.Shelley | |
data AsType GenesisUTxOKey Source # | |
Defined in Cardano.Api.Keys.Shelley | |
data AsType PaymentExtendedKey Source # | |
Defined in Cardano.Api.Keys.Shelley | |
data AsType PaymentKey Source # | |
Defined in Cardano.Api.Keys.Shelley | |
data AsType StakeExtendedKey Source # | |
Defined in Cardano.Api.Keys.Shelley | |
data AsType StakeKey Source # | |
Defined in Cardano.Api.Keys.Shelley | |
data AsType StakePoolKey Source # | |
Defined in Cardano.Api.Keys.Shelley | |
data AsType OperationalCertificate Source # | |
data AsType OperationalCertificateIssueCounter Source # | |
data AsType PraosNonce Source # | |
Defined in Cardano.Api.ProtocolParameters | |
data AsType UpdateProposal Source # | |
Defined in Cardano.Api.ProtocolParameters | |
data AsType PlutusScriptV1 Source # | |
Defined in Cardano.Api.Script | |
data AsType PlutusScriptV2 Source # | |
Defined in Cardano.Api.Script | |
data AsType PlutusScriptV3 Source # | |
Defined in Cardano.Api.Script | |
data AsType ScriptHash Source # | |
Defined in Cardano.Api.Script | |
data AsType ScriptInAnyLang Source # | |
Defined in Cardano.Api.Script | |
data AsType SimpleScript' Source # | |
Defined in Cardano.Api.Script | |
data AsType HashableScriptData Source # | |
Defined in Cardano.Api.ScriptData | |
data AsType ScriptData Source # | |
Defined in Cardano.Api.ScriptData | |
data AsType TextEnvelope Source # | |
Defined in Cardano.Api.SerialiseTextEnvelope | |
data AsType ByronUpdateProposal Source # | |
Defined in Cardano.Api.SpecialByron | |
data AsType ByronVote Source # | |
Defined in Cardano.Api.SpecialByron | |
data AsType StakePoolMetadata Source # | |
Defined in Cardano.Api.StakePoolMetadata | |
data AsType TxId Source # | |
Defined in Cardano.Api.TxIn | |
data AsType TxMetadata Source # | |
Defined in Cardano.Api.TxMetadata | |
data AsType AssetName Source # | |
Defined in Cardano.Api.Value | |
data AsType PolicyId Source # | |
Defined in Cardano.Api.Value | |
data AsType (Address addrtype) Source # | |
Defined in Cardano.Api.Address | |
data AsType (AddressInEra era) Source # | |
Defined in Cardano.Api.Address | |
data AsType (Certificate era) Source # | |
Defined in Cardano.Api.Certificate | |
data AsType (Proposal era) Source # | |
data AsType (VotingProcedure era) Source # | |
data AsType (VotingProcedures era) Source # | |
data AsType (Hash a) Source # | |
Defined in Cardano.Api.Hash | |
data AsType (SigningKey a) Source # | |
Defined in Cardano.Api.Keys.Class | |
data AsType (VerificationKey a) Source # | |
Defined in Cardano.Api.Keys.Class | |
data AsType (PlutusScript lang) Source # | |
Defined in Cardano.Api.Script | |
data AsType (Script lang) Source # | |
Defined in Cardano.Api.Script | |
data AsType (ScriptInEra era) Source # | |
Defined in Cardano.Api.Script | |
data AsType (KeyWitness era) Source # | |
Defined in Cardano.Api.Tx.Sign | |
data AsType (Tx era) Source # | |
Defined in Cardano.Api.Tx.Sign | |
data AsType (TxBody era) Source # | |
Defined in Cardano.Api.Tx.Sign |
data TxBody era where Source #
ShelleyTxBody | |
|
Instances
Show (TxBody era) Source # | |||||
HasTypeProxy era => HasTypeProxy (TxBody era) Source # | |||||
Defined in Cardano.Api.Tx.Sign
| |||||
IsShelleyBasedEra era => SerialiseAsCBOR (TxBody era) Source # | |||||
Defined in Cardano.Api.Tx.Sign serialiseToCBOR :: TxBody era -> ByteString Source # deserialiseFromCBOR :: AsType (TxBody era) -> ByteString -> Either DecoderError (TxBody era) Source # | |||||
IsShelleyBasedEra era => HasTextEnvelope (TxBody era) Source # | |||||
Defined in Cardano.Api.Tx.Sign textEnvelopeType :: AsType (TxBody era) -> TextEnvelopeType Source # textEnvelopeDefaultDescr :: TxBody era -> TextEnvelopeDescr Source # | |||||
Eq (TxBody era) Source # | |||||
data AsType (TxBody era) Source # | |||||
Defined in Cardano.Api.Tx.Sign |
data TxScriptValidity era where Source #
A representation of whether the era supports tx script validity.
The Alonzo and subsequent eras support script validity.
TxScriptValidityNone :: forall era. TxScriptValidity era | |
TxScriptValidity :: forall era. AlonzoEraOnwards era -> ScriptValidity -> TxScriptValidity era | Tx script validity is supported in transactions in the |
Instances
Show (TxScriptValidity era) Source # | |
Defined in Cardano.Api.Tx.Sign | |
Eq (TxScriptValidity era) Source # | |
Defined in Cardano.Api.Tx.Sign (==) :: TxScriptValidity era -> TxScriptValidity era -> Bool Source # (/=) :: TxScriptValidity era -> TxScriptValidity era -> Bool Source # |
txScriptValidityToIsValid :: TxScriptValidity era -> IsValid Source #
data TxBodyScriptData era where Source #
TxBodyNoScriptData :: forall era. TxBodyScriptData era | |
TxBodyScriptData :: forall era. AlonzoEraOnwardsConstraints era => AlonzoEraOnwards era -> TxDats (ShelleyLedgerEra era) -> Redeemers (ShelleyLedgerEra era) -> TxBodyScriptData era |
Instances
EraCrypto (ShelleyLedgerEra era) ~ StandardCrypto => Show (TxBodyScriptData era) Source # | |
Defined in Cardano.Api.Tx.Sign | |
Eq (TxBodyScriptData era) Source # | |
Defined in Cardano.Api.Tx.Sign (==) :: TxBodyScriptData era -> TxBodyScriptData era -> Bool Source # (/=) :: TxBodyScriptData era -> TxBodyScriptData era -> Bool Source # |