
    ;j&                         d dl mZmZmZ d dlmZmZ d dlmZ d dl	m
Z
 d dlmZmZmZ  G d de          Z G d d	e          Zd
S )    )AnyDictType)	BaseModel
ConfigDict)CoreSchemaField)to_camel)DEFAULT_REF_TEMPLATEGenerateJsonSchemaJsonSchemaModec                   ,     e Zd ZdZdedef fdZ xZS )OmitJsonSchemaz
    Custom JSON schema generator that omits the schema generation for fields that are
    invalid. Excluded fields (``Field(exclude=True)``) are generally useful as
    properties of the model but are not meant to be serialized to JSON.
    fieldreturnc                 v    |                     dd          rdS t                                          |          S )Nserialization_excludeF)getsuperfield_is_present)selfr   	__class__s     k/home/agent/projects/CryptoTradingBot/Crypto_Agent/.venv/lib/python3.11/site-packages/eth_utils/pydantic.pyr   zOmitJsonSchema.field_is_present   s7    99,e44 	5ww''...    )__name__
__module____qualname____doc__r   boolr   __classcell__r   s   @r   r   r      sU         /o /$ / / / / / / / / / /r   r   c                        e Zd ZdZ edded          Zedee	dfde
dedee         ded	eeef         f
 fd
            Z xZS )
CamelModelav  
    Camel-case pydantic model. This model is used to ensure serialization in a
    consistent manner, aliasing as camelCase serialization. This is useful for models
    that are used in JSON-RPC requests and responses, marking useful fields for the
    model, but that are not part of the JSON-RPC object, with ``Field(exclude=True)``.
    To serialize a model to the expected JSON-RPC format, or camelCase, use
    ``model_dump(by_alias=True)``.

    .. code-block:: python

        >>> from eth_utils.pydantic import CamelModel
        >>> from pydantic import Field

        >>> class SignedSetCodeAuthorization(CamelModel):
        ...     chain_id: int
        ...     address: bytes
        ...     nonce: int
        ...
        ...     # useful fields for the object but excluded from serialization
        ...     # (not part of the JSON-RPC object)
        ...     authorization_hash: bytes = Field(exclude=True)
        ...     signature: bytes = Field(exclude=True)

        >>> auth = SignedSetCodeAuthorization(
        ...     chain_id=1,
        ...     address=b"0x0000000000000000000000000000000000000000",
        ...     nonce=0,
        ...     authorization_hash=generated_hash,
        ...     signature=generated_signature,
        ... )
        >>> auth.model_dump(by_alias=True)
        {'chainId': 1, 'address': '0x000000000000000000000000000000000000', 'nonce': 0}
    T)arbitrary_types_allowedpopulate_by_namealias_generatorvalidate_default
validationby_aliasref_templateschema_generatormoder   c                 N    t                                          ||||          S )z
        Omits excluded fields from the JSON schema, preventing errors that would
        otherwise be raised by the default schema generator.
        )r(   r)   r*   r+   )r   model_json_schema)clsr(   r)   r*   r+   r   s        r   r-   zCamelModel.model_json_schemaS   s2     ww((%-	 ) 
 
 	
r   )r   r   r   r   r   r	   model_configclassmethodr
   r   r   strr   r   r   r   r   r-   r   r    s   @r   r"   r"   &   s           D : $   L  05C+
 

 

 12
 
 
c3h
 
 
 
 
 [
 
 
 
 
r   r"   N)typingr   r   r   pydanticr   r   pydantic._internal._core_utilsr   pydantic.alias_generatorsr	   pydantic.json_schemar
   r   r   r   r"    r   r   <module>r8      s,                                     / / / / /' / / /?
 ?
 ?
 ?
 ?
 ?
 ?
 ?
 ?
 ?
r   