# generated by datamodel-codegen:
#   filename:  cardano.json
#   timestamp: 2024-08-24T16:37:37+00:00

from __future__ import annotations

from datetime import datetime
from enum import Enum
from typing import Any, Dict, List, Optional, Union
import sys

from pydantic.v1 import AnyUrl, Extra, Field, conint, constr

if "pytest" in sys.modules:
    from pydantic.v1 import BaseModel
else:
    from ogmios.model.BaseModelNoException import BaseModelNoException as BaseModel


class Cardano(BaseModel):
    __root__: Any = Field(..., title='Cardano')


class Address(BaseModel):
    __root__: constr(regex=r'[1-9A-HJ-NP-Za-km-z]*') = Field(
        ...,
        description='A Cardano address (either legacy format or new format).',
        examples=[
            'addr1q9d34spgg2kdy47n82e7x9pdd6vql6d2engxmpj20jmhuc2047yqd4xnh7u6u5jp4t0q3fkxzckph4tgnzvamlu7k5psuahzcp',
            'DdzFFzCqrht8mbSTZHqpM2u4HeND2mdspsaBhdQ1BowPJBMzbDeBMeKgqdoKqo1D4sdPusEdZJVrFJRBBxX1jUEofNDYCJSZLg8MkyCE',
        ],
        title='Address',
    )


class AddressAttributes(BaseModel):
    __root__: str = Field(
        ...,
        description='Extra attributes carried by Byron addresses (network magic and/or HD payload).',
        title='AddressAttributes',
    )


class DigestAny(BaseModel):
    __root__: str = Field(
        ...,
        description='A hash digest from an unspecified algorithm and length.',
        examples=['90181c517a5beadc9c3fe64bf8'],
        title='Digest<Any>',
    )


class AssetQuantity(BaseModel):
    __root__: int = Field(
        ...,
        description='A number of asset, can be negative went burning assets.',
        title='AssetQuantity',
    )


class Assets(BaseModel):
    __root__: Optional[Dict[str, Dict[str, AssetQuantity]]] = None


class Type(Enum):
    ebb = 'ebb'


class Era(Enum):
    byron = 'byron'


class DigestBlake2b256(BaseModel):
    __root__: constr(min_length=64, max_length=64) = Field(
        ...,
        description='A Blake2b 32-byte hash digest, encoded in base16.',
        examples=['c248757d390181c517a5beadc9c3fe64bf821d3e889a963fc717003ec248757d'],
        title='Digest<Blake2b, 256>',
    )


class Type1(Enum):
    bft = 'bft'


class BlockHeight(BaseModel):
    __root__: conint(ge=0, le=18446744073709552999) = Field(
        ...,
        description='A block number, the i-th block to be minted is number i.',
        title='BlockHeight',
    )


class Type2(Enum):
    praos = 'praos'


class Era2(Enum):
    shelley = 'shelley'
    allegra = 'allegra'
    mary = 'mary'
    alonzo = 'alonzo'
    babbage = 'babbage'


class Ancestor(Enum):
    genesis = 'genesis'


class VrfProof(BaseModel):
    __root__: str = Field(..., title='VrfProof')


class UInt32(BaseModel):
    __root__: conint(ge=0, le=4294967295) = Field(..., title='UInt32')


class VerificationKey(BaseModel):
    __root__: constr(min_length=64, max_length=64) = Field(
        ..., description='An Ed25519 verification key.', title='VerificationKey'
    )


class BootstrapProtocolId(BaseModel):
    __root__: conint(ge=0, le=4294967295) = Field(
        ..., examples=[764824073], title='BootstrapProtocolId'
    )


class Ratio(BaseModel):
    __root__: constr(regex=r'^-?[0-9]+/[0-9]+$') = Field(
        ...,
        description='A ratio of two integers, to express exact fractions.',
        examples=['2/3', '7/8'],
        title='Ratio',
    )


class Voter(BaseModel):
    class Config:
        extra = Extra.forbid

    verificationKey: Union[VerificationKey, ExtendedVerificationKey]  # Edited


class Proposal1(BaseModel):
    class Config:
        extra = Extra.forbid

    id: DigestBlake2b256


class BootstrapVote(BaseModel):
    class Config:
        extra = Extra.forbid

    voter: Voter
    proposal: Proposal1


class RelativeTime(BaseModel):
    class Config:
        extra = Extra.forbid

    seconds: int


class Type3(Enum):
    stakeDelegation = 'stakeDelegation'


class Type4(Enum):
    stakeCredentialRegistration = 'stakeCredentialRegistration'


class Type5(Enum):
    stakeCredentialDeregistration = 'stakeCredentialDeregistration'


class Type6(Enum):
    stakePoolRegistration = 'stakePoolRegistration'


class Type7(Enum):
    stakePoolRetirement = 'stakePoolRetirement'


class Type8(Enum):
    genesisDelegation = 'genesisDelegation'


class Type9(Enum):
    constitutionalCommitteeDelegation = 'constitutionalCommitteeDelegation'


class Type10(Enum):
    constitutionalCommitteeRetirement = 'constitutionalCommitteeRetirement'


class Type11(Enum):
    delegateRepresentativeRegistration = 'delegateRepresentativeRegistration'


class Type12(Enum):
    delegateRepresentativeUpdate = 'delegateRepresentativeUpdate'


class Type13(Enum):
    delegateRepresentativeRetirement = 'delegateRepresentativeRetirement'


class CredentialOrigin(Enum):
    verificationKey = 'verificationKey'
    script = 'script'


class ChainCode(BaseModel):
    __root__: str = Field(
        ..., description='An Ed25519-BIP32 chain-code for key deriviation.', title='ChainCode'
    )


class Null(BaseModel):
    __root__: None


class Status(Enum):
    active = 'active'
    expired = 'expired'
    unrecognized = 'unrecognized'


class Change(Enum):
    toBeEnacted = 'toBeEnacted'


class Next(BaseModel):
    class Config:
        extra = Extra.forbid

    change: Change


class Change1(Enum):
    toBeRemoved = 'toBeRemoved'


class Next1(BaseModel):
    class Config:
        extra = Extra.forbid

    change: Change1


class Change2(Enum):
    expiring = 'expiring'


class Next2(BaseModel):
    class Config:
        extra = Extra.forbid

    change: Change2


class Change3(Enum):
    adjustingMandate = 'adjustingMandate'


class DigestBlake2b224(BaseModel):
    __root__: constr(min_length=56, max_length=56) = Field(
        ...,
        description='A Blake2b 28-byte hash digest, encoded in base16.',
        examples=['90181c517a5beadc9c3fe64bf821d3e889a963fc717003ec248757d3'],
        title='Digest<Blake2b, 224>',
    )


