Safe Haskell | None |
---|---|
Language | Haskell2010 |
Cardano.Api.Byron
Contents
Description
This module provides a library interface that is intended to be the complete API for Byron covering everything, including exposing constructors for the lower level types.
Synopsis
- module Cardano.Api
- data SomeByronSigningKey
- data family Hash keyrole :: Type
-
data
Address
addrtype
where
- ByronAddress :: Address -> Address ByronAddr
-
data
NetworkId
- = Mainnet
- | Testnet ! NetworkMagic
- data TxBody era where
- newtype TxId = TxId ( Hash StandardCrypto EraIndependentTxBody )
- data TxIn = TxIn TxId TxIx
- data TxOut ctx era = TxOut ( AddressInEra era) ( TxOutValue era) ( TxOutDatum ctx era) ( ReferenceScript era)
- newtype TxIx = TxIx Word
- newtype Lovelace = Lovelace Integer
-
data
Tx
era
where
- ByronTx :: ATxAux ByteString -> Tx ByronEra
- data KeyWitness era where
-
data
WitnessNetworkIdOrByronAddress
- = WitnessNetworkId ! NetworkId
- | WitnessByronAddress !( Address ByronAddr )
-
class
Show
e =>
Error
e
where
- displayError :: e -> String
- data FileError e
- data LocalNodeConnectInfo mode = LocalNodeConnectInfo ( ConsensusModeParams mode) NetworkId FilePath
- data ByronMode
- data ConsensusMode mode where
- data LocalNodeClientProtocols block point tip slot tx txid txerr query m = LocalNodeClientProtocols ( LocalChainSyncClient block point tip m) ( Maybe ( LocalTxSubmissionClient tx txerr m ())) ( Maybe ( LocalStateQueryClient block point query m ())) ( Maybe ( LocalTxMonitorClient txid tx slot m ()))
-
newtype
ChainSyncClient
header point tip (m ::
Type
->
Type
) a =
ChainSyncClient
{
- runChainSyncClient :: m ( ClientStIdle header point tip m a)
- newtype LocalTxSubmissionClient tx reject (m :: Type -> Type ) a = LocalTxSubmissionClient (m ( LocalTxClientStIdle tx reject m a))
-
newtype
LocalStateQueryClient
block point (query ::
Type
->
Type
) (m ::
Type
->
Type
) a =
LocalStateQueryClient
{
- runLocalStateQueryClient :: m ( ClientStIdle block point query m a)
- newtype NetworkMagic = NetworkMagic { }
- newtype ByronUpdateProposal = ByronUpdateProposal { }
-
data
ByronProtocolParametersUpdate
=
ByronProtocolParametersUpdate
{
- bPpuScriptVersion :: !( Maybe Word16 )
- bPpuSlotDuration :: !( Maybe Natural )
- bPpuMaxBlockSize :: !( Maybe Natural )
- bPpuMaxHeaderSize :: !( Maybe Natural )
- bPpuMaxTxSize :: !( Maybe Natural )
- bPpuMaxProposalSize :: !( Maybe Natural )
- bPpuMpcThd :: !( Maybe LovelacePortion )
- bPpuHeavyDelThd :: !( Maybe LovelacePortion )
- bPpuUpdateVoteThd :: !( Maybe LovelacePortion )
- bPpuUpdateProposalThd :: !( Maybe LovelacePortion )
- bPpuUpdateProposalTTL :: !( Maybe SlotNumber )
- bPpuSoftforkRule :: !( Maybe SoftforkRule )
- bPpuTxFeePolicy :: !( Maybe TxFeePolicy )
- bPpuUnlockStakeEpoch :: !( Maybe EpochNumber )
- makeByronUpdateProposal :: NetworkId -> ProtocolVersion -> SoftwareVersion -> SystemTag -> InstallerHash -> SomeByronSigningKey -> ByronProtocolParametersUpdate -> ByronUpdateProposal
- toByronLedgerUpdateProposal :: ByronUpdateProposal -> GenTx ByronBlock
- makeProtocolParametersUpdate :: ByronProtocolParametersUpdate -> ProtocolParametersUpdate
- newtype ByronVote = ByronVote { }
- makeByronVote :: NetworkId -> SomeByronSigningKey -> ByronUpdateProposal -> Bool -> ByronVote
- toByronLedgertoByronVote :: ByronVote -> GenTx ByronBlock
- fromByronTxIn :: TxIn -> TxIn
- toByronLovelace :: Lovelace -> Maybe Lovelace
- toByronNetworkMagic :: NetworkId -> NetworkMagic
- toByronProtocolMagicId :: NetworkId -> ProtocolMagicId
- toByronRequiresNetworkMagic :: NetworkId -> RequiresNetworkMagic
Documentation
module Cardano.Api
Cryptographic key interface
data SomeByronSigningKey Source #
Constructors
AByronSigningKeyLegacy ( SigningKey ByronKeyLegacy ) | |
AByronSigningKey ( SigningKey ByronKey ) |
Hashes
data family Hash keyrole :: Type Source #
Instances
Payment addresses
Constructing and inspecting Byron payment addresses
data Address addrtype where Source #
Addresses are used as locations where assets live. The address determines the rights needed to spend assets at the address: in particular holding some signing key or being able to satisfy the conditions of a script.
There are currently two types of address:
-
Byron addresses, which use the type tag
ByronAddr
; and -
Shelley addresses, which use the type tag
ShelleyAddr
. Notably, Shelley addresses support scripts and stake delegation.
The
address type
is subtly from the
ledger era
in which each
address type is valid: while Byron addresses are the only choice in the
Byron era, the Shelley era and all subsequent eras support both Byron and
Shelley addresses. The
Address
type param only says the type of the address
(either Byron or Shelley). The
AddressInEra
type connects the address type
with the era in which it is supported.
Constructors
ByronAddress :: Address -> Address ByronAddr |
Byron addresses were the only supported address type in the original Byron era. |
Instances
Building transactions
Constructing and inspecting transactions
data TxBody era where Source #
Constructors
ByronTxBody :: Annotated Tx ByteString -> TxBody ByronEra |
Instances
Eq ( TxBody era) Source # | |
Show ( TxBody era) Source # | |
HasTypeProxy era => HasTypeProxy ( TxBody era) Source # | |
IsCardanoEra era => SerialiseAsCBOR ( TxBody era) Source # | |
Defined in Cardano.Api.TxBody Methods serialiseToCBOR :: TxBody era -> ByteString Source # deserialiseFromCBOR :: AsType ( TxBody era) -> ByteString -> Either DecoderError ( TxBody era) Source # |
|
IsCardanoEra era => HasTextEnvelope ( TxBody era) Source # | |
Defined in Cardano.Api.TxBody Methods textEnvelopeType :: AsType ( TxBody era) -> TextEnvelopeType Source # textEnvelopeDefaultDescr :: TxBody era -> TextEnvelopeDescr Source # |
|
data AsType ( TxBody era) Source # | |
Defined in Cardano.Api.TxBody |
Constructors
TxId ( Hash StandardCrypto EraIndependentTxBody ) |
Instances
Eq TxId Source # | |
Ord TxId Source # | |
Defined in Cardano.Api.TxIn |
|
Show TxId Source # | |
IsString TxId Source # | |
Defined in Cardano.Api.TxIn Methods fromString :: String -> TxId Source # |
|
ToJSON TxId Source # | |
ToJSONKey TxId Source # | |
Defined in Cardano.Api.TxIn Methods toJSONKey :: ToJSONKeyFunction TxId Source # toJSONKeyList :: ToJSONKeyFunction [ TxId ] Source # |
|
FromJSON TxId Source # | |
FromJSONKey TxId Source # | |
Defined in Cardano.Api.TxIn Methods |
|
HasTypeProxy TxId Source # | |
SerialiseAsRawBytes TxId Source # | |
Defined in Cardano.Api.TxIn Methods serialiseToRawBytes :: TxId -> ByteString Source # deserialiseFromRawBytes :: AsType TxId -> ByteString -> Maybe TxId Source # |
|
data AsType TxId Source # | |
Defined in Cardano.Api.TxIn |
Instances
Eq TxIn Source # | |
Ord TxIn Source # | |
Defined in Cardano.Api.TxIn |
|
Show TxIn Source # | |
ToJSON TxIn Source # | |
ToJSONKey TxIn Source # | |
Defined in Cardano.Api.TxIn Methods toJSONKey :: ToJSONKeyFunction TxIn Source # toJSONKeyList :: ToJSONKeyFunction [ TxIn ] Source # |
|
FromJSON TxIn Source # | |
FromJSONKey TxIn Source # | |
Defined in Cardano.Api.TxIn Methods |
Constructors
TxOut ( AddressInEra era) ( TxOutValue era) ( TxOutDatum ctx era) ( ReferenceScript era) |
Instances
EraCast ( TxOut ctx) Source # | |
Defined in Cardano.Api.TxBody Methods eraCast :: ( IsCardanoEra fromEra, IsCardanoEra toEra) => CardanoEra toEra -> TxOut ctx fromEra -> Either EraCastError ( TxOut ctx toEra) Source # |
|
Eq ( TxOut ctx era) Source # | |
Show ( TxOut ctx era) Source # | |
IsCardanoEra era => ToJSON ( TxOut ctx era) Source # | |
( IsShelleyBasedEra era, IsCardanoEra era) => FromJSON ( TxOut CtxUTxO era) Source # | |
( IsShelleyBasedEra era, IsCardanoEra era) => FromJSON ( TxOut CtxTx era) Source # | |
Instances
Enum TxIx Source # | |
Eq TxIx Source # | |
Ord TxIx Source # | |
Defined in Cardano.Api.TxIn |
|
Show TxIx Source # | |
ToJSON TxIx Source # | |
FromJSON TxIx Source # | |
Instances
Signing transactions
Creating transaction witnesses one by one, or all in one go.
Constructors
ByronTx :: ATxAux ByteString -> Tx ByronEra |
Instances
Eq ( InAnyCardanoEra Tx ) Source # | |
Defined in Cardano.Api.Tx Methods (==) :: InAnyCardanoEra Tx -> InAnyCardanoEra Tx -> Bool Source # (/=) :: InAnyCardanoEra Tx -> InAnyCardanoEra Tx -> Bool Source # |
|
Eq ( Tx era) Source # | |
Show ( InAnyCardanoEra Tx ) Source # | |
Defined in Cardano.Api.Tx |
|
Show ( Tx era) Source # | |
HasTypeProxy era => HasTypeProxy ( Tx era) Source # | |
IsCardanoEra era => SerialiseAsCBOR ( Tx era) Source # | |
Defined in Cardano.Api.Tx Methods serialiseToCBOR :: Tx era -> ByteString Source # deserialiseFromCBOR :: AsType ( Tx era) -> ByteString -> Either DecoderError ( Tx era) Source # |
|
IsCardanoEra era => HasTextEnvelope ( Tx era) Source # | |
Defined in Cardano.Api.Tx Methods textEnvelopeType :: AsType ( Tx era) -> TextEnvelopeType Source # textEnvelopeDefaultDescr :: Tx era -> TextEnvelopeDescr Source # |
|
data AsType ( Tx era) Source # | |
Defined in Cardano.Api.Tx |
Incremental signing and separate witnesses
data KeyWitness era where Source #
Constructors
ByronKeyWitness :: TxInWitness -> KeyWitness ByronEra |
Instances
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. |
Errors
class Show e => Error e where Source #
Methods
displayError :: e -> String Source #
Instances
Constructors
FileError FilePath e | |
FileErrorTempFile | |
FileIOError FilePath IOException |
Low level protocol interaction with a Cardano node
data LocalNodeConnectInfo mode Source #
Constructors
LocalNodeConnectInfo ( ConsensusModeParams mode) NetworkId FilePath |
The Byron-only consensus mode consists of only the Byron era.
This was used on the mainnet before the deployment of the multi-era
CardanoMode
. It is now of little practical use, though it illustrates
how a single-era consensus mode works. It may be sensible to remove this
at some stage.
data ConsensusMode mode where Source #
This GADT provides a value-level representation of all the consensus modes. This enables pattern matching on the era to allow them to be treated in a non-uniform way.
Constructors
ByronMode :: ConsensusMode ByronMode |
Instances
Show ( ConsensusMode mode) Source # | |
Defined in Cardano.Api.Modes |
data LocalNodeClientProtocols block point tip slot tx txid txerr query m Source #
The protocols we can use with a local node. Use in conjunction with
connectToLocalNode
.
These protocols use the types from the rest of this API. The conversion
to/from the types used by the underlying wire formats is handled by
connectToLocalNode
.
Constructors
LocalNodeClientProtocols ( LocalChainSyncClient block point tip m) ( Maybe ( LocalTxSubmissionClient tx txerr m ())) ( Maybe ( LocalStateQueryClient block point query m ())) ( Maybe ( LocalTxMonitorClient txid tx slot m ())) |
Chain sync protocol
newtype ChainSyncClient header point tip (m :: Type -> Type ) a Source #
A chain sync protocol client, on top of some effect
m
.
The first choice of request is within that
m
.
Constructors
ChainSyncClient | |
Fields
|
Local tx submission
newtype LocalTxSubmissionClient tx reject (m :: Type -> Type ) a Source #
Constructors
LocalTxSubmissionClient (m ( LocalTxClientStIdle tx reject m a)) |
Local state query
newtype LocalStateQueryClient block point (query :: Type -> Type ) (m :: Type -> Type ) a Source #
Constructors
LocalStateQueryClient | |
Fields
|
Address
newtype NetworkMagic Source #
NetworkMagic is used to differentiate between different networks during the initial handshake.
Constructors
NetworkMagic | |
Fields |
Instances
Eq NetworkMagic | |
Defined in Ouroboros.Network.Magic Methods (==) :: NetworkMagic -> NetworkMagic -> Bool Source # (/=) :: NetworkMagic -> NetworkMagic -> Bool Source # |
|
Show NetworkMagic | |
Defined in Ouroboros.Network.Magic |
|
Generic NetworkMagic | |
Defined in Ouroboros.Network.Magic Methods from :: NetworkMagic -> Rep NetworkMagic x Source # to :: Rep NetworkMagic x -> NetworkMagic Source # |
|
NoThunks NetworkMagic | |
Defined in Ouroboros.Network.Magic |
|
type Rep NetworkMagic | |
Defined in Ouroboros.Network.Magic
type
Rep
NetworkMagic
=
D1
('
MetaData
"NetworkMagic" "Ouroboros.Network.Magic" "ouroboros-network-0.1.0.1-2UgqzRSdBh49QYumtriFSI" '
True
) (
C1
('
MetaCons
"NetworkMagic" '
PrefixI
'
True
) (
S1
('
MetaSel
('
Just
"unNetworkMagic") '
NoSourceUnpackedness
'
NoSourceStrictness
'
DecidedLazy
) (
Rec0
Word32
)))
|
Update Proposal
newtype ByronUpdateProposal Source #
Byron era update proposal
Constructors
ByronUpdateProposal | |
Fields |
Instances
Eq ByronUpdateProposal Source # | |
Defined in Cardano.Api.SpecialByron Methods (==) :: ByronUpdateProposal -> ByronUpdateProposal -> Bool Source # (/=) :: ByronUpdateProposal -> ByronUpdateProposal -> Bool Source # |
|
Show ByronUpdateProposal Source # | |
Defined in Cardano.Api.SpecialByron |
|
HasTypeProxy ByronUpdateProposal Source # | |
Defined in Cardano.Api.SpecialByron Associated Types data AsType ByronUpdateProposal Source # Methods proxyToAsType :: Proxy ByronUpdateProposal -> AsType ByronUpdateProposal Source # |
|
SerialiseAsRawBytes ByronUpdateProposal Source # | |
Defined in Cardano.Api.SpecialByron |
|
data AsType ByronUpdateProposal Source # | |
Defined in Cardano.Api.SpecialByron |
data ByronProtocolParametersUpdate Source #
Constructors
ByronProtocolParametersUpdate | |
Fields
|
Instances
makeByronUpdateProposal :: NetworkId -> ProtocolVersion -> SoftwareVersion -> SystemTag -> InstallerHash -> SomeByronSigningKey -> ByronProtocolParametersUpdate -> ByronUpdateProposal Source #
Vote
Byron era votes
Constructors
ByronVote | |
Fields |
Instances
Eq ByronVote Source # | |
Show ByronVote Source # | |
HasTypeProxy ByronVote Source # | |
SerialiseAsRawBytes ByronVote Source # | |
Defined in Cardano.Api.SpecialByron Methods serialiseToRawBytes :: ByronVote -> ByteString Source # deserialiseFromRawBytes :: AsType ByronVote -> ByteString -> Maybe ByronVote Source # |
|
data AsType ByronVote Source # | |
Defined in Cardano.Api.SpecialByron |
makeByronVote :: NetworkId -> SomeByronSigningKey -> ByronUpdateProposal -> Bool -> ByronVote Source #
Conversions
fromByronTxIn :: TxIn -> TxIn Source #