Deploy multi-chain AI agents in 5 lines of code
Official Python client for Valence API
pip install valence-sdk
from valence import Valence
# Initialize client
client = Valence(api_key="vln_live_...")
# Deploy an agent
agent = client.agents.create(
name="My Trading Bot",
operation_type="monitor",
chain_ids=[1, 3] # Ethereum + Arbitrum
)
print(f"Agent {agent['name']} deployed!")
Official Node.js client for Valence API
npm install valence-sdk
# or
yarn add valence-sdk
import { Valence } from 'valence-sdk';
// Initialize client
const client = new Valence({ apiKey: 'vln_live_...' });
// Deploy an agent
const agent = await client.agents.create({
name: 'My Trading Bot',
operationType: 'monitor',
chainIds: [1, 3] // Ethereum + Arbitrum
});
console.log(`Agent ${agent.name} deployed!`);
import { Valence, Agent, Event } from 'valence-sdk';
const client = new Valence({ apiKey: 'vln_live_xxx' });
const agents: Agent[] = await client.agents.list();
agent = client.agents.create(
name="DEX Monitor",
operation_type="monitor",
chain_ids=[1, 3, 4],
description="Monitors DEX trades"
)
print(f"Agent ID: {agent['id']}")
const agent = await client.agents.create({
name: 'DEX Monitor',
operationType: 'monitor',
chainIds: [1, 3, 4],
description: 'Monitors DEX trades'
});
console.log(`Agent ID: ${agent.id}`);
webhook = client.webhooks.create(
url="https://myapp.com/webhooks",
events=["agent.created", "event.created"]
)
secret = webhook['secret']
const webhook = await client.webhooks.create({
url: 'https://myapp.com/webhooks',
events: ['agent.created', 'event.created']
});
const secret = webhook.secret;
meta_agent = client.meta_agents.create(
name="Coordinator",
strategy={
"type": "load_balanced",
"decision_criteria": "latency"
},
chains=[1, 3, 4, 5]
)
const metaAgent = await client.metaAgents.create({
name: 'Coordinator',
strategy: {
type: 'load_balanced',
decisionCriteria: 'latency'
},
chains: [1, 3, 4, 5]
});
workflow = client.workflows.create(
name="Cross-chain swap",
trigger_type="manual",
steps=[
{
"step_order": 1,
"step_type": "monitor",
"agent_id": 42,
"chain_id": 1
}
]
)
const workflow = await client.workflows.create({
name: 'Cross-chain swap',
triggerType: 'manual',
steps: [
{
stepOrder: 1,
stepType: 'monitor',
agentId: 42,
chainId: 1
}
]
});
wallets = client.wallets.get_agent_wallets(
agent_id=42
)
for wallet in wallets['wallets']:
print(f"{wallet['chain']}: {wallet['address']}")
const result = await client.wallets.getAgentWallets(42);
result.wallets.forEach(wallet => {
console.log(`${wallet.chain}: ${wallet.address}`);
});