> 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).

# 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 |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.reveel.id/getting-started/reveel-payid-sdk.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