class Status1(Enum):
    authorized = 'authorized'


class ConstitutionalCommitteeDelegate1(BaseModel):
    class Config:
        extra = Extra.forbid

    status: Status1
    id: DigestBlake2b224
    from_: CredentialOrigin = Field(..., alias='from')


class Status2(Enum):
    resigned = 'resigned'


class Status3(Enum):
    none = 'none'


class ConstitutionalCommitteeDelegate3(BaseModel):
    class Config:
        extra = Extra.forbid

    status: Status3


class Epoch(BaseModel):
    __root__: conint(ge=0, le=18446744073709552000) = Field(
        ..., description='An epoch number or length.', title='Epoch'
    )


class Int64(BaseModel):
    __root__: conint(ge=-9223372036854775808, le=9223372036854775807) = Field(..., title='Int64')


class Datum(BaseModel):
    __root__: str = Field(..., title='Datum')


class ConstitutionalCommittee(BaseModel):
    class Config:
        extra = Extra.forbid

    default: Ratio
    stateOfNoConfidence: Ratio


class ProtocolParametersUpdate(BaseModel):
    class Config:
        extra = Extra.forbid

    network: Ratio
    economic: Ratio
    technical: Ratio
    governance: Ratio


class DelegateRepresentativeVotingThresholds(BaseModel):
    class Config:
        extra = Extra.forbid

    noConfidence: Ratio
    constitution: Ratio
    constitutionalCommittee: ConstitutionalCommittee
    hardForkInitiation: Ratio
    protocolParametersUpdate: ProtocolParametersUpdate
    treasuryWithdrawals: Ratio


class Type14(Enum):
    registered = 'registered'


class DelegateRepresentative1(BaseModel):
    class Config:
        extra = Extra.forbid

    id: DigestBlake2b224
    from_: CredentialOrigin = Field(..., alias='from')
    type: Type14


class Type15(Enum):
    noConfidence = 'noConfidence'


class DelegateRepresentative2(BaseModel):
    class Config:
        extra = Extra.forbid

    type: Type15 = Field(
        ...,
        description='A special delegate representative which always vote no, except on votes of no-confidence.',
    )


class Type16(Enum):
    abstain = 'abstain'


class DelegateRepresentative3(BaseModel):
    class Config:
        extra = Extra.forbid

    type: Type16 = Field(..., description='A special delegate representative which always abstain.')


class DelegateRepresentative(BaseModel):
    __root__: Union[DelegateRepresentative1, DelegateRepresentative2, DelegateRepresentative3] = (
        Field(..., title='DelegateRepresentative')
    )


class Era3(Enum):
    byron = 'byron'
    shelley = 'shelley'
    allegra = 'allegra'
    mary = 'mary'
    alonzo = 'alonzo'
    babbage = 'babbage'
    conway = 'conway'


class EraWithGenesis(Enum):
    byron = 'byron'
    shelley = 'shelley'
    alonzo = 'alonzo'
    conway = 'conway'


class SlotLength(BaseModel):
    class Config:
        extra = Extra.forbid

    milliseconds: int


class UInt64(BaseModel):
    __root__: conint(ge=0, le=18446744073709552999) = Field(..., title='UInt64')


class Era4(Enum):
    byron = 'byron'


class UtcTime(BaseModel):
    __root__: datetime = Field(..., title='UtcTime')


class Era5(Enum):
    shelley = 'shelley'


class NetworkMagic(BaseModel):
    __root__: conint(ge=0, le=4294967296) = Field(
        ...,
        description='A magic number for telling networks apart. (e.g. 764824073)',
        examples=[764824073],
        title='NetworkMagic',
    )


class Era6(Enum):
    alonzo = 'alonzo'


class NumberOfBytes(BaseModel):
    class Config:
        extra = Extra.forbid

    bytes: UInt64


class Era7(Enum):
    conway = 'conway'


class ProtocolParametersUpdate1(BaseModel):
    class Config:
        extra = Extra.forbid

    security: Ratio


class StakePoolVotingThresholds(BaseModel):
    class Config:
        extra = Extra.forbid

    noConfidence: Ratio
    constitutionalCommittee: ConstitutionalCommittee
    hardForkInitiation: Ratio
    protocolParametersUpdate: ProtocolParametersUpdate1


class GenesisDelegate(BaseModel):
    class Config:
        extra = Extra.forbid

    id: DigestBlake2b224
    vrfVerificationKeyHash: DigestBlake2b256


class StakePoolId(BaseModel):
    __root__: constr(regex=r'^pool1[0-9a-z]*$') = Field(
        ...,
        description="A Blake2b 32-byte hash digest of a pool's verification key.",
        examples=[
            'pool1qqqqpanw9zc0rzh0yp247nzf2s35uvnsm7aaesfl2nnejaev0uc',
            'pool1qqqqqdk4zhsjuxxd8jyvwncf5eucfskz0xjjj64fdmlgj735lr9',
        ],
        title='StakePoolId',
    )


class Type17(Enum):
    protocolParametersUpdate = 'protocolParametersUpdate'


class Guardrails(BaseModel):
    class Config:
        extra = Extra.forbid

    hash: DigestBlake2b224


class Type18(Enum):
    hardForkInitiation = 'hardForkInitiation'


class Type19(Enum):
    treasuryTransfer = 'treasuryTransfer'


class Source(Enum):
    reserves = 'reserves'
    treasury = 'treasury'


class Target(Enum):
    reserves = 'reserves'
    treasury = 'treasury'


class Type20(Enum):
    treasuryWithdrawals = 'treasuryWithdrawals'


class Type21(Enum):
    constitutionalCommittee = 'constitutionalCommittee'


class RemovedItem(BaseModel):
    class Config:
        extra = Extra.forbid

    id: DigestBlake2b224
    from_: CredentialOrigin = Field(..., alias='from')


class Type22(Enum):
    constitution = 'constitution'


class Type23(Enum):
    noConfidence = 'noConfidence'


class Type24(Enum):
    information = 'information'


class GovernanceAction8(BaseModel):
    class Config:
        extra = Extra.forbid

    type: Type24


class TransactionId(BaseModel):
    __root__: constr(min_length=64, max_length=64) = Field(
        ...,
        description='A Blake2b 32-byte hash digest of a transaction body',
        title='TransactionId',
    )


class Ada(BaseModel):
    class Config:
        extra = Extra.forbid

    lovelace: int


