@exagent/agent 0.1.27 → 0.1.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -237,7 +237,7 @@ var MarketDataService = class {
237
237
  constructor(rpcUrl) {
238
238
  this.rpcUrl = rpcUrl;
239
239
  this.client = (0, import_viem.createPublicClient)({
240
- transport: (0, import_viem.http)(rpcUrl)
240
+ transport: (0, import_viem.http)(rpcUrl, { timeout: 6e4 })
241
241
  });
242
242
  }
243
243
  /** Cached volume data */
@@ -1661,7 +1661,7 @@ function validateConfig(config) {
1661
1661
  throw new Error("Valid agent ID required");
1662
1662
  }
1663
1663
  }
1664
- var DEFAULT_RPC_URL = "https://base-rpc.publicnode.com";
1664
+ var DEFAULT_RPC_URL = "https://mainnet.base.org";
1665
1665
  function getRpcUrl() {
1666
1666
  return process.env.BASE_RPC_URL || process.env.EXAGENT_RPC_URL || DEFAULT_RPC_URL;
1667
1667
  }
@@ -2198,14 +2198,15 @@ var VaultManager = class {
2198
2198
  this.account = (0, import_accounts.privateKeyToAccount)(config.walletKey);
2199
2199
  this.chain = import_chains.base;
2200
2200
  const rpcUrl = getRpcUrl();
2201
+ const transport = (0, import_viem2.http)(rpcUrl, { timeout: 6e4 });
2201
2202
  this.publicClient = (0, import_viem2.createPublicClient)({
2202
2203
  chain: this.chain,
2203
- transport: (0, import_viem2.http)(rpcUrl)
2204
+ transport
2204
2205
  });
2205
2206
  this.walletClient = (0, import_viem2.createWalletClient)({
2206
2207
  account: this.account,
2207
2208
  chain: this.chain,
2208
- transport: (0, import_viem2.http)(rpcUrl)
2209
+ transport
2209
2210
  });
2210
2211
  if (this.addresses.vaultFactory === "0x0000000000000000000000000000000000000000") {
2211
2212
  console.warn("VaultFactory address is zero \u2014 vault operations will be disabled");
@@ -3307,7 +3308,7 @@ var PerpTradeRecorder = class {
3307
3308
  this.configHash = opts.configHash;
3308
3309
  this.account = (0, import_accounts2.privateKeyToAccount)(opts.privateKey);
3309
3310
  const rpcUrl = opts.rpcUrl || "https://mainnet.base.org";
3310
- const transport = (0, import_viem4.http)(rpcUrl);
3311
+ const transport = (0, import_viem4.http)(rpcUrl, { timeout: 6e4 });
3311
3312
  this.publicClient = (0, import_viem4.createPublicClient)({
3312
3313
  chain: import_chains2.base,
3313
3314
  transport
@@ -3825,7 +3826,7 @@ function loadSecureEnv(basePath, passphrase) {
3825
3826
  }
3826
3827
 
3827
3828
  // src/index.ts
3828
- var AGENT_VERSION = "0.1.27";
3829
+ var AGENT_VERSION = "0.1.29";
3829
3830
 
3830
3831
  // src/relay.ts
3831
3832
  var RelayClient = class {
@@ -4276,7 +4277,7 @@ var AgentRuntime = class {
4276
4277
  const account = (0, import_accounts5.privateKeyToAccount)(perpKey);
4277
4278
  const walletClient = (0, import_viem6.createWalletClient)({
4278
4279
  chain: { id: 42161, name: "Arbitrum", nativeCurrency: { name: "ETH", symbol: "ETH", decimals: 18 }, rpcUrls: { default: { http: ["https://arb1.arbitrum.io/rpc"] } } },
4279
- transport: (0, import_viem6.http)("https://arb1.arbitrum.io/rpc"),
4280
+ transport: (0, import_viem6.http)("https://arb1.arbitrum.io/rpc", { timeout: 6e4 }),
4280
4281
  account
4281
4282
  });
4282
4283
  this.perpSigner = new HyperliquidSigner(walletClient);
@@ -4514,7 +4515,7 @@ var AgentRuntime = class {
4514
4515
  const ccUrl = `https://exagent.io/agents/${encodeURIComponent(this.config.name)}/command-center`;
4515
4516
  const publicClientInstance = (0, import_viem6.createPublicClient)({
4516
4517
  chain: import_chains4.base,
4517
- transport: (0, import_viem6.http)(this.getRpcUrl())
4518
+ transport: (0, import_viem6.http)(this.getRpcUrl(), { timeout: 6e4 })
4518
4519
  });
4519
4520
  console.log("");
4520
4521
  console.log("=== ETH NEEDED FOR GAS ===");
@@ -5558,6 +5559,33 @@ async function checkFirstRunSetup(configPath) {
5558
5559
  llmEnvVar = `${provider.envVar}=${llmApiKey}
5559
5560
  `;
5560
5561
  }
5562
+ console.log("");
5563
+ console.log("[RPC] Base network RPC endpoint.");
5564
+ console.log("");
5565
+ console.log(" Your agent sends transactions through an RPC provider.");
5566
+ console.log(" The default (mainnet.base.org) works but has rate limits.");
5567
+ console.log(" A dedicated RPC gives faster transactions and fewer timeouts.");
5568
+ console.log("");
5569
+ console.log(" Free RPC providers:");
5570
+ console.log(" dRPC https://drpc.org (10.5M req/month free)");
5571
+ console.log(" Alchemy https://alchemy.com (30M compute units free)");
5572
+ console.log(" Infura https://infura.io (100K req/day free)");
5573
+ console.log(" Ankr https://ankr.com (generous free tier)");
5574
+ console.log("");
5575
+ console.log(" Sign up, create a Base mainnet endpoint, and paste the URL.");
5576
+ console.log("");
5577
+ const rpcUrl = await prompt(" RPC URL (or Enter for default): ");
5578
+ let rpcEnvVar = "";
5579
+ if (rpcUrl && rpcUrl.trim()) {
5580
+ rpcEnvVar = `BASE_RPC_URL=${rpcUrl.trim()}
5581
+ `;
5582
+ console.log("");
5583
+ console.log(` Using custom RPC: ${rpcUrl.trim()}`);
5584
+ } else {
5585
+ console.log("");
5586
+ console.log(" Using default: https://mainnet.base.org");
5587
+ console.log(" You can change this later by adding BASE_RPC_URL to your .env");
5588
+ }
5561
5589
  const envContent = `# Exagent Agent Configuration
5562
5590
  # Agent: ${config.name}
5563
5591
  # Agent ID: ${config.agentId}
@@ -5569,7 +5597,7 @@ EXAGENT_PRIVATE_KEY=${privateKey}
5569
5597
 
5570
5598
  # Network
5571
5599
  EXAGENT_NETWORK=${config.network || "mainnet"}
5572
-
5600
+ ${rpcEnvVar}
5573
5601
  # LLM (${llmProvider})
5574
5602
  ${llmEnvVar}EXAGENT_LLM_MODEL=${config.llm?.model || ""}
5575
5603
  `;
package/dist/cli.mjs CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  loadConfig,
7
7
  loadSecureEnv,
8
8
  validateConfig
9
- } from "./chunk-L67V7YG6.mjs";
9
+ } from "./chunk-AEPTFRZ4.mjs";
10
10
 
11
11
  // src/cli.ts
12
12
  import { Command } from "commander";
@@ -206,6 +206,33 @@ async function checkFirstRunSetup(configPath) {
206
206
  llmEnvVar = `${provider.envVar}=${llmApiKey}
207
207
  `;
208
208
  }
209
+ console.log("");
210
+ console.log("[RPC] Base network RPC endpoint.");
211
+ console.log("");
212
+ console.log(" Your agent sends transactions through an RPC provider.");
213
+ console.log(" The default (mainnet.base.org) works but has rate limits.");
214
+ console.log(" A dedicated RPC gives faster transactions and fewer timeouts.");
215
+ console.log("");
216
+ console.log(" Free RPC providers:");
217
+ console.log(" dRPC https://drpc.org (10.5M req/month free)");
218
+ console.log(" Alchemy https://alchemy.com (30M compute units free)");
219
+ console.log(" Infura https://infura.io (100K req/day free)");
220
+ console.log(" Ankr https://ankr.com (generous free tier)");
221
+ console.log("");
222
+ console.log(" Sign up, create a Base mainnet endpoint, and paste the URL.");
223
+ console.log("");
224
+ const rpcUrl = await prompt(" RPC URL (or Enter for default): ");
225
+ let rpcEnvVar = "";
226
+ if (rpcUrl && rpcUrl.trim()) {
227
+ rpcEnvVar = `BASE_RPC_URL=${rpcUrl.trim()}
228
+ `;
229
+ console.log("");
230
+ console.log(` Using custom RPC: ${rpcUrl.trim()}`);
231
+ } else {
232
+ console.log("");
233
+ console.log(" Using default: https://mainnet.base.org");
234
+ console.log(" You can change this later by adding BASE_RPC_URL to your .env");
235
+ }
209
236
  const envContent = `# Exagent Agent Configuration
210
237
  # Agent: ${config.name}
211
238
  # Agent ID: ${config.agentId}
@@ -217,7 +244,7 @@ EXAGENT_PRIVATE_KEY=${privateKey}
217
244
 
218
245
  # Network
219
246
  EXAGENT_NETWORK=${config.network || "mainnet"}
220
-
247
+ ${rpcEnvVar}
221
248
  # LLM (${llmProvider})
222
249
  ${llmEnvVar}EXAGENT_LLM_MODEL=${config.llm?.model || ""}
223
250
  `;
package/dist/index.d.mts CHANGED
@@ -2107,6 +2107,6 @@ declare function decryptEnvFile(encPath: string, passphrase: string): Record<str
2107
2107
  declare function loadSecureEnv(basePath: string, passphrase?: string): boolean;
2108
2108
 
2109
2109
  /** @exagent/agent package version — update alongside package.json */
2110
- declare const AGENT_VERSION = "0.1.27";
2110
+ declare const AGENT_VERSION = "0.1.29";
2111
2111
 
2112
2112
  export { AGENT_VERSION, type AccountSummary, type AgentConfig, AgentConfigSchema, type AgentMode, AgentRuntime, type AgentStatusPayload, AnthropicAdapter, BaseLLMAdapter, type CommandType, DeepSeekAdapter, FileStore, type FillCallback, type FundingCallback, type FundingPayment, GoogleAdapter, GroqAdapter, HYPERLIQUID_DOMAIN, HyperliquidClient, HyperliquidSigner, HyperliquidWebSocket, type LLMAdapter, type LLMConfig, LLMConfigSchema, type LLMMessage, type LLMMetadata, type LLMProvider, LLMProviderSchema, type LLMResponse, type LiquidationCallback, type MarketData, MarketDataService, type MessageLevel, type MessageType, MistralAdapter, OllamaAdapter, type OnboardingStatus, OpenAIAdapter, OrderManager, type OrderResult, type PerpAction, type PerpConfig$1 as PerpConfig, PerpConfigSchema, type PerpFill, type PerpMarketData, PerpOnboarding, type PerpPosition, type PerpStrategyFunction, PerpTradeRecorder, type PerpTradeSignal, type PerpConfig as PerpTradingConfig, PositionManager, type PositionSummary, PositionTracker, type RecordPerpTradeParams, RelayClient, type RelayCommand, type RelayConfig$1 as RelayConfig, RelayConfigSchema, RiskManager, type RiskState, type RiskUniverse, RiskUniverseSchema, type RuntimeConfig, STRATEGY_TEMPLATES, type StrategyContext, type StrategyFunction, type StrategyStore, type StrategyTemplate, TogetherAdapter, type TrackedPosition, TradeExecutor, type TradeRecord, type TradeSignal, type TradingConfig, TradingConfigSchema, type VaultConfig, VaultConfigSchema, VaultManager, type VaultManagerConfig, type VaultPolicy, VaultPolicySchema, type VaultStatus, createLLMAdapter, createSampleConfig, decryptEnvFile, encryptEnvFile, fillHashToBytes32, fillOidToBytes32, getAllStrategyTemplates, getNextNonce, getStrategyTemplate, loadConfig, loadSecureEnv, loadStrategy, validateConfig, validateStrategy };
package/dist/index.d.ts CHANGED
@@ -2107,6 +2107,6 @@ declare function decryptEnvFile(encPath: string, passphrase: string): Record<str
2107
2107
  declare function loadSecureEnv(basePath: string, passphrase?: string): boolean;
2108
2108
 
2109
2109
  /** @exagent/agent package version — update alongside package.json */
2110
- declare const AGENT_VERSION = "0.1.27";
2110
+ declare const AGENT_VERSION = "0.1.29";
2111
2111
 
2112
2112
  export { AGENT_VERSION, type AccountSummary, type AgentConfig, AgentConfigSchema, type AgentMode, AgentRuntime, type AgentStatusPayload, AnthropicAdapter, BaseLLMAdapter, type CommandType, DeepSeekAdapter, FileStore, type FillCallback, type FundingCallback, type FundingPayment, GoogleAdapter, GroqAdapter, HYPERLIQUID_DOMAIN, HyperliquidClient, HyperliquidSigner, HyperliquidWebSocket, type LLMAdapter, type LLMConfig, LLMConfigSchema, type LLMMessage, type LLMMetadata, type LLMProvider, LLMProviderSchema, type LLMResponse, type LiquidationCallback, type MarketData, MarketDataService, type MessageLevel, type MessageType, MistralAdapter, OllamaAdapter, type OnboardingStatus, OpenAIAdapter, OrderManager, type OrderResult, type PerpAction, type PerpConfig$1 as PerpConfig, PerpConfigSchema, type PerpFill, type PerpMarketData, PerpOnboarding, type PerpPosition, type PerpStrategyFunction, PerpTradeRecorder, type PerpTradeSignal, type PerpConfig as PerpTradingConfig, PositionManager, type PositionSummary, PositionTracker, type RecordPerpTradeParams, RelayClient, type RelayCommand, type RelayConfig$1 as RelayConfig, RelayConfigSchema, RiskManager, type RiskState, type RiskUniverse, RiskUniverseSchema, type RuntimeConfig, STRATEGY_TEMPLATES, type StrategyContext, type StrategyFunction, type StrategyStore, type StrategyTemplate, TogetherAdapter, type TrackedPosition, TradeExecutor, type TradeRecord, type TradeSignal, type TradingConfig, TradingConfigSchema, type VaultConfig, VaultConfigSchema, VaultManager, type VaultManagerConfig, type VaultPolicy, VaultPolicySchema, type VaultStatus, createLLMAdapter, createSampleConfig, decryptEnvFile, encryptEnvFile, fillHashToBytes32, fillOidToBytes32, getAllStrategyTemplates, getNextNonce, getStrategyTemplate, loadConfig, loadSecureEnv, loadStrategy, validateConfig, validateStrategy };
package/dist/index.js CHANGED
@@ -290,7 +290,7 @@ var MarketDataService = class {
290
290
  constructor(rpcUrl) {
291
291
  this.rpcUrl = rpcUrl;
292
292
  this.client = (0, import_viem.createPublicClient)({
293
- transport: (0, import_viem.http)(rpcUrl)
293
+ transport: (0, import_viem.http)(rpcUrl, { timeout: 6e4 })
294
294
  });
295
295
  }
296
296
  /** Cached volume data */
@@ -1720,7 +1720,7 @@ function validateConfig(config) {
1720
1720
  throw new Error("Valid agent ID required");
1721
1721
  }
1722
1722
  }
1723
- var DEFAULT_RPC_URL = "https://base-rpc.publicnode.com";
1723
+ var DEFAULT_RPC_URL = "https://mainnet.base.org";
1724
1724
  function getRpcUrl() {
1725
1725
  return process.env.BASE_RPC_URL || process.env.EXAGENT_RPC_URL || DEFAULT_RPC_URL;
1726
1726
  }
@@ -2286,14 +2286,15 @@ var VaultManager = class {
2286
2286
  this.account = (0, import_accounts.privateKeyToAccount)(config.walletKey);
2287
2287
  this.chain = import_chains.base;
2288
2288
  const rpcUrl = getRpcUrl();
2289
+ const transport = (0, import_viem2.http)(rpcUrl, { timeout: 6e4 });
2289
2290
  this.publicClient = (0, import_viem2.createPublicClient)({
2290
2291
  chain: this.chain,
2291
- transport: (0, import_viem2.http)(rpcUrl)
2292
+ transport
2292
2293
  });
2293
2294
  this.walletClient = (0, import_viem2.createWalletClient)({
2294
2295
  account: this.account,
2295
2296
  chain: this.chain,
2296
- transport: (0, import_viem2.http)(rpcUrl)
2297
+ transport
2297
2298
  });
2298
2299
  if (this.addresses.vaultFactory === "0x0000000000000000000000000000000000000000") {
2299
2300
  console.warn("VaultFactory address is zero \u2014 vault operations will be disabled");
@@ -3660,7 +3661,7 @@ var PerpTradeRecorder = class {
3660
3661
  this.configHash = opts.configHash;
3661
3662
  this.account = (0, import_accounts3.privateKeyToAccount)(opts.privateKey);
3662
3663
  const rpcUrl = opts.rpcUrl || "https://mainnet.base.org";
3663
- const transport = (0, import_viem4.http)(rpcUrl);
3664
+ const transport = (0, import_viem4.http)(rpcUrl, { timeout: 6e4 });
3664
3665
  this.publicClient = (0, import_viem4.createPublicClient)({
3665
3666
  chain: import_chains2.base,
3666
3667
  transport
@@ -4178,7 +4179,7 @@ var AgentRuntime = class {
4178
4179
  const account = (0, import_accounts5.privateKeyToAccount)(perpKey);
4179
4180
  const walletClient = (0, import_viem6.createWalletClient)({
4180
4181
  chain: { id: 42161, name: "Arbitrum", nativeCurrency: { name: "ETH", symbol: "ETH", decimals: 18 }, rpcUrls: { default: { http: ["https://arb1.arbitrum.io/rpc"] } } },
4181
- transport: (0, import_viem6.http)("https://arb1.arbitrum.io/rpc"),
4182
+ transport: (0, import_viem6.http)("https://arb1.arbitrum.io/rpc", { timeout: 6e4 }),
4182
4183
  account
4183
4184
  });
4184
4185
  this.perpSigner = new HyperliquidSigner(walletClient);
@@ -4416,7 +4417,7 @@ var AgentRuntime = class {
4416
4417
  const ccUrl = `https://exagent.io/agents/${encodeURIComponent(this.config.name)}/command-center`;
4417
4418
  const publicClientInstance = (0, import_viem6.createPublicClient)({
4418
4419
  chain: import_chains4.base,
4419
- transport: (0, import_viem6.http)(this.getRpcUrl())
4420
+ transport: (0, import_viem6.http)(this.getRpcUrl(), { timeout: 6e4 })
4420
4421
  });
4421
4422
  console.log("");
4422
4423
  console.log("=== ETH NEEDED FOR GAS ===");
@@ -5452,7 +5453,7 @@ function loadSecureEnv(basePath, passphrase) {
5452
5453
  }
5453
5454
 
5454
5455
  // src/index.ts
5455
- var AGENT_VERSION = "0.1.27";
5456
+ var AGENT_VERSION = "0.1.29";
5456
5457
  // Annotate the CommonJS export names for ESM import in node:
5457
5458
  0 && (module.exports = {
5458
5459
  AGENT_VERSION,
package/dist/index.mjs CHANGED
@@ -49,7 +49,7 @@ import {
49
49
  loadStrategy,
50
50
  validateConfig,
51
51
  validateStrategy
52
- } from "./chunk-L67V7YG6.mjs";
52
+ } from "./chunk-AEPTFRZ4.mjs";
53
53
  export {
54
54
  AGENT_VERSION,
55
55
  AgentConfigSchema,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exagent/agent",
3
- "version": "0.1.27",
3
+ "version": "0.1.29",
4
4
  "description": "Autonomous trading agent runtime for Exagent",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -29,7 +29,7 @@
29
29
  "clean": "rm -rf dist"
30
30
  },
31
31
  "dependencies": {
32
- "@exagent/sdk": "^0.1.13",
32
+ "@exagent/sdk": "^0.1.14",
33
33
  "@nktkas/hyperliquid": "^0.31.0",
34
34
  "chalk": "^5.3.0",
35
35
  "commander": "^12.0.0",
@@ -20,6 +20,17 @@ EXAGENT_PRIVATE_KEY=
20
20
  # Base mainnet
21
21
  EXAGENT_NETWORK=mainnet
22
22
 
23
+ # ============================================
24
+ # RPC Provider (recommended)
25
+ # ============================================
26
+ # Default: https://mainnet.base.org (Coinbase official, rate-limited)
27
+ # For better performance, use a dedicated RPC provider:
28
+ # dRPC: https://drpc.org (10.5M req/month free)
29
+ # Alchemy: https://alchemy.com (30M compute units free)
30
+ # Infura: https://infura.io (100K req/day free)
31
+ # Ankr: https://ankr.com (generous free tier)
32
+ # BASE_RPC_URL=https://lb.drpc.org/ogrpc?network=base&dkey=YOUR_KEY
33
+
23
34
  # ============================================
24
35
  # LLM API Keys (choose one based on your config)
25
36
  # ============================================