diff --git a/backend/src/anchor-toml-validator.ts b/backend/src/anchor-toml-validator.ts index f8593c2e..82239ab2 100644 --- a/backend/src/anchor-toml-validator.ts +++ b/backend/src/anchor-toml-validator.ts @@ -31,6 +31,14 @@ export async function fetchAnchorToml(homeDomain: string): Promise { }); const data: TomlData = toml.parse(response.data); + + const missingFields: string[] = []; + if (!data.SIGNING_KEY) missingFields.push('SIGNING_KEY'); + if (!data.NETWORK_PASSPHRASE) missingFields.push('NETWORK_PASSPHRASE'); + if (missingFields.length > 0) { + throw new Error(`stellar.toml missing required fields: ${missingFields.join(', ')}`); + } + tomlCache.set(cacheKey, data); logger.debug('Fetched and cached stellar.toml', { homeDomain }); return data;