Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module provides a library interface that is intended to be the complete API for Sophie covering everything, including exposing constructors for the lower level types.
Synopsis
- module Bcc.Api
- data SophieGenesis era = SophieGenesis {
- sgSystemStart ∷ !UTCTime
- sgNetworkMagic ∷ !Word32
- sgNetworkId ∷ !Network
- sgActiveSlotsCoeff ∷ !PositiveUnitInterval
- sgSecurityParam ∷ !Word64
- sgVestMultiple ∷ !Word64
- sgEpochLength ∷ !EpochSize
- sgSlotsPerKESPeriod ∷ !Word64
- sgMaxKESEvolutions ∷ !Word64
- sgSlotLength ∷ !NominalDiffTime
- sgUpdateQuorum ∷ !Word64
- sgMaxEntropicSupply ∷ !Word64
- sgProtocolParams ∷ !(PParams era)
- sgGenDelegs ∷ !(Map (KeyHash 'Genesis (Crypto era)) (GenDelegPair (Crypto era)))
- sgVestedDelegs ∷ !(Map (KeyHash 'Vested (Crypto era)) (VestedDelegPair (Crypto era)))
- sgInitialFunds ∷ !(Map (Addr (Crypto era)) Coin)
- sgStaking ∷ !(SophieGenesisStaking (Crypto era))
- sophieGenesisDefaults ∷ SophieGenesis crypto
- data family Hash keyrole ∷ Type
- data Address addrtype where
- SophieAddress ∷ Network → PaymentCredential StandardCrypto → StakeReference StandardCrypto → Address SophieAddr
- toSophieAddr ∷ AddressInEra era → Addr StandardCrypto
- fromSophieAddr ∷ IsSophieBasedEra era ⇒ Addr StandardCrypto → AddressInEra era
- toSophieStakeCredential ∷ StakeCredential → StakeCredential StandardCrypto
- fromSophieStakeCredential ∷ StakeCredential StandardCrypto → StakeCredential
- data NetworkId
- data PaymentCredential
- data StakeAddress where
- StakeAddress ∷ Network → StakeCredential StandardCrypto → StakeAddress
- data StakeAddressReference
- data StakeCredential
- toSophieStakeAddr ∷ StakeAddress → RewardAcnt StandardCrypto
- fromSophieStakeAddr ∷ RewardAcnt StandardCrypto → StakeAddress
- fromSophieStakeReference ∷ StakeReference StandardCrypto → StakeAddressReference
- fromSophiePaymentCredential ∷ PaymentCredential StandardCrypto → PaymentCredential
- data TxBody era where
- SophieTxBody ∷ SophieBasedEra era → TxBody (SophieLedgerEra era) → [Script (SophieLedgerEra era)] → TxBodyScriptData era → Maybe (AuxiliaryData (SophieLedgerEra era)) → TxScriptValidity era → TxBody era
- newtype TxId = TxId (Hash StandardCrypto EraIndependentTxBody)
- toSophieTxId ∷ TxId → TxId StandardCrypto
- fromSophieTxId ∷ TxId StandardCrypto → TxId
- getTxIdSophie ∷ Crypto (SophieLedgerEra era) ~ StandardCrypto ⇒ UsesTxBody (SophieLedgerEra era) ⇒ SophieBasedEra era → TxBody (SophieLedgerEra era) → TxId
- data TxIn = TxIn TxId TxIx
- toSophieTxIn ∷ TxIn → TxIn StandardCrypto
- fromSophieTxIn ∷ TxIn StandardCrypto → TxIn
- data TxOut era = TxOut (AddressInEra era) (TxOutValue era) (TxOutDatumHash era)
- toSophieTxOut ∷ ∀ era ledgerera. SophieLedgerEra era ~ ledgerera ⇒ SophieBasedEra era → TxOut era → TxOut ledgerera
- fromSophieTxOut ∷ SophieLedgerEra era ~ ledgerera ⇒ SophieBasedEra era → TxOut ledgerera → TxOut era
- newtype TxIx = TxIx Word
- newtype Entropic = Entropic Integer
- toSophieEntropic ∷ Entropic → Coin
- fromSophieEntropic ∷ Coin → Entropic
- toJenValue ∷ Value → Value StandardCrypto
- fromJenValue ∷ Value StandardCrypto → Value
- calcMinimumDeposit ∷ Value → Entropic → Entropic
- data Tx era where
- SophieTx ∷ SophieBasedEra era → Tx (SophieLedgerEra era) → Tx era
- data KeyWitness era where
- SophieBootstrapWitness ∷ SophieBasedEra era → BootstrapWitness StandardCrypto → KeyWitness era
- SophieKeyWitness ∷ SophieBasedEra era → WitVKey Witness StandardCrypto → KeyWitness era
- 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)
- | WitnessVestedKey (SigningKey VestedKey)
- | WitnessVestedExtendedKey (SigningKey VestedExtendedKey)
- | WitnessVestedDelegateKey (SigningKey VestedDelegateKey)
- | WitnessVestedDelegateExtendedKey (SigningKey VestedDelegateExtendedKey)
- data SophieSigningKey
- = SophieNormalSigningKey (SignKeyDSIGN StandardCrypto)
- | SophieExtendedSigningKey XPrv
- getSophieKeyWitnessVerificationKey ∷ SophieSigningKey → VKey Witness StandardCrypto
- makeSophieSignature ∷ SignableRepresentation tosign ⇒ tosign → SophieSigningKey → SignedDSIGN StandardCrypto tosign
- toSophieSigningKey ∷ SophieWitnessSigningKey → SophieSigningKey
- toSophieMetadata ∷ Map Word64 TxMetadataValue → Map Word64 Metadatum
- fromSophieMetadata ∷ Map Word64 Metadatum → Map Word64 TxMetadataValue
- toSophieMetadatum ∷ TxMetadataValue → Metadatum
- fromSophieMetadatum ∷ Metadatum → TxMetadataValue
- data ProtocolParameters = ProtocolParameters {
- protocolParamProtocolVersion ∷ (Natural, Natural)
- protocolParamDecentralization ∷ Rational
- protocolParamExtraOptimumEntropy ∷ Maybe OptimumNonce
- protocolParamMaxBlockHeaderSize ∷ Natural
- protocolParamMaxBlockBodySize ∷ Natural
- protocolParamMaxTxSize ∷ Natural
- protocolParamTxFeeFixed ∷ Natural
- protocolParamTxFeePerByte ∷ Natural
- protocolParamMinUTxOValue ∷ Maybe Entropic
- protocolParamStakeAddressDeposit ∷ Entropic
- protocolParamStakePoolDeposit ∷ Entropic
- protocolParamMinPoolCost ∷ Entropic
- protocolParamPoolRetireMaxEpoch ∷ EpochNo
- protocolParamStakePoolTargetNum ∷ Natural
- protocolParamPoolPledgeInfluence ∷ Rational
- protocolParamMonetaryExpansion ∷ Rational
- protocolParamTreasuryCut ∷ Rational
- protocolParamUTxOCostPerWord ∷ Maybe Entropic
- protocolParamCostModels ∷ Map AnyZerepochScriptVersion CostModel
- protocolParamPrices ∷ Maybe ExecutionUnitPrices
- protocolParamMaxTxExUnits ∷ Maybe ExecutionUnits
- protocolParamMaxBlockExUnits ∷ Maybe ExecutionUnits
- protocolParamMaxValueSize ∷ Maybe Natural
- protocolParamCollateralPercent ∷ Maybe Natural
- protocolParamMaxCollateralInputs ∷ Maybe Natural
- checkProtocolParameters ∷ ∀ era. IsBccEra era ⇒ SophieBasedEra era → ProtocolParameters → Either ProtocolParametersError ()
- data ProtocolParametersError
- toSophieScript ∷ ScriptInEra era → Script (SophieLedgerEra era)
- toSophieMultiSig ∷ SimpleScript SimpleScriptV1 → MultiSig StandardCrypto
- fromSophieMultiSig ∷ MultiSig StandardCrypto → SimpleScript lang
- toEvieTimelock ∷ ∀ lang. SimpleScript lang → Timelock StandardCrypto
- fromEvieTimelock ∷ TimeLocksSupported lang → Timelock StandardCrypto → SimpleScript lang
- toSophieScriptHash ∷ ScriptHash → ScriptHash StandardCrypto
- fromSophieScriptHash ∷ ScriptHash StandardCrypto → ScriptHash
- data ZerepochScript lang where
- toZerepochData ∷ ScriptData → Data
- fromZerepochData ∷ Data → ScriptData
- toAurumData ∷ ScriptData → Data ledgerera
- fromAurumData ∷ Data ledgerera → ScriptData
- toAurumPrices ∷ ExecutionUnitPrices → Maybe Prices
- fromAurumPrices ∷ Prices → ExecutionUnitPrices
- toAurumExUnits ∷ ExecutionUnits → ExUnits
- fromAurumExUnits ∷ ExUnits → ExecutionUnits
- toAurumRdmrPtr ∷ ScriptWitnessIndex → RdmrPtr
- fromAurumRdmrPtr ∷ RdmrPtr → ScriptWitnessIndex
- data Certificate
- = StakeAddressRegistrationCertificate StakeCredential
- | StakeAddressDeregistrationCertificate StakeCredential
- | StakeAddressDelegationCertificate StakeCredential PoolId
- | StakePoolRegistrationCertificate StakePoolParameters
- | StakePoolRetirementCertificate PoolId EpochNo
- | GenesisKeyDelegationCertificate (Hash GenesisKey) (Hash GenesisDelegateKey) (Hash VrfKey)
- | VestedKeyDelegationCertificate (Hash VestedKey) (Hash VestedDelegateKey) (Hash VrfKey)
- | MIRCertificate MIRPot MIRTarget
- toSophieCertificate ∷ Certificate → DCert StandardCrypto
- fromSophieCertificate ∷ DCert StandardCrypto → Certificate
- data OperationalCertificate = OperationalCertificate !(OCert StandardCrypto) !(VerificationKey StakePoolKey)
- data OperationalCertificateIssueCounter = OperationalCertificateIssueCounter !Word64 !(VerificationKey StakePoolKey)
- data OperationalCertIssueError = OperationalCertKeyMismatch (VerificationKey StakePoolKey) (VerificationKey StakePoolKey)
- data StakePoolMetadata = StakePoolMetadata !Text !Text !Text !Text
- stakePoolName ∷ StakePoolMetadata → Text
- stakePoolDescription ∷ StakePoolMetadata → Text
- stakePoolTicker ∷ StakePoolMetadata → Text
- stakePoolHomepage ∷ StakePoolMetadata → Text
- data StakePoolMetadataReference = StakePoolMetadataReference Text (Hash StakePoolMetadata)
- stakePoolMetadataURL ∷ StakePoolMetadataReference → Text
- stakePoolMetadataHash ∷ StakePoolMetadataReference → Hash StakePoolMetadata
- data StakePoolParameters = StakePoolParameters PoolId (Hash VrfKey) Entropic Rational StakeAddress Entropic [Hash StakeKey] [StakePoolRelay] (Maybe StakePoolMetadataReference)
- stakePoolId ∷ StakePoolParameters → PoolId
- stakePoolVRF ∷ StakePoolParameters → Hash VrfKey
- stakePoolCost ∷ StakePoolParameters → Entropic
- stakePoolMargin ∷ StakePoolParameters → Rational
- stakePoolRewardAccount ∷ StakePoolParameters → StakeAddress
- stakePoolPledge ∷ StakePoolParameters → Entropic
- stakePoolOwners ∷ StakePoolParameters → [Hash StakeKey]
- stakePoolRelays ∷ StakePoolParameters → [StakePoolRelay]
- stakePoolMetadata ∷ StakePoolParameters → Maybe StakePoolMetadataReference
- data StakePoolRelay
- = StakePoolRelayIp (Maybe IPv4) (Maybe IPv6) (Maybe PortNumber)
- | StakePoolRelayDnsARecord ByteString (Maybe PortNumber)
- | StakePoolRelayDnsSrvRecord ByteString
- newtype EpochNo = EpochNo {}
- data StakePoolKey
- type PoolId = Hash StakePoolKey
- data KesKey
- newtype KESPeriod = KESPeriod {}
- data VrfKey
- data LocalNodeConnectInfo mode = LocalNodeConnectInfo (ConsensusModeParams mode) NetworkId FilePath
- data SophieMode
- data ConsensusMode mode where
- data LocalNodeClientProtocols block point tip tx txerr query m = LocalNodeClientProtocols (LocalChainSyncClient block point tip m) (Maybe (LocalTxSubmissionClient tx txerr m ())) (Maybe (LocalStateQueryClient block point query m ()))
- type family SophieLedgerEra era where ...
- data DebugLedgerState era where
- DebugLedgerState ∷ SophieLedgerEra era ~ ledgerera ⇒ NewEpochState ledgerera → DebugLedgerState era
- newtype ProtocolState era = ProtocolState (Serialised (ChainDepState (Crypto (SophieLedgerEra era))))
- newtype SerialisedDebugLedgerState era = SerialisedDebugLedgerState (Serialised (NewEpochState (SophieLedgerEra era)))
- newtype UTxO era = UTxO (Map TxIn (TxOut era))
- toSophieNetwork ∷ NetworkId → Network
- fromSophiePParams ∷ PParams ledgerera → ProtocolParameters
Documentation
module Bcc.Api
Genesis
data SophieGenesis era #
SophieGenesis | |
|
Instances
sophieGenesisDefaults ∷ SophieGenesis crypto Source #
Some reasonable starting defaults for constructing a SophieGenesis
.
You must override at least the following fields for this to be useful:
sgSystemStart
the time of the first blocksgNetworkMagic
to a suitable testnet or mainnet network magic number.sgGenDelegs
to have some initial nodessgInitialFunds
to have any money in the systemsgMaxEntropicSupply
must be at least the sum of thesgInitialFunds
but more if you want to allow for rewards.
Cryptographic key interface
Hashes
data family Hash keyrole ∷ Type Source #
Instances
Payment addresses
Constructing and inspecting Sophie 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:
- Cole addresses, which use the type tag
ColeAddr
; and - Sophie addresses, which use the type tag
SophieAddr
. Notably, Sophie addresses support scripts and stake delegation.
The address type is subtly from the ledger era in which each
address type is valid: while Cole addresses are the only choice in the
Cole era, the Sophie era and all subsequent eras support both Cole and
Sophie addresses. The Address
type param only says the type of the address
(either Cole or Sophie). The AddressInEra
type connects the address type
with the era in which it is supported.
SophieAddress ∷ Network → PaymentCredential StandardCrypto → StakeReference StandardCrypto → Address SophieAddr | Sophie addresses allow delegation. Sophie addresses were introduced in Sophie era and are thus supported from the Sophie era onwards |
Instances
toSophieAddr ∷ AddressInEra era → Addr StandardCrypto Source #
fromSophieAddr ∷ IsSophieBasedEra era ⇒ Addr StandardCrypto → AddressInEra era Source #
toSophieStakeCredential ∷ StakeCredential → StakeCredential StandardCrypto Source #
fromSophieStakeCredential ∷ StakeCredential StandardCrypto → StakeCredential Source #
Stake addresses
data PaymentCredential Source #
Instances
Eq PaymentCredential Source # | |
Defined in Bcc.Api.Address | |
Ord PaymentCredential Source # | |
Defined in Bcc.Api.Address compare ∷ PaymentCredential → PaymentCredential → Ordering Source # (<) ∷ PaymentCredential → PaymentCredential → Bool Source # (<=) ∷ PaymentCredential → PaymentCredential → Bool Source # (>) ∷ PaymentCredential → PaymentCredential → Bool Source # (>=) ∷ PaymentCredential → PaymentCredential → Bool Source # max ∷ PaymentCredential → PaymentCredential → PaymentCredential Source # min ∷ PaymentCredential → PaymentCredential → PaymentCredential Source # | |
Show PaymentCredential Source # | |
Defined in Bcc.Api.Address |
data StakeAddress where Source #
StakeAddress ∷ Network → StakeCredential StandardCrypto → StakeAddress |
Instances
Eq StakeAddress Source # | |
Defined in Bcc.Api.Address (==) ∷ StakeAddress → StakeAddress → Bool Source # (/=) ∷ StakeAddress → StakeAddress → Bool Source # | |
Ord StakeAddress Source # | |
Defined in Bcc.Api.Address compare ∷ StakeAddress → StakeAddress → Ordering Source # (<) ∷ StakeAddress → StakeAddress → Bool Source # (<=) ∷ StakeAddress → StakeAddress → Bool Source # (>) ∷ StakeAddress → StakeAddress → Bool Source # (>=) ∷ StakeAddress → StakeAddress → Bool Source # | |
Show StakeAddress Source # | |
Defined in Bcc.Api.Address | |
HasTypeProxy StakeAddress Source # | |
Defined in Bcc.Api.Address data AsType StakeAddress Source # | |
SerialiseAsRawBytes StakeAddress Source # | |
SerialiseAsBech32 StakeAddress Source # | |
Defined in Bcc.Api.Address | |
SerialiseAddress StakeAddress Source # | |
Defined in Bcc.Api.Address | |
data AsType StakeAddress Source # | |
Defined in Bcc.Api.Address |
data StakeAddressReference Source #
Instances
Eq StakeAddressReference Source # | |
Defined in Bcc.Api.Address | |
Show StakeAddressReference Source # | |
Defined in Bcc.Api.Address |
data StakeCredential Source #
Instances
Eq StakeCredential Source # | |
Defined in Bcc.Api.Address | |
Ord StakeCredential Source # | |
Defined in Bcc.Api.Address compare ∷ StakeCredential → StakeCredential → Ordering Source # (<) ∷ StakeCredential → StakeCredential → Bool Source # (<=) ∷ StakeCredential → StakeCredential → Bool Source # (>) ∷ StakeCredential → StakeCredential → Bool Source # (>=) ∷ StakeCredential → StakeCredential → Bool Source # max ∷ StakeCredential → StakeCredential → StakeCredential Source # min ∷ StakeCredential → StakeCredential → StakeCredential Source # | |
Show StakeCredential Source # | |
Defined in Bcc.Api.Address |
toSophieStakeAddr ∷ StakeAddress → RewardAcnt StandardCrypto Source #
fromSophieStakeAddr ∷ RewardAcnt StandardCrypto → StakeAddress Source #
fromSophieStakeReference ∷ StakeReference StandardCrypto → StakeAddressReference Source #
fromSophiePaymentCredential ∷ PaymentCredential StandardCrypto → PaymentCredential Source #
Building transactions
Constructing and inspecting transactions
data TxBody era where Source #
SophieTxBody | |
|
Instances
Eq (TxBody era) Source # | |
Show (TxBody era) Source # | |
HasTypeProxy era ⇒ HasTypeProxy (TxBody era) Source # | |
IsBccEra era ⇒ SerialiseAsCBOR (TxBody era) Source # | |
Defined in Bcc.Api.TxBody serialiseToCBOR ∷ TxBody era → ByteString Source # deserialiseFromCBOR ∷ AsType (TxBody era) → ByteString → Either DecoderError (TxBody era) Source # | |
IsBccEra era ⇒ HasTextEnvelope (TxBody era) Source # | |
Defined in Bcc.Api.TxBody textEnvelopeType ∷ AsType (TxBody era) → TextEnvelopeType Source # textEnvelopeDefaultDescr ∷ TxBody era → TextEnvelopeDescr Source # | |
data AsType (TxBody era) Source # | |
Defined in Bcc.Api.TxBody |
TxId (Hash StandardCrypto EraIndependentTxBody) |
Instances
Eq TxId Source # | |
Ord TxId Source # | |
Show TxId Source # | |
IsString TxId Source # | |
Defined in Bcc.Api.TxBody fromString ∷ String → TxId Source # | |
FromJSON TxId Source # | |
Defined in Bcc.Api.TxBody | |
ToJSON TxId Source # | |
Defined in Bcc.Api.TxBody | |
FromJSONKey TxId Source # | |
Defined in Bcc.Api.TxBody fromJSONKey ∷ FromJSONKeyFunction TxId fromJSONKeyList ∷ FromJSONKeyFunction [TxId] | |
ToJSONKey TxId Source # | |
Defined in Bcc.Api.TxBody toJSONKey ∷ ToJSONKeyFunction TxId toJSONKeyList ∷ ToJSONKeyFunction [TxId] | |
HasTypeProxy TxId Source # | |
SerialiseAsRawBytes TxId Source # | |
Defined in Bcc.Api.TxBody | |
data AsType TxId Source # | |
Defined in Bcc.Api.TxBody |
toSophieTxId ∷ TxId → TxId StandardCrypto Source #
fromSophieTxId ∷ TxId StandardCrypto → TxId Source #
getTxIdSophie ∷ Crypto (SophieLedgerEra era) ~ StandardCrypto ⇒ UsesTxBody (SophieLedgerEra era) ⇒ SophieBasedEra era → TxBody (SophieLedgerEra era) → TxId Source #
Instances
Eq TxIn Source # | |
Ord TxIn Source # | |
Show TxIn Source # | |
ToJSON TxIn Source # | |
Defined in Bcc.Api.TxBody | |
ToJSONKey TxIn Source # | |
Defined in Bcc.Api.TxBody toJSONKey ∷ ToJSONKeyFunction TxIn toJSONKeyList ∷ ToJSONKeyFunction [TxIn] |
toSophieTxIn ∷ TxIn → TxIn StandardCrypto Source #
fromSophieTxIn ∷ TxIn StandardCrypto → TxIn Source #
TxOut (AddressInEra era) (TxOutValue era) (TxOutDatumHash era) |
Instances
Eq (TxOut era) Source # | |
Show (TxOut era) Source # | |
Generic (TxOut era) Source # | |
IsBccEra era ⇒ ToJSON (TxOut era) Source # | |
Defined in Bcc.Api.TxBody toEncoding ∷ TxOut era → Encoding # toJSONList ∷ [TxOut era] → Value # toEncodingList ∷ [TxOut era] → Encoding # | |
type Rep (TxOut era) Source # | |
Defined in Bcc.Api.TxBody type Rep (TxOut era) = D1 ('MetaData "TxOut" "Bcc.Api.TxBody" "bcc-api-1.99.0-inplace" 'False) (C1 ('MetaCons "TxOut" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (AddressInEra era)) :*: (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (TxOutValue era)) :*: S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (TxOutDatumHash era))))) |
toSophieTxOut ∷ ∀ era ledgerera. SophieLedgerEra era ~ ledgerera ⇒ SophieBasedEra era → TxOut era → TxOut ledgerera Source #
fromSophieTxOut ∷ SophieLedgerEra era ~ ledgerera ⇒ SophieBasedEra era → TxOut ledgerera → TxOut era Source #
Instances
Instances
Enum Entropic Source # | |
Defined in Bcc.Api.Value succ ∷ Entropic → Entropic Source # pred ∷ Entropic → Entropic Source # toEnum ∷ Int → Entropic Source # fromEnum ∷ Entropic → Int Source # enumFrom ∷ Entropic → [Entropic] Source # enumFromThen ∷ Entropic → Entropic → [Entropic] Source # enumFromTo ∷ Entropic → Entropic → [Entropic] Source # enumFromThenTo ∷ Entropic → Entropic → Entropic → [Entropic] Source # | |
Eq Entropic Source # | |
Num Entropic Source # | |
Defined in Bcc.Api.Value | |
Ord Entropic Source # | |
Show Entropic Source # | |
Semigroup Entropic Source # | |
Monoid Entropic Source # | |
FromJSON Entropic Source # | |
Defined in Bcc.Api.Value | |
ToJSON Entropic Source # | |
Defined in Bcc.Api.Value toEncoding ∷ Entropic → Encoding # toJSONList ∷ [Entropic] → Value # toEncodingList ∷ [Entropic] → Encoding # | |
FromCBOR Entropic Source # | |
ToCBOR Entropic Source # | |
toSophieEntropic ∷ Entropic → Coin Source #
fromSophieEntropic ∷ Coin → Entropic Source #
toJenValue ∷ Value → Value StandardCrypto Source #
fromJenValue ∷ Value StandardCrypto → Value Source #
calcMinimumDeposit ∷ Value → Entropic → Entropic Source #
Calculate cost of making a UTxO entry for a given Value
and
mininimum UTxO value derived from the ProtocolParameters
Signing transactions
Creating transaction witnesses one by one, or all in one go.
SophieTx ∷ SophieBasedEra era → Tx (SophieLedgerEra 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 |
Incremental signing and separate witnesses
data KeyWitness era where Source #
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 |
data SophieWitnessSigningKey Source #
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 |
getSophieKeyWitnessVerificationKey ∷ SophieSigningKey → VKey Witness StandardCrypto Source #
makeSophieSignature ∷ SignableRepresentation tosign ⇒ tosign → SophieSigningKey → SignedDSIGN StandardCrypto tosign Source #
Transaction metadata
Embedding additional structured data within transactions.
toSophieMetadata ∷ Map Word64 TxMetadataValue → Map Word64 Metadatum Source #
fromSophieMetadata ∷ Map Word64 Metadatum → Map Word64 TxMetadataValue Source #
toSophieMetadatum ∷ TxMetadataValue → Metadatum Source #
fromSophieMetadatum ∷ Metadatum → TxMetadataValue Source #
Protocol parameters
data ProtocolParameters Source #
The values of the set of updateable protocol paramaters. At any particular point on the chain there is a current set of paramaters in use.
These paramaters can be updated (at epoch boundaries) via an
UpdateProposal
, which contains a ProtocolParametersUpdate
.
The ProtocolParametersUpdate
is essentially a diff for the
ProtocolParameters
.
There are also paramaters fixed in the Genesis file. See GenesisParameters
.
ProtocolParameters | |
|
Instances
checkProtocolParameters ∷ ∀ era. IsBccEra era ⇒ SophieBasedEra era → ProtocolParameters → Either ProtocolParametersError () Source #
data ProtocolParametersError Source #
Instances
Show ProtocolParametersError Source # | |
Defined in Bcc.Api.ProtocolParameters | |
Error ProtocolParametersError Source # | |
Defined in Bcc.Api.ProtocolParameters |
Scripts
toSophieScript ∷ ScriptInEra era → Script (SophieLedgerEra era) Source #
toSophieMultiSig ∷ SimpleScript SimpleScriptV1 → MultiSig StandardCrypto Source #
Conversion for the MultiSig
language used by the Sophie era.
fromSophieMultiSig ∷ MultiSig StandardCrypto → SimpleScript lang Source #
Conversion for the MultiSig
language used by the Sophie era.
toEvieTimelock ∷ ∀ lang. SimpleScript lang → Timelock StandardCrypto Source #
Conversion for the Timelock
language that is shared between the
Evie and Jen eras.
fromEvieTimelock ∷ TimeLocksSupported lang → Timelock StandardCrypto → SimpleScript lang Source #
Conversion for the Timelock
language that is shared between the
Evie and Jen eras.
toSophieScriptHash ∷ ScriptHash → ScriptHash StandardCrypto Source #
fromSophieScriptHash ∷ ScriptHash StandardCrypto → ScriptHash Source #
data ZerepochScript lang where Source #
Zerepoch scripts.
Note that Zerepoch scripts have a binary serialisation but no JSON serialisation.
Instances
toZerepochData ∷ ScriptData → Data Source #
fromZerepochData ∷ Data → ScriptData Source #
toAurumData ∷ ScriptData → Data ledgerera Source #
fromAurumData ∷ Data ledgerera → ScriptData Source #
toAurumPrices ∷ ExecutionUnitPrices → Maybe Prices Source #
fromAurumPrices ∷ Prices → ExecutionUnitPrices Source #
toAurumExUnits ∷ ExecutionUnits → ExUnits Source #
fromAurumExUnits ∷ ExUnits → ExecutionUnits Source #
toAurumRdmrPtr ∷ ScriptWitnessIndex → RdmrPtr Source #
fromAurumRdmrPtr ∷ RdmrPtr → ScriptWitnessIndex Source #
Certificates
data Certificate Source #
Instances
toSophieCertificate ∷ Certificate → DCert StandardCrypto Source #
fromSophieCertificate ∷ DCert StandardCrypto → Certificate Source #
Operational certificates
data OperationalCertificate Source #
OperationalCertificate !(OCert StandardCrypto) !(VerificationKey StakePoolKey) |
Instances
Eq OperationalCertificate Source # | |
Show OperationalCertificate Source # | |
Defined in Bcc.Api.OperationalCertificate | |
FromCBOR OperationalCertificate Source # | |
Defined in Bcc.Api.OperationalCertificate fromCBOR ∷ Decoder s OperationalCertificate # | |
ToCBOR OperationalCertificate Source # | |
Defined in Bcc.Api.OperationalCertificate toCBOR ∷ OperationalCertificate → Encoding # encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy OperationalCertificate → Size # encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [OperationalCertificate] → Size # | |
HasTypeProxy OperationalCertificate Source # | |
SerialiseAsCBOR OperationalCertificate Source # | |
Defined in Bcc.Api.OperationalCertificate | |
HasTextEnvelope OperationalCertificate Source # | |
data AsType OperationalCertificate Source # | |
Defined in Bcc.Api.OperationalCertificate |
data OperationalCertificateIssueCounter Source #
Instances
data OperationalCertIssueError Source #
OperationalCertKeyMismatch (VerificationKey StakePoolKey) (VerificationKey StakePoolKey) | The stake pool verification key expected for the
Order: pool vkey expected, pool skey supplied |
Instances
Stake Pool
data StakePoolMetadata Source #
A representation of the required fields for off-chain stake pool metadata.
Instances
Eq StakePoolMetadata Source # | |
Defined in Bcc.Api.StakePoolMetadata | |
Show StakePoolMetadata Source # | |
Defined in Bcc.Api.StakePoolMetadata | |
FromJSON StakePoolMetadata Source # | |
Defined in Bcc.Api.StakePoolMetadata parseJSON ∷ Value → Parser StakePoolMetadata # parseJSONList ∷ Value → Parser [StakePoolMetadata] # | |
HasTypeProxy StakePoolMetadata Source # | |
Defined in Bcc.Api.StakePoolMetadata data AsType StakePoolMetadata Source # | |
Eq (Hash StakePoolMetadata) Source # | |
Defined in Bcc.Api.StakePoolMetadata | |
Show (Hash StakePoolMetadata) Source # | |
Defined in Bcc.Api.StakePoolMetadata | |
SerialiseAsRawBytes (Hash StakePoolMetadata) Source # | |
data AsType StakePoolMetadata Source # | |
Defined in Bcc.Api.StakePoolMetadata | |
newtype Hash StakePoolMetadata Source # | |
Defined in Bcc.Api.StakePoolMetadata |
stakePoolName ∷ StakePoolMetadata → Text Source #
A name of up to 50 characters.
stakePoolDescription ∷ StakePoolMetadata → Text Source #
A description of up to 255 characters.
stakePoolTicker ∷ StakePoolMetadata → Text Source #
A ticker of 3-5 characters, for a compact display of stake pools in a wallet.
stakePoolHomepage ∷ StakePoolMetadata → Text Source #
A URL to a homepage with additional information about the pool. n.b. the spec does not specify a character limit for this field.
data StakePoolMetadataReference Source #
Instances
data StakePoolParameters Source #
StakePoolParameters PoolId (Hash VrfKey) Entropic Rational StakeAddress Entropic [Hash StakeKey] [StakePoolRelay] (Maybe StakePoolMetadataReference) |
Instances
Eq StakePoolParameters Source # | |
Defined in Bcc.Api.Certificate | |
Show StakePoolParameters Source # | |
Defined in Bcc.Api.Certificate |
data StakePoolRelay Source #
StakePoolRelayIp (Maybe IPv4) (Maybe IPv6) (Maybe PortNumber) | One or both of IPv4 & IPv6 |
StakePoolRelayDnsARecord ByteString (Maybe PortNumber) | An DNS name pointing to a |
StakePoolRelayDnsSrvRecord ByteString | A DNS name pointing to a |
Instances
Eq StakePoolRelay Source # | |
Defined in Bcc.Api.Certificate (==) ∷ StakePoolRelay → StakePoolRelay → Bool Source # (/=) ∷ StakePoolRelay → StakePoolRelay → Bool Source # | |
Show StakePoolRelay Source # | |
Defined in Bcc.Api.Certificate |
Instances
Stake pool operator's keys
data StakePoolKey Source #
Instances
type PoolId = Hash StakePoolKey Source #
KES keys
Instances
Instances
Eq KESPeriod | |
Ord KESPeriod | |
Defined in Bcc.Protocol.TOptimum.OCert | |
Show KESPeriod | |
Generic KESPeriod | |
NoThunks KESPeriod | |
FromCBOR KESPeriod | |
ToCBOR KESPeriod | |
type Rep KESPeriod | |
Defined in Bcc.Protocol.TOptimum.OCert type Rep KESPeriod = D1 ('MetaData "KESPeriod" "Bcc.Protocol.TOptimum.OCert" "bcc-protocol-toptimum-0.1.0.0-e4c0ddeda0ea93d48bc0ac574b4d9bf5a041e1f973a8cf794f57007f11331e09" 'True) (C1 ('MetaCons "KESPeriod" 'PrefixI 'True) (S1 ('MetaSel ('Just "unKESPeriod") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word))) |
VRF keys
Instances
Low level protocol interaction with a Bcc node
data LocalNodeConnectInfo mode Source #
data SophieMode Source #
The Sophie-only consensus mode consists of only the Sophie era.
This was used for the early Sophie testnets prior to the use of the
multi-era BccMode
. It is useful for setting up Sophie test networks
(e.g. for benchmarking) without having to go through the complication of the
hard fork from Cole to Sophie eras. It also shows how a single-era
consensus mode works. It may be replaced by other single-era modes in future.
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 Bcc.Api.Modes |
data LocalNodeClientProtocols block point tip tx 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 ())) |
Sophie based eras
type family SophieLedgerEra era where ... Source #
A type family that connects our era type tags to equivalent type tags used in the Sophie ledger library.
This type mapping connect types from this API with types in the Sophie ledger library which allows writing conversion functions in a more generic way.
SophieLedgerEra SophieEra = StandardSophie | |
SophieLedgerEra EvieEra = StandardEvie | |
SophieLedgerEra JenEra = StandardJen | |
SophieLedgerEra AurumEra = StandardAurum |
Local State Query
data DebugLedgerState era where Source #
DebugLedgerState ∷ SophieLedgerEra era ~ ledgerera ⇒ NewEpochState ledgerera → DebugLedgerState era |
Instances
(IsSophieBasedEra era, SophieLedgerEra era ~ ledgerera, SophieBasedEra ledgerera, ToJSON (PParams ledgerera), ToJSON (PParamsDelta ledgerera), ToJSON (TxOut ledgerera)) ⇒ ToJSON (DebugLedgerState era) Source # | |
Defined in Bcc.Api.Query toJSON ∷ DebugLedgerState era → Value # toEncoding ∷ DebugLedgerState era → Encoding # toJSONList ∷ [DebugLedgerState era] → Value # toEncodingList ∷ [DebugLedgerState era] → Encoding # | |
(Typeable era, TransLedgerState FromCBOR (SophieLedgerEra era)) ⇒ FromCBOR (DebugLedgerState era) Source # | |
Defined in Bcc.Api.Query fromCBOR ∷ Decoder s (DebugLedgerState era) # label ∷ Proxy (DebugLedgerState era) → Text # |
newtype ProtocolState era Source #
ProtocolState (Serialised (ChainDepState (Crypto (SophieLedgerEra era)))) |
newtype SerialisedDebugLedgerState era Source #
SerialisedDebugLedgerState (Serialised (NewEpochState (SophieLedgerEra era))) |
Conversions
toSophieNetwork ∷ NetworkId → Network Source #
fromSophiePParams ∷ PParams ledgerera → ProtocolParameters Source #