Skip to content

Commit eed0fcf

Browse files
warengonzagaclaudepedromcunha
authored
Refresh depository contract addresses from live Chains API (#298)
* Refresh depository contract addresses from live Chains API Regenerates the per-chain depository table in references/protocol/addresses.mdx against the current api.relay.link/chains response: - Adds 13 chains newly supported by the API: monad, stable, hyperliquid, tempo, megaeth, plasma, mythos, doma, gensyn, lighter, ethereal, tron, plus the hyperliquid-vm/tron-vm/lighter-vm VM types. - Removes 12 chains no longer returned by the API: mint, appchain (466), polygon_zkevm, gravity, sanko, hychain, powerloom, arena_z, onchain_points, funki, xai, forma. - Renames 8 chains to match current API slugs: bnb->bsc, manta->manta-pacific, worldchain->world-chain, flow->flow-evm, b3->B3, arbitrum_nova->arbitrum-nova, anime->animechain, zero->zero-network. - Updates bitcoin depository address to 1KT3zCYUrmQxjcveUNs1Rs7WcXDcPQZ4av. - Fixes the generator jq snippet in the leading comment (was referencing .protocol.v2.chainId; now matches the actual column output: .name). - Widens VM Type column to fit hyperliquid-vm (14 chars). Prompted by SafePal (Pylon #4519) flagging that newly supported chains were missing from the docs. The Chains API remains the authoritative source; this refresh brings the static page back in sync. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Address Copilot review feedback - Rename "EVM Chain Id" column to "Chain ID" since the column now includes non-EVM chains (bitcoin, solana, tron, etc.) whose values are Relay chain IDs, not EVM chain IDs. - Fill in the Relay chain ID for all non-EVM rows (bitcoin, eclipse, soon, tron, solana, lighter) so the column is consistently populated. - Lowercase the b3 slug to match the convention used for other chain slugs in the table and in references/protocol/depository/addresses.mdx. - Add the trailing pipe to the jq format string in the generator comment so regenerated output matches the table format exactly. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Render depository table dynamically from Chains API Replace the static depository table in references/protocol/addresses.mdx with a live-fetched table rendered by a new /snippets/Depositories.mdx, mirroring the pattern used by /snippets/Chains.mdx and /snippets/Contracts.mdx. New chains added to api.relay.link/chains will now appear automatically without a docs update. Per Pedro's review feedback on PR #298. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Map raw API vmType codes to human-friendly labels The /chains response returns short codes (evm, bvm, svm, tvm, hypevm, lvm). Mapping them to the ethereum-vm / bitcoin-vm / solana-vm / tron-vm / hyperliquid-vm / lighter-vm labels preserves the phrasing the static table used, so integrators scanning the page see consistent wording. Unknown codes fall through unchanged. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Co-authored-by: pedromcunha <pedro.spinsomewebs@gmail.com>
1 parent a829164 commit eed0fcf

2 files changed

Lines changed: 106 additions & 77 deletions

File tree

‎references/protocol/addresses.mdx‎

Lines changed: 4 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ description: Contract addresses for the Relay Settlement Protocol
44
sidebarTitle: Addresses
55
---
66

7+
import { Depositories } from "/snippets/Depositories.mdx"
8+
79
## Relay Chain
810

911
Core settlement contracts deployed on the [Relay Chain](/references/protocol/components/relay-chain) (Chain ID `537713`).
@@ -24,81 +26,6 @@ The [Allocator](/references/protocol/components/allocator) and [Security Council
2426

2527
## Depository Contracts
2628

27-
{/* Generated using: "curl https://api.relay.link/chains | jq '.chains[] | "|\(.protocol.v2.chainId)|\(.protocol.v2.depository)|\(.vmType)|\(.id)"" */}
28-
29-
[Depository](/references/protocol/components/depository) contracts are deployed on every supported origin chain.
29+
[Depository](/references/protocol/components/depository) contracts are deployed on every supported origin chain. The list below is fetched live from the [Chains API](https://api.relay.link/chains) and stays in sync as new chains are added.
3030

31-
| Chain | Address | VM Type | EVM Chain Id |
32-
| -------------- | -------------------------------------------- | ----------- | ------------ |
33-
| ethereum | 0x4cd00e387622c35bddb9b4c962c136462338bc31 | ethereum-vm | 1 |
34-
| optimism | 0x4cd00e387622c35bddb9b4c962c136462338bc31 | ethereum-vm | 10 |
35-
| cronos | 0x59916da825d2d2ec1bf878d71c88826f6633ecca | ethereum-vm | 25 |
36-
| bnb | 0x4cd00e387622c35bddb9b4c962c136462338bc31 | ethereum-vm | 56 |
37-
| gnosis | 0x4cd00e387622c35bddb9b4c962c136462338bc31 | ethereum-vm | 100 |
38-
| unichain | 0x4cd00e387622c35bddb9b4c962c136462338bc31 | ethereum-vm | 130 |
39-
| polygon | 0x4cd00e387622c35bddb9b4c962c136462338bc31 | ethereum-vm | 137 |
40-
| sonic | 0x4cd00e387622c35bddb9b4c962c136462338bc31 | ethereum-vm | 146 |
41-
| manta | 0x4cd00e387622c35bddb9b4c962c136462338bc31 | ethereum-vm | 169 |
42-
| mint | 0x4cd00e387622c35bddb9b4c962c136462338bc31 | ethereum-vm | 185 |
43-
| boba | 0x4cd00e387622c35bddb9b4c962c136462338bc31 | ethereum-vm | 288 |
44-
| zksync | 0x4cd00e387622c35bddb9b4c962c136462338bc31 | ethereum-vm | 324 |
45-
| shape | 0x4cd00e387622c35bddb9b4c962c136462338bc31 | ethereum-vm | 360 |
46-
| appchain | 0x4cd00e387622c35bddb9b4c962c136462338bc31 | ethereum-vm | 466 |
47-
| worldchain | 0x4cd00e387622c35bddb9b4c962c136462338bc31 | ethereum-vm | 480 |
48-
| redstone | 0x4cd00e387622c35bddb9b4c962c136462338bc31 | ethereum-vm | 690 |
49-
| flow | 0x4cd00e387622c35bddb9b4c962c136462338bc31 | ethereum-vm | 747 |
50-
| hyperevm | 0x4cd00e387622c35bddb9b4c962c136462338bc31 | ethereum-vm | 999 |
51-
| metis | 0x59916da825d2d2ec1bf878d71c88826f6633ecca | ethereum-vm | 1088 |
52-
| polygon_zkevm | 0x59916da825d2d2ec1bf878d71c88826f6633ecca | ethereum-vm | 1101 |
53-
| lisk | 0x4cd00e387622c35bddb9b4c962c136462338bc31 | ethereum-vm | 1135 |
54-
| sei | 0x4cd00e387622c35bddb9b4c962c136462338bc31 | ethereum-vm | 1329 |
55-
| story | 0x4cd00e387622c35bddb9b4c962c136462338bc31 | ethereum-vm | 1514 |
56-
| gravity | 0x4cd00e387622c35bddb9b4c962c136462338bc31 | ethereum-vm | 1625 |
57-
| soneium | 0x4cd00e387622c35bddb9b4c962c136462338bc31 | ethereum-vm | 1868 |
58-
| swellchain | 0x4cd00e387622c35bddb9b4c962c136462338bc31 | ethereum-vm | 1923 |
59-
| sanko | 0x4cd00e387622c35bddb9b4c962c136462338bc31 | ethereum-vm | 1996 |
60-
| ronin | 0x4cd00e387622c35bddb9b4c962c136462338bc31 | ethereum-vm | 2020 |
61-
| abstract | 0x4cd00e387622c35bddb9b4c962c136462338bc31 | ethereum-vm | 2741 |
62-
| morph | 0x4cd00e387622c35bddb9b4c962c136462338bc31 | ethereum-vm | 2818 |
63-
| hychain | 0x59916da825d2d2ec1bf878d71c88826f6633ecca | ethereum-vm | 2911 |
64-
| mantle | 0x59916da825d2d2ec1bf878d71c88826f6633ecca | ethereum-vm | 5000 |
65-
| somnia | 0x4cd00e387622c35bddb9b4c962c136462338bc31 | ethereum-vm | 5031 |
66-
| superseed | 0x4cd00e387622c35bddb9b4c962c136462338bc31 | ethereum-vm | 5330 |
67-
| cyber | 0x4cd00e387622c35bddb9b4c962c136462338bc31 | ethereum-vm | 7560 |
68-
| powerloom | 0x4cd00e387622c35bddb9b4c962c136462338bc31 | ethereum-vm | 7869 |
69-
| arena_z | 0x4cd00e387622c35bddb9b4c962c136462338bc31 | ethereum-vm | 7897 |
70-
| b3 | 0x4cd00e387622c35bddb9b4c962c136462338bc31 | ethereum-vm | 8333 |
71-
| base | 0x4cd00e387622c35bddb9b4c962c136462338bc31 | ethereum-vm | 8453 |
72-
| onchain_points | 0x4cd00e387622c35bddb9b4c962c136462338bc31 | ethereum-vm | 17071 |
73-
| apechain | 0x4cd00e387622c35bddb9b4c962c136462338bc31 | ethereum-vm | 33139 |
74-
| funki | 0x4cd00e387622c35bddb9b4c962c136462338bc31 | ethereum-vm | 33979 |
75-
| mode | 0x4cd00e387622c35bddb9b4c962c136462338bc31 | ethereum-vm | 34443 |
76-
| arbitrum | 0x4cd00e387622c35bddb9b4c962c136462338bc31 | ethereum-vm | 42161 |
77-
| arbitrum_nova | 0x4cd00e387622c35bddb9b4c962c136462338bc31 | ethereum-vm | 42170 |
78-
| celo | 0x4cd00e387622c35bddb9b4c962c136462338bc31 | ethereum-vm | 42220 |
79-
| hemi | 0x4cd00e387622c35bddb9b4c962c136462338bc31 | ethereum-vm | 43111 |
80-
| avalanche | 0x4cd00e387622c35bddb9b4c962c136462338bc31 | ethereum-vm | 43114 |
81-
| gunz | 0x4cd00e387622c35bddb9b4c962c136462338bc31 | ethereum-vm | 43419 |
82-
| zircuit | 0x4cd00e387622c35bddb9b4c962c136462338bc31 | ethereum-vm | 48900 |
83-
| superposition | 0x4cd00e387622c35bddb9b4c962c136462338bc31 | ethereum-vm | 55244 |
84-
| ink | 0x4cd00e387622c35bddb9b4c962c136462338bc31 | ethereum-vm | 57073 |
85-
| linea | 0x59916da825d2d2ec1bf878d71c88826f6633ecca | ethereum-vm | 59144 |
86-
| bob | 0x4cd00e387622c35bddb9b4c962c136462338bc31 | ethereum-vm | 60808 |
87-
| anime | 0x4cd00e387622c35bddb9b4c962c136462338bc31 | ethereum-vm | 69000 |
88-
| berachain | 0x4cd00e387622c35bddb9b4c962c136462338bc31 | ethereum-vm | 80094 |
89-
| blast | 0x4cd00e387622c35bddb9b4c962c136462338bc31 | ethereum-vm | 81457 |
90-
| plume | 0x4cd00e387622c35bddb9b4c962c136462338bc31 | ethereum-vm | 98866 |
91-
| taiko | 0x59916da825d2d2ec1bf878d71c88826f6633ecca | ethereum-vm | 167000 |
92-
| syndicate | 0x4cd00e387622c35bddb9b4c962c136462338bc31 | ethereum-vm | 510003 |
93-
| scroll | 0x4cd00e387622c35bddb9b4c962c136462338bc31 | ethereum-vm | 534352 |
94-
| zero | 0xa88cf7864951147a08707ed732237eaa9b1c3b9b | ethereum-vm | 543210 |
95-
| xai | 0x4cd00e387622c35bddb9b4c962c136462338bc31 | ethereum-vm | 660279 |
96-
| katana | 0x4cd00e387622c35bddb9b4c962c136462338bc31 | ethereum-vm | 747474 |
97-
| forma | 0x4cd00e387622c35bddb9b4c962c136462338bc31 | ethereum-vm | 984122 |
98-
| zora | 0x4cd00e387622c35bddb9b4c962c136462338bc31 | ethereum-vm | 7777777 |
99-
| bitcoin | bc1qdqqsq6y7csd0cr3ye45h9lv8ydh777j2wehgl6 | bitcoin-vm | |
100-
| eclipse | 99vQwtBwYtrqqD9YSXbdum3KBdxPAVxYTaQ3cfnJSrN2 | solana-vm | |
101-
| degen | 0x4cd00e387622c35bddb9b4c962c136462338bc31 | ethereum-vm | 666666666 |
102-
| solana | 99vQwtBwYtrqqD9YSXbdum3KBdxPAVxYTaQ3cfnJSrN2 | solana-vm | |
103-
| ancient8 | 0x4cd00e387622c35bddb9b4c962c136462338bc31 | ethereum-vm | 888888888 |
104-
| rari | 0x4cd00e387622c35bddb9b4c962c136462338bc31 | ethereum-vm | 1380012617 |
31+
<Depositories id="mainnetDepositories" env="mainnets" />

‎snippets/Depositories.mdx‎

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
export const VM_TYPE_LABELS = {
2+
evm: "ethereum-vm",
3+
bvm: "bitcoin-vm",
4+
svm: "solana-vm",
5+
tvm: "tron-vm",
6+
hypevm: "hyperliquid-vm",
7+
lvm: "lighter-vm"
8+
}
9+
10+
export const Depositories = ({ env, id }) => {
11+
const key = `depositories-${env}`
12+
13+
if (typeof window === "undefined") {
14+
return null
15+
}
16+
17+
if (!window[key]) {
18+
window[key] = {
19+
fetching: false,
20+
data: null
21+
}
22+
}
23+
if (!window[key].fetching) {
24+
const appendDepositories = (data) => {
25+
const rootElement = document.getElementById(id)
26+
if (!rootElement) {
27+
return
28+
}
29+
const rows = data
30+
.slice()
31+
.filter((chain) => chain.protocol && chain.protocol.v2 && chain.protocol.v2.depository)
32+
.sort((a, b) => a.id - b.id)
33+
.map((chain) => {
34+
return `<tr key=${chain.id}>
35+
<td>${chain.name}</td>
36+
<td>${chain.protocol.v2.depository}</td>
37+
<td>${VM_TYPE_LABELS[chain.vmType] || chain.vmType}</td>
38+
<td>${chain.id}</td>
39+
</tr>`
40+
})
41+
rootElement.innerHTML = rows.join("")
42+
const loaderContainer = document.getElementById(`loader-container-${id}`)
43+
if (loaderContainer) {
44+
loaderContainer.style.display = "none"
45+
}
46+
}
47+
48+
const fetchChains = async () => {
49+
try {
50+
window[key].fetching = true
51+
window[key].data = null
52+
const response = await fetch(
53+
env === "testnets"
54+
? "https://api.testnets.relay.link/chains"
55+
: "https://api.relay.link/chains"
56+
)
57+
const data = await response.json()
58+
window[key].fetching = false
59+
window[key].data = data.chains
60+
appendDepositories(data.chains)
61+
} catch (e) {
62+
window[key].fetching = false
63+
window[key].data = false
64+
}
65+
}
66+
const loaderContainer = document.getElementById(`loader-container-${id}`)
67+
if (loaderContainer) {
68+
loaderContainer.style.display = "flex"
69+
}
70+
if (window[key].data) {
71+
setTimeout(() => {
72+
appendDepositories(window[key].data)
73+
}, 1000)
74+
} else {
75+
fetchChains()
76+
}
77+
}
78+
79+
return (
80+
<table style={{ width: "100%", borderSpacing: "48px" }} className="relay-table">
81+
<thead
82+
style={{
83+
borderBottom: "1px solid rgb(227 226 230)",
84+
paddingBottom: 5,
85+
width: "100%",
86+
fontSize: 16,
87+
}}
88+
>
89+
<tr style={{ textAlign: "left" }}>
90+
<th>Chain</th>
91+
<th>Address</th>
92+
<th>VM Type</th>
93+
<th>Chain ID</th>
94+
</tr>
95+
</thead>
96+
<tbody id={id} style={{ width: "100%" }}></tbody>
97+
<div className={`loader-container-${id}`} style={{ display: "none", justifyContent: "center", alignItems: "center", height: "200px", width: "100%" }}>
98+
<div className="loader"></div>
99+
</div>
100+
</table>
101+
)
102+
}

0 commit comments

Comments
 (0)