@exagent/agent 0.1.33 → 0.1.34

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
@@ -699,24 +699,34 @@ var MarketDataService = class {
699
699
  const nativeBalance = await this.client.getBalance({ address: wallet });
700
700
  balances[NATIVE_ETH.toLowerCase()] = nativeBalance;
701
701
  if (tokenAddresses.length > 0) {
702
- try {
703
- const results = await this.client.multicall({
704
- contracts: tokenAddresses.map((addr) => ({
705
- address: addr,
706
- abi: import_viem2.erc20Abi,
707
- functionName: "balanceOf",
708
- args: [wallet]
709
- })),
710
- allowFailure: true
711
- });
712
- for (let i = 0; i < tokenAddresses.length; i++) {
713
- const addr = tokenAddresses[i].toLowerCase();
714
- const r = results[i];
715
- balances[addr] = r.status === "success" ? r.result : 0n;
702
+ const BALANCE_BATCH_SIZE = 25;
703
+ for (let i = 0; i < tokenAddresses.length; i += BALANCE_BATCH_SIZE) {
704
+ const batch = tokenAddresses.slice(i, i + BALANCE_BATCH_SIZE);
705
+ try {
706
+ const results = await this.client.multicall({
707
+ contracts: batch.map((addr) => ({
708
+ address: addr,
709
+ abi: import_viem2.erc20Abi,
710
+ functionName: "balanceOf",
711
+ args: [wallet]
712
+ })),
713
+ allowFailure: true
714
+ });
715
+ for (let j = 0; j < batch.length; j++) {
716
+ const addr = batch[j].toLowerCase();
717
+ const r = results[j];
718
+ if (r.status === "success") {
719
+ balances[addr] = r.result;
720
+ } else {
721
+ const sym = this.resolver.getSymbol(addr) || addr.slice(0, 10);
722
+ console.warn(` balanceOf reverted for ${sym}`);
723
+ balances[addr] = 0n;
724
+ }
725
+ }
726
+ } catch (e) {
727
+ console.warn(`Multicall3 balanceOf batch failed (${batch.length} tokens): ${e instanceof Error ? e.message : String(e)}`);
728
+ await this.fetchBalancesIndividual(wallet, batch, balances);
716
729
  }
717
- } catch {
718
- console.warn("Multicall3 balanceOf failed, falling back to individual queries");
719
- await this.fetchBalancesIndividual(wallet, tokenAddresses, balances);
720
730
  }
721
731
  }
722
732
  } catch (error) {
@@ -741,7 +751,9 @@ var MarketDataService = class {
741
751
  args: [wallet]
742
752
  });
743
753
  return { address: tokenAddress.toLowerCase(), balance };
744
- } catch {
754
+ } catch (e) {
755
+ const sym = this.resolver.getSymbol(tokenAddress.toLowerCase()) || tokenAddress.slice(0, 10);
756
+ console.warn(` balanceOf failed for ${sym}: ${e instanceof Error ? e.message : String(e)}`);
745
757
  return { address: tokenAddress.toLowerCase(), balance: 0n };
746
758
  }
747
759
  });
@@ -4168,7 +4180,7 @@ function loadSecureEnv(basePath, passphrase) {
4168
4180
  }
4169
4181
 
4170
4182
  // src/index.ts
4171
- var AGENT_VERSION = "0.1.32";
4183
+ var AGENT_VERSION = "0.1.34";
4172
4184
 
4173
4185
  // src/relay.ts
4174
4186
  var RelayClient = class {
package/dist/cli.mjs CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  loadConfig,
7
7
  loadSecureEnv,
8
8
  validateConfig
9
- } from "./chunk-Q23UPFHO.mjs";
9
+ } from "./chunk-EMQYMJZD.mjs";
10
10
 
11
11
  // src/cli.ts
12
12
  import { Command } from "commander";