class ValueAdaOnly(BaseModel):
    class Config:
        extra = Extra.forbid

    ada: Ada


class Vote(Enum):
    yes = 'yes'
    no = 'no'
    abstain = 'abstain'


class Role(Enum):
    genesisDelegate = 'genesisDelegate'


class GovernanceVoter1(BaseModel):
    class Config:
        extra = Extra.forbid

    role: Role
    id: DigestBlake2b224
    from_: CredentialOrigin = Field(..., alias='from')


class Role1(Enum):
    constitutionalCommittee = 'constitutionalCommittee'


class GovernanceVoter2(BaseModel):
    class Config:
        extra = Extra.forbid

    role: Role1
    id: DigestBlake2b224
    from_: CredentialOrigin = Field(..., alias='from')


class Role2(Enum):
    delegateRepresentative = 'delegateRepresentative'


class GovernanceVoter3(BaseModel):
    class Config:
        extra = Extra.forbid

    role: Role2
    id: DigestBlake2b224
    from_: CredentialOrigin = Field(..., alias='from')


class Role3(Enum):
    stakePoolOperator = 'stakePoolOperator'


class GovernanceVoter4(BaseModel):
    class Config:
        extra = Extra.forbid

    role: Role3
    id: StakePoolId


class GovernanceVoter(BaseModel):
    __root__: Union[GovernanceVoter1, GovernanceVoter2, GovernanceVoter3, GovernanceVoter4]


class ExtendedVerificationKey(BaseModel):
    __root__: constr(min_length=128, max_length=128) = Field(
        ...,
        description='An Ed25519-BIP32 Byron genesis delegate verification key with chain-code.',
        title='ExtendedVerificationKey',
    )


class Issuer4(BaseModel):
    class Config:
        extra = Extra.forbid

    id: DigestBlake2b224


class InitialDelegate(BaseModel):
    class Config:
        extra = Extra.forbid

    issuer: Issuer4
    delegate: GenesisDelegate


class InitialDelegates(BaseModel):
    __root__: List[InitialDelegate] = Field(..., title='InitialDelegates')


class InputSource(Enum):
    inputs = 'inputs'
    collaterals = 'collaterals'


class Language(Enum):
    plutus_v1 = 'plutus:v1'
    plutus_v2 = 'plutus:v2'
    plutus_v3 = 'plutus:v3'


class KesVerificationKey(BaseModel):
    __root__: str = Field(..., title='KesVerificationKey')


class Metadatum1(BaseModel):
    class Config:
        extra = Extra.forbid

    int: int


class Metadatum2(BaseModel):
    class Config:
        extra = Extra.forbid

    string: str


class Metadatum3(BaseModel):
    class Config:
        extra = Extra.forbid

    bytes: constr(regex=r'^[0-9a-f]*$')


class Field0(BaseModel):
    __root__: Union[int, str, List[Field0], Dict[str, Field0]] = Field(
        ..., title='Metadatum<NoSchema>'
    )


class Field11(BaseModel):
    class Config:
        extra = Extra.forbid

    int: int


class Field12(BaseModel):
    class Config:
        extra = Extra.forbid

    string: str


class Field13(BaseModel):
    class Config:
        extra = Extra.forbid

    bytes: constr(regex=r'^[0-9a-f]*$')


class Network(Enum):
    mainnet = 'mainnet'
    testnet = 'testnet'


class Nonce1(Enum):
    neutral = 'neutral'


class Nonce(BaseModel):
    __root__: Union[Nonce1, DigestBlake2b256] = Field(..., title='Nonce')


class Kes(BaseModel):
    class Config:
        extra = Extra.forbid

    period: UInt64
    verificationKey: KesVerificationKey


class Signature(BaseModel):
    __root__: constr(min_length=128, max_length=128) = Field(
        ..., description='An EdDSA signature.', title='Signature'
    )


class Origin(Enum):
    origin = 'origin'


class PolicyId(BaseModel):
    __root__: DigestBlake2b224 = Field(..., title='PolicyId')


class MinFeeReferenceScripts(BaseModel):
    class Config:
        extra = Extra.forbid

    range: UInt32
    base: float
    multiplier: float


class ScriptExecutionPrices(BaseModel):
    class Config:
        extra = Extra.forbid

    memory: Ratio
    cpu: Ratio


class MinFeeReferenceScripts1(BaseModel):
    class Config:
        extra = Extra.forbid

    range: UInt32
    base: float = Field(..., description='The base cost for the tier-price calculation.')
    multiplier: float = Field(..., description='The multiplier increasing the cost of each tier.')


class UInt16(BaseModel):
    __root__: conint(ge=0, le=65536) = Field(..., title='UInt16')


class RedeemerData(BaseModel):
    __root__: str = Field(..., description='Plutus data, CBOR-serialised.', title='RedeemerData')


class Purpose(Enum):
    spend = 'spend'
    mint = 'mint'
    publish = 'publish'
    withdraw = 'withdraw'
    vote = 'vote'
    propose = 'propose'


class RedeemerPointer(BaseModel):
    class Config:
        extra = Extra.forbid

    purpose: Purpose
    index: UInt64


class Type25(Enum):
    ipAddress = 'ipAddress'


class Relay1(BaseModel):
    class Config:
        extra = Extra.forbid

    type: Type25
    ipv4: Optional[str] = None
    ipv6: Optional[str] = None
    port: Optional[conint(ge=0, le=65535)] = None


class Type26(Enum):
    hostname = 'hostname'


class Relay2(BaseModel):
    class Config:
        extra = Extra.forbid

    type: Type26
    hostname: str
    port: Optional[conint(ge=0, le=65535)] = None


class Relay(BaseModel):
    __root__: Union[Relay1, Relay2] = Field(..., title='Relay')


class RewardAccount(BaseModel):
    __root__: constr(regex=r'^stake(_test)?1[0-9a-z]+$') = Field(
        ...,
        description="A reward account, also known as 'stake address'.",
        examples=['stake1ux7pt9adw8z46tgqn2f8fvurrhk325gcm4mf75mkmmxpx6gae9mzv'],
        title='RewardAccount',
    )


class Ada1(BaseModel):
    class Config:
        extra = Extra.forbid

    lovelace: conint(ge=-9223372036854775808, le=9223372036854775807) = Field(
        ..., description='An amount, possibly negative, in Lovelace (1e6 Lovelace = 1 Ada).'
    )


class ValueDelta(BaseModel):
    class Config:
        extra = Extra.forbid

    ada: Ada1


