Safe Haskell | None |
---|---|
Language | Haskell2010 |
Cardano.Api.Tx
Description
Complete, signed transactions
Synopsis
- data Tx era where
- ShelleyTx :: 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 :: forall era. Tx era -> [KeyWitness era]
- getTxWitnessesByron :: ATxAux ByteString -> [KeyWitness ByronEra]
- data ScriptValidity
- data ShelleySigningKey
- = ShelleyNormalSigningKey (SignKeyDSIGN StandardCrypto)
- | ShelleyExtendedSigningKey XPrv
- 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 :: forall era. [KeyWitness era] -> TxBody era -> Tx era
- makeSignedTransaction' :: CardanoEra era -> [KeyWitness era] -> TxBody era -> Tx era
- data KeyWitness era where
- ByronKeyWitness :: TxInWitness -> KeyWitness ByronEra
- ShelleyBootstrapWitness :: ShelleyBasedEra era -> BootstrapWitness StandardCrypto -> KeyWitness era
- ShelleyKeyWitness :: ShelleyBasedEra era -> WitVKey Witness StandardCrypto -> KeyWitness era
- makeByronKeyWitness :: forall key. 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)
- | WitnessCommitteeHotKey (SigningKey CommitteeHotKey)
- makeShelleyKeyWitness :: forall era. ShelleyBasedEra era -> TxBody era -> ShelleyWitnessSigningKey -> KeyWitness era
- data WitnessNetworkIdOrByronAddress
- makeShelleyBootstrapWitness :: forall era. 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
Signing transactions
Creating transaction witnesses one by one, or all in one go.
Constructors
ShelleyTx :: ShelleyBasedEra era -> Tx (ShelleyLedgerEra era) -> Tx era |
Bundled Patterns
pattern Tx :: TxBody era -> [KeyWitness era] -> Tx era |
Instances
Constructors
ATxAux | |
Fields
|
Instances
Functor ATxAux | |
DecCBOR TxAux | |
EncCBOR TxAux | |
Defined in Cardano.Chain.UTxO.TxAux Methods encCBOR :: TxAux -> Encoding encodedSizeExpr :: (forall t. EncCBOR t => Proxy t -> Size) -> Proxy TxAux -> Size encodedListSizeExpr :: (forall t. EncCBOR t => Proxy t -> Size) -> Proxy [TxAux] -> Size | |
FromCBOR TxAux | |
ToCBOR TxAux | |
Defined in Cardano.Chain.UTxO.TxAux | |
Buildable TxAux | |
Defined in Cardano.Chain.UTxO.TxAux Methods build :: TxAux -> Builder | |
Eq a => Eq (ATxAux a) | |
Show a => Show (ATxAux a) | |
Generic (ATxAux a) | |
NFData a => NFData (ATxAux a) | |
Defined in Cardano.Chain.UTxO.TxAux | |
DecCBOR (ATxAux ByteSpan) | |
FromCBOR (ATxAux ByteSpan) | |
ToJSON a => ToJSON (ATxAux a) | |
Defined in Cardano.Chain.UTxO.TxAux | |
Decoded (ATxAux ByteString) | |
Defined in Cardano.Chain.UTxO.TxAux Associated Types type BaseType (ATxAux ByteString) Methods recoverBytes :: ATxAux ByteString -> ByteString | |
type Rep (ATxAux a) | |
Defined in Cardano.Chain.UTxO.TxAux type Rep (ATxAux a) = D1 ('MetaData "ATxAux" "Cardano.Chain.UTxO.TxAux" "cardano-ledger-byron-1.0.0.3-7XPhaeqCEJ61p5A3PpSRBs" 'False) (C1 ('MetaCons "ATxAux" 'PrefixI 'True) (S1 ('MetaSel ('Just "aTaTx") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Annotated Tx a)) :*: (S1 ('MetaSel ('Just "aTaWitness") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Annotated TxWitness a)) :*: S1 ('MetaSel ('Just "aTaAnnotation") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 a)))) | |
type BaseType (ATxAux ByteString) | |
Defined in Cardano.Chain.UTxO.TxAux |
getTxWitnesses :: forall era. Tx era -> [KeyWitness era] Source #
getTxWitnessesByron :: ATxAux ByteString -> [KeyWitness ByronEra] Source #
data ScriptValidity Source #
Indicates whether a script is expected to fail or pass validation.
Constructors
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
Eq ScriptValidity Source # | |
Defined in Cardano.Api.TxBody Methods (==) :: ScriptValidity -> ScriptValidity -> Bool Source # (/=) :: ScriptValidity -> ScriptValidity -> Bool Source # | |
Show ScriptValidity Source # | |
Defined in Cardano.Api.TxBody | |
DecCBOR ScriptValidity Source # | |
Defined in Cardano.Api.TxBody Methods decCBOR :: Decoder s ScriptValidity dropCBOR :: Proxy ScriptValidity -> Decoder s () label :: Proxy ScriptValidity -> Text | |
EncCBOR ScriptValidity Source # | |
Defined in Cardano.Api.TxBody Methods encCBOR :: ScriptValidity -> Encoding encodedSizeExpr :: (forall t. EncCBOR t => Proxy t -> Size) -> Proxy ScriptValidity -> Size encodedListSizeExpr :: (forall t. EncCBOR t => Proxy t -> Size) -> Proxy [ScriptValidity] -> Size |
Signing in one go
data ShelleySigningKey Source #
We support making key witnesses with both normal and extended signing keys.
Constructors
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 :: forall era. [KeyWitness era] -> TxBody era -> Tx era Source #
makeSignedTransaction' :: CardanoEra era -> [KeyWitness era] -> TxBody era -> Tx era Source #
data KeyWitness era where Source #
Constructors
ByronKeyWitness :: TxInWitness -> KeyWitness ByronEra | |
ShelleyBootstrapWitness :: ShelleyBasedEra era -> BootstrapWitness StandardCrypto -> KeyWitness era | |
ShelleyKeyWitness :: ShelleyBasedEra era -> WitVKey Witness StandardCrypto -> KeyWitness era |
Instances
makeByronKeyWitness :: forall key. IsByronKey key => NetworkId -> Annotated Tx ByteString -> SigningKey key -> KeyWitness ByronEra Source #
data ShelleyWitnessSigningKey Source #
Constructors
makeShelleyKeyWitness :: forall era. 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.
Constructors
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 :: forall era. 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.