package/dist/index.d.mts CHANGED
@@ -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.32";
2194
+ declare const AGENT_VERSION = "0.1.34";
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
@@ -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.32";
2194
+ declare const AGENT_VERSION = "0.1.34";
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
@@ -752,24 +752,34 @@ var MarketDataService = class {
752
752
  const nativeBalance = await this.client.getBalance({ address: wallet });
753
753
  balances[NATIVE_ETH.toLowerCase()] = nativeBalance;
754
754
  if (tokenAddresses.length > 0) {
755
- try {
756
- const results = await this.client.multicall({
757
- contracts: tokenAddresses.map((addr) => ({
758
- address: addr,
759
- abi: import_viem2.erc20Abi,
760
- functionName: "balanceOf",
761
- args: [wallet]
762
- })),
763
- allowFailure: true
764
- });
765
- for (let i = 0; i < tokenAddresses.length; i++) {
766
- const addr = tokenAddresses[i].toLowerCase();
767
- const r = results[i];
768
- balances[addr] = r.status === "success" ? r.result : 0n;
755
+ const BALANCE_BATCH_SIZE = 25;
756
+ for (let i = 0; i < tokenAddresses.length; i += BALANCE_BATCH_SIZE) {
757
+ const batch = tokenAddresses.slice(i, i + BALANCE_BATCH_SIZE);
758
+ try {
759
+ const results = await this.client.multicall({
760
+ contracts: batch.map((addr) => ({
761
+ address: addr,
762
+ abi: import_viem2.erc20Abi,
763
+ functionName: "balanceOf",
764
+ args: [wallet]
765
+ })),
766
+ allowFailure: true
767
+ });
768
+ for (let j = 0; j < batch.length; j++) {
769
+ const addr = batch[j].toLowerCase();
770
+ const r = results[j];
771
+ if (r.status === "success") {
772
+ balances[addr] = r.result;
773
+ } else {
774
+ const sym = this.resolver.getSymbol(addr) || addr.slice(0, 10);
775
+ console.warn(` balanceOf reverted for ${sym}`);
776
+ balances[addr] = 0n;
777
+ }
778
+ }
779
+ } catch (e) {
780
+ console.warn(`Multicall3 balanceOf batch failed (${batch.length} tokens): ${e instanceof Error ? e.message : String(e)}`);
781
+ await this.fetchBalancesIndividual(wallet, batch, balances);
769
782
  }
770
- } catch {
771
- console.warn("Multicall3 balanceOf failed, falling back to individual queries");
772
- await this.fetchBalancesIndividual(wallet, tokenAddresses, balances);
773
783
  }
774
784
  }
775
785
  } catch (error) {
@@ -794,7 +804,9 @@ var MarketDataService = class {
794
804
  args: [wallet]
795
805
  });
796
806
  return { address: tokenAddress.toLowerCase(), balance };
797
- } catch {
807
+ } catch (e) {
808
+ const sym = this.resolver.getSymbol(tokenAddress.toLowerCase()) || tokenAddress.slice(0, 10);
809
+ console.warn(` balanceOf failed for ${sym}: ${e instanceof Error ? e.message : String(e)}`);
798
810
  return { address: tokenAddress.toLowerCase(), balance: 0n };
799
811
  }
800
812
  });
@@ -5854,7 +5866,7 @@ function loadSecureEnv(basePath, passphrase) {
5854
5866
  }
5855
5867
 
5856
5868
  // src/index.ts
5857
- var AGENT_VERSION = "0.1.32";
5869
+ var AGENT_VERSION = "0.1.34";
5858
5870
  // Annotate the CommonJS export names for ESM import in node:
5859
5871
  0 && (module.exports = {
5860
5872
  AGENT_VERSION,
package/dist/index.mjs CHANGED
@@ -49,7 +49,7 @@ import {
49
49
  loadStrategy,
50
50
  validateConfig,
51
51
  validateStrategy
52
- } from "./chunk-Q23UPFHO.mjs";
52
+ } from "./chunk-EMQYMJZD.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.33",
3
+ "version": "0.1.34",
4
4
  "description": "Autonomous trading agent runtime for Exagent",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",