class SafeZone(BaseModel):
    __root__: conint(ge=0, le=18446744073709552999) = Field(
        ...,
        description='Number of slots from the tip of the ledger in which it is guaranteed that no hard fork can take place. This should be (at least) the number of slots in which we are guaranteed to have k blocks.',
        title='SafeZone',
    )


class Language1(Enum):
    native = 'native'


class Language2(Enum):
    plutus_v1 = 'plutus:v1'
    plutus_v2 = 'plutus:v2'
    plutus_v3 = 'plutus:v3'


class Script2(BaseModel):
    class Config:
        extra = Extra.forbid

    language: Language2
    cbor: str


class Clause(Enum):
    signature = 'signature'


class ScriptNative1(BaseModel):
    class Config:
        extra = Extra.forbid

    clause: Clause
    from_: DigestBlake2b224 = Field(..., alias='from')


class Clause1(Enum):
    any = 'any'


class Clause2(Enum):
    all = 'all'


class Clause3(Enum):
    some = 'some'


class Clause4(Enum):
    before = 'before'


class Clause5(Enum):
    after = 'after'


class Slot(BaseModel):
    __root__: conint(ge=0, le=18446744073709552000) = Field(
        ..., description='An absolute slot number.', title='Slot'
    )


class Purpose1(Enum):
    spend = 'spend'


class Purpose2(Enum):
    mint = 'mint'


class ScriptPurpose2(BaseModel):
    class Config:
        extra = Extra.forbid

    purpose: Purpose2
    policy: PolicyId


class Purpose3(Enum):
    publish = 'publish'


class Purpose4(Enum):
    withdraw = 'withdraw'


class ScriptPurpose4(BaseModel):
    class Config:
        extra = Extra.forbid

    purpose: Purpose4
    rewardAccount: RewardAccount


class Purpose5(Enum):
    propose = 'propose'


class Purpose6(Enum):
    vote = 'vote'


class ScriptPurpose6(BaseModel):
    class Config:
        extra = Extra.forbid

    purpose: Purpose6
    issuer: GovernanceVoter


class Transaction2(BaseModel):
    class Config:
        extra = Extra.forbid

    id: TransactionId


class TransactionOutputReference(BaseModel):
    class Config:
        extra = Extra.forbid

    transaction: Transaction2
    index: UInt64


class Signatory(BaseModel):
    class Config:
        extra = Extra.forbid

    key: VerificationKey
    signature: Signature
    chainCode: Optional[ChainCode] = None
    addressAttributes: Optional[AddressAttributes] = None


class SoftwareVersion(BaseModel):
    class Config:
        extra = Extra.forbid

    appName: str
    number: UInt32


class StakeAddress(BaseModel):
    __root__: constr(regex=r'^(stake|stake_test)1[0-9a-z]*$') = Field(
        ...,
        description='A stake address (a.k.a reward account)',
        examples=['stake179kzq4qulejydh045yzxwk4ksx780khkl4gdve9kzwd9vjcek9u8h'],
        title='StakeAddress',
    )


class Tip(BaseModel):
    class Config:
        extra = Extra.forbid

    slot: Slot
    id: DigestBlake2b256
    height: BlockHeight


class Treasury(BaseModel):
    class Config:
        extra = Extra.forbid

    value: Optional[ValueAdaOnly] = None
    donation: Optional[ValueAdaOnly] = None


class Ada2(BaseModel):
    class Config:
        extra = Extra.forbid

    lovelace: int


class Value(BaseModel):
    ada: Ada2


class UInt8(BaseModel):
    __root__: conint(ge=0, le=255) = Field(..., title='UInt8')


class ValidityInterval(BaseModel):
    class Config:
        extra = Extra.forbid

    invalidBefore: Optional[Slot] = None
    invalidAfter: Optional[Slot] = None


class VotingPeriod(Enum):
    voteForThisEpoch = 'voteForThisEpoch'
    voteForNextEpoch = 'voteForNextEpoch'


class VrfOutput(BaseModel):
    __root__: str = Field(..., title='VrfOutput')


class Withdrawals(BaseModel):
    __root__: Optional[Dict[str, ValueAdaOnly]] = None


class Anchor(BaseModel):
    class Config:
        extra = Extra.forbid

    hash: DigestAny
    url: AnyUrl


class BlockEBB(BaseModel):
    class Config:
        extra = Extra.forbid

    type: Type
    era: Era
    id: DigestBlake2b256
    ancestor: DigestBlake2b256
    height: BlockHeight


class Issuer(BaseModel):
    class Config:
        extra = Extra.forbid

    verificationKey: ExtendedVerificationKey


class Delegate(BaseModel):
    class Config:
        extra = Extra.forbid

    verificationKey: ExtendedVerificationKey


class CertifiedVrf(BaseModel):
    class Config:
        extra = Extra.forbid

    proof: Optional[VrfProof] = None
    output: Optional[VrfOutput] = None


class ProtocolVersion(BaseModel):
    class Config:
        extra = Extra.forbid

    major: UInt32
    minor: UInt32
    patch: Optional[UInt32] = None


class Issuer2(BaseModel):
    class Config:
        extra = Extra.forbid

    verificationKey: VerificationKey


class Delegate1(BaseModel):
    class Config:
        extra = Extra.forbid

    verificationKey: VerificationKey


class BootstrapOperationalCertificate(BaseModel):
    class Config:
        extra = Extra.forbid

    issuer: Issuer2
    delegate: Delegate1


class BootstrapProtocolParameters(BaseModel):
    class Config:
        extra = Extra.forbid

    heavyDelegationThreshold: Optional[Ratio] = None
    maxBlockBodySize: Optional[NumberOfBytes] = None
    maxBlockHeaderSize: Optional[NumberOfBytes] = None
    maxUpdateProposalSize: Optional[NumberOfBytes] = None
    maxTransactionSize: Optional[NumberOfBytes] = None
    multiPartyComputationThreshold: Optional[Ratio] = None
    scriptVersion: Optional[UInt64] = None
    slotDuration: Optional[UInt64] = None
    unlockStakeEpoch: Optional[UInt64] = None
    updateProposalThreshold: Optional[Ratio] = None
    updateProposalTimeToLive: Optional[UInt64] = None
    updateVoteThreshold: Optional[Ratio] = None
    softForkInitThreshold: Optional[Ratio] = None
    softForkMinThreshold: Optional[Ratio] = None
    softForkDecrementThreshold: Optional[Ratio] = None
    minFeeCoefficient: Optional[UInt64] = None
    minFeeConstant: Optional[ValueAdaOnly] = None


class Bound(BaseModel):
    class Config:
        extra = Extra.forbid

    time: RelativeTime
    slot: Slot
    epoch: Epoch


