@celo/compliance
TypeScript icon, indicating that this package has built-in type declarations

1.0.21 • Public • Published

OFAC Compliance

A simple package to help you stay compliant with OFAC sanctioned addresses (e.g. front-ends, other applicable products).

Purpose

This package simplifies the process of staying up-to-date with the latest OFAC sanctioned addresses by providing them in a JSON format via an API (recommended) or direct import (discouraged).

Update Cadence

[!IMPORTANT] Please note that there is currently no SLA for how quickly the repository will be updated to reflect the most recent OFAC sanctioned addresses. Updates will be done on a best-effort basis.

Usage

Option 1: Make an API call (recommended)

You can make an API call to retrieve the latest OFAC sanctions list from

https://celo-org.github.io/compliance/ofac.sanctions.json

For example:

export async function getSanctionedAddresses(): Promise<string[]> {
    return await fetch("https://celo-org.github.io/compliance/ofac.sanctions.json")
        .then((response) => {
            return response.json();
        })
        .catch((err) => {
            console.log(err);
        });
}

[!TIP] No changes to your code will be necessary when the list is updated as this API will always return the latest version.

Option 2: Import the SANCTIONED_ADDRESSES list (discouraged)

If you really want to, you can explicitly import the SANCTIONED_ADDRESSES list exported in the @celo/compliance package directly into your code.

[!WARNING] Although, please note that this is not recommended as it will require you to update your dependency every time the list is updated.

import { SANCTIONED_ADDRESSES } from "@celo/compliance";

export function getSanctionedAddresses(): string[] {
    return SANCTIONED_ADDRESSES;
}

Readme

Keywords

none

Package Sidebar

Install

npm i @celo/compliance

Weekly Downloads

95

Version

1.0.21

License

Apache-2.0

Unpacked Size

56.2 kB

Total Files

16

Last publish

Collaborators

  • app-tooling
  • pputman684
  • soloseng
  • aaron-clabs
  • nicolasbrugneaux
  • timmoreton
  • mcortesi
  • alecps