# generated by datamodel-codegen:
#   filename:  ogmios.json
#   timestamp: 2024-08-24T16:37:43+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, confloat, conint, constr

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


class Jsonrpc(Enum):
    field_2_0 = '2.0'


class Method(Enum):
    findIntersection = 'findIntersection'


class Code(Enum):
    integer_1000 = 1000


class Code1(Enum):
    integer_1001 = 1001


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

    code: Code1
    message: str


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

    jsonrpc: Jsonrpc
    method: Method
    error: Error1 = Field(
        ...,
        description="An internal error indicating that requests were interleaved in an unexpected way. Shouldn't ever happen.",
    )
    id: Optional[Any] = Field(
        None, description="Any value that was set by a client request in the 'id' field."
    )


class Method4(Enum):
    nextBlock = 'nextBlock'


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

    jsonrpc: Jsonrpc
    method: Method4
    id: Optional[Any] = Field(
        None, description='An arbitrary JSON value that will be mirrored back in the response.'
    )


class Direction(Enum):
    forward = 'forward'


class Direction1(Enum):
    backward = 'backward'


class Method6(Enum):
    submitTransaction = 'submitTransaction'


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

    cbor: constr(regex=r'^[0-9a-f]+$') = Field(
        ..., description='CBOR-serialized signed transaction (base16)'
    )


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

    transaction: Transaction


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

    jsonrpc: Jsonrpc
    method: Method6
    params: Params1
    id: Optional[Any] = Field(
        None, description='An arbitrary JSON value that will be mirrored back in the response.'
    )


class Method10(Enum):
    evaluateTransaction = 'evaluateTransaction'


class Method14(Enum):
    acquireLedgerState = 'acquireLedgerState'


class Code2(Enum):
    integer_2000 = 2000


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

    code: Code2
    message: str
    data: str = Field(..., description='A reason for the failure.')


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

    jsonrpc: Jsonrpc
    method: Method14
    error: Error2 = Field(
        ..., description='Unable to acquire the ledger state at the request point.'
    )
    id: Optional[Any] = Field(
        None, description="Any value that was set by a client request in the 'id' field."
    )


class Acquired(Enum):
    ledgerState = 'ledgerState'


class Method17(Enum):
    releaseLedgerState = 'releaseLedgerState'


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

    jsonrpc: Jsonrpc
    method: Method17
    id: Optional[Any] = Field(
        None, description='An arbitrary JSON value that will be mirrored back in the response.'
    )


class Released(Enum):
    ledgerState = 'ledgerState'


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

    released: Released


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

    jsonrpc: Jsonrpc
    method: Method17
    result: Result5
    id: Optional[Any] = Field(
        None, description="Any value that was set by a client request in the 'id' field."
    )


class Method19(Enum):
    queryLedgerState_constitution = 'queryLedgerState/constitution'
    queryLedgerState_constitutionalCommittee = 'queryLedgerState/constitutionalCommittee'
    queryLedgerState_epoch = 'queryLedgerState/epoch'
    queryLedgerState_eraStart = 'queryLedgerState/eraStart'
    queryLedgerState_eraSummaries = 'queryLedgerState/eraSummaries'
    queryLedgerState_liveStakeDistribution = 'queryLedgerState/liveStakeDistribution'
    queryLedgerState_projectedRewards = 'queryLedgerState/projectedRewards'
    queryLedgerState_protocolParameters = 'queryLedgerState/protocolParameters'
    queryLedgerState_proposedProtocolParameters = 'queryLedgerState/proposedProtocolParameters'
    queryLedgerState_rewardAccountSummaries = 'queryLedgerState/rewardAccountSummaries'
    queryLedgerState_rewardsProvenance = 'queryLedgerState/rewardsProvenance'
    queryLedgerState_stakePools = 'queryLedgerState/stakePools'
    queryLedgerState_utxo = 'queryLedgerState/utxo'
    queryLedgerState_tip = 'queryLedgerState/tip'
    queryLedgerState_treasuryAndReserves = 'queryLedgerState/treasuryAndReserves'


class Code3(Enum):
    integer_2001 = 2001


class Code4(Enum):
    integer_2002 = 2002


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

    code: Code4
    message: str


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

    jsonrpc: Jsonrpc
    method: Method19
    error: Error4 = Field(
        ..., description='Some query is not available for the requested ledger era.'
    )
    id: Optional[Any] = Field(
        None, description="Any value that was set by a client request in the 'id' field."
    )


class Code5(Enum):
    integer_2003 = 2003


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

    code: Code5
    message: str
    data: str = Field(..., description='A reason for the failure.')


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

    jsonrpc: Jsonrpc
    method: Method19
    error: Error5 = Field(
        ..., description='Previously acquired ledger state is no longer available.'
    )
    id: Optional[Any] = Field(
        None, description="Any value that was set by a client request in the 'id' field."
    )


class Method22(Enum):
    queryLedgerState_constitution = 'queryLedgerState/constitution'


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

    jsonrpc: Jsonrpc
    method: Method22
    id: Optional[Any] = Field(
        None, description='An arbitrary JSON value that will be mirrored back in the response.'
    )


class Method24(Enum):
    queryLedgerState_constitutionalCommittee = 'queryLedgerState/constitutionalCommittee'


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

    jsonrpc: Jsonrpc
    method: Method24
    id: Optional[Any] = Field(
        None, description='An arbitrary JSON value that will be mirrored back in the response.'
    )


class Method26(Enum):
    queryLedgerState_epoch = 'queryLedgerState/epoch'


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

    jsonrpc: Jsonrpc
    method: Method26
    id: Optional[Any] = Field(
        None, description='An arbitrary JSON value that will be mirrored back in the response.'
    )


class Method28(Enum):
    queryLedgerState_eraStart = 'queryLedgerState/eraStart'


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

    jsonrpc: Jsonrpc
    method: Method28
    id: Optional[Any] = Field(
        None, description='An arbitrary JSON value that will be mirrored back in the response.'
    )


class Method30(Enum):
    queryLedgerState_eraSummaries = 'queryLedgerState/eraSummaries'


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

    jsonrpc: Jsonrpc
    method: Method30
    id: Optional[Any] = Field(
        None, description='An arbitrary JSON value that will be mirrored back in the response.'
    )


class Method32(Enum):
    queryLedgerState_liveStakeDistribution = 'queryLedgerState/liveStakeDistribution'


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

    jsonrpc: Jsonrpc
    method: Method32
    id: Optional[Any] = Field(
        None, description='An arbitrary JSON value that will be mirrored back in the response.'
    )


class Method34(Enum):
    queryLedgerState_projectedRewards = 'queryLedgerState/projectedRewards'


class Method36(Enum):
    queryLedgerState_proposedProtocolParameters = 'queryLedgerState/proposedProtocolParameters'


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

    jsonrpc: Jsonrpc
    method: Method36
    id: Optional[Any] = Field(
        None, description='An arbitrary JSON value that will be mirrored back in the response.'
    )


class Method38(Enum):
    queryLedgerState_protocolParameters = 'queryLedgerState/protocolParameters'


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

    jsonrpc: Jsonrpc
    method: Method38
    id: Optional[Any] = Field(
        None, description='An arbitrary JSON value that will be mirrored back in the response.'
    )


class Method40(Enum):
    queryLedgerState_rewardAccountSummaries = 'queryLedgerState/rewardAccountSummaries'


class Method42(Enum):
    queryLedgerState_rewardsProvenance = 'queryLedgerState/rewardsProvenance'


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

    jsonrpc: Jsonrpc
    method: Method42
    id: Optional[Any] = Field(
        None, description='An arbitrary JSON value that will be mirrored back in the response.'
    )


class Method44(Enum):
    queryLedgerState_stakePools = 'queryLedgerState/stakePools'


class Method46(Enum):
    queryLedgerState_tip = 'queryLedgerState/tip'


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

    jsonrpc: Jsonrpc
    method: Method46
    id: Optional[Any] = Field(
        None, description='An arbitrary JSON value that will be mirrored back in the response.'
    )


