Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor #1

Merged
merged 9 commits into from
Feb 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
dist
81 changes: 81 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# XMTP Client package

Eliza's client packages enable integration with various platforms and services. Each client provides a standardized interface for sending and receiving messages, handling media, and interacting with platform-specific features.

## Architecture Overview

```mermaid
graph TD
RT["Agent Runtime"]
CI["Client Interface"]
RT --> CI

%% Main Clients
CI --> DC["Direct Client"]
CI --> DSC["Discord Client"]
CI --> TC["Telegram Client"]
CI --> TWC["Twitter Client"]
CI --> AC["Auto Client"]
CI --> XMTP["XMTP Client"]

%% Key Features - one per client for clarity
DC --> |"REST API"| DC1["Messages & Images"]
DSC --> |"Bot Integration"| DSC1["Voice & Messages"]
TC --> |"Bot API"| TC1["Commands & Media"]
TWC --> |"Social"| TWC1["Posts & Interactions"]
AC --> |"Trading"| AC1["Analysis & Execution"]
XMTP --> |"E2EE Messaging"| XMTP1["Secure messaging"]

%% Simple styling with better contrast and black text
classDef default fill:#f9f9f9,stroke:#333,stroke-width:1px,color:black
classDef highlight fill:#e9e9e9,stroke:#333,stroke-width:2px,color:black

class RT,CI highlight
```

## Available Client

- XMTP (@elizaos/client-xmtp) - XMTP agent integration

## Installation

```bash
# XMTP

pnpm add @elizaos/client-xmtp
```

## XMTP Client

The XMTP client enables secure, decentralized, and encrypted messaging.

### Basic Setup

```tsx
import { XmtpClientInterface } from "@elizaos/client-xmtp";

// Initialize the XMTP client
const client = await XmtpClientInterface.start(runtime);

// Configuration in .env
WALLET_KEY= // the private key of the wallet
ENCRYPTION_KEY= // a second random 32 bytes encryption key for local db encryption
```

For more information about XMTP visit it's [agent examples repo](https://github.com/ephemeraHQ/xmtp-agent-examples)

## Why XMTP

- **End-to-end & compliant**: Data is encrypted in transit and at rest, meeting strict security and regulatory standards.
- **Open-source & trustless**: Built on top of the [MLS](https://messaginglayersecurity.rocks/) protocol, it replaces trust in centralized certificate authorities with cryptographic proofs.
- **Privacy & metadata protection**: Offers anonymous or pseudonymous usage with no tracking of sender routes, IPs, or device and message timestamps.
- **Decentralized**: Operates on a peer-to-peer network, eliminating single points of failure.
- **Multi-tenant**: Allows multi-agent multi-human confidential communication over MLS group chats.

> See [FAQ](https://docs.xmtp.org/intro/faq) for more detailed information.

## Web inbox

Interact with the XMTP protocol using [xmtp.chat](https://xmtp.chat) the official web inbox for developers using the latest version powered by MLS.

![](/chat.png)
Binary file added chat.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 0 additions & 7 deletions dist/index.d.ts

This file was deleted.

171 changes: 0 additions & 171 deletions dist/index.js

This file was deleted.

1 change: 0 additions & 1 deletion dist/index.js.map

This file was deleted.

42 changes: 23 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
{
"name": "@elizaos-plugins/client-xmtp",
"version": "0.25.6-alpha.1",
"main": "dist/index.js",
"type": "module",
"types": "dist/index.d.ts",
"dependencies": {
"@xmtp/agent-starter": "^0.0.6"
},
"devDependencies": {
"tsup": "8.3.5"
},
"scripts": {
"build": "tsup --format esm --dts",
"dev": "tsup --format esm --dts --watch",
"lint": "eslint --fix --cache ."
},
"publishConfig": {
"access": "public"
}
"name": "@elizaos-plugins/client-xmtp",
"version": "0.25.6-alpha.1",
"main": "dist/index.js",
"type": "module",
"types": "dist/index.d.ts",
"dependencies": {
"@xmtp/node-sdk": "0.0.40",
"tsx": "^4.19.2",
"uint8arrays": "^5.1.0",
"viem": "^2.22.17"
},
"devDependencies": {
"tsup": "8.3.5",
"typescript": "^5.7.3"
},
"scripts": {
"build": "tsup --format esm --dts",
"dev": "tsup --format esm --dts --watch",
"lint": "eslint --fix --cache ."
},
"publishConfig": {
"access": "public"
}
}
Loading