cow.api

Documentation for eth_defi.cow.api Python module.

Cow API utilities.

Functions

get_cowswap_api(chain_id)

Get CowSwap API endpoint for given chain ID.

Exceptions

CowAPIError

Error returned by CowSwap API.

exception CowAPIError

Bases: Exception

Error returned by CowSwap API.

__init__(*args, **kwargs)
__new__(**kwargs)
add_note()

Exception.add_note(note) – add a note to the exception

with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

get_cowswap_api(chain_id)

Get CowSwap API endpoint for given chain ID.

Parameters

chain_id (int) – Chain ID to get the endpoint for

Returns

CowSwap API endpoint URL

Raises

KeyError – If chain is not supported by CowSwap

Return type

str