> For the complete documentation index, see [llms.txt](https://docs.reveel.id/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.reveel.id/getting-started/reveel-payid-sdk.md). Agents can also search and read this documentation through its [MCP server](https://docs.reveel.id/~gitbook/mcp).

# Reveel PayID SDK

Human-readable payments for any wallet

{% embed url="<https://www.npmjs.com/package/@reveelid/sdk>" %}

### 💡 What is Reveel?

> 🔹 **Reveel is a PayID layer for crypto wallets**

Instead of sending funds to a long address like:

```
0x742d35Cc6634C0532...
```

Your users simply send to:

```
@aldo
```

➡️ We handle:

* PayID resolution
* Cross-chain routing
* Swap logic

➡️ Your wallet just **signs the transaction**

***

### 🔄 How It Works

```
User types "@aldo"
        ↓
SDK: initTransaction(...)
        ↓
Reveel backend resolves + routes + builds tx
        ↓
Returns unsigned transaction
        ↓
Wallet signs & submits ✅
```

> 📞 **Think of it like:**
>
> Reveel = phonebook + smart router
>
> Your wallet = the phone

***

### ⚡ Why Integrate?

| Feature         | ❌ Without Reveel   | ✅ With Reveel |
| --------------- | ------------------ | ------------- |
| Send flow       | Paste long address | Type `@aldo`  |
| Cross-chain     | Build yourself     | Automatic     |
| Recipient prefs | Not supported      | Auto-matched  |
| Private keys    | —                  | Never touched |
| Dependencies    | —                  | Zero          |

***

### 🧩 Integration Levels

\<details> \<summary>🟢 Level 1 — Resolve Only (5 min)\</summary>

Quick drop-in to resolve PayIDs:

```
import {createReveel }from"@reveelid/sdk";

constreveel=createReveel({ apiKey:"YOUR_API_KEY" });

const { address }=awaitreveel.resolve("@aldo");
```

➡️ Returns wallet address

\</details>

***

\<details> \<summary>🟡 Level 2 — Full Transaction Flow\</summary>

We build the full transaction for you:

```
constresult=awaitreveel.initTransaction({
  userId:"sender-uuid",
  recipientPayId:"@aldo",
  amount:50,
  token:"USDC",
  network:"BASE",
});

if (result.approveTx) {
awaitwallet.sendTransaction(result.approveTx);
}

consttxHash=awaitwallet.sendTransaction(result.tx);
```

\</details>

***

\<details> \<summary>🔵 Level 3 — User + PayID System\</summary>

Create users & assign PayIDs:

```
constuser=awaitreveel.createUser({
  <email:"user@yourwallet.com>",
  walletAddress:"0x...",
});

constclaim=awaitreveel.claimPayId(user.id,"aldo");
```

\</details>

***

\<details> \<summary>🟣 Level 4 — Smart Routing\</summary>

Define how users receive funds:

```
constroute=awaitreveel.createRoute({
  userId:"recipient-uuid",
  name:"USDC on Base",
  incomingNetworks: ["ETH","OP","BASE"],
  incomingTokens: ["USDC","USDT"],
  outgoingWallet:"0x...",
  swapNetwork:"BASE",
  swapToken:"USDC",
});
```

➡️ Automatically matches on send

\</details>

***

### 🌐 Supported Chains & Tokens

| Chain     | Tokens          |
| --------- | --------------- |
| Ethereum  | USDC, USDT, ETH |
| Base      | USDC, USDT, ETH |
| Polygon   | USDC, USDT, POL |
| Optimism  | USDC, USDT, ETH |
| BNB Chain | USDC, USDT, BNB |

***

### 📦 What `initTransaction` Returns

```
{
amount:50,
token:"USDC",
network:"BASE",
tx: {to,data,value,chainId },
approveTx: {to,data,chainId },
fees: {
applicationFee:null,
protocolFee:null,
bridgeFee:null
  }
}
```

> 🔐 You sign it — Reveel never touches private keys

***

### 🔒 Security & Architecture

* ✅ Zero dependencies
* ✅ Unsigned transactions only
* ✅ TypeScript-first
* ✅ Wallet-agnostic
* ✅ Retry + timeout built-in

***

### 🔍 Autocomplete Search

```
constresults=awaitreveel.searchPayId("ald","ALL");
```

➡️ Returns:

* PayID
* Wallet address
* Twitter handle

***

### ⚠️ Error Handling

```
try {
awaitreveel.resolve("@nonexistent");
}catch (err) {
if (err.code==="PAYID_NOT_FOUND") {
show("This PayID doesn't exist yet");
  }
}
```

***

### 🚀 Get Started

```
npm install @reveelid/sdk
```

📩 Contact: [**partner@reveel.id**](mailto:partner@reveel.id)

***

### 📚 Quick Reference

| Method              | Description     |
| ------------------- | --------------- |
| resolve             | PayID → address |
| searchPayId         | Search users    |
| createUser          | Create user     |
| claimPayId          | Claim PayID     |
| initTransaction     | Build tx        |
| reportTransaction   | Track tx        |
| getActivities       | History         |
| createRoute         | Setup route     |
| getRoutes           | List routes     |
| updateRoute         | Update route    |
| deleteRoute         | Delete route    |
| checkRouteConflicts | Validate routes |