class Method48(Enum):
    queryLedgerState_treasuryAndReserves = 'queryLedgerState/treasuryAndReserves'


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

    jsonrpc: Jsonrpc
    method: Method48
    id: Optional[Any] = Field(
        None, description='An arbitrary JSON value that will be mirrored back in the response.'
    )


class Method50(Enum):
    queryLedgerState_utxo = 'queryLedgerState/utxo'


class Method52(Enum):
    queryNetwork_blockHeight = 'queryNetwork/blockHeight'


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

    jsonrpc: Jsonrpc
    method: Method52
    id: Optional[Any] = Field(
        None, description='An arbitrary JSON value that will be mirrored back in the response.'
    )


class Method54(Enum):
    queryNetwork_genesisConfiguration = 'queryNetwork/genesisConfiguration'


class Code6(Enum):
    integer_2004 = 2004


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

    code: Code6
    message: str
    data: str = Field(..., description='A reason for the failure.')


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

    jsonrpc: Jsonrpc
    method: Method54
    error: Optional[Error6] = Field(
        None,
        description='Something went wrong (e.g. misconfiguration) in reading genesis file for the latest era.',
    )
    id: Optional[Any] = Field(
        None, description="Any value that was set by a client request in the 'id' field."
    )


class Method57(Enum):
    queryNetwork_startTime = 'queryNetwork/startTime'


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

    jsonrpc: Jsonrpc
    method: Method57
    id: Optional[Any] = Field(
        None, description='An arbitrary JSON value that will be mirrored back in the response.'
    )


class Method59(Enum):
    queryNetwork_tip = 'queryNetwork/tip'


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

    jsonrpc: Jsonrpc
    method: Method59
    id: Optional[Any] = Field(
        None, description='An arbitrary JSON value that will be mirrored back in the response.'
    )


class Method61(Enum):
    acquireMempool = 'acquireMempool'


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

    jsonrpc: Jsonrpc
    method: Method61
    id: Optional[Any] = Field(
        None, description='An arbitrary JSON value that will be mirrored back in the response.'
    )


class Acquired1(Enum):
    mempool = 'mempool'


class Method63(Enum):
    nextTransaction = 'nextTransaction'


class Fields(Enum):
    all = 'all'


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

    fields: Optional[Fields] = None


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

    jsonrpc: Jsonrpc
    method: Method63
    params: Optional[Params10] = None
    id: Optional[Any] = Field(
        None, description='An arbitrary JSON value that will be mirrored back in the response.'
    )


class Method64(Enum):
    hasTransaction = 'hasTransaction'
    nextTransaction = 'nextTransaction'
    sizeOfMempool = 'sizeOfMempool'
    releaseMempool = 'releaseMempool'


class Code7(Enum):
    integer_4000 = 4000


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

    code: Code7
    message: str


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

    jsonrpc: Jsonrpc
    method: Method64
    error: Error7 = Field(
        ..., description='Must acquire a mempool snapshot prior to performing any query.'
    )
    id: Optional[Any] = Field(
        None, description="Any value that was set by a client request in the 'id' field."
    )


class Method65(Enum):
    nextTransaction = 'nextTransaction'


class Method66(Enum):
    hasTransaction = 'hasTransaction'


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

    jsonrpc: Jsonrpc
    method: Method66
    result: bool
    id: Optional[Any] = Field(
        None, description="Any value that was set by a client request in the 'id' field."
    )


class Method68(Enum):
    sizeOfMempool = 'sizeOfMempool'


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

    jsonrpc: Jsonrpc
    method: Method68
    id: Optional[Any] = Field(
        None, description='An arbitrary JSON value that will be mirrored back in the response.'
    )


class Method70(Enum):
    releaseMempool = 'releaseMempool'


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

    jsonrpc: Jsonrpc
    method: Method70
    id: Optional[Any] = Field(
        None, description='An arbitrary JSON value that will be mirrored back in the response.'
    )


