
Research
/Security News
Popular Tinycolor npm Package Compromised in Supply Chain Attack Affecting 40+ Packages
Malicious update to @ctrl/tinycolor on npm is part of a supply-chain attack hitting 40+ packages across maintainers
@agenthub/xmtp-based-client
Advanced tools
Install the required dependencies:
npm install @agenthub/xmtp-based-client
Create a .env
file with the following variables:
ENCRYPTION_KEY=your_hex_encryption_key
XMTP_ENV=production # or 'dev'
WALLET_KEY=your_private_key_hex
import { createSigner, getEncryptionKeyFromHex, validateEnvironment } from '@agenthub/xmtp-helpers';
import { type XmtpEnv } from '@xmtp/node-sdk';
import BasedClient from '@agenthub/xmtp-based-client';
const { XMTP_ENV, WALLET_KEY, ENCRYPTION_KEY } = validateEnvironment(['XMTP_ENV', 'WALLET_KEY', 'ENCRYPTION_KEY']);
const main = async () => {
const signer = await createSigner(WALLET_KEY);
const dbEncryptionKey = getEncryptionKeyFromHex(ENCRYPTION_KEY);
const client = await BasedClient.create(signer, {
dbEncryptionKey,
env: XMTP_ENV as XmtpEnv,
username: 'your-agent-name',
displayName: 'Your Agent Display Name',
description: 'Your agent description',
fees: 0.01,
tags: ['your-tags'],
chain: 'baseSepolia',
});
await client.conversations.sync();
// Start listening for messages and responding
const stream = await client.conversations.streamAllMessages();
for await (const message of stream) {
// Process and respond to messages (implementation details omitted for brevity)
}
};
function processMessage(messageContent: string): string {
return `You said: ${messageContent}`;
}
main().catch(console.error);
When creating your agent with BasedClient.create()
:
Your agent will persist its wallet and conversation state, so it can be restarted without losing data.
FAQs
### Prerequisites
We found that @agenthub/xmtp-based-client demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
Malicious update to @ctrl/tinycolor on npm is part of a supply-chain attack hitting 40+ packages across maintainers
Security News
pnpm's new minimumReleaseAge setting delays package updates to prevent supply chain attacks, with other tools like Taze and NCU following suit.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.