Fetch the standard location
Requests /.well-known/stellar.toml over HTTPS and rejects unsuccessful HTTP responses.
A small, focused toolkit for discovering, parsing, and sanity-checking SEP-1 stellar.toml files in TypeScript applications.
Use the utility that fits your integration. Network and parsing errors are surfaced instead of being replaced with placeholder data.
Requests /.well-known/stellar.toml over HTTPS and rejects unsuccessful HTTP responses.
Parses the response with a TOML parser, enforces SEP-1's 100 KiB file limit, and reports malformed input.
Checks that VERSION is present and validates common endpoint URL and documentation field types.
Install the package, then call the asynchronous fetch helper from your Node.js application.
npm install github:anchor-tools/stellar-sep-helper
import {
fetchStellarToml,
validateStellarToml
} from 'stellar-sep-helper';
const record = await fetchStellarToml({ domain: 'example.com' });
const result = validateStellarToml(record);
if (!result.valid) {
console.error('Stellar TOML needs attention:', result.errors);
}
parseStellarToml(source). For custom runtimes or tests, pass a fetcher in the fetch options.All exported helpers and types are available from the package root.
fetchStellarToml(options)Fetches from the SEP-1 well-known URL and returns a parsed Sep1Record. Rejects on invalid input, HTTP errors, oversize content, or malformed TOML.
parseStellarToml(source)Parses TOML text without network access and returns a Sep1Record. Throws when the source is not valid TOML.
validateStellarToml(record)Returns { valid, errors } after checking the version, supported HTTPS endpoint fields, and optional documentation field types.
Protocol support should be tied to the SEP text, tested, and described accurately. Start with an issue for new SEP integrations or larger design changes.