Skip to content

Commit c2cc08d

Browse files
add unichain token api (#170)
* relax validate errors for testnets * add token api to unichain * chore: auto-bump version to 0.7.38 (patch) --------- Co-authored-by: Pinax Bot <[email protected]>
1 parent ac2b671 commit c2cc08d

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "0.7.37",
2+
"version": "0.7.38",
33
"private": true,
44
"type": "module",
55
"scripts": {

registry/eip155/unichain.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
"substreams": [
1515
"unichain.substreams.pinax.network:443",
1616
"mainnet.unichain.streamingfast.io:443"
17-
]
17+
],
18+
"tokenApi": ["https://token-api.thegraph.com"]
1819
},
1920
"networkType": "mainnet",
2021
"relations": [{ "kind": "l2Of", "network": "mainnet" }],
@@ -41,5 +42,6 @@
4142
},
4243
"blockFeatures": ["extended"]
4344
},
45+
"tokenApi": { "features": ["tokens", "dexes", "nfts"], "networkId": "unichain" },
4446
"icon": { "web3Icons": { "name": "unichain" } }
4547
}

src/validate_urls.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ async function testURL({
4646
} catch (e) {
4747
// Only add warning/error after all retries have failed
4848
console.error(` ${networkId} - exception at ${url}: ${e.message}`);
49-
ERRORS.push(`\`${networkId}\` - unreachable URL: ${url}`);
49+
WARNINGS.push(`\`${networkId}\` - unreachable URL: ${url}`);
5050
return false;
5151
}
5252
return true;
@@ -205,7 +205,11 @@ async function validatePublicRpcs(networks: Network[]) {
205205
.map((u, i) => ({ url: u.url, valid: results[i] }))
206206
.filter(({ url }) => network.rpcUrls?.includes(url));
207207
if (networkUrls.length > 0 && !networkUrls.some(({ valid }) => valid)) {
208-
ERRORS.push(`\`${network.id}\` - no working public RPC endpoints`);
208+
if (network.networkType === "testnet") {
209+
WARNINGS.push(`\`${network.id}\` - no working public RPC endpoints [testnet]`);
210+
} else {
211+
ERRORS.push(`\`${network.id}\` - no working public RPC endpoints [mainnet]`);
212+
}
209213
}
210214
}
211215

0 commit comments

Comments
 (0)