economy.utils

Define utilities and generic logic for the economy application.

Copyright (C) 2021 Gitcoin Core

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see http://www.gnu.org/licenses/.

ConversionRateNotFoundError

ConversionRateNotFoundError(self, /, *args, **kwargs)

Thrown if ConversionRate not found.

convert_token_to_usdt

convert_token_to_usdt(from_token, timestamp=None)

Convert the token to USDT.

Args: from_token (str): The token identifier.

Returns: float: The current rate of the provided token to USDT.

etherscan_link(txid)

Build the Etherscan URL.

Args: txid (str): The transaction ID.

Returns: str: The Etherscan TX URL.

watch_txn

watch_txn(tx_id)

Watches the Ethereum txn for updates (mainly being dropped/replaced)

Args: txid (str): The transaction ID.

Returns: str: The Etherscan TX URL.