Skip to main content

Address formatting

This example shows how to format an EVM-compatible address within a dashboard table. It includes:

  1. Hiding columns needed to link to explorers (chain and network), but not necessarily user-facing.
  2. Shortening the address to it's leading/trailing characters
  3. 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
  4. 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
}
]
}
]