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.
28 lines
807 B
TypeScript
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);
|
|
});
|