openclaw-pribado
v1.2.1
Published
Privacy-first DeFi vault and session management skill for OpenClaw. Oasis Sapphire TEE sessions + multi-chain vault swaps.
Downloads
516
Maintainers
Readme
🔐 openclaw-pribado
Privacy-first DeFi vault & session management skill for OpenClaw AI agents. Powered by Oasis Sapphire TEE.
Your users connect MetaMask once. Your bot executes swaps through their private vault. No private keys ever leave MetaMask. Gas is sponsored — users pay nothing.
Install
npm install openclaw-pribadoThe Flow
npm install openclaw-pribado
│
▼
1. Initiate Session
POST /api/session/initiate
→ Returns auth URL
→ Send to user on Telegram
│
▼
2. User Clicks Auth Link
→ MetaMask popup
→ Session created in Sapphire TEE
→ Gas sponsored by master wallet ✨
│
▼
3. Deploy Vault
POST /api/vault/deploy
→ Vault deployed on Sepolia/Base/Polygon
→ Gas sponsored by bot wallet ✨
│
▼
4. Execute Swaps
POST /api/session/execute-swap
→ Swap via Uniswap V3
→ Through user's private vault
→ User's key never exposedQuick Start (3 Commands)
# Server defaults to https://pribado.dev — override with:
# export PRIBADO_SERVER=https://your-own-server.com
# 1. Create session → user clicks the auth link
npx pribado-initiate 521774918 lobstermixerbot
# 2. Deploy vault on Sepolia (gas sponsored!)
npx pribado-deploy-vault <request_id> sepolia
# 3. Swap 0.001 ETH → USDC
npx pribado-swap <request_id> sepolia 0xfFf9976782d46CC05630D1f6eBAb18b2324d6B14 0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238 0.001That's it. No hardhat, no Solidity, no gas tokens needed.
JavaScript SDK
const pribado = require('openclaw-pribado');
// All endpoint definitions
console.log(pribado.endpoints);
// {
// initiate: { method: 'POST', path: '/api/session/initiate', ... },
// status: { method: 'GET', path: '/api/session/status', ... },
// deployVault: { method: 'POST', path: '/api/vault/deploy', ... },
// executeSwap: { method: 'POST', path: '/api/session/execute-swap', ... },
// }
// Supported chains
console.log(pribado.chains);
// { sepolia, base_sepolia, polygon_amoy, bsc_testnet }
// Contract addresses
console.log(pribado.contracts);
// { factory: '0xfee8...', vault_example: '0x19eB...' }Integration Example (Telegram Bot)
const pribado = require('openclaw-pribado');
const SERVER = 'https://your-server.com';
// /connect command
async function handleConnect(userId, botUsername) {
const res = await fetch(`${SERVER}${pribado.endpoints.initiate.path}`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ telegramUserId: userId, botUsername }),
});
const { authUrl, requestId } = await res.json();
// Send authUrl to user → they click → MetaMask → done
return { authUrl, requestId };
}
// /vault command
async function handleDeployVault(requestId, chain) {
const res = await fetch(`${SERVER}${pribado.endpoints.deployVault.path}`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ requestId, chain }),
});
const { vault } = await res.json();
// vault.address = '0x...'
// vault.explorer = 'https://sepolia.etherscan.io/address/0x...'
return vault;
}
// /swap command
async function handleSwap(requestId, chain, tokenIn, tokenOut, amount) {
const res = await fetch(`${SERVER}${pribado.endpoints.executeSwap.path}`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ requestId, chain, mode: 'vault', tokenIn, tokenOut, amountIn: amount }),
});
const { txHash, explorer } = await res.json();
return { txHash, explorer };
}API Reference
| Method | Endpoint | Description | Gas |
|--------|----------|-------------|-----|
| POST | /api/session/initiate | Generate auth link | Sponsored ✨ |
| GET | /api/session/status?id=UUID | Poll: pending → confirmed | Free |
| POST | /api/vault/deploy | Deploy vault on L2 | Sponsored ✨ |
| POST | /api/session/execute-swap | Swap through vault | Sponsored ✨ |
Supported Chains
| Chain | ChainID | DEX | Status | |-------|---------|-----|--------| | Ethereum Sepolia | 11155111 | Uniswap V3 | ✅ Live | | Base Sepolia | 84532 | Uniswap V3 | ✅ Live | | Polygon Amoy | 80002 | Uniswap V3 | ✅ Live | | BSC Testnet | 97 | PancakeSwap V3 | ✅ Live |
Contracts (Verified on Sourcify)
| Contract | Chain | Address |
|----------|-------|---------|
| OpenClawFactory | Sapphire Testnet | 0xfee8486F... |
| OpenClawSession | Sapphire Testnet | Per-user (deployed by factory) |
| OpenClawVault | Any L2 | Per-user (deployed by server) |
Security
| Feature | Detail | |---------|--------| | 🔒 Private Keys | Never leave MetaMask | | 🛡️ Session Keys | Encrypted inside Oasis Sapphire TEE | | 🤖 Bot Wallet | Separate dedicated key (not user's) | | ⚡ Revocation | Users revoke access instantly on-chain | | 💰 Withdrawals | Only vault owner (user) can withdraw |
Links
License
MIT
