Safe Haskell | None |
---|---|
Language | Haskell2010 |
Complete, signed transactions
Synopsis
- data Tx era where
- ColeTx ∷ ATxAux ByteString → Tx ColeEra
- SophieTx ∷ SophieBasedEra era → Tx (SophieLedgerEra era) → Tx era
- pattern Tx ∷ TxBody era → [KeyWitness era] → Tx era
- getTxBody ∷ ∀ era. Tx era → TxBody era
- getTxWitnesses ∷ ∀ era. Tx era → [KeyWitness era]
- data ScriptValidity
- data SophieSigningKey
- = SophieNormalSigningKey (SignKeyDSIGN StandardCrypto)
- | SophieExtendedSigningKey XPrv
- toSophieSigningKey ∷ SophieWitnessSigningKey → SophieSigningKey
- signColeTransaction ∷ NetworkId → TxBody ColeEra → [SigningKey ColeKey] → Tx ColeEra
- signSophieTransaction ∷ IsSophieBasedEra era ⇒ TxBody era → [SophieWitnessSigningKey] → Tx era
- makeSignedTransaction ∷ ∀ era. [KeyWitness era] → TxBody era → Tx era
- data KeyWitness era where
- ColeKeyWitness ∷ TxInWitness → KeyWitness ColeEra
- SophieBootstrapWitness ∷ SophieBasedEra era → BootstrapWitness StandardCrypto → KeyWitness era
- SophieKeyWitness ∷ SophieBasedEra era → WitVKey Witness StandardCrypto → KeyWitness era
- makeColeKeyWitness ∷ ∀ key. IsColeKey key ⇒ NetworkId → TxBody ColeEra → SigningKey key → KeyWitness ColeEra
- data SophieWitnessSigningKey
- = 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)
- | WitnessVestedKey (SigningKey VestedKey)
- | WitnessVestedExtendedKey (SigningKey VestedExtendedKey)
- | WitnessVestedDelegateKey (SigningKey VestedDelegateKey)
- | WitnessVestedDelegateExtendedKey (SigningKey VestedDelegateExtendedKey)
- | WitnessVestedUTxOKey (SigningKey VestedUTxOKey)
- makeSophieKeyWitness ∷ ∀ era. IsSophieBasedEra era ⇒ TxBody era → SophieWitnessSigningKey → KeyWitness era
- data WitnessNetworkIdOrColeAddress
- makeSophieBootstrapWitness ∷ ∀ era. IsSophieBasedEra era ⇒ WitnessNetworkIdOrColeAddress → TxBody era → SigningKey ColeKey → KeyWitness era
- makeSophieSignature ∷ SignableRepresentation tosign ⇒ tosign → SophieSigningKey → SignedDSIGN StandardCrypto tosign
- getSophieKeyWitnessVerificationKey ∷ SophieSigningKey → VKey Witness StandardCrypto
- data family AsType t
Signing transactions
Creating transaction witnesses one by one, or all in one go.
ColeTx ∷ ATxAux ByteString → Tx ColeEra | |
SophieTx ∷ SophieBasedEra era → Tx (SophieLedgerEra era) → Tx era |
pattern Tx ∷ TxBody era → [KeyWitness era] → Tx era |
Instances
Eq (Tx era) Source # | |
Show (Tx era) Source # | |
HasTypeProxy era ⇒ HasTypeProxy (Tx era) Source # | |
IsBccEra era ⇒ SerialiseAsCBOR (Tx era) Source # | |
Defined in Bcc.Api.Tx serialiseToCBOR ∷ Tx era → ByteString Source # deserialiseFromCBOR ∷ AsType (Tx era) → ByteString → Either DecoderError (Tx era) Source # | |
IsBccEra era ⇒ HasTextEnvelope (Tx era) Source # | |
Defined in Bcc.Api.Tx textEnvelopeType ∷ AsType (Tx era) → TextEnvelopeType Source # textEnvelopeDefaultDescr ∷ Tx era → TextEnvelopeDescr Source # | |
data AsType (Tx era) Source # | |
Defined in Bcc.Api.Tx |
getTxWitnesses ∷ ∀ era. 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
Eq ScriptValidity Source # | |
Defined in Bcc.Api.TxBody (==) ∷ ScriptValidity → ScriptValidity → Bool Source # (/=) ∷ ScriptValidity → ScriptValidity → Bool Source # | |
Show ScriptValidity Source # | |
Defined in Bcc.Api.TxBody | |
FromCBOR ScriptValidity Source # | |
Defined in Bcc.Api.TxBody fromCBOR ∷ Decoder s ScriptValidity # label ∷ Proxy ScriptValidity → Text # | |
ToCBOR ScriptValidity Source # | |
Defined in Bcc.Api.TxBody toCBOR ∷ ScriptValidity → Encoding # encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy ScriptValidity → Size # encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [ScriptValidity] → Size # |
Signing in one go
data SophieSigningKey Source #
We support making key witnesses with both normal and extended signing keys.
SophieNormalSigningKey (SignKeyDSIGN StandardCrypto) | A normal ed25519 signing key |
SophieExtendedSigningKey XPrv | An extended ed25519 signing key |
signColeTransaction ∷ NetworkId → TxBody ColeEra → [SigningKey ColeKey] → Tx ColeEra Source #
signSophieTransaction ∷ IsSophieBasedEra era ⇒ TxBody era → [SophieWitnessSigningKey] → Tx era Source #
Incremental signing and separate witnesses
makeSignedTransaction ∷ ∀ era. [KeyWitness era] → TxBody era → Tx era Source #
data KeyWitness era where Source #
ColeKeyWitness ∷ TxInWitness → KeyWitness ColeEra | |
SophieBootstrapWitness ∷ SophieBasedEra era → BootstrapWitness StandardCrypto → KeyWitness era | |
SophieKeyWitness ∷ SophieBasedEra era → WitVKey Witness StandardCrypto → KeyWitness era |
Instances
Eq (KeyWitness era) Source # | |
Defined in Bcc.Api.Tx (==) ∷ KeyWitness era → KeyWitness era → Bool Source # (/=) ∷ KeyWitness era → KeyWitness era → Bool Source # | |
Show (KeyWitness era) Source # | |
Defined in Bcc.Api.Tx | |
HasTypeProxy era ⇒ HasTypeProxy (KeyWitness era) Source # | |
Defined in Bcc.Api.Tx data AsType (KeyWitness era) Source # proxyToAsType ∷ Proxy (KeyWitness era) → AsType (KeyWitness era) Source # | |
IsBccEra era ⇒ SerialiseAsCBOR (KeyWitness era) Source # | |
Defined in Bcc.Api.Tx serialiseToCBOR ∷ KeyWitness era → ByteString Source # deserialiseFromCBOR ∷ AsType (KeyWitness era) → ByteString → Either DecoderError (KeyWitness era) Source # | |
IsBccEra era ⇒ HasTextEnvelope (KeyWitness era) Source # | |
Defined in Bcc.Api.Tx | |
data AsType (KeyWitness era) Source # | |
Defined in Bcc.Api.Tx |
makeColeKeyWitness ∷ ∀ key. IsColeKey key ⇒ NetworkId → TxBody ColeEra → SigningKey key → KeyWitness ColeEra Source #
data SophieWitnessSigningKey Source #
makeSophieKeyWitness ∷ ∀ era. IsSophieBasedEra era ⇒ TxBody era → SophieWitnessSigningKey → KeyWitness era Source #
data WitnessNetworkIdOrColeAddress Source #
Either a network ID or a Cole address to be used in constructing a Sophie bootstrap witness.
WitnessNetworkId !NetworkId | Network ID. If this value is used in the construction of a Sophie bootstrap witness,
the result will not consist of a derivation path. If that is required,
specify a |
WitnessColeAddress !(Address ColeAddr) | Cole address. If this value is used in the construction of a Sophie bootstrap witness, both the network ID and derivation path will be extracted from the address and used in the construction of the witness. |
makeSophieBootstrapWitness ∷ ∀ era. IsSophieBasedEra era ⇒ WitnessNetworkIdOrColeAddress → TxBody era → SigningKey ColeKey → KeyWitness era Source #
makeSophieSignature ∷ SignableRepresentation tosign ⇒ tosign → SophieSigningKey → SignedDSIGN StandardCrypto tosign Source #
getSophieKeyWitnessVerificationKey ∷ SophieSigningKey → VKey Witness StandardCrypto 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.