@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/chunk-EMQYMJZD.mjs +5854 -0
- package/dist/cli.js +31 -19
- package/dist/cli.mjs +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +31 -19
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
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
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
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.
|
|
4183
|
+
var AGENT_VERSION = "0.1.34";
|
|
4172
4184
|
|
|
4173
4185
|
// src/relay.ts
|
|
4174
4186
|
var RelayClient = class {
|
package/dist/cli.mjs
CHANGED
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.
|
|
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.
|
|
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
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
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.
|
|
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