class Released1(Enum):
    mempool = 'mempool'


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

    released: Released1


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

    jsonrpc: Jsonrpc
    method: Method70
    result: Result10
    id: Optional[Any] = Field(
        None, description="Any value that was set by a client request in the 'id' field."
    )


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

    code: conint(ge=-32700, le=-32000) = Field(
        ..., description='An error code telling about the nature of the error.'
    )
    message: Optional[str] = Field(
        None, description='A descriptive error message giving hints about the error.'
    )
    data: Optional[Any] = Field(
        None,
        description='Some optional data / context about the error. The exact type of this (optional) field depends on the error.',
    )


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

    jsonrpc: Jsonrpc
    error: Error8
    id: Optional[Any] = Field(
        None, description="Any value that was set by a client request in the 'id' field."
    )


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


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'
    conway = 'conway'  # Edited


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=128) = Field(
        ..., description='An Ed25519 verification key.', title='VerificationKey'
    )  # Edited


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: 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: Optional[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 ScriptNative5(BaseModel):
    class Config:
        extra = Extra.forbid

    clause: Clause4
    slot: Slot


class Clause5(Enum):
    after = 'after'


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

    clause: Clause5
    slot: 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 Transaction5(BaseModel):
    class Config:
        extra = Extra.forbid

    id: TransactionId


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

    transaction: Transaction5
    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 AnyStakeCredential(BaseModel):
    __root__: Union[
        constr(min_length=56, max_length=56),
        constr(regex=r'^(stake_vkh|script)1[0-9a-z]*$'),
        StakeAddress,
    ] = Field(..., title='AnyStakeCredential')


class Code8(Enum):
    integer__32602 = -32602


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

    shelley: str
    allegra: str
    mary: str
    alonzo: str
    babbage: str
    conway: str


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

    code: Code8
    message: str
    data: Data1


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

    queryEra: Era3
    ledgerEra: Era3


class Code9(Enum):
    integer_3000 = 3000


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

    incompatibleEra: Era3


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

    code: Code9
    message: str
    data: Data2 = Field(..., description='The era in which the transaction has been identified.')


class Code10(Enum):
    integer_3001 = 3001


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

    unsupportedEra: Era3


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

    code: Code10
    message: str
    data: Data3 = Field(..., description='The era in which the transaction has been identified.')


class Code11(Enum):
    integer_3002 = 3002


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

    overlappingOutputReferences: List[TransactionOutputReference]


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

    code: Code11
    message: str
    data: Data4


class Code12(Enum):
    integer_3003 = 3003


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

    minimumRequiredEra: Era3
    currentNodeEra: Era3


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

    code: Code12
    message: str
    data: Data5


class Code13(Enum):
    integer_3004 = 3004


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

    reason: str


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

    code: Code13
    message: str
    data: Data6


class Code14(Enum):
    integer_3010 = 3010


class Code15(Enum):
    integer_3011 = 3011


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

    missingScripts: List[RedeemerPointer]


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

    code: Code15
    message: str
    data: Data7


class Code16(Enum):
    integer_3012 = 3012


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

    validationError: str
    traces: List[str]


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

    code: Code16
    message: str
    data: Data8


class Code17(Enum):
    integer_3013 = 3013


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

    unsuitableOutputReference: TransactionOutputReference


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

    code: Code17
    message: str
    data: Data9


class Code18(Enum):
    integer_3110 = 3110


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

    extraneousRedeemers: List[RedeemerPointer]


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

    code: Code18
    message: str
    data: Data10


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

    stake: Ratio
    vrf: DigestBlake2b256


class LiveStakeDistribution(BaseModel):
    __root__: Optional[Dict[str, LiveStakeDistribution1]] = None


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

    count: UInt32


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

    maxCapacity: NumberOfBytes
    currentSize: NumberOfBytes
    transactions: Transactions


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


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

    id: StakePoolId


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

    delegate: Delegate2
    rewards: ValueAdaOnly
    deposit: ValueAdaOnly


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

    cost: ValueAdaOnly
    margin: Ratio
    pledge: ValueAdaOnly


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

    id: StakePoolId
    stake: ValueAdaOnly
    ownerStake: ValueAdaOnly
    approximatePerformance: confloat(ge=0.0) = Field(
        ...,
        description='Number of blocks produced divided by expected number of blocks (based on stake and epoch progress). Can be larger than 1.0 for pools that get lucky.',
    )
    parameters: Parameters = Field(
        ..., description='Some of the pool parameters relevant for the reward calculation.'
    )


class Code19(Enum):
    integer_3005 = 3005


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

    code: Code19
    message: str
    data: EraMismatch


class Code20(Enum):
    integer_3100 = 3100


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

    invalidSignatories: List[VerificationKey]


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

    code: Code20
    message: str
    data: Data11


class Code21(Enum):
    integer_3101 = 3101


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

    missingSignatories: List[DigestBlake2b224]


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

    code: Code21
    message: str
    data: Data12


class Code22(Enum):
    integer_3102 = 3102


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

    missingScripts: List[DigestBlake2b224]


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

    code: Code22
    message: str
    data: Data13


class Code23(Enum):
    integer_3103 = 3103


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

    failingNativeScripts: List[DigestBlake2b224]


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

    code: Code23
    message: str
    data: Data14


class Code24(Enum):
    integer_3104 = 3104


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

    extraneousScripts: List[DigestBlake2b224]


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

    code: Code24
    message: str
    data: Data15


class Code25(Enum):
    integer_3105 = 3105


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

    hash: DigestBlake2b256


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

    metadata: Metadata1


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

    code: Code25
    message: str
    data: Data16


class Code26(Enum):
    integer_3106 = 3106


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

    metadata: Metadata1


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

    code: Code26
    message: str
    data: Data17


class Code27(Enum):
    integer_3107 = 3107


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

    hash: DigestBlake2b256


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

    hash: DigestBlake2b256


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

    provided: Provided
    computed: Computed


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

    code: Code27
    message: str
    data: Data18


class Code28(Enum):
    integer_3108 = 3108


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

    code: Code28
    message: str


class Code29(Enum):
    integer_3109 = 3109


class Code30(Enum):
    integer_3112 = 3112


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

    extraneousDatums: List[DigestBlake2b256]


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

    code: Code30
    message: str
    data: Data20


class Code31(Enum):
    integer_3113 = 3113


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

    providedScriptIntegrity: Union[DigestBlake2b256, Null]
    computedScriptIntegrity: Union[DigestBlake2b256, Null]


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

    code: Code31
    message: str
    data: Data21


class Code32(Enum):
    integer_3114 = 3114


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

    orphanScriptInputs: List[TransactionOutputReference]


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

    code: Code32
    message: str
    data: Data22


class Code33(Enum):
    integer_3116 = 3116


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

    malformedScripts: List[DigestBlake2b224]


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

    code: Code33
    message: str
    data: Data23


class Code34(Enum):
    integer_3118 = 3118


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

    validityInterval: ValidityInterval
    currentSlot: Slot


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

    code: Code34
    message: str
    data: Data24


class Code35(Enum):
    integer_3119 = 3119


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

    measuredTransactionSize: NumberOfBytes
    maximumTransactionSize: NumberOfBytes


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

    code: Code35
    message: str
    data: Data25


class Code36(Enum):
    integer_3120 = 3120


class Code37(Enum):
    integer_3121 = 3121


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

    code: Code37
    message: str


class Code38(Enum):
    integer_3122 = 3122


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

    minimumRequiredFee: ValueAdaOnly
    providedFee: ValueAdaOnly


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

    code: Code38
    message: str
    data: Data27


class Code39(Enum):
    integer_3123 = 3123


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

    valueConsumed: Value
    valueProduced: Value


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

    code: Code39
    message: str
    data: Data28


class Code40(Enum):
    integer_3124 = 3124


class DiscriminatedType(Enum):
    address = 'address'


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

    expectedNetwork: Network
    discriminatedType: DiscriminatedType
    invalidEntities: List[Address]


class DiscriminatedType1(Enum):
    rewardAccount = 'rewardAccount'


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

    expectedNetwork: Network
    discriminatedType: DiscriminatedType1
    invalidEntities: List[RewardAccount]


class DiscriminatedType2(Enum):
    stakePoolCertificate = 'stakePoolCertificate'


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

    expectedNetwork: Network
    discriminatedType: DiscriminatedType2
    invalidEntities: List[StakePoolId]


class DiscriminatedType3(Enum):
    transaction = 'transaction'


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

    expectedNetwork: Network
    discriminatedType: DiscriminatedType3


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

    code: Code40
    message: str
    data: Union[Data29, Data30, Data31, Data32]


class Code41(Enum):
    integer_3125 = 3125


class Code42(Enum):
    integer_3126 = 3126


class Code43(Enum):
    integer_3127 = 3127


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

    code: Code43
    message: str


class Code44(Enum):
    integer_3128 = 3128


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

    providedCollateral: ValueDelta
    minimumRequiredCollateral: ValueAdaOnly


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

    code: Code44
    message: str
    data: Data35


class Code45(Enum):
    integer_3129 = 3129


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

    unsuitableCollateralInputs: List[TransactionOutputReference]


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

    code: Code45
    message: str
    data: Data36


class Code46(Enum):
    integer_3130 = 3130


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

    unforeseeableSlot: Slot


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

    code: Code46
    message: str
    data: Data37


class Code47(Enum):
    integer_3131 = 3131


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

    maximumCollateralInputs: UInt32
    countedCollateralInputs: UInt32


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

    code: Code47
    message: str
    data: Data38


class Code48(Enum):
    integer_3132 = 3132


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

    code: Code48
    message: str


class Code49(Enum):
    integer_3133 = 3133


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

    unsuitableCollateralValue: Value


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

    code: Code49
    message: str
    data: Data39


class Code50(Enum):
    integer_3134 = 3134


class Code51(Enum):
    integer_3135 = 3135


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

    declaredTotalCollateral: ValueAdaOnly
    computedTotalCollateral: ValueDelta


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

    code: Code51
    message: str
    data: Data41


class Code52(Enum):
    integer_3136 = 3136


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

    declaredSpending: InputSource
    mismatchReason: str


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

    code: Code52
    message: str
    data: Data42


class Code53(Enum):
    integer_3137 = 3137


class Code54(Enum):
    integer_3138 = 3138


class Code55(Enum):
    integer_3139 = 3139


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

    code: Code55
    message: str


class Code56(Enum):
    integer_3140 = 3140


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

    unknownStakePool: StakePoolId


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

    code: Code56
    message: str
    data: Data45


class Code57(Enum):
    integer_3141 = 3141


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

    incompleteWithdrawals: Withdrawals


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

    code: Code57
    message: str
    data: Data46


class Code58(Enum):
    integer_3142 = 3142


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

    currentEpoch: Epoch
    declaredEpoch: Epoch
    firstInvalidEpoch: Epoch


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

    code: Code58
    message: str
    data: Data47


class Code59(Enum):
    integer_3143 = 3143


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

    minimumStakePoolCost: ValueAdaOnly
    declaredStakePoolCost: ValueAdaOnly


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

    code: Code59
    message: str
    data: Data48


class Code60(Enum):
    integer_3144 = 3144


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

    id: StakePoolId


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

    infringingStakePool: InfringingStakePool
    computedMetadataHashSize: NumberOfBytes


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

    code: Code60
    message: str
    data: Data49


class Code61(Enum):
    integer_3145 = 3145


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

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


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

    code: Code61
    message: str
    data: Data50


class Code62(Enum):
    integer_3146 = 3146


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

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


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

    code: Code62
    message: str
    data: Data51


class Code63(Enum):
    integer_3147 = 3147


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

    nonEmptyRewardAccountBalance: ValueAdaOnly


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

    code: Code63
    message: str
    data: Data52


class Code64(Enum):
    integer_3148 = 3148


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

    code: Code64
    message: str


class Code65(Enum):
    integer_3149 = 3149


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

    code: Code65
    message: str


class Code66(Enum):
    integer_3150 = 3150


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

    marginalizedCredentials: List[DigestBlake2b224]


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

    code: Code66
    message: str
    data: Data53


class Code67(Enum):
    integer_3151 = 3151


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

    providedDeposit: ValueAdaOnly
    expectedDeposit: Optional[ValueAdaOnly] = None


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

    code: Code67
    message: str
    data: Data54


class Code68(Enum):
    integer_3152 = 3152


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

    knownDelegateRepresentative: DelegateRepresentative


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

    code: Code68
    message: str
    data: Data55


class Code69(Enum):
    integer_3153 = 3153


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

    unknownDelegateRepresentative: DelegateRepresentative


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

    code: Code69
    message: str
    data: Data56


class Code70(Enum):
    integer_3154 = 3154


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

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


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

    unknownConstitutionalCommitteeMember: UnknownConstitutionalCommitteeMember


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

    code: Code70
    message: str
    data: Data57


class Code71(Enum):
    integer_3155 = 3155


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

    providedDeposit: ValueAdaOnly
    expectedDeposit: ValueAdaOnly


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

    code: Code71
    message: str
    data: Data58


class Code72(Enum):
    integer_3156 = 3156


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

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


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

    conflictingMembers: List[ConflictingMember]


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

    code: Code72
    message: str
    data: Data59


class Code73(Enum):
    integer_3157 = 3157


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

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


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

    alreadyRetiredMembers: List[AlreadyRetiredMember]


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

    code: Code73
    message: str
    data: Data60


class Code74(Enum):
    integer_3158 = 3158


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

    providedWithdrawal: ValueAdaOnly
    computedWithdrawal: ValueAdaOnly


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

    code: Code74
    message: str
    data: Data61


class Code75(Enum):
    integer_3159 = 3159


class Type27(Enum):
    hardForkInitiation = 'hardForkInitiation'
    protocolParametersUpdate = 'protocolParametersUpdate'
    constitutionalCommittee = 'constitutionalCommittee'
    constitution = 'constitution'


class Code76(Enum):
    integer_3160 = 3160


class Code77(Enum):
    integer_3162 = 3162


class Code78(Enum):
    integer_3163 = 3163


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

    providedHash: Union[Null, DigestBlake2b224]
    expectedHash: Union[Null, DigestBlake2b224]


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

    code: Code78
    message: str
    data: Data65


class Code79(Enum):
    integer_3164 = 3164


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

    conflictingReferences: List[TransactionOutputReference]


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

    code: Code79
    message: str
    data: Data66


class Code80(Enum):
    integer_3165 = 3165


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

    code: Code80
    message: str


class Code81(Enum):
    integer_3166 = 3166


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

    measuredReferenceScriptsSize: NumberOfBytes
    maximumReferenceScriptsSize: NumberOfBytes


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

    code: Code81
    message: str
    data: Data67


class Code82(Enum):
    integer_3167 = 3167


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

    unknownVoters: List[GovernanceVoter]


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

    code: Code82
    message: str
    data: Data68


class Code83(Enum):
    integer_3998 = 3998


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

    code: Code83
    message: str


class Code84(Enum):
    integer_3111 = 3111


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

    missingDatums: List[DigestBlake2b256]


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

    code: Code84
    message: str
    data: Data69


class Code85(Enum):
    integer_3117 = 3117


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

    unknownOutputReferences: List[TransactionOutputReference]


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

    code: Code85
    message: str
    data: Data70


class Code86(Enum):
    integer_3115 = 3115


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

    missingCostModels: List[Language]


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

    code: Code86
    message: str
    data: Data71


class Code87(Enum):
    integer_3161 = 3161


class TipOrOrigin(BaseModel):
    __root__: Union[Tip, Origin]


class Method72(Enum):
    acquireLedgerState = 'acquireLedgerState'


class Code88(Enum):
    integer_2000 = 2000


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

    code: Code88
    message: str
    data: str = Field(..., description='A reason for the failure.')


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

    jsonrpc: Jsonrpc
    method: Method72
    error: Error9 = Field(
        ..., description='Unable to acquire the ledger state at the request point.'
    )
    id: Optional[Any] = Field(
        None, description="Any value that was set by a client request in the 'id' field."
    )


class Method73(Enum):
    queryLedgerState_constitution = 'queryLedgerState/constitution'
    queryLedgerState_constitutionalCommittee = 'queryLedgerState/constitutionalCommittee'
    queryLedgerState_epoch = 'queryLedgerState/epoch'
    queryLedgerState_eraStart = 'queryLedgerState/eraStart'
    queryLedgerState_eraSummaries = 'queryLedgerState/eraSummaries'
    queryLedgerState_liveStakeDistribution = 'queryLedgerState/liveStakeDistribution'
    queryLedgerState_projectedRewards = 'queryLedgerState/projectedRewards'
    queryLedgerState_protocolParameters = 'queryLedgerState/protocolParameters'
    queryLedgerState_proposedProtocolParameters = 'queryLedgerState/proposedProtocolParameters'
    queryLedgerState_rewardAccountSummaries = 'queryLedgerState/rewardAccountSummaries'
    queryLedgerState_rewardsProvenance = 'queryLedgerState/rewardsProvenance'
    queryLedgerState_stakePools = 'queryLedgerState/stakePools'
    queryLedgerState_utxo = 'queryLedgerState/utxo'
    queryLedgerState_tip = 'queryLedgerState/tip'
    queryLedgerState_treasuryAndReserves = 'queryLedgerState/treasuryAndReserves'


class Code89(Enum):
    integer_2001 = 2001


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

    code: Code89
    message: str
    data: EraMismatch


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

    jsonrpc: Jsonrpc
    method: Method73
    error: Error10 = Field(
        ...,
        description='An era mismatch between a client request and the era the ledger is in. This may occur when running queries on a syncing node and/or when the node is crossing an era.',
    )
    id: Optional[Any] = Field(
        None, description="Any value that was set by a client request in the 'id' field."
    )


class Code90(Enum):
    integer_2002 = 2002


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

    code: Code90
    message: str


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

    jsonrpc: Jsonrpc
    method: Method73
    error: Error11 = Field(
        ..., description='Some query is not available for the requested ledger era.'
    )
    id: Optional[Any] = Field(
        None, description="Any value that was set by a client request in the 'id' field."
    )


class Code91(Enum):
    integer_2003 = 2003


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

    code: Code91
    message: str
    data: str = Field(..., description='A reason for the failure.')


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

    jsonrpc: Jsonrpc
    method: Method73
    error: Error12 = Field(
        ..., description='Previously acquired ledger state is no longer available.'
    )
    id: Optional[Any] = Field(
        None, description="Any value that was set by a client request in the 'id' field."
    )


class Method76(Enum):
    queryNetwork_genesisConfiguration = 'queryNetwork/genesisConfiguration'


class Code92(Enum):
    integer_2004 = 2004


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

    code: Code92
    message: str
    data: str = Field(..., description='A reason for the failure.')


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

    jsonrpc: Jsonrpc
    method: Method76
    error: Optional[Error13] = Field(
        None,
        description='Something went wrong (e.g. misconfiguration) in reading genesis file for the latest era.',
    )
    id: Optional[Any] = Field(
        None, description="Any value that was set by a client request in the 'id' field."
    )


class Method77(Enum):
    hasTransaction = 'hasTransaction'
    nextTransaction = 'nextTransaction'
    sizeOfMempool = 'sizeOfMempool'
    releaseMempool = 'releaseMempool'


class Code93(Enum):
    integer_4000 = 4000


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

    code: Code93
    message: str


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

    jsonrpc: Jsonrpc
    method: Method77
    error: Error14 = Field(
        ..., description='Must acquire a mempool snapshot prior to performing any query.'
    )
    id: Optional[Any] = Field(
        None, description="Any value that was set by a client request in the 'id' field."
    )


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

    tip: TipOrOrigin


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

    code: Code
    message: str
    data: Data


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

    jsonrpc: Jsonrpc
    method: Method
    error: Error = Field(..., description='No intersection found with the requested points.')
    id: Optional[Any] = Field(
        None, description="Any value that was set by a client request in the 'id' field."
    )


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

    transaction: Transaction5


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

    jsonrpc: Jsonrpc
    method: Method6
    result: Result3
    id: Optional[Any] = Field(
        None, description="Any value that was set by a client request in the 'id' field."
    )


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

    jsonrpc: Jsonrpc
    method: Method6
    error: DeserialisationFailure
    id: Optional[Any] = Field(
        None, description="Any value that was set by a client request in the 'id' field."
    )


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

    jsonrpc: Jsonrpc
    method: Method10
    error: DeserialisationFailure
    id: Optional[Any] = Field(
        None, description="Any value that was set by a client request in the 'id' field."
    )


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

    code: Code3
    message: str
    data: EraMismatch


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

    jsonrpc: Jsonrpc
    method: Method19
    error: Error3 = Field(
        ...,
        description='An era mismatch between a client request and the era the ledger is in. This may occur when running queries on a syncing node and/or when the node is crossing an era.',
    )
    id: Optional[Any] = Field(
        None, description="Any value that was set by a client request in the 'id' field."
    )


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

    jsonrpc: Jsonrpc
    method: Method26
    result: Epoch
    id: Optional[Any] = Field(
        None, description="Any value that was set by a client request in the 'id' field."
    )


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

    jsonrpc: Jsonrpc
    method: Method32
    result: LiveStakeDistribution
    id: Optional[Any] = Field(
        None, description="Any value that was set by a client request in the 'id' field."
    )


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

    stake: Optional[List[ValueAdaOnly]] = None
    scripts: Optional[List[AnyStakeCredential]] = None
    keys: Optional[List[AnyStakeCredential]] = None


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

    jsonrpc: Jsonrpc
    method: Method34
    params: Params4
    id: Optional[Any] = Field(
        None, description='An arbitrary JSON value that will be mirrored back in the response.'
    )


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

    jsonrpc: Jsonrpc
    method: Method34
    result: ProjectedRewards
    id: Optional[Any] = Field(
        None, description="Any value that was set by a client request in the 'id' field."
    )


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

    scripts: Optional[List[AnyStakeCredential]] = None
    keys: Optional[List[AnyStakeCredential]] = None


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

    jsonrpc: Jsonrpc
    method: Method40
    params: Params5
    id: Optional[Any] = Field(
        None, description='An arbitrary JSON value that will be mirrored back in the response.'
    )


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

    jsonrpc: Jsonrpc
    method: Method40
    result: Dict[str, RewardAccountSummary] = Field(..., title='RewardAccountSummaries')
    id: Optional[Any] = Field(
        None, description="Any value that was set by a client request in the 'id' field."
    )


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

    id: StakePoolId


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

    stakePools: List[StakePool]


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

    jsonrpc: Jsonrpc
    method: Method44
    params: Optional[Params6] = None
    id: Optional[Any] = Field(
        None, description='An arbitrary JSON value that will be mirrored back in the response.'
    )


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

    treasury: ValueAdaOnly
    reserves: ValueAdaOnly


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

    jsonrpc: Jsonrpc
    method: Method48
    result: Result7
    id: Optional[Any] = Field(
        None, description="Any value that was set by a client request in the 'id' field."
    )


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

    outputReferences: List[TransactionOutputReference]


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

    addresses: List[Address]


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

    jsonrpc: Jsonrpc
    method: Method50
    params: Optional[Union[Params7, Params8, Dict[str, Any]]] = None
    id: Optional[Any] = Field(
        None, description='An arbitrary JSON value that will be mirrored back in the response.'
    )


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

    jsonrpc: Jsonrpc
    method: Method52
    result: Union[BlockHeight, Origin]
    id: Optional[Any] = Field(
        None, description="Any value that was set by a client request in the 'id' field."
    )


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

    era: EraWithGenesis


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

    jsonrpc: Jsonrpc
    method: Method54
    params: Params9
    id: Optional[Any] = Field(
        None, description='An arbitrary JSON value that will be mirrored back in the response.'
    )


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

    jsonrpc: Jsonrpc
    method: Method57
    result: UtcTime
    id: Optional[Any] = Field(
        None, description="Any value that was set by a client request in the 'id' field."
    )


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

    acquired: Acquired1
    slot: Slot


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

    jsonrpc: Jsonrpc
    method: Method61
    result: Result8
    id: Optional[Any] = Field(
        None, description="Any value that was set by a client request in the 'id' field."
    )


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

    id: TransactionId


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

    jsonrpc: Jsonrpc
    method: Method66
    params: Params11
    id: Optional[Any] = Field(
        None, description='An arbitrary JSON value that will be mirrored back in the response.'
    )


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

    jsonrpc: Jsonrpc
    method: Method68
    result: MempoolSizeAndCapacity
    id: Optional[Any] = Field(
        None, description="Any value that was set by a client request in the 'id' field."
    )


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

    slot: Slot
    id: DigestBlake2b256


class PointOrOrigin(BaseModel):
    __root__: Union[PointOrOrigin1, Origin]


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

    hash: DigestAny
    url: str  # Edited


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: Union[VerificationKey, ExtendedVerificationKey]  # Edited


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

    verificationKey: Union[VerificationKey, ExtendedVerificationKey]  # Edited


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 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 StakePool2(BaseModel):
    class Config:
        extra = Extra.forbid

    retirementEpoch: Epoch
    id: StakePoolId


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

    type: Type7
    stakePool: StakePool2


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: Transaction5
    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 ScriptPurpose1(BaseModel):
    class Config:
        extra = Extra.forbid

    purpose: Purpose1
    outputReference: TransactionOutputReference


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

    desiredNumberOfStakePools: conint(ge=0, le=18446744073709552999) = Field(
        ..., description='Desired number of stake pools.'
    )
    stakePoolPledgeInfluence: constr(regex=r'^-?[0-9]+/[0-9]+$') = Field(
        ...,
        description="Influence of the pool owner's pledge on rewards, as a ratio of two integers.",
        examples=['2/3', '7/8'],
    )
    totalRewardsInEpoch: ValueAdaOnly
    totalStakeInEpoch: ValueAdaOnly
    activeStakeInEpoch: ValueAdaOnly
    stakePools: Dict[str, StakePoolSummary]


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

    providedExecutionUnits: ExecutionUnits
    maximumExecutionUnits: ExecutionUnits


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

    code: Code50
    message: str
    data: Data40


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

    proposal: GovernanceProposalReference
    voter: GovernanceVoter


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

    unauthorizedVotes: List[UnauthorizedVote]


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

    code: Code53
    message: str
    data: Data43


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

    unknownProposals: List[GovernanceProposalReference]


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

    code: Code54
    message: str
    data: Data44


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

    metadata: Anchor
    type: Type27
    invalidPreviousProposal: Optional[GovernanceProposalReference] = None


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

    invalidOrMissingPreviousProposals: List[InvalidOrMissingPreviousProposal]


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

    code: Code75
    message: str
    data: Data62


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

    proposal: GovernanceProposalReference
    voter: GovernanceVoter


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

    invalidVotes: List[InvalidVote]


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

    code: Code76
    message: str
    data: Data63


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

    proposedVersion: ProtocolVersion
    currentVersion: ProtocolVersion


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

    code: Code77
    message: str
    data: Data64


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

    budgetUsed: ExecutionUnits


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

    code: Code87
    message: str
    data: Data72


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

    points: Optional[List[PointOrOrigin]] = None


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

    jsonrpc: Jsonrpc
    method: Method
    params: Params
    id: Optional[Any] = Field(
        None, description='An arbitrary JSON value that will be mirrored back in the response.'
    )


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

    intersection: PointOrOrigin
    tip: TipOrOrigin


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

    jsonrpc: Jsonrpc
    method: Method
    result: Result
    id: Optional[Any] = Field(
        None, description="Any value that was set by a client request in the 'id' field."
    )


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

    direction: Direction1
    tip: TipOrOrigin
    point: PointOrOrigin


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

    validator: RedeemerPointer
    budget: ExecutionUnits


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

    jsonrpc: Jsonrpc
    method: Method10
    result: List[ResultItem]
    id: Optional[Any] = Field(
        None, description="Any value that was set by a client request in the 'id' field."
    )


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

    point: PointOrOrigin


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

    jsonrpc: Jsonrpc
    method: Method14
    params: Params3
    id: Optional[Any] = Field(
        None, description='An arbitrary JSON value that will be mirrored back in the response.'
    )


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

    acquired: Acquired
    point: PointOrOrigin


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

    jsonrpc: Jsonrpc
    method: Method14
    result: Result4
    id: Optional[Any] = Field(
        None, description="Any value that was set by a client request in the 'id' field."
    )


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

    jsonrpc: Jsonrpc
    method: Method22
    result: Constitution
    id: Optional[Any] = Field(
        None, description="Any value that was set by a client request in the 'id' field."
    )


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

    jsonrpc: Jsonrpc
    method: Method28
    result: Bound
    id: Optional[Any] = Field(
        None, description="Any value that was set by a client request in the 'id' field."
    )


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

    jsonrpc: Jsonrpc
    method: Method30
    result: List[EraSummary]
    id: Optional[Any] = Field(
        None, description="Any value that was set by a client request in the 'id' field."
    )


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

    jsonrpc: Jsonrpc
    method: Method42
    result: RewardsProvenance
    id: Optional[Any] = Field(
        None, description="Any value that was set by a client request in the 'id' field."
    )


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

    jsonrpc: Jsonrpc
    method: Method44
    result: Dict[str, StakePoolModel]
    id: Optional[Any] = Field(
        None, description="Any value that was set by a client request in the 'id' field."
    )


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

    jsonrpc: Jsonrpc
    method: Method46
    result: PointOrOrigin
    id: Optional[Any] = Field(
        None, description="Any value that was set by a client request in the 'id' field."
    )


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

    jsonrpc: Jsonrpc
    method: Method59
    result: PointOrOrigin
    id: Optional[Any] = Field(
        None, description="Any value that was set by a client request in the 'id' field."
    )


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: Optional[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: Optional[ConstitutionalCommitteeDelegate]  # Edited
    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: Optional[List[ConstitutionalCommitteeMemberSummary]]  # Edited
    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 ScriptExecutionFailure(BaseModel):
    __root__: Union[
        ScriptExecutionFailure1,
        ScriptExecutionFailure2,
        ScriptExecutionFailure3,
        SubmitTransactionFailureExtraneousRedeemers,
        SubmitTransactionFailureMissingDatums,
        SubmitTransactionFailureUnknownOutputReference,
        SubmitTransactionFailureMissingCostModels,
        SubmitTransactionFailureExecutionBudgetOutOfBounds,
    ]


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

    members: List[ConstitutionalCommitteeMember]
    quorum: Optional[Ratio]


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

    jsonrpc: Jsonrpc
    method: Method24
    result: Optional[Result6]
    id: Optional[Any] = Field(
        None, description="Any value that was set by a client request in the 'id' field."
    )


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

    jsonrpc: Jsonrpc
    method: Method36
    result: List[ProposedProtocolParameters]
    id: Optional[Any] = Field(
        None, description="Any value that was set by a client request in the 'id' field."
    )


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

    jsonrpc: Jsonrpc
    method: Method38
    result: ProtocolParameters
    id: Optional[Any] = Field(
        None, description="Any value that was set by a client request in the 'id' field."
    )


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[BootstrapProtocolParameters] = None  # Edited


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 Datum1(BaseModel):
    class Config:
        extra = Extra.forbid

    validator: RedeemerPointer
    error: ScriptExecutionFailure


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

    code: Code14
    message: str
    data: List[Datum1]


class EvaluateTransactionFailure(BaseModel):
    __root__: Union[
        EvaluateTransactionFailure1,
        EvaluateTransactionFailure2,
        EvaluateTransactionFailure3,
        EvaluateTransactionFailure4,
        EvaluateTransactionFailure5,
        EvaluateTransactionFailure6,
    ]


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

    missingRedeemers: List[ScriptPurpose]


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

    code: Code29
    message: str
    data: Data19


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

    jsonrpc: Jsonrpc
    method: Method10
    error: EvaluateTransactionFailure
    id: Optional[Any] = Field(
        None, description="Any value that was set by a client request in the 'id' field."
    )


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

    jsonrpc: Jsonrpc
    method: Method54
    result: Union[
        QueryNetworkInvalidGenesis,
        Union[GenesisByron, GenesisShelley, GenesisAlonzo, GenesisConway],
    ]
    id: Optional[Any] = Field(
        None, description="Any value that was set by a client request in the 'id' field."
    )


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

    direction: Direction
    tip: Tip
    block: Block


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

    jsonrpc: Jsonrpc
    method: Method4
    result: Union[Result1, Result2]
    id: Optional[Any] = Field(
        None, description="Any value that was set by a client request in the 'id' field."
    )


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

    jsonrpc: Jsonrpc
    method: Method6
    error: SubmitTransactionFailure
    id: Optional[Any] = Field(
        None, description="Any value that was set by a client request in the 'id' field."
    )


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

    transaction: Transaction
    additionalUtxo: Optional[Utxo] = None


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

    jsonrpc: Jsonrpc
    method: Method10
    params: Params2
    id: Optional[Any] = Field(
        None, description='An arbitrary JSON value that will be mirrored back in the response.'
    )


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

    jsonrpc: Jsonrpc
    method: Method50
    result: Utxo
    id: Optional[Any] = Field(
        None, description="Any value that was set by a client request in the 'id' field."
    )


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

    transaction: Optional[Union[Transaction5, TransactionModel]]


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

    jsonrpc: Jsonrpc
    method: Method65
    result: Result9 = Field(
        ..., description="A transaction (or id) or an empty object if there's no more transactions."
    )
    id: Optional[Any] = Field(
        None, description="Any value that was set by a client request in the 'id' field."
    )


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

    FindIntersection: FindIntersection = Field(
        ...,
        description='Ask cardano-node to find an intersection between its local chain and the given points.',
        title='FindIntersection',
    )
    FindIntersectionResponse: Union[
        FindIntersectionResponse, FindIntersectionResponse1, FindIntersectionResponse2
    ]
    NextBlock: NextBlock = Field(
        ...,
        description="Request next block from the current cardano-node's cursor.",
        title='NextBlock',
    )
    NextBlockResponse: NextBlockResponse = Field(
        ..., description="Response to a 'nextBlock' request.", title='NextBlockResponse'
    )
    SubmitTransaction: SubmitTransaction = Field(
        ...,
        description='Submit a signed and serialized transaction to the network.',
        title='SubmitTransaction',
    )
    SubmitTransactionResponse: Union[
        SubmitTransactionResponse, SubmitTransactionResponse1, SubmitTransactionResponse2
    ]
    EvaluateTransaction: EvaluateTransaction = Field(
        ...,
        description="Evaluate execution units for which redeemers's budget hasn't yet been set.",
        title='EvaluateTransaction',
    )
    EvaluateTransactionResponse: Union[
        EvaluateTransactionResponse, EvaluateTransactionResponse1, EvaluateTransactionResponse2
    ]
    AcquireLedgerState: AcquireLedgerState = Field(
        ...,
        description='Acquire a point on chain from which to run ledger-state queries.',
        title='AcquireLedgerState',
    )
    AcquireLedgerStateFailure: Optional[AcquireLedgerStateFailure] = Field(
        None, title='AcquireLedgerStateFailure'
    )
    AcquireLedgerStateResponse: Union[AcquireLedgerStateResponse, AcquireLedgerStateFailureModel]
    ReleaseLedgerState: ReleaseLedgerState = Field(
        ..., description='Release a previously acquired ledger state.', title='ReleaseLedgerState'
    )
    ReleaseLedgerStateResponse: ReleaseLedgerStateResponse = Field(
        ...,
        description="Response to a 'releaseLedgerState' request.",
        title='ReleaseLedgerStateResponse',
    )
    QueryLedgerStateEraMismatch: Optional[QueryLedgerStateEraMismatchModel] = Field(
        None, title='QueryLedgerStateEraMismatch'
    )
    QueryLedgerStateUnavailableInCurrentEra: Optional[QueryLedgerStateUnavailableInCurrentEra] = (
        Field(None, title='QueryLedgerStateUnavailableInCurrentEra')
    )
    QueryLedgerStateAcquiredExpired: Optional[QueryLedgerStateAcquiredExpired] = Field(
        None, title='QueryLedgerStateAcquiredExpired'
    )
    QueryLedgerStateConstitution: QueryLedgerStateConstitution = Field(
        ...,
        description='Query the current constitution definition (only available from Conway onwards).',
        title='QueryLedgerStateConstitution',
    )
    QueryLedgerStateConstitutionResponse: Union[
        QueryLedgerStateConstitutionResponse,
        QueryLedgerStateEraMismatch,
        QueryLedgerStateUnavailableInCurrentEraModel,
        QueryLedgerStateAcquiredExpiredModel,
    ]
    QueryLedgerStateConstitutionalCommittee: QueryLedgerStateConstitutionalCommittee = Field(
        ...,
        description='Get the state of the constitutional committee (only available from Conway onwards).',
        title='QueryLedgerStateConstitutionalCommittee',
    )
    QueryLedgerStateConstitutionalCommitteeResponse: Union[
        QueryLedgerStateConstitutionalCommitteeResponse,
        QueryLedgerStateEraMismatch,
        QueryLedgerStateUnavailableInCurrentEraModel,
        QueryLedgerStateAcquiredExpiredModel,
    ]
    QueryLedgerStateEpoch: QueryLedgerStateEpoch = Field(
        ...,
        description='Query the current epoch number the ledger is at.',
        title='QueryLedgerStateEpoch',
    )
    QueryLedgerStateEpochResponse: Union[
        QueryLedgerStateEpochResponse,
        QueryLedgerStateEraMismatch,
        QueryLedgerStateUnavailableInCurrentEraModel,
        QueryLedgerStateAcquiredExpiredModel,
    ]
    QueryLedgerStateEraStart: QueryLedgerStateEraStart = Field(
        ...,
        description='Query the start of the current ledger era.',
        title='QueryLedgerStateEraStart',
    )
    QueryLedgerStateEraStartResponse: Union[
        QueryLedgerStateEraStartResponse,
        QueryLedgerStateEraMismatch,
        QueryLedgerStateUnavailableInCurrentEraModel,
        QueryLedgerStateAcquiredExpiredModel,
    ]
    QueryLedgerStateEraSummaries: QueryLedgerStateEraSummaries = Field(
        ...,
        description='Query a summary of the slotting parameters and boundaries for each known era. Useful for doing slot-arithmetic and time conversions.',
        title='QueryLedgerStateEraSummaries',
    )
    QueryLedgerStateEraSummariesResponse: Union[
        QueryLedgerStateEraSummariesResponse,
        QueryLedgerStateEraMismatch,
        QueryLedgerStateUnavailableInCurrentEraModel,
        QueryLedgerStateAcquiredExpiredModel,
    ]
    QueryLedgerStateLiveStakeDistribution: QueryLedgerStateLiveStakeDistribution = Field(
        ...,
        description='Query the current distribution of the stake across all known stake pools, relative to the TOTAL stake in the network.',
        title='QueryLedgerStateLiveStakeDistribution',
    )
    QueryLedgerStateLiveStakeDistributionResponse: Union[
        QueryLedgerStateLiveStakeDistributionResponse,
        QueryLedgerStateEraMismatch,
        QueryLedgerStateUnavailableInCurrentEraModel,
        QueryLedgerStateAcquiredExpiredModel,
    ]
    QueryLedgerStateProjectedRewards: QueryLedgerStateProjectedRewards = Field(
        ...,
        description='Query the projected rewards of an account in a context where the top stake pools are fully saturated. This projection gives, in principle, a ranking of stake pools that maximizes delegator rewards.',
        title='QueryLedgerStateProjectedRewards',
    )
    QueryLedgerStateProjectedRewardsResponse: Union[
        QueryLedgerStateProjectedRewardsResponse,
        QueryLedgerStateEraMismatch,
        QueryLedgerStateUnavailableInCurrentEraModel,
        QueryLedgerStateAcquiredExpiredModel,
    ]
    QueryLedgerStateProposedProtocolParameters: QueryLedgerStateProposedProtocolParameters = Field(
        ...,
        description='Query the last update proposal w.r.t. protocol parameters, if any.',
        title='QueryLedgerStateProposedProtocolParameters',
    )
    QueryLedgerStateProposedProtocolParametersResponse: Union[
        QueryLedgerStateProposedProtocolParametersResponse,
        QueryLedgerStateEraMismatch,
        QueryLedgerStateUnavailableInCurrentEraModel,
        QueryLedgerStateAcquiredExpiredModel,
    ]
    QueryLedgerStateProtocolParameters: QueryLedgerStateProtocolParameters = Field(
        ...,
        description='Query the current protocol parameters.',
        title='QueryLedgerStateProtocolParameters',
    )
    QueryLedgerStateProtocolParametersResponse: Union[
        QueryLedgerStateProtocolParametersResponse,
        QueryLedgerStateEraMismatch,
        QueryLedgerStateUnavailableInCurrentEraModel,
        QueryLedgerStateAcquiredExpiredModel,
    ]
    QueryLedgerStateRewardAccountSummaries: QueryLedgerStateRewardAccountSummaries = Field(
        ...,
        description='Query current delegation settings and rewards of some given reward accounts.',
        title='QueryLedgerStateRewardAccountSummaries',
    )
    QueryLedgerStateRewardAccountSummariesResponse: Union[
        QueryLedgerStateRewardAccountSummariesResponse,
        QueryLedgerStateEraMismatch,
        QueryLedgerStateUnavailableInCurrentEraModel,
        QueryLedgerStateAcquiredExpiredModel,
    ]
    QueryLedgerStateRewardsProvenance: QueryLedgerStateRewardsProvenance = Field(
        ...,
        description='Query details about rewards calculation for the ongoing epoch.',
        title='QueryLedgerStateRewardsProvenance',
    )
    QueryLedgerStateRewardsProvenanceResponse: Union[
        QueryLedgerStateRewardsProvenanceResponse,
        QueryLedgerStateEraMismatch,
        QueryLedgerStateUnavailableInCurrentEraModel,
        QueryLedgerStateAcquiredExpiredModel,
    ]
    QueryLedgerStateStakePools: QueryLedgerStateStakePools = Field(
        ...,
        description='Query the list of all stake pools currently registered and active, optionally filtered by ids.',
        title='QueryLedgerStateStakePools',
    )
    QueryLedgerStateStakePoolsResponse: Union[
        QueryLedgerStateStakePoolsResponse,
        QueryLedgerStateEraMismatch,
        QueryLedgerStateUnavailableInCurrentEraModel,
        QueryLedgerStateAcquiredExpiredModel,
    ]
    QueryLedgerStateTip: QueryLedgerStateTip = Field(
        ...,
        description='Query the current tip the ledger is at. Said differently, the slot number and header hash of the last block that has been processed by the ledger.',
        title='QueryLedgerStateTip',
    )
    QueryLedgerStateTipResponse: Union[
        QueryLedgerStateTipResponse,
        QueryLedgerStateEraMismatch,
        QueryLedgerStateUnavailableInCurrentEraModel,
        QueryLedgerStateAcquiredExpiredModel,
    ]
    QueryLedgerStateTreasuryAndReserves: QueryLedgerStateTreasuryAndReserves = Field(
        ...,
        description='Query the Ada value of the treasury and reserves accounts.',
        title='QueryLedgerStateTreasuryAndReserves',
    )
    QueryLedgerStateTreasuryAndReservesResponse: Union[
        QueryLedgerStateTreasuryAndReservesResponse,
        QueryLedgerStateEraMismatch,
        QueryLedgerStateUnavailableInCurrentEraModel,
        QueryLedgerStateAcquiredExpiredModel,
    ]
    QueryLedgerStateUtxo: QueryLedgerStateUtxo = Field(
        ...,
        description='Query the current Utxo set, restricted to some output references or addresses.',
        title='QueryLedgerStateUtxo',
    )
    QueryLedgerStateUtxoResponse: Union[
        QueryLedgerStateUtxoResponse,
        QueryLedgerStateEraMismatch,
        QueryLedgerStateUnavailableInCurrentEraModel,
        QueryLedgerStateAcquiredExpiredModel,
    ]
    QueryNetworkBlockHeight: QueryNetworkBlockHeight = Field(
        ...,
        description='Query the network’s highest block number.',
        title='QueryNetworkBlockHeight',
    )
    QueryNetworkBlockHeightResponse: QueryNetworkBlockHeightResponse = Field(
        ..., title='QueryNetworkBlockHeightResponse'
    )
    QueryNetworkGenesisConfiguration: QueryNetworkGenesisConfiguration = Field(
        ...,
        description='Query the genesis configuration of a given era.',
        title='QueryNetworkGenesisConfiguration',
    )
    QueryNetworkGenesisConfigurationResponse: QueryNetworkGenesisConfigurationResponse = Field(
        ..., title='QueryNetworkGenesisConfigurationResponse'
    )
    QueryNetworkInvalidGenesis: Optional[QueryNetworkInvalidGenesis1] = Field(
        None, title='QueryNetworkInvalidGenesis'
    )
    QueryNetworkStartTime: QueryNetworkStartTime = Field(
        ..., description='Query the network start time.', title='QueryNetworkStartTime'
    )
    QueryNetworkStartTimeResponse: QueryNetworkStartTimeResponse = Field(
        ..., title='QueryNetworkStartTimeResponse'
    )
    QueryNetworkTip: QueryNetworkTip = Field(
        ...,
        description='Get the current network tip. Said differently, this is the most recent slot and block header hash that the node it aware of.',
        title='QueryNetworkTip',
    )
    QueryNetworkTipResponse: QueryNetworkTipResponse = Field(..., title='QueryNetworkTipResponse')
    AcquireMempool: AcquireMempool = Field(
        ...,
        description='Acquire a mempool snapshot. This is blocking until a new (i.e different) snapshot is available.',
        title='AcquireMempool',
    )
    AcquireMempoolResponse: AcquireMempoolResponse = Field(
        ..., description="Response to a 'acquireMempool' request.", title='AcquireMempoolResponse'
    )
    NextTransaction: NextTransaction = Field(
        ...,
        description='Request the next transaction from an acquired mempools napshot.',
        title='NextTransaction',
    )
    MustAcquireMempoolFirst: Optional[MustAcquireMempoolFirst] = Field(
        None, title='MustAcquireMempoolFirst'
    )
    NextTransactionResponse: Union[NextTransactionResponse, MustAcquireMempoolFirstModel]
    HasTransaction: HasTransaction = Field(
        ...,
        description='Ask whether a given transaction is present in the acquired mempool snapshot.',
        title='HasTransaction',
    )
    HasTransactionResponse: Union[HasTransactionResponse, MustAcquireMempoolFirstModel]
    SizeOfMempool: SizeOfMempool = Field(
        ...,
        description='Get size and capacities of the mempool (acquired snapshot).',
        title='SizeOfMempool',
    )
    SizeOfMempoolResponse: Optional[Union[SizeOfMempoolResponse, MustAcquireMempoolFirstModel]] = (
        None
    )
    ReleaseMempool: ReleaseMempool = Field(
        ..., description='Release a previously acquired mempool snapshot.', title='ReleaseMempool'
    )
    ReleaseMempoolResponse: Union[ReleaseMempoolResponse, MustAcquireMempoolFirstModel]
    RpcError: RpcError = Field(
        ...,
        description='A generic error in the JSON-RPC protocol. This is returned by the server when a request from clients is deemed invalid or, when the server was unable to reply to a well-formed request.',
        examples=[
            {
                'jsonrpc': '2.0',
                'error': {'message': 'Invalid request: invalid query.', 'code': '-32601'},
            }
        ],
        title='RpcError',
    )


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[TransactionModel]] = 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[TransactionModel]] = 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 TransactionModel(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: Transaction5
    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')


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

    excessivelyLargeOutputs: List[TransactionOutput]


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

    code: Code36
    message: str
    data: Data26


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

    output: TransactionOutput
    minimumRequiredValue: Optional[ValueAdaOnly] = None


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

    insufficientlyFundedOutputs: List[InsufficientlyFundedOutput]


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

    code: Code41
    message: str
    data: Data33


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

    bootstrapOutputs: List[TransactionOutput]


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

    code: Code42
    message: str
    data: Data34


class SubmitTransactionFailure(BaseModel):
    __root__: Union[
        SubmitTransactionFailure1,
        SubmitTransactionFailure2,
        SubmitTransactionFailure3,
        SubmitTransactionFailure4,
        SubmitTransactionFailure5,
        SubmitTransactionFailure6,
        SubmitTransactionFailure7,
        SubmitTransactionFailure8,
        SubmitTransactionFailure9,
        SubmitTransactionFailure10,
        SubmitTransactionFailure11,
        SubmitTransactionFailureExtraneousRedeemers,
        SubmitTransactionFailureMissingDatums,
        SubmitTransactionFailure12,
        SubmitTransactionFailure13,
        SubmitTransactionFailure14,
        SubmitTransactionFailureMissingCostModels,
        SubmitTransactionFailure15,
        SubmitTransactionFailureUnknownOutputReference,
        SubmitTransactionFailure16,
        SubmitTransactionFailure17,
        SubmitTransactionFailure18,
        SubmitTransactionFailure19,
        SubmitTransactionFailure20,
        SubmitTransactionFailure21,
        SubmitTransactionFailure22,
        SubmitTransactionFailure23,
        SubmitTransactionFailure24,
        SubmitTransactionFailure25,
        SubmitTransactionFailure26,
        SubmitTransactionFailure27,
        SubmitTransactionFailure28,
        SubmitTransactionFailure29,
        SubmitTransactionFailure30,
        SubmitTransactionFailure31,
        SubmitTransactionFailure32,
        SubmitTransactionFailure33,
        SubmitTransactionFailure34,
        SubmitTransactionFailure35,
        SubmitTransactionFailure36,
        SubmitTransactionFailure37,
        SubmitTransactionFailure38,
        SubmitTransactionFailure39,
        SubmitTransactionFailure40,
        SubmitTransactionFailure41,
        SubmitTransactionFailure42,
        SubmitTransactionFailure43,
        SubmitTransactionFailure44,
        SubmitTransactionFailure45,
        SubmitTransactionFailure46,
        SubmitTransactionFailure47,
        SubmitTransactionFailure48,
        SubmitTransactionFailure49,
        SubmitTransactionFailure50,
        SubmitTransactionFailure51,
        SubmitTransactionFailure52,
        SubmitTransactionFailure53,
        SubmitTransactionFailure54,
        SubmitTransactionFailure55,
        SubmitTransactionFailure56,
        SubmitTransactionFailure57,
        SubmitTransactionFailure58,
        SubmitTransactionFailureExecutionBudgetOutOfBounds,
        SubmitTransactionFailure59,
        SubmitTransactionFailure60,
        SubmitTransactionFailure61,
        SubmitTransactionFailure62,
        SubmitTransactionFailure63,
        SubmitTransactionFailure64,
        SubmitTransactionFailure65,
    ]


VerificationKey.update_forward_refs()  # Edited
Voter.update_forward_refs()  # Edited
ConstitutionalCommitteeMember.update_forward_refs()  # Edited
Field0.update_forward_refs()
Result1.update_forward_refs()
SubmitTransactionResponse1.update_forward_refs()
Params2.update_forward_refs()
QueryLedgerStateUtxoResponse.update_forward_refs()
Result9.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()
TransactionModel.update_forward_refs()