class StakePool(BaseModel):
    class Config:
        extra = Extra.forbid

    id: StakePoolId


class Certificate1(BaseModel):
    class Config:
        extra = Extra.forbid

    type: Type3
    from_: CredentialOrigin = Field(..., alias='from')
    credential: DigestBlake2b224
    stakePool: Optional[StakePool] = None
    delegateRepresentative: Optional[DelegateRepresentative] = None


class Certificate2(BaseModel):
    class Config:
        extra = Extra.forbid

    type: Type4
    from_: CredentialOrigin = Field(..., alias='from')
    credential: DigestBlake2b224
    deposit: Optional[ValueAdaOnly] = None


class Certificate3(BaseModel):
    class Config:
        extra = Extra.forbid

    type: Type5
    from_: CredentialOrigin = Field(..., alias='from')
    credential: DigestBlake2b224
    deposit: Optional[ValueAdaOnly] = None


class StakePool1(BaseModel):
    class Config:
        extra = Extra.forbid

    retirementEpoch: Epoch
    id: StakePoolId


class Certificate5(BaseModel):
    class Config:
        extra = Extra.forbid

    type: Type7
    stakePool: StakePool1


class Issuer3(BaseModel):
    class Config:
        extra = Extra.forbid

    id: DigestBlake2b224


class Certificate6(BaseModel):
    class Config:
        extra = Extra.forbid

    type: Type8
    delegate: GenesisDelegate
    issuer: Issuer3


class Member(BaseModel):
    class Config:
        extra = Extra.forbid

    id: DigestBlake2b224
    from_: CredentialOrigin = Field(..., alias='from')


class Certificate8(BaseModel):
    class Config:
        extra = Extra.forbid

    type: Type10
    member: Member
    metadata: Optional[Anchor] = None


class Certificate9(BaseModel):
    class Config:
        extra = Extra.forbid

    type: Type11
    delegateRepresentative: DelegateRepresentative
    deposit: ValueAdaOnly
    metadata: Optional[Anchor] = None


class Certificate10(BaseModel):
    class Config:
        extra = Extra.forbid

    type: Type12
    delegateRepresentative: DelegateRepresentative
    metadata: Optional[Anchor]


class Certificate11(BaseModel):
    class Config:
        extra = Extra.forbid

    type: Type13
    delegateRepresentative: DelegateRepresentative
    deposit: ValueAdaOnly


class Constitution(BaseModel):
    class Config:
        extra = Extra.forbid

    guardrails: Union[Null, Guardrails]
    metadata: Anchor


class ConstitutionalCommitteeDelegate2(BaseModel):
    class Config:
        extra = Extra.forbid

    status: Status2
    metadata: Optional[Anchor] = None


class ConstitutionalCommitteeDelegate(BaseModel):
    __root__: Union[
        ConstitutionalCommitteeDelegate1,
        ConstitutionalCommitteeDelegate2,
        ConstitutionalCommitteeDelegate3,
    ] = Field(..., title='ConstitutionalCommitteeDelegate')


class Mandate(BaseModel):
    class Config:
        extra = Extra.forbid

    epoch: Epoch


class CostModel(BaseModel):
    __root__: List[Int64] = Field(..., title='CostModel')


class EraParameters(BaseModel):
    class Config:
        extra = Extra.forbid

    epochLength: Epoch
    slotLength: SlotLength
    safeZone: Optional[SafeZone]


class EraSummary(BaseModel):
    class Config:
        extra = Extra.forbid

    start: Bound
    end: Optional[Bound] = None
    parameters: EraParameters


class ExecutionUnits(BaseModel):
    class Config:
        extra = Extra.forbid

    memory: UInt64
    cpu: UInt64


class UpdatableParameters1(BaseModel):
    class Config:
        extra = Extra.forbid

    stakePoolVotingThresholds: StakePoolVotingThresholds
    constitutionalCommitteeMinSize: UInt64
    constitutionalCommitteeMaxTermLength: UInt64
    governanceActionLifetime: Epoch
    governanceActionDeposit: ValueAdaOnly
    delegateRepresentativeVotingThresholds: DelegateRepresentativeVotingThresholds
    delegateRepresentativeDeposit: ValueAdaOnly
    delegateRepresentativeMaxIdleTime: Epoch


class StakePoolModel(BaseModel):
    class Config:
        extra = Extra.forbid

    id: StakePoolId
    vrfVerificationKeyHash: DigestBlake2b256
    owners: List[DigestBlake2b224]
    cost: ValueAdaOnly
    margin: Ratio
    pledge: ValueAdaOnly
    rewardAccount: RewardAccount
    metadata: Optional[Anchor] = None
    relays: List[Relay]


class GovernanceAction3(BaseModel):
    class Config:
        extra = Extra.forbid

    type: Type19
    source: Source
    target: Target
    value: ValueAdaOnly


class GovernanceProposalReference(BaseModel):
    class Config:
        extra = Extra.forbid

    transaction: Transaction2
    index: UInt32


class GovernanceVote(BaseModel):
    class Config:
        extra = Extra.forbid

    issuer: GovernanceVoter
    metadata: Optional[Anchor] = None
    vote: Vote
    proposal: Optional[GovernanceProposalReference] = None


class OperationalCertificate(BaseModel):
    class Config:
        extra = Extra.forbid

    count: UInt64
    sigma: Optional[Signature] = None
    kes: Kes


class Redeemer(BaseModel):
    class Config:
        extra = Extra.forbid

    redeemer: RedeemerData
    executionUnits: ExecutionUnits
    validator: RedeemerPointer


class RewardTransfer(BaseModel):
    __root__: Optional[Dict[str, ValueDelta]] = None


class ScriptNative5(BaseModel):
    class Config:
        extra = Extra.forbid

    clause: Clause4
    slot: Slot


class ScriptNative6(BaseModel):
    class Config:
        extra = Extra.forbid

    clause: Clause5
    slot: Slot


class ScriptPurpose1(BaseModel):
    class Config:
        extra = Extra.forbid

    purpose: Purpose1
    outputReference: TransactionOutputReference


class Protocol1(BaseModel):
    class Config:
        extra = Extra.forbid

    version: ProtocolVersion


class Issuer1(BaseModel):
    class Config:
        extra = Extra.forbid

    verificationKey: VerificationKey
    vrfVerificationKey: VerificationKey
    operationalCertificate: OperationalCertificate
    leaderValue: CertifiedVrf


