TokenAmount
The Token Amount component is used to display a token logo followed by an amount and the token symbol.
Usage
import { TokenAmount } from '@aragon/ui'
function App() {
return (
<TokenAmount
address="0x6B175474E89094C44Da98b954EedeAC495271d0F"
amount="1049228954700000000000"
decimals={18}
symbol="DAI"
/>
)
}
Demonstration

Props
address
address
TYPE
DEFAULT VALUE
string
None
The address of the token contract, on the specified chainId
(only Ethereum Mainnet is supported at the moment).
amount
amount
TYPE
DEFAULT VALUE
BigInt
, Number
, String
None (required)
The token amount.
chainId
chainId
TYPE
DEFAULT VALUE
Number
1
The chain ID for the token. Only Ethereum Mainnet (1
) is supported at the moment.
decimals
decimals
TYPE
DEFAULT VALUE
BigInt
, Number
, String
None (required)
The number of decimals for the token amount, as specified by the token contract.
digits
digits
TYPE
DEFAULT VALUE
BigInt
, Number
, String
2
Rounds the number to a given decimal place.
iconUrl
iconUrl
TYPE
DEFAULT VALUE
String
None
Overrides the icon URL given by the token address.
size
size
TYPE
DEFAULT VALUE
"large"
or "medium"
"medium"
Size of the component.
symbol
symbol
TYPE
DEFAULT VALUE
String
None
Overrides the symbol given by the token address.
Last updated
Was this helpful?