@exagent/agent 0.1.34 → 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/chunk-46HZKJLU.mjs +5869 -0
- package/dist/chunk-TDG46HJJ.mjs +5871 -0
- package/dist/cli.js +32 -15
- package/dist/cli.mjs +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +32 -15
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
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
|
|
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]
|
|
@@ -882,6 +884,9 @@ var PositionTracker = class {
|
|
|
882
884
|
existing.totalCostBasis = newTotalCost;
|
|
883
885
|
existing.totalAmountAcquired = newTotalAmount;
|
|
884
886
|
existing.lastUpdateTimestamp = Date.now();
|
|
887
|
+
if (!existing.symbol) {
|
|
888
|
+
existing.symbol = TOKEN_SYMBOLS[token] || getTokenSymbol(token);
|
|
889
|
+
}
|
|
885
890
|
if (txHash) {
|
|
886
891
|
existing.txHashes.push(txHash);
|
|
887
892
|
if (existing.txHashes.length > 10) existing.txHashes.shift();
|
|
@@ -938,6 +943,13 @@ var PositionTracker = class {
|
|
|
938
943
|
this.positions[token].lastUpdateTimestamp = Date.now();
|
|
939
944
|
changed = true;
|
|
940
945
|
}
|
|
946
|
+
if (!this.positions[token].symbol) {
|
|
947
|
+
const resolved = TOKEN_SYMBOLS[token] || getTokenSymbol(token);
|
|
948
|
+
if (resolved) {
|
|
949
|
+
this.positions[token].symbol = resolved;
|
|
950
|
+
changed = true;
|
|
951
|
+
}
|
|
952
|
+
}
|
|
941
953
|
} else {
|
|
942
954
|
const price = prices[token] || 0;
|
|
943
955
|
this.positions[token] = {
|
|
@@ -969,8 +981,13 @@ var PositionTracker = class {
|
|
|
969
981
|
// ============================================================
|
|
970
982
|
// QUERY METHODS (for strategies)
|
|
971
983
|
// ============================================================
|
|
972
|
-
/** Get all tracked positions */
|
|
984
|
+
/** Get all tracked positions (backfills missing symbols from resolver) */
|
|
973
985
|
getPositions() {
|
|
986
|
+
for (const pos of Object.values(this.positions)) {
|
|
987
|
+
if (!pos.symbol) {
|
|
988
|
+
pos.symbol = TOKEN_SYMBOLS[pos.token] || getTokenSymbol(pos.token);
|
|
989
|
+
}
|
|
990
|
+
}
|
|
974
991
|
return Object.values(this.positions);
|
|
975
992
|
}
|
|
976
993
|
/** Get a single position by token address */
|
|
@@ -2463,7 +2480,7 @@ var FileStore = class {
|
|
|
2463
2480
|
// src/vault/manager.ts
|
|
2464
2481
|
var import_viem3 = require("viem");
|
|
2465
2482
|
var import_accounts = require("viem/accounts");
|
|
2466
|
-
var
|
|
2483
|
+
var import_chains2 = require("viem/chains");
|
|
2467
2484
|
var ADDRESSES = {
|
|
2468
2485
|
mainnet: {
|
|
2469
2486
|
vaultFactory: process.env.EXAGENT_VAULT_FACTORY_ADDRESS || "0x0000000000000000000000000000000000000000",
|
|
@@ -2550,7 +2567,7 @@ var VaultManager = class {
|
|
|
2550
2567
|
this.config = config;
|
|
2551
2568
|
this.addresses = ADDRESSES[config.network];
|
|
2552
2569
|
this.account = (0, import_accounts.privateKeyToAccount)(config.walletKey);
|
|
2553
|
-
this.chain =
|
|
2570
|
+
this.chain = import_chains2.base;
|
|
2554
2571
|
const rpcUrl = getRpcUrl();
|
|
2555
2572
|
const transport = (0, import_viem3.http)(rpcUrl, { timeout: 6e4 });
|
|
2556
2573
|
this.publicClient = (0, import_viem3.createPublicClient)({
|
|
@@ -3620,7 +3637,7 @@ var HyperliquidWebSocket = class {
|
|
|
3620
3637
|
|
|
3621
3638
|
// src/perp/recorder.ts
|
|
3622
3639
|
var import_viem5 = require("viem");
|
|
3623
|
-
var
|
|
3640
|
+
var import_chains3 = require("viem/chains");
|
|
3624
3641
|
var import_accounts2 = require("viem/accounts");
|
|
3625
3642
|
var ROUTER_ADDRESS = "0x1BCFa13f677fDCf697D8b7d5120f544817F1de1A";
|
|
3626
3643
|
var ROUTER_ABI = [
|
|
@@ -3664,11 +3681,11 @@ var PerpTradeRecorder = class {
|
|
|
3664
3681
|
const rpcUrl = opts.rpcUrl || "https://mainnet.base.org";
|
|
3665
3682
|
const transport = (0, import_viem5.http)(rpcUrl, { timeout: 6e4 });
|
|
3666
3683
|
this.publicClient = (0, import_viem5.createPublicClient)({
|
|
3667
|
-
chain:
|
|
3684
|
+
chain: import_chains3.base,
|
|
3668
3685
|
transport
|
|
3669
3686
|
});
|
|
3670
3687
|
this.walletClient = (0, import_viem5.createWalletClient)({
|
|
3671
|
-
chain:
|
|
3688
|
+
chain: import_chains3.base,
|
|
3672
3689
|
transport,
|
|
3673
3690
|
account: this.account
|
|
3674
3691
|
});
|
|
@@ -3976,7 +3993,7 @@ var PerpOnboarding = class {
|
|
|
3976
3993
|
|
|
3977
3994
|
// src/perp/funding.ts
|
|
3978
3995
|
var import_viem6 = require("viem");
|
|
3979
|
-
var
|
|
3996
|
+
var import_chains4 = require("viem/chains");
|
|
3980
3997
|
var import_accounts3 = require("viem/accounts");
|
|
3981
3998
|
var ERC20_ABI = (0, import_viem6.parseAbi)([
|
|
3982
3999
|
"function approve(address spender, uint256 amount) external returns (bool)",
|
|
@@ -4180,7 +4197,7 @@ function loadSecureEnv(basePath, passphrase) {
|
|
|
4180
4197
|
}
|
|
4181
4198
|
|
|
4182
4199
|
// src/index.ts
|
|
4183
|
-
var AGENT_VERSION = "0.1.
|
|
4200
|
+
var AGENT_VERSION = "0.1.36";
|
|
4184
4201
|
|
|
4185
4202
|
// src/relay.ts
|
|
4186
4203
|
var RelayClient = class {
|
|
@@ -4873,7 +4890,7 @@ var AgentRuntime = class {
|
|
|
4873
4890
|
if (message.includes("insufficient funds") || message.includes("intrinsic gas too low") || message.includes("exceeds the balance")) {
|
|
4874
4891
|
const ccUrl = `https://exagent.io/agents/${encodeURIComponent(this.config.name)}/command-center`;
|
|
4875
4892
|
const publicClientInstance = (0, import_viem7.createPublicClient)({
|
|
4876
|
-
chain:
|
|
4893
|
+
chain: import_chains5.base,
|
|
4877
4894
|
transport: (0, import_viem7.http)(this.getRpcUrl(), { timeout: 6e4 })
|
|
4878
4895
|
});
|
|
4879
4896
|
console.log("");
|
|
@@ -5603,8 +5620,8 @@ var AgentRuntime = class {
|
|
|
5603
5620
|
* for Frontier agents trading outside the whitelist) stay visible.
|
|
5604
5621
|
*/
|
|
5605
5622
|
getTokensToTrack() {
|
|
5606
|
-
const
|
|
5607
|
-
const baseSet = new Set(
|
|
5623
|
+
const base6 = this.config.allowedTokens || this.getDefaultTokens();
|
|
5624
|
+
const baseSet = new Set(base6.map((t) => t.toLowerCase()));
|
|
5608
5625
|
const trackedPositions = this.positionTracker.getPositions();
|
|
5609
5626
|
const extras = [];
|
|
5610
5627
|
for (const pos of trackedPositions) {
|
|
@@ -5627,7 +5644,7 @@ var AgentRuntime = class {
|
|
|
5627
5644
|
console.log(`Auto-tracking ${extras.length} additional token(s) from position history`);
|
|
5628
5645
|
}
|
|
5629
5646
|
const resolver = this.marketData.getResolver();
|
|
5630
|
-
const allTokens = [...
|
|
5647
|
+
const allTokens = [...base6, ...extras];
|
|
5631
5648
|
const filtered = allTokens.filter((t) => !resolver.isUnresolvable(t.toLowerCase()));
|
|
5632
5649
|
const dropped = allTokens.length - filtered.length;
|
|
5633
5650
|
if (dropped > 0) {
|
package/dist/cli.mjs
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -57,7 +57,7 @@ declare class PositionTracker {
|
|
|
57
57
|
* Updates currentAmount, detects new tokens (airdrops), removes zeroed positions.
|
|
58
58
|
*/
|
|
59
59
|
syncBalances(balances: Record<string, bigint>, prices: Record<string, number>): void;
|
|
60
|
-
/** Get all tracked positions */
|
|
60
|
+
/** Get all tracked positions (backfills missing symbols from resolver) */
|
|
61
61
|
getPositions(): TrackedPosition[];
|
|
62
62
|
/** Get a single position by token address */
|
|
63
63
|
getPosition(token: string): TrackedPosition | 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.
|
|
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
|
@@ -57,7 +57,7 @@ declare class PositionTracker {
|
|
|
57
57
|
* Updates currentAmount, detects new tokens (airdrops), removes zeroed positions.
|
|
58
58
|
*/
|
|
59
59
|
syncBalances(balances: Record<string, bigint>, prices: Record<string, number>): void;
|
|
60
|
-
/** Get all tracked positions */
|
|
60
|
+
/** Get all tracked positions (backfills missing symbols from resolver) */
|
|
61
61
|
getPositions(): TrackedPosition[];
|
|
62
62
|
/** Get a single position by token address */
|
|
63
63
|
getPosition(token: string): TrackedPosition | 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.
|
|
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
|
|
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]
|
|
@@ -935,6 +937,9 @@ var PositionTracker = class {
|
|
|
935
937
|
existing.totalCostBasis = newTotalCost;
|
|
936
938
|
existing.totalAmountAcquired = newTotalAmount;
|
|
937
939
|
existing.lastUpdateTimestamp = Date.now();
|
|
940
|
+
if (!existing.symbol) {
|
|
941
|
+
existing.symbol = TOKEN_SYMBOLS[token] || getTokenSymbol(token);
|
|
942
|
+
}
|
|
938
943
|
if (txHash) {
|
|
939
944
|
existing.txHashes.push(txHash);
|
|
940
945
|
if (existing.txHashes.length > 10) existing.txHashes.shift();
|
|
@@ -991,6 +996,13 @@ var PositionTracker = class {
|
|
|
991
996
|
this.positions[token].lastUpdateTimestamp = Date.now();
|
|
992
997
|
changed = true;
|
|
993
998
|
}
|
|
999
|
+
if (!this.positions[token].symbol) {
|
|
1000
|
+
const resolved = TOKEN_SYMBOLS[token] || getTokenSymbol(token);
|
|
1001
|
+
if (resolved) {
|
|
1002
|
+
this.positions[token].symbol = resolved;
|
|
1003
|
+
changed = true;
|
|
1004
|
+
}
|
|
1005
|
+
}
|
|
994
1006
|
} else {
|
|
995
1007
|
const price = prices[token] || 0;
|
|
996
1008
|
this.positions[token] = {
|
|
@@ -1022,8 +1034,13 @@ var PositionTracker = class {
|
|
|
1022
1034
|
// ============================================================
|
|
1023
1035
|
// QUERY METHODS (for strategies)
|
|
1024
1036
|
// ============================================================
|
|
1025
|
-
/** Get all tracked positions */
|
|
1037
|
+
/** Get all tracked positions (backfills missing symbols from resolver) */
|
|
1026
1038
|
getPositions() {
|
|
1039
|
+
for (const pos of Object.values(this.positions)) {
|
|
1040
|
+
if (!pos.symbol) {
|
|
1041
|
+
pos.symbol = TOKEN_SYMBOLS[pos.token] || getTokenSymbol(pos.token);
|
|
1042
|
+
}
|
|
1043
|
+
}
|
|
1027
1044
|
return Object.values(this.positions);
|
|
1028
1045
|
}
|
|
1029
1046
|
/** Get a single position by token address */
|
|
@@ -2551,7 +2568,7 @@ var FileStore = class {
|
|
|
2551
2568
|
// src/vault/manager.ts
|
|
2552
2569
|
var import_viem3 = require("viem");
|
|
2553
2570
|
var import_accounts = require("viem/accounts");
|
|
2554
|
-
var
|
|
2571
|
+
var import_chains2 = require("viem/chains");
|
|
2555
2572
|
var ADDRESSES = {
|
|
2556
2573
|
mainnet: {
|
|
2557
2574
|
vaultFactory: process.env.EXAGENT_VAULT_FACTORY_ADDRESS || "0x0000000000000000000000000000000000000000",
|
|
@@ -2638,7 +2655,7 @@ var VaultManager = class {
|
|
|
2638
2655
|
this.config = config;
|
|
2639
2656
|
this.addresses = ADDRESSES[config.network];
|
|
2640
2657
|
this.account = (0, import_accounts.privateKeyToAccount)(config.walletKey);
|
|
2641
|
-
this.chain =
|
|
2658
|
+
this.chain = import_chains2.base;
|
|
2642
2659
|
const rpcUrl = getRpcUrl();
|
|
2643
2660
|
const transport = (0, import_viem3.http)(rpcUrl, { timeout: 6e4 });
|
|
2644
2661
|
this.publicClient = (0, import_viem3.createPublicClient)({
|
|
@@ -3973,7 +3990,7 @@ var HyperliquidWebSocket = class {
|
|
|
3973
3990
|
|
|
3974
3991
|
// src/perp/recorder.ts
|
|
3975
3992
|
var import_viem5 = require("viem");
|
|
3976
|
-
var
|
|
3993
|
+
var import_chains3 = require("viem/chains");
|
|
3977
3994
|
var import_accounts3 = require("viem/accounts");
|
|
3978
3995
|
var ROUTER_ADDRESS = "0x1BCFa13f677fDCf697D8b7d5120f544817F1de1A";
|
|
3979
3996
|
var ROUTER_ABI = [
|
|
@@ -4017,11 +4034,11 @@ var PerpTradeRecorder = class {
|
|
|
4017
4034
|
const rpcUrl = opts.rpcUrl || "https://mainnet.base.org";
|
|
4018
4035
|
const transport = (0, import_viem5.http)(rpcUrl, { timeout: 6e4 });
|
|
4019
4036
|
this.publicClient = (0, import_viem5.createPublicClient)({
|
|
4020
|
-
chain:
|
|
4037
|
+
chain: import_chains3.base,
|
|
4021
4038
|
transport
|
|
4022
4039
|
});
|
|
4023
4040
|
this.walletClient = (0, import_viem5.createWalletClient)({
|
|
4024
|
-
chain:
|
|
4041
|
+
chain: import_chains3.base,
|
|
4025
4042
|
transport,
|
|
4026
4043
|
account: this.account
|
|
4027
4044
|
});
|
|
@@ -4329,7 +4346,7 @@ var PerpOnboarding = class {
|
|
|
4329
4346
|
|
|
4330
4347
|
// src/perp/funding.ts
|
|
4331
4348
|
var import_viem6 = require("viem");
|
|
4332
|
-
var
|
|
4349
|
+
var import_chains4 = require("viem/chains");
|
|
4333
4350
|
var import_accounts4 = require("viem/accounts");
|
|
4334
4351
|
var ERC20_ABI = (0, import_viem6.parseAbi)([
|
|
4335
4352
|
"function approve(address spender, uint256 amount) external returns (bool)",
|
|
@@ -4775,7 +4792,7 @@ var AgentRuntime = class {
|
|
|
4775
4792
|
if (message.includes("insufficient funds") || message.includes("intrinsic gas too low") || message.includes("exceeds the balance")) {
|
|
4776
4793
|
const ccUrl = `https://exagent.io/agents/${encodeURIComponent(this.config.name)}/command-center`;
|
|
4777
4794
|
const publicClientInstance = (0, import_viem7.createPublicClient)({
|
|
4778
|
-
chain:
|
|
4795
|
+
chain: import_chains5.base,
|
|
4779
4796
|
transport: (0, import_viem7.http)(this.getRpcUrl(), { timeout: 6e4 })
|
|
4780
4797
|
});
|
|
4781
4798
|
console.log("");
|
|
@@ -5505,8 +5522,8 @@ var AgentRuntime = class {
|
|
|
5505
5522
|
* for Frontier agents trading outside the whitelist) stay visible.
|
|
5506
5523
|
*/
|
|
5507
5524
|
getTokensToTrack() {
|
|
5508
|
-
const
|
|
5509
|
-
const baseSet = new Set(
|
|
5525
|
+
const base6 = this.config.allowedTokens || this.getDefaultTokens();
|
|
5526
|
+
const baseSet = new Set(base6.map((t) => t.toLowerCase()));
|
|
5510
5527
|
const trackedPositions = this.positionTracker.getPositions();
|
|
5511
5528
|
const extras = [];
|
|
5512
5529
|
for (const pos of trackedPositions) {
|
|
@@ -5529,7 +5546,7 @@ var AgentRuntime = class {
|
|
|
5529
5546
|
console.log(`Auto-tracking ${extras.length} additional token(s) from position history`);
|
|
5530
5547
|
}
|
|
5531
5548
|
const resolver = this.marketData.getResolver();
|
|
5532
|
-
const allTokens = [...
|
|
5549
|
+
const allTokens = [...base6, ...extras];
|
|
5533
5550
|
const filtered = allTokens.filter((t) => !resolver.isUnresolvable(t.toLowerCase()));
|
|
5534
5551
|
const dropped = allTokens.length - filtered.length;
|
|
5535
5552
|
if (dropped > 0) {
|
|
@@ -5866,7 +5883,7 @@ function loadSecureEnv(basePath, passphrase) {
|
|
|
5866
5883
|
}
|
|
5867
5884
|
|
|
5868
5885
|
// src/index.ts
|
|
5869
|
-
var AGENT_VERSION = "0.1.
|
|
5886
|
+
var AGENT_VERSION = "0.1.36";
|
|
5870
5887
|
// Annotate the CommonJS export names for ESM import in node:
|
|
5871
5888
|
0 && (module.exports = {
|
|
5872
5889
|
AGENT_VERSION,
|
package/dist/index.mjs
CHANGED