class Proposal(BaseModel):
    class Config:
        extra = Extra.forbid

    version: ProtocolVersion
    software: SoftwareVersion
    parameters: BootstrapProtocolParameters
    metadata: Dict[str, str]


class BootstrapProtocolUpdate(BaseModel):
    class Config:
        extra = Extra.forbid

    proposal: Optional[Proposal] = None
    votes: List[BootstrapVote]


class Certificate4(BaseModel):
    class Config:
        extra = Extra.forbid

    type: Type6
    stakePool: StakePoolModel


class Certificate7(BaseModel):
    class Config:
        extra = Extra.forbid

    type: Type9
    member: Member
    delegate: ConstitutionalCommitteeDelegate


class Certificate(BaseModel):
    __root__: Union[
        Certificate1,
        Certificate2,
        Certificate3,
        Certificate4,
        Certificate5,
        Certificate6,
        Certificate7,
        Certificate8,
        Certificate9,
        Certificate10,
        Certificate11,
    ] = Field(..., title='Certificate')


class Next3(BaseModel):
    class Config:
        extra = Extra.forbid

    change: Change3
    mandate: Mandate


class ConstitutionalCommitteeMember(BaseModel):
    class Config:
        extra = Extra.forbid

    id: DigestBlake2b224
    from_: CredentialOrigin = Field(..., alias='from')
    status: Status = Field(
        ...,
        description="A member status. 'active' indicates that this member vote will count during the ratification of the ongoing epoch. 'unrecognized' means that some hot credential currently points to a non-existing (or no longer existing) member.",
    )
    delegate: ConstitutionalCommitteeDelegate
    mandate: Optional[Mandate] = None
    next: Optional[Union[Next, Next1, Next2, Next3]] = None


class ConstitutionalCommitteeMemberSummary(BaseModel):
    class Config:
        extra = Extra.forbid

    id: DigestBlake2b224
    from_: CredentialOrigin = Field(..., alias='from')
    mandate: Optional[Mandate] = None


class CostModels(BaseModel):
    __root__: Optional[Dict[str, CostModel]] = None


class UpdatableParameters(BaseModel):
    class Config:
        extra = Extra.forbid

    minUtxoDepositCoefficient: UInt64
    collateralPercentage: UInt64
    plutusCostModels: CostModels
    maxCollateralInputs: UInt64
    maxExecutionUnitsPerBlock: ExecutionUnits
    maxExecutionUnitsPerTransaction: ExecutionUnits
    maxValueSize: NumberOfBytes
    scriptExecutionPrices: ScriptExecutionPrices


class GenesisAlonzo(BaseModel):
    class Config:
        extra = Extra.forbid

    era: Era6
    updatableParameters: UpdatableParameters


class ConstitutionalCommittee1(BaseModel):
    class Config:
        extra = Extra.forbid

    members: List[ConstitutionalCommitteeMemberSummary]
    quorum: Ratio


class GenesisConway(BaseModel):
    class Config:
        extra = Extra.forbid

    era: Era7
    constitution: Constitution
    constitutionalCommittee: ConstitutionalCommittee1
    updatableParameters: UpdatableParameters1


class GenesisStakePools(BaseModel):
    class Config:
        extra = Extra.forbid

    stakePools: Dict[str, StakePoolModel]
    delegators: Dict[str, StakePoolId]


class GovernanceAction2(BaseModel):
    class Config:
        extra = Extra.forbid

    type: Type18
    ancestor: Optional[GovernanceProposalReference] = None
    version: ProtocolVersion


class GovernanceAction4(BaseModel):
    class Config:
        extra = Extra.forbid

    type: Type20
    withdrawals: RewardTransfer
    guardrails: Union[Null, Guardrails]


class Members(BaseModel):
    class Config:
        extra = Extra.forbid

    added: List[ConstitutionalCommitteeMemberSummary]
    removed: List[RemovedItem]


class GovernanceAction5(BaseModel):
    class Config:
        extra = Extra.forbid

    type: Type21
    ancestor: Optional[GovernanceProposalReference] = None
    members: Members
    quorum: Ratio


class GovernanceAction6(BaseModel):
    class Config:
        extra = Extra.forbid

    type: Type22
    ancestor: Optional[GovernanceProposalReference] = None
    guardrails: Union[Null, Guardrails]
    metadata: Anchor


class GovernanceAction7(BaseModel):
    class Config:
        extra = Extra.forbid

    type: Type23
    ancestor: Optional[GovernanceProposalReference] = None


class ProposedProtocolParameters(BaseModel):
    class Config:
        extra = Extra.forbid

    minFeeCoefficient: Optional[UInt64] = None
    minFeeConstant: Optional[ValueAdaOnly] = None
    minFeeReferenceScripts: Optional[MinFeeReferenceScripts] = None
    minUtxoDepositCoefficient: Optional[UInt64] = None
    minUtxoDepositConstant: Optional[ValueAdaOnly] = None
    maxBlockBodySize: Optional[NumberOfBytes] = None
    maxBlockHeaderSize: Optional[NumberOfBytes] = None
    maxTransactionSize: Optional[NumberOfBytes] = None
    maxReferenceScriptsSize: Optional[NumberOfBytes] = None
    maxValueSize: Optional[NumberOfBytes] = None
    extraEntropy: Optional[Nonce] = None
    stakeCredentialDeposit: Optional[ValueAdaOnly] = None
    stakePoolDeposit: Optional[ValueAdaOnly] = None
    stakePoolRetirementEpochBound: Optional[UInt64] = None
    stakePoolPledgeInfluence: Optional[Ratio] = None
    minStakePoolCost: Optional[ValueAdaOnly] = None
    desiredNumberOfStakePools: Optional[UInt64] = None
    federatedBlockProductionRatio: Optional[Ratio] = None
    monetaryExpansion: Optional[Ratio] = None
    treasuryExpansion: Optional[Ratio] = None
    collateralPercentage: Optional[UInt64] = None
    maxCollateralInputs: Optional[UInt64] = None
    plutusCostModels: Optional[CostModels] = None
    scriptExecutionPrices: Optional[ScriptExecutionPrices] = None
    maxExecutionUnitsPerTransaction: Optional[ExecutionUnits] = None
    maxExecutionUnitsPerBlock: Optional[ExecutionUnits] = None
    stakePoolVotingThresholds: Optional[StakePoolVotingThresholds] = None
    constitutionalCommitteeMinSize: Optional[UInt16] = None
    constitutionalCommitteeMaxTermLength: Optional[UInt64] = None
    governanceActionLifetime: Optional[Epoch] = None
    governanceActionDeposit: Optional[ValueAdaOnly] = None
    delegateRepresentativeVotingThresholds: Optional[DelegateRepresentativeVotingThresholds] = None
    delegateRepresentativeDeposit: Optional[ValueAdaOnly] = None
    delegateRepresentativeMaxIdleTime: Optional[Epoch] = None
    version: Optional[ProtocolVersion] = None


