Safe Haskell | None |
---|---|
Language | Haskell2010 |
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 #
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.
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 #
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 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 textEnvelopeType :: AsType ( TxBody era) -> TextEnvelopeType Source # textEnvelopeDefaultDescr :: TxBody era -> TextEnvelopeDescr Source # |
|
data AsType ( TxBody era) Source # | |
Defined in Cardano.Api.TxBody |
Instances
Eq TxId Source # | |
Ord TxId Source # | |
Show TxId Source # | |
IsString TxId Source # | |
Defined in Cardano.Api.TxIn fromString :: String -> TxId Source # |
|
ToJSON TxId Source # | |
ToJSONKey TxId Source # | |
Defined in Cardano.Api.TxIn |
|
FromJSON TxId Source # | |
FromJSONKey TxId Source # | |
Defined in Cardano.Api.TxIn |
|
HasTypeProxy TxId Source # | |
SerialiseAsRawBytes TxId Source # | |
Defined in Cardano.Api.TxIn serialiseToRawBytes :: TxId -> ByteString Source # deserialiseFromRawBytes :: AsType TxId -> ByteString -> Maybe TxId Source # |
|
data AsType TxId Source # | |
Defined in Cardano.Api.TxIn |
TxOut ( AddressInEra era) ( TxOutValue era) ( TxOutDatum ctx era) ( ReferenceScript era) |
Instances
EraCast ( TxOut ctx) Source # | |
Defined in Cardano.Api.TxBody 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 # | |
Show TxIx Source # | |
ToJSON TxIx Source # | |
FromJSON TxIx Source # | |
Instances
Signing transactions
Creating transaction witnesses one by one, or all in one go.
ByronTx :: ATxAux ByteString -> Tx ByronEra |
Instances
Eq ( InAnyCardanoEra Tx ) Source # | |
Defined in Cardano.Api.Tx (==) :: 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 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 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 #
Instances
Eq ( KeyWitness era) Source # | |
Defined in Cardano.Api.Tx (==) :: KeyWitness era -> KeyWitness era -> Bool Source # (/=) :: KeyWitness era -> KeyWitness era -> Bool Source # |
|
Show ( KeyWitness era) Source # | |
Defined in Cardano.Api.Tx |
|
HasTypeProxy era => HasTypeProxy ( KeyWitness era) Source # | |
Defined in Cardano.Api.Tx data AsType ( KeyWitness era) Source # proxyToAsType :: Proxy ( KeyWitness era) -> AsType ( KeyWitness era) Source # |
|
IsCardanoEra era => SerialiseAsCBOR ( KeyWitness era) Source # | |
Defined in Cardano.Api.Tx 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 textEnvelopeType :: AsType ( KeyWitness era) -> TextEnvelopeType Source # textEnvelopeDefaultDescr :: KeyWitness era -> TextEnvelopeDescr Source # |
|
data AsType ( KeyWitness era) Source # | |
Defined in Cardano.Api.Tx |
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. |
Errors
class Show e => Error e where Source #
displayError :: e -> String Source #
Instances
Low level protocol interaction with a Cardano node
data LocalNodeConnectInfo mode Source #
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.
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
.
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
.
ChainSyncClient | |
|
Local tx submission
newtype LocalTxSubmissionClient tx reject (m :: Type -> Type ) a Source #
LocalTxSubmissionClient (m ( LocalTxClientStIdle tx reject m a)) |
Local state query
newtype LocalStateQueryClient block point (query :: Type -> Type ) (m :: Type -> Type ) a Source #
LocalStateQueryClient | |
|
Address
newtype NetworkMagic Source #
NetworkMagic is used to differentiate between different networks during the initial handshake.
Instances
Eq NetworkMagic | |
Defined in Ouroboros.Network.Magic (==) :: NetworkMagic -> NetworkMagic -> Bool Source # (/=) :: NetworkMagic -> NetworkMagic -> Bool Source # |
|
Show NetworkMagic | |
Defined in Ouroboros.Network.Magic |
|
Generic NetworkMagic | |
Defined in Ouroboros.Network.Magic 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
Instances
Eq ByronUpdateProposal Source # | |
Defined in Cardano.Api.SpecialByron (==) :: ByronUpdateProposal -> ByronUpdateProposal -> Bool Source # (/=) :: ByronUpdateProposal -> ByronUpdateProposal -> Bool Source # |
|
Show ByronUpdateProposal Source # | |
Defined in Cardano.Api.SpecialByron |
|
HasTypeProxy ByronUpdateProposal Source # | |
Defined in Cardano.Api.SpecialByron data AsType ByronUpdateProposal Source # |
|
SerialiseAsRawBytes ByronUpdateProposal Source # | |
data AsType ByronUpdateProposal Source # | |
Defined in Cardano.Api.SpecialByron |
data ByronProtocolParametersUpdate Source #
ByronProtocolParametersUpdate | |
|
Instances
makeByronUpdateProposal :: NetworkId -> ProtocolVersion -> SoftwareVersion -> SystemTag -> InstallerHash -> SomeByronSigningKey -> ByronProtocolParametersUpdate -> ByronUpdateProposal Source #
Vote
Byron era votes
makeByronVote :: NetworkId -> SomeByronSigningKey -> ByronUpdateProposal -> Bool -> ByronVote Source #
Conversions
fromByronTxIn :: TxIn -> TxIn Source #