feat: add guarded Base Sepolia encore

This commit is contained in:
golem
2026-08-21 16:01:35 -06:00
parent 94f2ad6e09
commit 90b0a11b8a
16 changed files with 784 additions and 25 deletions
+8
View File
@@ -34,6 +34,14 @@ export function validatePublicManifest(manifest) {
for (const field of ["token", "proxy", "implementation", "owner"]) assertAddress(manifest[field], field);
assertActors(manifest.actors);
for (const field of optionalFields) if (Object.hasOwn(manifest, field)) assertPublicUrl(manifest[field], field);
if (manifest.network === "baseSepolia") {
if (Object.hasOwn(manifest, "rpcUrl") && new URL(manifest.rpcUrl).protocol !== "https:") {
throw new Error("manifest Base Sepolia rpcUrl must use HTTPS");
}
if (Object.hasOwn(manifest, "explorerBaseUrl") && manifest.explorerBaseUrl !== "https://sepolia.basescan.org") {
throw new Error("manifest Base Sepolia explorerBaseUrl must use BaseScan");
}
}
}
function isRecord(value) { return typeof value === "object" && value !== null && !Array.isArray(value); }