ape
ape copied to clipboard
Add fee token information to Ecosystem API
Overview
It would be helpful to know information about the base fee currency token for display purposes. Let's say I am building a display app / plugin using ape I want to show balances of accounts. Right now, hard to know what "balance" means (from an abstract perspective). Also want the correct symbol when it is not paid in ETH.
Specification
class FeeTokenAPI:
symbol: str
decimals: int
name: str
class EcosystemAPI:
fee_token: Optional[FeeTokenAPI] = None
optional in case it is some alpha chain with no fees yet.
Dependencies
Include links to any open issues that must be resolved before this feature can be implemented.
maybe it should be called native_token
maybe it should be called
native_token
It is not always native though. In the case of Starknet, it is an ERC20 at the moment
maybe it should be called
native_token
It could be fee_token: Optional[AddressType] = None where None means "use native Ether-like balances", and having one means that it should download and reference the contract address for balance information
It could be
fee_token: Optional[AddressType] = NonewhereNonemeans "use native Ether-like balances"
What if the native token is not Ether like?
It could be
fee_token: Optional[AddressType] = NonewhereNonemeans "use native Ether-like balances"What if the native token is not Ether like?
I would say this semantic would mean "fee token is an ERC-like token" at a specific address, or if it is blank it means "the fee token is the native token, using whatever API the chain has natively for working with it's native tokens"
Even if it is a native token, how can I know how many decimals it uses?
Like say I am building a command that outputs balances in a nicer way, and all I have is a EcosystemAPI, how do I know the symbol and decimal amount?
Even if it is a native token, how can I know how many decimals it uses? Like say I am building a command that outputs balances in a nicer way, and all I have is a
EcosystemAPI, how do I know the symbol and decimal amount?
This might be something ecosystem-specific. For example, I built this converter into ape-ethereum which converts the different ether unit values: https://github.com/ApeWorX/ape/blob/main/src/ape_ethereum/_converters.py
this got done!