@exagent/agent 0.1.35 → 0.1.36

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
@@ -33,11 +33,12 @@ var path2 = __toESM(require("path"));
33
33
  // src/runtime.ts
34
34
  var import_sdk = require("@exagent/sdk");
35
35
  var import_viem7 = require("viem");
36
- var import_chains4 = require("viem/chains");
36
+ var import_chains5 = require("viem/chains");
37
37
  var import_accounts5 = require("viem/accounts");
38
38
 
39
39
  // src/trading/market.ts
40
40
  var import_viem2 = require("viem");
41
+ var import_chains = require("viem/chains");
41
42
 
42
43
  // src/trading/token-resolver.ts
43
44
  var import_viem = require("viem");
@@ -508,6 +509,7 @@ var MarketDataService = class {
508
509
  constructor(rpcUrl, store) {
509
510
  this.rpcUrl = rpcUrl;
510
511
  this.client = (0, import_viem2.createPublicClient)({
512
+ chain: import_chains.base,
511
513
  transport: (0, import_viem2.http)(rpcUrl, { timeout: 6e4 })
512
514
  });
513
515
  this.resolver = new TokenResolver(this.client, store);
@@ -705,7 +707,7 @@ var MarketDataService = class {
705
707
  try {
706
708
  const results = await this.client.multicall({
707
709
  contracts: batch.map((addr) => ({
708
- address: addr,
710
+ address: addr.toLowerCase(),
709
711
  abi: import_viem2.erc20Abi,
710
712
  functionName: "balanceOf",
711
713
  args: [wallet]
@@ -745,7 +747,7 @@ var MarketDataService = class {
745
747
  const promises = tokenAddresses.map(async (tokenAddress) => {
746
748
  try {
747
749
  const balance = await this.client.readContract({
748
- address: tokenAddress,
750
+ address: tokenAddress.toLowerCase(),
749
751
  abi: import_viem2.erc20Abi,
750
752
  functionName: "balanceOf",
751
753
  args: [wallet]
@@ -2478,7 +2480,7 @@ var FileStore = class {
2478
2480
  // src/vault/manager.ts
2479
2481
  var import_viem3 = require("viem");
2480
2482
  var import_accounts = require("viem/accounts");
2481
- var import_chains = require("viem/chains");
2483
+ var import_chains2 = require("viem/chains");
2482
2484
  var ADDRESSES = {
2483
2485
  mainnet: {
2484
2486
  vaultFactory: process.env.EXAGENT_VAULT_FACTORY_ADDRESS || "0x0000000000000000000000000000000000000000",
@@ -2565,7 +2567,7 @@ var VaultManager = class {
2565
2567
  this.config = config;
2566
2568
  this.addresses = ADDRESSES[config.network];
2567
2569
  this.account = (0, import_accounts.privateKeyToAccount)(config.walletKey);
2568
- this.chain = import_chains.base;
2570
+ this.chain = import_chains2.base;
2569
2571
  const rpcUrl = getRpcUrl();
2570
2572
  const transport = (0, import_viem3.http)(rpcUrl, { timeout: 6e4 });
2571
2573
  this.publicClient = (0, import_viem3.createPublicClient)({
@@ -3635,7 +3637,7 @@ var HyperliquidWebSocket = class {
3635
3637
 
3636
3638
  // src/perp/recorder.ts
3637
3639
  var import_viem5 = require("viem");
3638
- var import_chains2 = require("viem/chains");
3640
+ var import_chains3 = require("viem/chains");
3639
3641
  var import_accounts2 = require("viem/accounts");
3640
3642
  var ROUTER_ADDRESS = "0x1BCFa13f677fDCf697D8b7d5120f544817F1de1A";
3641
3643
  var ROUTER_ABI = [
@@ -3679,11 +3681,11 @@ var PerpTradeRecorder = class {
3679
3681
  const rpcUrl = opts.rpcUrl || "https://mainnet.base.org";
3680
3682
  const transport = (0, import_viem5.http)(rpcUrl, { timeout: 6e4 });
3681
3683
  this.publicClient = (0, import_viem5.createPublicClient)({
3682
- chain: import_chains2.base,
3684
+ chain: import_chains3.base,
3683
3685
  transport
3684
3686
  });
3685
3687
  this.walletClient = (0, import_viem5.createWalletClient)({
3686
- chain: import_chains2.base,
3688
+ chain: import_chains3.base,
3687
3689
  transport,
3688
3690
  account: this.account
3689
3691
  });
@@ -3991,7 +3993,7 @@ var PerpOnboarding = class {
3991
3993
 
3992
3994
  // src/perp/funding.ts
3993
3995
  var import_viem6 = require("viem");
3994
- var import_chains3 = require("viem/chains");
3996
+ var import_chains4 = require("viem/chains");
3995
3997
  var import_accounts3 = require("viem/accounts");
3996
3998
  var ERC20_ABI = (0, import_viem6.parseAbi)([
3997
3999
  "function approve(address spender, uint256 amount) external returns (bool)",
@@ -4195,7 +4197,7 @@ function loadSecureEnv(basePath, passphrase) {
4195
4197
  }
4196
4198
 
4197
4199
  // src/index.ts
4198
- var AGENT_VERSION = "0.1.35";
4200
+ var AGENT_VERSION = "0.1.36";
4199
4201
 
4200
4202
  // src/relay.ts
4201
4203
  var RelayClient = class {
@@ -4888,7 +4890,7 @@ var AgentRuntime = class {
4888
4890
  if (message.includes("insufficient funds") || message.includes("intrinsic gas too low") || message.includes("exceeds the balance")) {
4889
4891
  const ccUrl = `https://exagent.io/agents/${encodeURIComponent(this.config.name)}/command-center`;
4890
4892
  const publicClientInstance = (0, import_viem7.createPublicClient)({
4891
- chain: import_chains4.base,
4893
+ chain: import_chains5.base,
4892
4894
  transport: (0, import_viem7.http)(this.getRpcUrl(), { timeout: 6e4 })
4893
4895
  });
4894
4896
  console.log("");
@@ -5618,8 +5620,8 @@ var AgentRuntime = class {
5618
5620
  * for Frontier agents trading outside the whitelist) stay visible.
5619
5621
  */
5620
5622
  getTokensToTrack() {
5621
- const base5 = this.config.allowedTokens || this.getDefaultTokens();
5622
- const baseSet = new Set(base5.map((t) => t.toLowerCase()));
5623
+ const base6 = this.config.allowedTokens || this.getDefaultTokens();
5624
+ const baseSet = new Set(base6.map((t) => t.toLowerCase()));
5623
5625
  const trackedPositions = this.positionTracker.getPositions();
5624
5626
  const extras = [];
5625
5627
  for (const pos of trackedPositions) {
@@ -5642,7 +5644,7 @@ var AgentRuntime = class {
5642
5644
  console.log(`Auto-tracking ${extras.length} additional token(s) from position history`);
5643
5645
  }
5644
5646
  const resolver = this.marketData.getResolver();
5645
- const allTokens = [...base5, ...extras];
5647
+ const allTokens = [...base6, ...extras];
5646
5648
  const filtered = allTokens.filter((t) => !resolver.isUnresolvable(t.toLowerCase()));
5647
5649
  const dropped = allTokens.length - filtered.length;
5648
5650
  if (dropped > 0) {
package/dist/cli.mjs CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  loadConfig,
7
7
  loadSecureEnv,
8
8
  validateConfig
9
- } from "./chunk-46HZKJLU.mjs";
9
+ } from "./chunk-TDG46HJJ.mjs";
10
10
 
11
11
  // src/cli.ts
12
12
  import { Command } from "commander";
package/dist/index.d.mts CHANGED
@@ -339,9 +339,9 @@ declare const AgentConfigSchema: z.ZodObject<{
339
339
  }>>;
340
340
  allowedTokens: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
341
341
  }, "strip", z.ZodTypeAny, {
342
+ agentId: string | number;
342
343
  name: string;
343
344
  network: "mainnet";
344
- agentId: string | number;
345
345
  llm: {
346
346
  provider: "custom" | "openai" | "anthropic" | "google" | "deepseek" | "mistral" | "groq" | "together" | "ollama";
347
347
  temperature: number;
@@ -388,8 +388,8 @@ declare const AgentConfigSchema: z.ZodObject<{
388
388
  } | undefined;
389
389
  allowedTokens?: string[] | undefined;
390
390
  }, {
391
- name: string;
392
391
  agentId: string | number;
392
+ name: string;
393
393
  llm: {
394
394
  provider: "custom" | "openai" | "anthropic" | "google" | "deepseek" | "mistral" | "groq" | "together" | "ollama";
395
395
  model?: string | undefined;
@@ -2191,6 +2191,6 @@ declare function decryptEnvFile(encPath: string, passphrase: string): Record<str
2191
2191
  declare function loadSecureEnv(basePath: string, passphrase?: string): boolean;
2192
2192
 
2193
2193
  /** @exagent/agent package version — update alongside package.json */
2194
- declare const AGENT_VERSION = "0.1.35";
2194
+ declare const AGENT_VERSION = "0.1.36";
2195
2195
 
2196
2196
  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
@@ -339,9 +339,9 @@ declare const AgentConfigSchema: z.ZodObject<{
339
339
  }>>;
340
340
  allowedTokens: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
341
341
  }, "strip", z.ZodTypeAny, {
342
+ agentId: string | number;
342
343
  name: string;
343
344
  network: "mainnet";
344
- agentId: string | number;
345
345
  llm: {
346
346
  provider: "custom" | "openai" | "anthropic" | "google" | "deepseek" | "mistral" | "groq" | "together" | "ollama";
347
347
  temperature: number;
@@ -388,8 +388,8 @@ declare const AgentConfigSchema: z.ZodObject<{
388
388
  } | undefined;
389
389
  allowedTokens?: string[] | undefined;
390
390
  }, {
391
- name: string;
392
391
  agentId: string | number;
392
+ name: string;
393
393
  llm: {
394
394
  provider: "custom" | "openai" | "anthropic" | "google" | "deepseek" | "mistral" | "groq" | "together" | "ollama";
395
395
  model?: string | undefined;
@@ -2191,6 +2191,6 @@ declare function decryptEnvFile(encPath: string, passphrase: string): Record<str
2191
2191
  declare function loadSecureEnv(basePath: string, passphrase?: string): boolean;
2192
2192
 
2193
2193
  /** @exagent/agent package version — update alongside package.json */
2194
- declare const AGENT_VERSION = "0.1.35";
2194
+ declare const AGENT_VERSION = "0.1.36";
2195
2195
 
2196
2196
  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
@@ -86,11 +86,12 @@ module.exports = __toCommonJS(index_exports);
86
86
  // src/runtime.ts
87
87
  var import_sdk = require("@exagent/sdk");
88
88
  var import_viem7 = require("viem");
89
- var import_chains4 = require("viem/chains");
89
+ var import_chains5 = require("viem/chains");
90
90
  var import_accounts5 = require("viem/accounts");
91
91
 
92
92
  // src/trading/market.ts
93
93
  var import_viem2 = require("viem");
94
+ var import_chains = require("viem/chains");
94
95
 
95
96
  // src/trading/token-resolver.ts
96
97
  var import_viem = require("viem");
@@ -561,6 +562,7 @@ var MarketDataService = class {
561
562
  constructor(rpcUrl, store) {
562
563
  this.rpcUrl = rpcUrl;
563
564
  this.client = (0, import_viem2.createPublicClient)({
565
+ chain: import_chains.base,
564
566
  transport: (0, import_viem2.http)(rpcUrl, { timeout: 6e4 })
565
567
  });
566
568
  this.resolver = new TokenResolver(this.client, store);
@@ -758,7 +760,7 @@ var MarketDataService = class {
758
760
  try {
759
761
  const results = await this.client.multicall({
760
762
  contracts: batch.map((addr) => ({
761
- address: addr,
763
+ address: addr.toLowerCase(),
762
764
  abi: import_viem2.erc20Abi,
763
765
  functionName: "balanceOf",
764
766
  args: [wallet]
@@ -798,7 +800,7 @@ var MarketDataService = class {
798
800
  const promises = tokenAddresses.map(async (tokenAddress) => {
799
801
  try {
800
802
  const balance = await this.client.readContract({
801
- address: tokenAddress,
803
+ address: tokenAddress.toLowerCase(),
802
804
  abi: import_viem2.erc20Abi,
803
805
  functionName: "balanceOf",
804
806
  args: [wallet]
@@ -2566,7 +2568,7 @@ var FileStore = class {
2566
2568
  // src/vault/manager.ts
2567
2569
  var import_viem3 = require("viem");
2568
2570
  var import_accounts = require("viem/accounts");
2569
- var import_chains = require("viem/chains");
2571
+ var import_chains2 = require("viem/chains");
2570
2572
  var ADDRESSES = {
2571
2573
  mainnet: {
2572
2574
  vaultFactory: process.env.EXAGENT_VAULT_FACTORY_ADDRESS || "0x0000000000000000000000000000000000000000",
@@ -2653,7 +2655,7 @@ var VaultManager = class {
2653
2655
  this.config = config;
2654
2656
  this.addresses = ADDRESSES[config.network];
2655
2657
  this.account = (0, import_accounts.privateKeyToAccount)(config.walletKey);
2656
- this.chain = import_chains.base;
2658
+ this.chain = import_chains2.base;
2657
2659
  const rpcUrl = getRpcUrl();
2658
2660
  const transport = (0, import_viem3.http)(rpcUrl, { timeout: 6e4 });
2659
2661
  this.publicClient = (0, import_viem3.createPublicClient)({
@@ -3988,7 +3990,7 @@ var HyperliquidWebSocket = class {
3988
3990
 
3989
3991
  // src/perp/recorder.ts
3990
3992
  var import_viem5 = require("viem");
3991
- var import_chains2 = require("viem/chains");
3993
+ var import_chains3 = require("viem/chains");
3992
3994
  var import_accounts3 = require("viem/accounts");
3993
3995
  var ROUTER_ADDRESS = "0x1BCFa13f677fDCf697D8b7d5120f544817F1de1A";
3994
3996
  var ROUTER_ABI = [
@@ -4032,11 +4034,11 @@ var PerpTradeRecorder = class {
4032
4034
  const rpcUrl = opts.rpcUrl || "https://mainnet.base.org";
4033
4035
  const transport = (0, import_viem5.http)(rpcUrl, { timeout: 6e4 });
4034
4036
  this.publicClient = (0, import_viem5.createPublicClient)({
4035
- chain: import_chains2.base,
4037
+ chain: import_chains3.base,
4036
4038
  transport
4037
4039
  });
4038
4040
  this.walletClient = (0, import_viem5.createWalletClient)({
4039
- chain: import_chains2.base,
4041
+ chain: import_chains3.base,
4040
4042
  transport,
4041
4043
  account: this.account
4042
4044
  });
@@ -4344,7 +4346,7 @@ var PerpOnboarding = class {
4344
4346
 
4345
4347
  // src/perp/funding.ts
4346
4348
  var import_viem6 = require("viem");
4347
- var import_chains3 = require("viem/chains");
4349
+ var import_chains4 = require("viem/chains");
4348
4350
  var import_accounts4 = require("viem/accounts");
4349
4351
  var ERC20_ABI = (0, import_viem6.parseAbi)([
4350
4352
  "function approve(address spender, uint256 amount) external returns (bool)",
@@ -4790,7 +4792,7 @@ var AgentRuntime = class {
4790
4792
  if (message.includes("insufficient funds") || message.includes("intrinsic gas too low") || message.includes("exceeds the balance")) {
4791
4793
  const ccUrl = `https://exagent.io/agents/${encodeURIComponent(this.config.name)}/command-center`;
4792
4794
  const publicClientInstance = (0, import_viem7.createPublicClient)({
4793
- chain: import_chains4.base,
4795
+ chain: import_chains5.base,
4794
4796
  transport: (0, import_viem7.http)(this.getRpcUrl(), { timeout: 6e4 })
4795
4797
  });
4796
4798
  console.log("");
@@ -5520,8 +5522,8 @@ var AgentRuntime = class {
5520
5522
  * for Frontier agents trading outside the whitelist) stay visible.
5521
5523
  */
5522
5524
  getTokensToTrack() {
5523
- const base5 = this.config.allowedTokens || this.getDefaultTokens();
5524
- const baseSet = new Set(base5.map((t) => t.toLowerCase()));
5525
+ const base6 = this.config.allowedTokens || this.getDefaultTokens();
5526
+ const baseSet = new Set(base6.map((t) => t.toLowerCase()));
5525
5527
  const trackedPositions = this.positionTracker.getPositions();
5526
5528
  const extras = [];
5527
5529
  for (const pos of trackedPositions) {
@@ -5544,7 +5546,7 @@ var AgentRuntime = class {
5544
5546
  console.log(`Auto-tracking ${extras.length} additional token(s) from position history`);
5545
5547
  }
5546
5548
  const resolver = this.marketData.getResolver();
5547
- const allTokens = [...base5, ...extras];
5549
+ const allTokens = [...base6, ...extras];
5548
5550
  const filtered = allTokens.filter((t) => !resolver.isUnresolvable(t.toLowerCase()));
5549
5551
  const dropped = allTokens.length - filtered.length;
5550
5552
  if (dropped > 0) {
@@ -5881,7 +5883,7 @@ function loadSecureEnv(basePath, passphrase) {
5881
5883
  }
5882
5884
 
5883
5885
  // src/index.ts
5884
- var AGENT_VERSION = "0.1.35";
5886
+ var AGENT_VERSION = "0.1.36";
5885
5887
  // Annotate the CommonJS export names for ESM import in node:
5886
5888
  0 && (module.exports = {
5887
5889
  AGENT_VERSION,
package/dist/index.mjs CHANGED
@@ -49,7 +49,7 @@ import {
49
49
  loadStrategy,
50
50
  validateConfig,
51
51
  validateStrategy
52
- } from "./chunk-46HZKJLU.mjs";
52
+ } from "./chunk-TDG46HJJ.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.35",
3
+ "version": "0.1.36",
4
4
  "description": "Autonomous trading agent runtime for Exagent",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",