Skip to content

New Disclosure use case #1138

@ArturVargas

Description

@ArturVargas

Feature Request: excludeAllCountriesExcept Option for ConfigStore

Context

Currently, DefaultConfigStore allows developers to exclude specific countries via the excludedCountries parameter, e.g.:

const configStore = new DefaultConfigStore({
  excludedCountries: [countries.IRAN, countries.NORTH_KOREA, countries.SYRIA],
  ofac: true,
});

This works well for blocking a handful of countries, but it becomes cumbersome for the opposite use case:

  • Applications that should only be available in a limited region (e.g., only LATAM).

Proposed Feature

Introduce a new configuration parameter:

const configStore = new DefaultConfigStore({
  excludeAllCountriesExcept: [
    countries.MEXICO,
    countries.COLOMBIA,
    countries.ARGENTINA,
    countries.CHILE,
    countries.PERU,
  ],
});

This would simplify region-restricted deployments where all countries are excluded by default, except for those explicitly listed.

Example Use Case

  • Local/Regional Apps:
    • A fintech or DeFi protocol targeting only Latin American users. Instead of listing ~180 countries in excludedCountries, the developer could simply whitelist the relevant LATAM countries.
  • Compliance / Licensing:
    • Apps that must comply with regulations allowing service only in specific jurisdictions (e.g., an exchange licensed only in Brazil and Mexico).
  • Content Gating:
    • Platforms offering services or content available only to residents of a given region (e.g., age-restricted services or national communities).

Benefits

  • Reduces developer complexity for regional restrictions.
  • Makes intent clearer in code (except reads as allow-list).
  • Aligns with compliance workflows where restrictions are often phrased as "only these countries are allowed."

Implementation Considerations

  • Should not conflict with existing excludedCountries (decide priority if both are set).
    • Suggestion: If both are defined, throw an error or enforce a rule that only one can be active at a time.
  • Integrate seamlessly with the @selfxyz/core countries and countryCodes constants.
  • Maintain consistency with OFAC flagging (ofac: true).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions