velora.api

Documentation for eth_defi.velora.api Python module.

Velora API utilities.

Functions

get_augustus_swapper(chain_id)

Get Augustus Swapper contract address for a chain.

get_token_transfer_proxy(chain_id)

Get TokenTransferProxy contract address for a chain.

get_velora_api_url()

Get Velora API base URL.

Exceptions

VeloraAPIError

Error returned by Velora API.

exception VeloraAPIError

Bases: Exception

Error returned by Velora 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_velora_api_url()

Get Velora API base URL.

Returns

Velora API endpoint URL

Return type

str

get_augustus_swapper(chain_id)

Get Augustus Swapper contract address for a chain.

Parameters

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

Returns

Augustus Swapper contract address

Raises

KeyError – If chain is not supported by Velora

Return type

eth_typing.evm.HexAddress

get_token_transfer_proxy(chain_id)

Get TokenTransferProxy contract address for a chain.

This is the contract that users must approve for token spending.

Warning

Approve TokenTransferProxy, NOT Augustus Swapper. Funds may be lost if approved to Augustus directly.

Parameters

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

Returns

TokenTransferProxy contract address

Raises

KeyError – If chain is not supported by Velora

Return type

eth_typing.evm.HexAddress