class ProtocolParameters(BaseModel):
    class Config:
        extra = Extra.forbid

    minFeeCoefficient: UInt64
    minFeeConstant: ValueAdaOnly
    minFeeReferenceScripts: Optional[MinFeeReferenceScripts1] = None
    minUtxoDepositCoefficient: UInt64
    minUtxoDepositConstant: ValueAdaOnly
    maxBlockBodySize: NumberOfBytes
    maxBlockHeaderSize: NumberOfBytes
    maxTransactionSize: Optional[NumberOfBytes] = None
    maxValueSize: Optional[NumberOfBytes] = None
    extraEntropy: Optional[Nonce] = None
    stakeCredentialDeposit: ValueAdaOnly
    stakePoolDeposit: ValueAdaOnly
    stakePoolRetirementEpochBound: UInt64
    stakePoolPledgeInfluence: Ratio
    minStakePoolCost: ValueAdaOnly
    desiredNumberOfStakePools: UInt64
    federatedBlockProductionRatio: Optional[Ratio] = None
    monetaryExpansion: Ratio
    treasuryExpansion: Ratio
    collateralPercentage: Optional[UInt64] = None
    maxCollateralInputs: Optional[UInt64] = None
    plutusCostModels: Optional[CostModels] = None
    scriptExecutionPrices: Optional[ScriptExecutionPrices] = None
    maxExecutionUnitsPerTransaction: Optional[ExecutionUnits] = None
    maxExecutionUnitsPerBlock: Optional[ExecutionUnits] = None
    maxReferenceScriptsSize: Optional[NumberOfBytes] = None
    stakePoolVotingThresholds: Optional[StakePoolVotingThresholds] = None
    constitutionalCommitteeMinSize: Optional[UInt16] = None
    constitutionalCommitteeMaxTermLength: Optional[UInt64] = None
    governanceActionLifetime: Optional[Epoch] = None
    governanceActionDeposit: Optional[ValueAdaOnly] = None
    delegateRepresentativeVotingThresholds: Optional[DelegateRepresentativeVotingThresholds] = None
    delegateRepresentativeDeposit: Optional[ValueAdaOnly] = None
    delegateRepresentativeMaxIdleTime: Optional[Epoch] = None
    version: ProtocolVersion


class ScriptPurpose3(BaseModel):
    class Config:
        extra = Extra.forbid

    purpose: Purpose3
    certificate: Certificate


class Protocol(BaseModel):
    class Config:
        extra = Extra.forbid

    id: BootstrapProtocolId
    version: ProtocolVersion
    software: SoftwareVersion
    update: Optional[BootstrapProtocolUpdate] = None


class GenesisByron(BaseModel):
    class Config:
        extra = Extra.forbid

    era: Era4
    genesisKeyHashes: List[DigestBlake2b224]
    genesisDelegations: Dict[str, BootstrapOperationalCertificate]
    startTime: UtcTime
    initialFunds: Dict[str, ValueAdaOnly]
    initialVouchers: Dict[str, ValueAdaOnly]
    securityParameter: UInt64
    networkMagic: NetworkMagic
    updatableParameters: Optional[ProtocolParameters] = None


class GenesisShelley(BaseModel):
    class Config:
        extra = Extra.forbid

    era: Era5
    startTime: UtcTime
    networkMagic: NetworkMagic
    network: Network
    activeSlotsCoefficient: Ratio
    securityParameter: UInt64
    epochLength: Epoch
    slotsPerKesPeriod: UInt64
    maxKesEvolutions: UInt64
    slotLength: SlotLength
    updateQuorum: UInt64
    maxLovelaceSupply: UInt64
    initialParameters: ProtocolParameters
    initialDelegates: InitialDelegates
    initialFunds: Dict[str, ValueAdaOnly] = Field(..., title='InitialFunds')
    initialStakePools: GenesisStakePools


class GovernanceAction1(BaseModel):
    class Config:
        extra = Extra.forbid

    type: Type17
    ancestor: Optional[GovernanceProposalReference] = None
    parameters: ProposedProtocolParameters
    guardrails: Union[Null, Guardrails]


class GovernanceAction(BaseModel):
    __root__: Union[
        GovernanceAction1,
        GovernanceAction2,
        GovernanceAction3,
        GovernanceAction4,
        GovernanceAction5,
        GovernanceAction6,
        GovernanceAction7,
        GovernanceAction8,
    ]


class GovernanceProposal(BaseModel):
    class Config:
        extra = Extra.forbid

    deposit: Optional[ValueAdaOnly] = None
    returnAccount: Optional[RewardAccount] = None
    metadata: Optional[Anchor] = None
    action: GovernanceAction


class ScriptPurpose5(BaseModel):
    class Config:
        extra = Extra.forbid

    purpose: Purpose5
    proposal: GovernanceProposal


class ScriptPurpose(BaseModel):
    __root__: Union[
        ScriptPurpose1,
        ScriptPurpose2,
        ScriptPurpose3,
        ScriptPurpose4,
        ScriptPurpose5,
        ScriptPurpose6,
    ] = Field(..., title='ScriptPurpose')


class Block(BaseModel):
    __root__: Union[BlockEBB, BlockBFT, BlockPraos] = Field(..., title='Block')


class BlockBFT(BaseModel):
    class Config:
        extra = Extra.forbid

    type: Type1
    era: Era
    id: DigestBlake2b256
    ancestor: DigestBlake2b256
    height: BlockHeight
    slot: Slot
    size: NumberOfBytes
    transactions: Optional[List[Transaction]] = None
    operationalCertificates: Optional[List[BootstrapOperationalCertificate]] = None
    protocol: Protocol
    issuer: Issuer
    delegate: Delegate


class BlockPraos(BaseModel):
    class Config:
        extra = Extra.forbid

    type: Type2
    era: Era2
    id: DigestBlake2b256
    ancestor: Union[DigestBlake2b256, Ancestor]
    nonce: Optional[CertifiedVrf] = None
    height: BlockHeight
    size: NumberOfBytes
    slot: Slot
    transactions: Optional[List[Transaction]] = None
    protocol: Protocol1
    issuer: Issuer1


class Metadata(BaseModel):
    class Config:
        extra = Extra.forbid

    hash: DigestBlake2b256
    labels: MetadataLabels


