Address formatting
This example shows how to format an EVM-compatible address within a dashboard table. It includes:
- Hiding columns needed to link to explorers (
chain
andnetwork
), but not necessarily user-facing. - Shortening the address to it's leading/trailing characters
- Displaying the shortened address as a link to to the address in the corresponding explorer. For this example, we use Arbitrum, but any supported chain follows the same pattern
- Using an account alias for display, but linking to the actual address in an explorer
Example dashboard JSON
[
{
"panels": [
{
"name": "Address formatting in a table",
"chartType": "table",
"description": "Shows different ways to format an address within an EVM table. Notice that you need to return both 'chain' and 'network' in your dataset to link to the relevant explorer",
"config": {
"table": {
"hiddenColumns": ["chain", "network"],
"formatting": [
{
"format": { "justify": "left" },
"columns": ["demo_address", "demo_alias"]
},
{
"format": {
"link": "{{explorerUrl}}/address/{{rawValue}}/",
"valueTransformer": "formatEthAddress"
},
"columns": ["demo_address"]
},
{
"format": {
"link": "{{explorerUrl}}/address/{{row.demo_address}}",
"valueTransformer": "formatEthAddress"
},
"columns": ["demo_alias"]
}
]
}
},
"panelType": "query",
"queries": [
{
"query": "select '0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9' as demo_address, 'USDt' as demo_alias, 'arbitrum' as chain, 'mainnet' as network;"
}
],
"network": "mainnet",
"span": 1
}
]
}
]