openclaw/extensions/xmtp/scripts/register-wallet.ts
HeresMyGit 9a831636a5 feat(xmtp): add Web3 messaging channel via XMTP protocol
Add new XMTP channel extension for decentralized messaging:
- Direct messages (DMs) and group conversations
- Text messages, reactions, and attachments
- ENS address resolution for human-readable names
- Quantum-resistant encryption (MLS protocol)
- Multi-account support with per-account configuration
- Database isolation and network selection (dev/production)
- Comprehensive onboarding with wallet generation

Includes wallet generation scripts, example configurations,
troubleshooting guide, and test coverage for schemas, ENS
resolution, multi-account handling, and onboarding flows.

Note: Tests use Node's test runner format (node:test) and
should be converted to Vitest format in follow-up work.
2026-01-26 21:18:10 -08:00

28 lines
807 B
TypeScript

import { Agent } from "@xmtp/agent-sdk";
import { createSigner, createUser } from "@xmtp/agent-sdk/user";
async function main() {
const walletKey = "0xef0760e5f534adb201b9c2d4140b130d5fbc870d2b3513df5442c999d3e58b54";
const user = createUser(walletKey);
const signer = createSigner(user);
console.log("Creating XMTP agent and registering on network...");
const agent = await Agent.create(signer, {
env: "dev",
dbPath: null, // in-memory for testing
});
console.log("✅ Agent created! Address:", agent.address);
console.log("✅ Wallet is now registered on XMTP dev network");
console.log("");
console.log("The bot is now ready to receive messages!");
await agent.stop();
process.exit(0);
}
main().catch((err) => {
console.error("Error:", err);
process.exit(1);
});