# Integration pathways

There are three main ways to integrate HAPI Protocol into your solution:

* On-chain calls
* Blockchain RPC
* REST API

### On-chain integration <a href="#on-chain-integration" id="on-chain-integration"></a>

This integration means your solution requests data from HAPI Protocol on-chain. Currently we support the following blockchains:

* [Solana](accessing-solana-contract-via-javascript)
* [NEAR](hapi-integration-on-near)

You can query the contract for an address and if the address is present in HAPI database, you’ll receive a category and risk score that you can use to make an informed decision about a transaction or just show it on the interface to notify the solution user about the risks.

**Pros:**

* Real time access to HAPI database
* Can be integrated into a smart contract directly

**Cons:**

* May require additional setup
* Some metadata may be unavailable

## Blockchain RPC

You can call HAPI contract methods via blockchain RPC if you're operating in an off-chain (ex: application frontend or backend) environment, but don't want to rely on third parties for data querying.

**Pros:**

* Real time access to HAPI database
* Existing channels of communication with public blockchain APIs can be reused

**Cons:**

* Public blockchain RPCs can have severe rate limiting
* In some cases client libraries are needed that are only available in Javascript and Rust
* Can only retrieve data for blockchains that have HAPI contracts on them

### Off-chain/API integration <a href="#off-chain-api-integration" id="off-chain-api-integration"></a>

This integration means your solution connects to HAPI API servers through a standardized REST API interface. All blockchains that HAPI Protocol supports work with this method, including the ones that don’t work with smart contracts (i.e. Bitcoin).

**Pros:**

* Industry-standard OpenAPI/Swagger interface
* Access to data from all blockchains
* Additional metadata

**Cons:**

* Can lag behind the HAPI database for a few seconds due to indexing
* Can’t be used by smart contracts
* Rate limiting will be introduced in future

### Integration scenarios <a href="#integration-scenarios" id="integration-scenarios"></a>

#### Centralized exchanges (CEX) <a href="#centralized-exchanges-cex" id="centralized-exchanges-cex"></a>

CEXes can use both integration pathways and use the collected data to check the incoming and outgoing transaction for illicit activity. Illegal incoming funds can be locked for return to their rightful owners in future or bounced back to avoid money loundering. Withdrawal to bad actors can be flagged or prevented alltogether.

CEXes can also contribute their data about illicit activities they have detected to notify other HAPI Protocol users about their stolen funds.

#### Decentralized exchanges (DEX) <a href="#decentralized-exchanges-dex" id="decentralized-exchanges-dex"></a>

DEXes can incorporate address checking into their business logic to prevent mixing of illicit money with their legit liquidity pools based on established risk thresholds.

#### Wallets <a href="#wallets" id="wallets"></a>

Crypto wallets can use HAPI Protocol to notify their users of suspicious addresses to prevent them from participating in known scam schemes and phishing campaigns when the users are prompted to interact with a smart contract or to connect to a Web3 app.

Wallet users also can be informed about potential risks about using tokens and coins from illicit addresses.
