@audren-xyz/gateway-screening-publisher
v1.0.5
Published
Turnkey US Treasury OFAC SDN XML + multi-feed Ed25519 signed-snapshot publisher for Audren Gateways (audren-gateway-screen-v1)
Maintainers
Readme
@audren-xyz/gateway-screening-publisher
Standalone CLI that fetches the official US Treasury OFAC SDN XML (primary https://sanctionslistservice.ofac.treas.gov/api/PublicationPreview/exports/SDN.XML, automatic fallback https://www.treasury.gov/ofac/downloads/sdn.xml), extracts canonical 32-byte Base58 Solana addresses (Digital Currency Address - SOL), merges optional supplementary feeds (--extra-feed), guards against truncated upstream responses (--min-addresses), and signs a canonical audren-gateway-screen-v1 Ed25519 JSON snapshot.
Usage
Run directly from npm (npx)
# Generate a dedicated Ed25519 screening signing keypair
npx --yes @audren-xyz/gateway-screening-publisher --generate-key
# Fetch OFAC SDN XML, merge an optional exploit feed, and write a signed snapshot
SCREENING_SIGNING_KEY_HEX=<64-or-128-hex-key> npx --yes @audren-xyz/gateway-screening-publisher \
--out ./ofac-solana.json \
--min-addresses 1 \
--extra-feed https://example.com/solana-exploits.jsonCLI Options & Exit Codes
--generate-key/--keygen— Print a fresh{ signingKeySeedHex, signingPubkeyHex }Ed25519 keypair JSON and exit.--signing-key-hex <64-or-128-hex>(or envSCREENING_SIGNING_KEY_HEX) — 32-byte seed (64hex chars) or 64-byte Ed25519 keypair (128hex chars).--out <path>— Output file path (omit to write the signed JSON tostdout).--min-addresses <n>— Minimum extracted address guard (default1).--extra-feed <https-url-or-file>— Repeatable supplementary feed (HTTPS URL or local file path; accepts JSON{ addresses: string[] }, JSONstring[], or newline-separated Base58 addresses with optional#comments).--ofac-file <path>— Parse a local OFAC SDN XML file instead of fetching from US Treasury.--skip-ofac— Skip OFAC SDN XML and publish from--extra-feedsources only.--help/-h— Show usage and exit0.- Exit codes:
0on success /--help;1on invalid arguments, upstream fetch failure, post-sign verification error, or--min-addressesguard rejection.
Run from a local checkout
pnpm --dir tools/screening-publisher install --frozen-lockfile
pnpm --dir tools/screening-publisher publish:snapshot -- --generate-keyUpload the resulting JSON file to your Cloudflare R2 SCREENING_BUCKET (e.g., npx --yes wrangler@4 r2 object put <bucket>/screening/ofac-solana.json --file ./ofac-solana.json --content-type application/json --remote) and point your Gateway at SCREENING_LIST_URL="r2://screening/ofac-solana.json" with your pinned SCREENING_SIGNING_PUBKEY_HEX. Schedule refreshes well within SCREENING_MAX_AGE_SEC (for GitHub Actions .github/workflows/publish-screening.yml, configure the production environment secrets SCREENING_SIGNING_KEY_HEX, SCREENING_R2_BUCKET, CLOUDFLARE_ACCOUNT_ID, CLOUDFLARE_API_TOKEN, and optional vars.SCREENING_R2_KEY matching your SCREENING_LIST_URL key).
