ContractSwagger

ContractSwagger

class ContractSwagger(**kwargs)

Implements the connectionmanager api endpoints.

address(address: Address | str, **kwargs) OpenAPISchemaModel

Dynamically generates a swagger document for the contract at the given address.

Parameters:
  • address (str, Address) – The smart contract address.

  • **kwargs – Extra keyword arguments.

Returns:

The swagger/OpenAPI schema for the smart contract.

Return type:

OpenAPISchemaModel

Raises:

APIError – Error thrown by node API. See message for details.

__call__(address: Address | str, **kwargs) None

Add the contract address to the Swagger dropdown.

Parameters:
  • address (Address, str) – The smart contract address.

  • **kwargs – Extra keyword arguments.

Returns:

None

Raises:

APIError – Error thrown by node API. See message for details.

OpenAPIEndpointsModel

class OpenAPIEndpointsModel(response: dict)

A model for the OpenAPI schema paths for deployed smart contracts.

static validate_values(values) bool

OpenAPIInfoModel

class OpenAPIInfoModel(*, title: str, description: str, version: str)

A pydantic model for the OpenAPI schema information for deployed smart contracts.

title: str

The smart contract title.

description: str

The smart contract description.

version: str

The smart contract version.

OpenAPISchemaModel

class OpenAPISchemaModel(*, openapi: str, info: OpenAPIInfoModel, paths: OpenAPIEndpointsModel, components: dict)

A pydantic model for the OpenAPI smart contract schema response.

openapi: str

The OpenAPI version.

info: OpenAPIInfoModel

Schema information.

paths: OpenAPIEndpointsModel

Schema endpoint information.

components: dict

Schema components.

SwaggerEndpointModel

class SwaggerEndpointModel(method: str, parameters: dict, response_body: dict | None = None)

A swagger schema path.

property method: str
property parameters: dict
property response_body: dict | None