class MetadataLabels1(BaseModel):
    class Config:
        extra = Extra.forbid

    cbor: Optional[constr(regex=r'^[0-9a-f]*$')] = None
    json_: Optional[Metadatum] = Field(None, alias='json')


class MetadataLabels(BaseModel):
    __root__: Optional[Dict[str, MetadataLabels1]] = Field(
        None,
        description="An associated metadatum, as a CBOR bytestring or a JSON object if possible. If not possible, default to 'cbor'. Use --include-metadata-cbor to ALWAYS include the cbor field.",
    )


class Metadatum4(BaseModel):
    class Config:
        extra = Extra.forbid

    list: List[Field1]


class Metadatum5(BaseModel):
    class Config:
        extra = Extra.forbid

    map: List[MetadatumMap]


class Metadatum(BaseModel):
    __root__: Union[
        Union[int, str, List[Field0], Dict[str, Field0]],
        Union[Metadatum1, Metadatum2, Metadatum3, Metadatum4, Metadatum5],
    ] = Field(..., title='Metadatum')


class MetadatumMap(BaseModel):
    class Config:
        extra = Extra.forbid

    k: Field1
    v: Field1


class Field14(BaseModel):
    class Config:
        extra = Extra.forbid

    list: List[Field1]


class Field15(BaseModel):
    class Config:
        extra = Extra.forbid

    map: List[MetadatumMap]


class Field1(BaseModel):
    __root__: Union[Field11, Field12, Field13, Field14, Field15] = Field(
        ..., title='Metadatum<DetailedSchema>'
    )


class Script1(BaseModel):
    class Config:
        extra = Extra.forbid

    language: Language1
    json_: ScriptNative = Field(..., alias='json')
    cbor: Optional[str] = None


class Script(BaseModel):
    __root__: Union[Script1, Script2] = Field(..., title='Script')


class ScriptNative2(BaseModel):
    class Config:
        extra = Extra.forbid

    clause: Clause1
    from_: List[ScriptNative] = Field(..., alias='from')


class ScriptNative3(BaseModel):
    class Config:
        extra = Extra.forbid

    clause: Clause2
    from_: List[ScriptNative] = Field(..., alias='from')


class ScriptNative4(BaseModel):
    class Config:
        extra = Extra.forbid

    clause: Clause3
    atLeast: int
    from_: List[ScriptNative] = Field(..., alias='from')


class ScriptNative(BaseModel):
    __root__: Union[
        ScriptNative1, ScriptNative2, ScriptNative3, ScriptNative4, ScriptNative5, ScriptNative6
    ] = Field(
        ...,
        description='A phase-1 monetary script. Timelocks constraints are only supported since Allegra.',
        examples=[
            {
                'clause': 'signature',
                'from': '3c07030e36bfff7cd2f004356ef320f3fe3c07030e7cd2f004356437',
            },
            {
                'clause': 'all',
                'from': [
                    {
                        'clause': 'signature',
                        'from': 'ec09e5293d384637cd2f004356ef320f3fe3c07030e36bfffe67e2e2',
                    },
                    {
                        'clause': 'signature',
                        'from': '3c07030e36bfff7cd2f004356ef320f3fe3c07030e7cd2f004356437',
                    },
                ],
            },
            {
                'clause': 'some',
                'atLeast': 2,
                'from': [
                    {
                        'clause': 'signature',
                        'from': 'ec09e5293d384637cd2f004356ef320f3fe3c07030e36bfffe67e2e2',
                    },
                    {
                        'clause': 'signature',
                        'from': '3c07030e36bfff7cd2f004356ef320f3fe3c07030e7cd2f004356437',
                    },
                    {'clause': 'after', 'slot': 42},
                ],
            },
        ],
        title='Script<Native>',
    )


class Transaction(BaseModel):
    class Config:
        extra = Extra.forbid

    id: DigestBlake2b256
    spends: InputSource
    inputs: List[TransactionOutputReference]
    references: Optional[List[TransactionOutputReference]] = None
    collaterals: Optional[List[TransactionOutputReference]] = None
    totalCollateral: Optional[ValueAdaOnly] = None
    collateralReturn: Optional[TransactionOutput] = None
    outputs: List[TransactionOutput]
    certificates: Optional[List[Certificate]] = None
    withdrawals: Optional[Withdrawals] = None
    fee: Optional[ValueAdaOnly] = None
    validityInterval: Optional[ValidityInterval] = None
    mint: Optional[Assets] = None
    network: Optional[Network] = None
    scriptIntegrityHash: Optional[DigestBlake2b256] = None
    requiredExtraSignatories: Optional[List[DigestBlake2b224]] = None
    requiredExtraScripts: Optional[List[DigestBlake2b224]] = None
    proposals: Optional[List[GovernanceProposal]] = None
    votes: Optional[List[GovernanceVote]] = None
    metadata: Optional[Metadata] = None
    signatories: List[Signatory]
    scripts: Optional[Dict[str, Script]] = None
    datums: Optional[Dict[str, Datum]] = None
    redeemers: Optional[List[Redeemer]] = None
    treasury: Optional[Treasury] = None
    cbor: Optional[str] = Field(
        None,
        description="The raw serialized (CBOR) transaction, as found on-chain. Use --include-transaction-cbor to ALWAYS include the 'cbor' field. Omitted otherwise.",
    )


class TransactionOutput(BaseModel):
    class Config:
        extra = Extra.forbid

    address: Address
    value: Value
    datumHash: Optional[DigestBlake2b256] = None
    datum: Optional[Datum] = None
    script: Optional[Script] = None


class UtxoItem(BaseModel):
    class Config:
        extra = Extra.forbid

    transaction: Transaction2
    index: UInt32
    address: Address
    value: Value
    datumHash: Optional[DigestBlake2b256] = None
    datum: Optional[Datum] = None
    script: Optional[Script] = None


class Utxo(BaseModel):
    __root__: List[UtxoItem] = Field(..., title='Utxo')


Voter.update_forward_refs()  # Edited
Field0.update_forward_refs()
Block.update_forward_refs()
BlockBFT.update_forward_refs()
BlockPraos.update_forward_refs()
Metadata.update_forward_refs()
MetadataLabels1.update_forward_refs()
Metadatum4.update_forward_refs()
Metadatum5.update_forward_refs()
MetadatumMap.update_forward_refs()
Field14.update_forward_refs()
Script1.update_forward_refs()
ScriptNative2.update_forward_refs()
ScriptNative3.update_forward_refs()
ScriptNative4.update_forward_refs()
Transaction.update_forward_refs()
