@exagent/agent 0.1.40 → 0.1.41
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-34JBZQO6.mjs +9475 -0
- package/dist/chunk-AEASQNGT.mjs +9475 -0
- package/dist/cli.js +112 -31
- package/dist/cli.mjs +1 -1
- package/dist/index.d.mts +53 -53
- package/dist/index.d.ts +53 -53
- package/dist/index.js +112 -31
- package/dist/index.mjs +1 -1
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -4163,13 +4163,6 @@ var VAULT_FACTORY_ABI = [
|
|
|
4163
4163
|
outputs: [{ type: "address" }],
|
|
4164
4164
|
stateMutability: "view"
|
|
4165
4165
|
},
|
|
4166
|
-
{
|
|
4167
|
-
type: "function",
|
|
4168
|
-
name: "canCreateVault",
|
|
4169
|
-
inputs: [{ name: "creator", type: "address" }],
|
|
4170
|
-
outputs: [{ name: "canCreate", type: "bool" }, { name: "reason", type: "string" }],
|
|
4171
|
-
stateMutability: "view"
|
|
4172
|
-
},
|
|
4173
4166
|
{
|
|
4174
4167
|
type: "function",
|
|
4175
4168
|
name: "createVault",
|
|
@@ -4186,10 +4179,17 @@ var VAULT_FACTORY_ABI = [
|
|
|
4186
4179
|
},
|
|
4187
4180
|
{
|
|
4188
4181
|
type: "function",
|
|
4189
|
-
name: "
|
|
4182
|
+
name: "MIN_SEED_AMOUNT",
|
|
4190
4183
|
inputs: [],
|
|
4191
4184
|
outputs: [{ type: "uint256" }],
|
|
4192
4185
|
stateMutability: "view"
|
|
4186
|
+
},
|
|
4187
|
+
{
|
|
4188
|
+
type: "function",
|
|
4189
|
+
name: "allowedAssets",
|
|
4190
|
+
inputs: [{ name: "asset", type: "address" }],
|
|
4191
|
+
outputs: [{ type: "bool" }],
|
|
4192
|
+
stateMutability: "view"
|
|
4193
4193
|
}
|
|
4194
4194
|
];
|
|
4195
4195
|
var VAULT_ABI = [
|
|
@@ -4287,23 +4287,34 @@ var VaultManager = class {
|
|
|
4287
4287
|
} catch {
|
|
4288
4288
|
}
|
|
4289
4289
|
}
|
|
4290
|
-
|
|
4291
|
-
|
|
4292
|
-
|
|
4293
|
-
|
|
4294
|
-
|
|
4295
|
-
|
|
4296
|
-
|
|
4297
|
-
|
|
4298
|
-
|
|
4290
|
+
let canCreate = true;
|
|
4291
|
+
let cannotCreateReason = null;
|
|
4292
|
+
if (hasVault) {
|
|
4293
|
+
canCreate = false;
|
|
4294
|
+
cannotCreateReason = "Vault already exists for this agent";
|
|
4295
|
+
} else {
|
|
4296
|
+
try {
|
|
4297
|
+
const isAssetAllowed = await this.publicClient.readContract({
|
|
4298
|
+
address: this.addresses.vaultFactory,
|
|
4299
|
+
abi: VAULT_FACTORY_ABI,
|
|
4300
|
+
functionName: "allowedAssets",
|
|
4301
|
+
args: [this.addresses.usdc]
|
|
4302
|
+
});
|
|
4303
|
+
if (!isAssetAllowed) {
|
|
4304
|
+
canCreate = false;
|
|
4305
|
+
cannotCreateReason = "USDC is not an allowed asset on the vault factory";
|
|
4306
|
+
}
|
|
4307
|
+
} catch {
|
|
4308
|
+
}
|
|
4309
|
+
}
|
|
4299
4310
|
return {
|
|
4300
4311
|
hasVault,
|
|
4301
4312
|
vaultAddress,
|
|
4302
4313
|
totalAssets,
|
|
4303
|
-
canCreateVault:
|
|
4304
|
-
cannotCreateReason
|
|
4305
|
-
requirementsMet:
|
|
4306
|
-
requirements
|
|
4314
|
+
canCreateVault: canCreate,
|
|
4315
|
+
cannotCreateReason,
|
|
4316
|
+
requirementsMet: canCreate,
|
|
4317
|
+
requirements: { isBypassed: true }
|
|
4307
4318
|
};
|
|
4308
4319
|
}
|
|
4309
4320
|
/**
|
|
@@ -4351,11 +4362,67 @@ var VaultManager = class {
|
|
|
4351
4362
|
if (existingVault) {
|
|
4352
4363
|
return { success: false, error: "Vault already exists", vaultAddress: existingVault };
|
|
4353
4364
|
}
|
|
4354
|
-
const status = await this.getVaultStatus();
|
|
4355
|
-
if (!status.canCreateVault) {
|
|
4356
|
-
return { success: false, error: status.cannotCreateReason || "Requirements not met" };
|
|
4357
|
-
}
|
|
4358
4365
|
const seed = seedAmount || BigInt(1e8);
|
|
4366
|
+
let usdcBalance;
|
|
4367
|
+
try {
|
|
4368
|
+
usdcBalance = await this.publicClient.readContract({
|
|
4369
|
+
address: this.addresses.usdc,
|
|
4370
|
+
abi: import_viem3.erc20Abi,
|
|
4371
|
+
functionName: "balanceOf",
|
|
4372
|
+
args: [this.account.address]
|
|
4373
|
+
});
|
|
4374
|
+
} catch {
|
|
4375
|
+
return { success: false, error: "Failed to read USDC balance" };
|
|
4376
|
+
}
|
|
4377
|
+
if (usdcBalance < seed) {
|
|
4378
|
+
const needed = Number(seed) / 1e6;
|
|
4379
|
+
const have = Number(usdcBalance) / 1e6;
|
|
4380
|
+
return {
|
|
4381
|
+
success: false,
|
|
4382
|
+
error: `Insufficient USDC: need ${needed} USDC seed but wallet has ${have} USDC. Fund ${this.account.address} with at least ${needed} USDC and retry.`
|
|
4383
|
+
};
|
|
4384
|
+
}
|
|
4385
|
+
try {
|
|
4386
|
+
const isAllowed = await this.publicClient.readContract({
|
|
4387
|
+
address: this.addresses.vaultFactory,
|
|
4388
|
+
abi: VAULT_FACTORY_ABI,
|
|
4389
|
+
functionName: "allowedAssets",
|
|
4390
|
+
args: [this.addresses.usdc]
|
|
4391
|
+
});
|
|
4392
|
+
if (!isAllowed) {
|
|
4393
|
+
return { success: false, error: "USDC is not whitelisted on the vault factory. Contact protocol admin." };
|
|
4394
|
+
}
|
|
4395
|
+
} catch {
|
|
4396
|
+
}
|
|
4397
|
+
try {
|
|
4398
|
+
const currentAllowance = await this.publicClient.readContract({
|
|
4399
|
+
address: this.addresses.usdc,
|
|
4400
|
+
abi: import_viem3.erc20Abi,
|
|
4401
|
+
functionName: "allowance",
|
|
4402
|
+
args: [this.account.address, this.addresses.vaultFactory]
|
|
4403
|
+
});
|
|
4404
|
+
if (currentAllowance < seed) {
|
|
4405
|
+
console.log(`Approving ${Number(seed) / 1e6} USDC to VaultFactory...`);
|
|
4406
|
+
const approveHash = await this.walletClient.writeContract({
|
|
4407
|
+
address: this.addresses.usdc,
|
|
4408
|
+
abi: import_viem3.erc20Abi,
|
|
4409
|
+
functionName: "approve",
|
|
4410
|
+
args: [this.addresses.vaultFactory, seed],
|
|
4411
|
+
chain: import_chains2.base,
|
|
4412
|
+
account: this.account
|
|
4413
|
+
});
|
|
4414
|
+
const approveReceipt = await this.publicClient.waitForTransactionReceipt({ hash: approveHash });
|
|
4415
|
+
if (approveReceipt.status !== "success") {
|
|
4416
|
+
return { success: false, error: "USDC approval transaction failed" };
|
|
4417
|
+
}
|
|
4418
|
+
console.log("USDC approved successfully");
|
|
4419
|
+
}
|
|
4420
|
+
} catch (error) {
|
|
4421
|
+
return {
|
|
4422
|
+
success: false,
|
|
4423
|
+
error: `USDC approval failed: ${error instanceof Error ? error.message : "Unknown error"}`
|
|
4424
|
+
};
|
|
4425
|
+
}
|
|
4359
4426
|
const vaultName = this.config.vaultConfig.defaultName || `${this.config.agentName} Trading Vault`;
|
|
4360
4427
|
const vaultSymbol = this.config.vaultConfig.defaultSymbol || `ex${this.config.agentName.replace(/[^a-zA-Z]/g, "").slice(0, 4).toUpperCase()}`;
|
|
4361
4428
|
const feeRecipient = this.config.vaultConfig.feeRecipient || this.account.address;
|
|
@@ -4377,8 +4444,9 @@ var VaultManager = class {
|
|
|
4377
4444
|
});
|
|
4378
4445
|
const receipt = await this.publicClient.waitForTransactionReceipt({ hash });
|
|
4379
4446
|
if (receipt.status !== "success") {
|
|
4380
|
-
return { success: false, error: "
|
|
4447
|
+
return { success: false, error: "createVault transaction reverted on-chain", txHash: hash };
|
|
4381
4448
|
}
|
|
4449
|
+
this.lastVaultCheck = 0;
|
|
4382
4450
|
const vaultAddress = await this.getVaultAddress();
|
|
4383
4451
|
this.cachedVaultAddress = vaultAddress;
|
|
4384
4452
|
return {
|
|
@@ -4387,10 +4455,23 @@ var VaultManager = class {
|
|
|
4387
4455
|
txHash: hash
|
|
4388
4456
|
};
|
|
4389
4457
|
} catch (error) {
|
|
4390
|
-
|
|
4391
|
-
|
|
4392
|
-
|
|
4393
|
-
}
|
|
4458
|
+
const msg = error instanceof Error ? error.message : "Unknown error";
|
|
4459
|
+
if (msg.includes("NotAgentOwner")) {
|
|
4460
|
+
return { success: false, error: "This wallet is not the owner of the agent. Only the agent owner can create a fund." };
|
|
4461
|
+
}
|
|
4462
|
+
if (msg.includes("InsufficientStake")) {
|
|
4463
|
+
return { success: false, error: "Staking requirement not met. This should not happen with StakingStub \u2014 contact protocol admin." };
|
|
4464
|
+
}
|
|
4465
|
+
if (msg.includes("FrontierCannotCreateVault")) {
|
|
4466
|
+
return { success: false, error: "Frontier-risk agents cannot create funds. Change the agent risk universe first." };
|
|
4467
|
+
}
|
|
4468
|
+
if (msg.includes("VaultAlreadyExists")) {
|
|
4469
|
+
return { success: false, error: "A fund already exists for this agent and asset." };
|
|
4470
|
+
}
|
|
4471
|
+
if (msg.includes("InsufficientSeed")) {
|
|
4472
|
+
return { success: false, error: `Seed amount too low. Minimum is 100 USDC.` };
|
|
4473
|
+
}
|
|
4474
|
+
return { success: false, error: msg };
|
|
4394
4475
|
}
|
|
4395
4476
|
}
|
|
4396
4477
|
/**
|
|
@@ -7680,7 +7761,7 @@ function loadSecureEnv(basePath, passphrase) {
|
|
|
7680
7761
|
}
|
|
7681
7762
|
|
|
7682
7763
|
// src/index.ts
|
|
7683
|
-
var AGENT_VERSION = "0.1.
|
|
7764
|
+
var AGENT_VERSION = "0.1.41";
|
|
7684
7765
|
|
|
7685
7766
|
// src/relay.ts
|
|
7686
7767
|
var RelayClient = class {
|
package/dist/cli.mjs
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -271,29 +271,21 @@ declare const PredictionConfigSchema: z.ZodOptional<z.ZodObject<{
|
|
|
271
271
|
maxTotalExposureUSD: number;
|
|
272
272
|
polygonAllocationUSD: number;
|
|
273
273
|
feeBridgeThresholdUSD: number;
|
|
274
|
-
vault?: {
|
|
275
|
-
enabled: boolean;
|
|
276
|
-
factoryAddress: string;
|
|
277
|
-
isVerified: boolean;
|
|
278
|
-
feeRecipient?: string | undefined;
|
|
279
|
-
feeCollectorAddress?: string | undefined;
|
|
280
|
-
vaultAddress?: string | undefined;
|
|
281
|
-
} | undefined;
|
|
282
274
|
polygonRpcUrl?: string | undefined;
|
|
283
275
|
clobApiKey?: string | undefined;
|
|
284
276
|
clobApiSecret?: string | undefined;
|
|
285
277
|
clobApiPassphrase?: string | undefined;
|
|
286
278
|
predictionRelayerKey?: string | undefined;
|
|
287
279
|
allowedCategories?: string[] | undefined;
|
|
288
|
-
}, {
|
|
289
280
|
vault?: {
|
|
281
|
+
enabled: boolean;
|
|
290
282
|
factoryAddress: string;
|
|
283
|
+
isVerified: boolean;
|
|
291
284
|
feeRecipient?: string | undefined;
|
|
292
|
-
enabled?: boolean | undefined;
|
|
293
285
|
feeCollectorAddress?: string | undefined;
|
|
294
286
|
vaultAddress?: string | undefined;
|
|
295
|
-
isVerified?: boolean | undefined;
|
|
296
287
|
} | undefined;
|
|
288
|
+
}, {
|
|
297
289
|
enabled?: boolean | undefined;
|
|
298
290
|
maxNotionalUSD?: number | undefined;
|
|
299
291
|
clobApiUrl?: string | undefined;
|
|
@@ -307,6 +299,14 @@ declare const PredictionConfigSchema: z.ZodOptional<z.ZodObject<{
|
|
|
307
299
|
polygonAllocationUSD?: number | undefined;
|
|
308
300
|
allowedCategories?: string[] | undefined;
|
|
309
301
|
feeBridgeThresholdUSD?: number | undefined;
|
|
302
|
+
vault?: {
|
|
303
|
+
factoryAddress: string;
|
|
304
|
+
feeRecipient?: string | undefined;
|
|
305
|
+
enabled?: boolean | undefined;
|
|
306
|
+
feeCollectorAddress?: string | undefined;
|
|
307
|
+
vaultAddress?: string | undefined;
|
|
308
|
+
isVerified?: boolean | undefined;
|
|
309
|
+
} | undefined;
|
|
310
310
|
}>>;
|
|
311
311
|
type PredictionConfig$1 = z.infer<typeof PredictionConfigSchema>;
|
|
312
312
|
declare const AgentConfigSchema: z.ZodObject<{
|
|
@@ -504,29 +504,21 @@ declare const AgentConfigSchema: z.ZodObject<{
|
|
|
504
504
|
maxTotalExposureUSD: number;
|
|
505
505
|
polygonAllocationUSD: number;
|
|
506
506
|
feeBridgeThresholdUSD: number;
|
|
507
|
-
vault?: {
|
|
508
|
-
enabled: boolean;
|
|
509
|
-
factoryAddress: string;
|
|
510
|
-
isVerified: boolean;
|
|
511
|
-
feeRecipient?: string | undefined;
|
|
512
|
-
feeCollectorAddress?: string | undefined;
|
|
513
|
-
vaultAddress?: string | undefined;
|
|
514
|
-
} | undefined;
|
|
515
507
|
polygonRpcUrl?: string | undefined;
|
|
516
508
|
clobApiKey?: string | undefined;
|
|
517
509
|
clobApiSecret?: string | undefined;
|
|
518
510
|
clobApiPassphrase?: string | undefined;
|
|
519
511
|
predictionRelayerKey?: string | undefined;
|
|
520
512
|
allowedCategories?: string[] | undefined;
|
|
521
|
-
}, {
|
|
522
513
|
vault?: {
|
|
514
|
+
enabled: boolean;
|
|
523
515
|
factoryAddress: string;
|
|
516
|
+
isVerified: boolean;
|
|
524
517
|
feeRecipient?: string | undefined;
|
|
525
|
-
enabled?: boolean | undefined;
|
|
526
518
|
feeCollectorAddress?: string | undefined;
|
|
527
519
|
vaultAddress?: string | undefined;
|
|
528
|
-
isVerified?: boolean | undefined;
|
|
529
520
|
} | undefined;
|
|
521
|
+
}, {
|
|
530
522
|
enabled?: boolean | undefined;
|
|
531
523
|
maxNotionalUSD?: number | undefined;
|
|
532
524
|
clobApiUrl?: string | undefined;
|
|
@@ -540,12 +532,27 @@ declare const AgentConfigSchema: z.ZodObject<{
|
|
|
540
532
|
polygonAllocationUSD?: number | undefined;
|
|
541
533
|
allowedCategories?: string[] | undefined;
|
|
542
534
|
feeBridgeThresholdUSD?: number | undefined;
|
|
535
|
+
vault?: {
|
|
536
|
+
factoryAddress: string;
|
|
537
|
+
feeRecipient?: string | undefined;
|
|
538
|
+
enabled?: boolean | undefined;
|
|
539
|
+
feeCollectorAddress?: string | undefined;
|
|
540
|
+
vaultAddress?: string | undefined;
|
|
541
|
+
isVerified?: boolean | undefined;
|
|
542
|
+
} | undefined;
|
|
543
543
|
}>>;
|
|
544
544
|
allowedTokens: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
545
545
|
}, "strip", z.ZodTypeAny, {
|
|
546
|
-
agentId: string | number;
|
|
547
546
|
name: string;
|
|
548
547
|
network: "mainnet";
|
|
548
|
+
vault: {
|
|
549
|
+
policy: "disabled" | "manual";
|
|
550
|
+
preferVaultTrading: boolean;
|
|
551
|
+
defaultName?: string | undefined;
|
|
552
|
+
defaultSymbol?: string | undefined;
|
|
553
|
+
feeRecipient?: string | undefined;
|
|
554
|
+
};
|
|
555
|
+
agentId: string | number;
|
|
549
556
|
llm: {
|
|
550
557
|
provider: "custom" | "openai" | "anthropic" | "google" | "deepseek" | "mistral" | "groq" | "together" | "ollama";
|
|
551
558
|
temperature: number;
|
|
@@ -564,13 +571,6 @@ declare const AgentConfigSchema: z.ZodObject<{
|
|
|
564
571
|
maxSlippageBps: number;
|
|
565
572
|
minTradeValueUSD: number;
|
|
566
573
|
};
|
|
567
|
-
vault: {
|
|
568
|
-
policy: "disabled" | "manual";
|
|
569
|
-
preferVaultTrading: boolean;
|
|
570
|
-
defaultName?: string | undefined;
|
|
571
|
-
defaultSymbol?: string | undefined;
|
|
572
|
-
feeRecipient?: string | undefined;
|
|
573
|
-
};
|
|
574
574
|
wallet?: {
|
|
575
575
|
setup: "generate" | "provide";
|
|
576
576
|
} | undefined;
|
|
@@ -598,6 +598,12 @@ declare const AgentConfigSchema: z.ZodObject<{
|
|
|
598
598
|
maxTotalExposureUSD: number;
|
|
599
599
|
polygonAllocationUSD: number;
|
|
600
600
|
feeBridgeThresholdUSD: number;
|
|
601
|
+
polygonRpcUrl?: string | undefined;
|
|
602
|
+
clobApiKey?: string | undefined;
|
|
603
|
+
clobApiSecret?: string | undefined;
|
|
604
|
+
clobApiPassphrase?: string | undefined;
|
|
605
|
+
predictionRelayerKey?: string | undefined;
|
|
606
|
+
allowedCategories?: string[] | undefined;
|
|
601
607
|
vault?: {
|
|
602
608
|
enabled: boolean;
|
|
603
609
|
factoryAddress: string;
|
|
@@ -606,17 +612,11 @@ declare const AgentConfigSchema: z.ZodObject<{
|
|
|
606
612
|
feeCollectorAddress?: string | undefined;
|
|
607
613
|
vaultAddress?: string | undefined;
|
|
608
614
|
} | undefined;
|
|
609
|
-
polygonRpcUrl?: string | undefined;
|
|
610
|
-
clobApiKey?: string | undefined;
|
|
611
|
-
clobApiSecret?: string | undefined;
|
|
612
|
-
clobApiPassphrase?: string | undefined;
|
|
613
|
-
predictionRelayerKey?: string | undefined;
|
|
614
|
-
allowedCategories?: string[] | undefined;
|
|
615
615
|
} | undefined;
|
|
616
616
|
allowedTokens?: string[] | undefined;
|
|
617
617
|
}, {
|
|
618
|
-
agentId: string | number;
|
|
619
618
|
name: string;
|
|
619
|
+
agentId: string | number;
|
|
620
620
|
llm: {
|
|
621
621
|
provider: "custom" | "openai" | "anthropic" | "google" | "deepseek" | "mistral" | "groq" | "together" | "ollama";
|
|
622
622
|
model?: string | undefined;
|
|
@@ -626,6 +626,13 @@ declare const AgentConfigSchema: z.ZodObject<{
|
|
|
626
626
|
maxTokens?: number | undefined;
|
|
627
627
|
};
|
|
628
628
|
network?: "mainnet" | undefined;
|
|
629
|
+
vault?: {
|
|
630
|
+
policy?: "disabled" | "manual" | undefined;
|
|
631
|
+
defaultName?: string | undefined;
|
|
632
|
+
defaultSymbol?: string | undefined;
|
|
633
|
+
feeRecipient?: string | undefined;
|
|
634
|
+
preferVaultTrading?: boolean | undefined;
|
|
635
|
+
} | undefined;
|
|
629
636
|
wallet?: {
|
|
630
637
|
setup?: "generate" | "provide" | undefined;
|
|
631
638
|
} | undefined;
|
|
@@ -639,13 +646,6 @@ declare const AgentConfigSchema: z.ZodObject<{
|
|
|
639
646
|
maxSlippageBps?: number | undefined;
|
|
640
647
|
minTradeValueUSD?: number | undefined;
|
|
641
648
|
} | undefined;
|
|
642
|
-
vault?: {
|
|
643
|
-
policy?: "disabled" | "manual" | undefined;
|
|
644
|
-
defaultName?: string | undefined;
|
|
645
|
-
defaultSymbol?: string | undefined;
|
|
646
|
-
feeRecipient?: string | undefined;
|
|
647
|
-
preferVaultTrading?: boolean | undefined;
|
|
648
|
-
} | undefined;
|
|
649
649
|
relay?: {
|
|
650
650
|
apiUrl: string;
|
|
651
651
|
enabled?: boolean | undefined;
|
|
@@ -663,14 +663,6 @@ declare const AgentConfigSchema: z.ZodObject<{
|
|
|
663
663
|
allowedInstruments?: string[] | undefined;
|
|
664
664
|
} | undefined;
|
|
665
665
|
prediction?: {
|
|
666
|
-
vault?: {
|
|
667
|
-
factoryAddress: string;
|
|
668
|
-
feeRecipient?: string | undefined;
|
|
669
|
-
enabled?: boolean | undefined;
|
|
670
|
-
feeCollectorAddress?: string | undefined;
|
|
671
|
-
vaultAddress?: string | undefined;
|
|
672
|
-
isVerified?: boolean | undefined;
|
|
673
|
-
} | undefined;
|
|
674
666
|
enabled?: boolean | undefined;
|
|
675
667
|
maxNotionalUSD?: number | undefined;
|
|
676
668
|
clobApiUrl?: string | undefined;
|
|
@@ -684,6 +676,14 @@ declare const AgentConfigSchema: z.ZodObject<{
|
|
|
684
676
|
polygonAllocationUSD?: number | undefined;
|
|
685
677
|
allowedCategories?: string[] | undefined;
|
|
686
678
|
feeBridgeThresholdUSD?: number | undefined;
|
|
679
|
+
vault?: {
|
|
680
|
+
factoryAddress: string;
|
|
681
|
+
feeRecipient?: string | undefined;
|
|
682
|
+
enabled?: boolean | undefined;
|
|
683
|
+
feeCollectorAddress?: string | undefined;
|
|
684
|
+
vaultAddress?: string | undefined;
|
|
685
|
+
isVerified?: boolean | undefined;
|
|
686
|
+
} | undefined;
|
|
687
687
|
} | undefined;
|
|
688
688
|
allowedTokens?: string[] | undefined;
|
|
689
689
|
}>;
|
|
@@ -3283,6 +3283,6 @@ declare function decryptEnvFile(encPath: string, passphrase: string): Record<str
|
|
|
3283
3283
|
declare function loadSecureEnv(basePath: string, passphrase?: string): boolean;
|
|
3284
3284
|
|
|
3285
3285
|
/** @exagent/agent package version — update alongside package.json */
|
|
3286
|
-
declare const AGENT_VERSION = "0.1.
|
|
3286
|
+
declare const AGENT_VERSION = "0.1.41";
|
|
3287
3287
|
|
|
3288
3288
|
export { AGENT_VERSION, type AccountSummary, type AgentConfig, AgentConfigSchema, type AgentMode, AgentRuntime, type AgentStatusPayload, AnthropicAdapter, BaseLLMAdapter, type BridgeResult, type BridgeStep, 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 LocalPosition, MARKET_CATEGORIES, MarketBrowser, type MarketCategory, 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, PolymarketClient, PositionManager, type PositionSummary, PositionTracker, type PredictionAccountSummary, type PredictionAction, type PredictionConfig$1 as PredictionConfig, PredictionConfigSchema, type PredictionFill, PredictionFunding, type PredictionFundingConfig, type PredictionMarket, PredictionOrderManager, type PredictionPosition, PredictionPositionManager, type PredictionStrategyFunction, PredictionTradeRecorder, type PredictionTradeSignal, type PredictionConfig as PredictionTradingConfig, type RecordPerpTradeParams, type RecordPredictionTradeParams, 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, calculatePredictionFee, createLLMAdapter, createSampleConfig, decodePredictionInstrument, decryptEnvFile, encodePredictionInstrument, encryptEnvFile, fillHashToBytes32, fillOidToBytes32, getAllStrategyTemplates, getNextNonce, getStrategyTemplate, loadConfig, loadSecureEnv, loadStrategy, orderIdToBytes32, tradeIdToBytes32, validateConfig, validateStrategy };
|
package/dist/index.d.ts
CHANGED
|
@@ -271,29 +271,21 @@ declare const PredictionConfigSchema: z.ZodOptional<z.ZodObject<{
|
|
|
271
271
|
maxTotalExposureUSD: number;
|
|
272
272
|
polygonAllocationUSD: number;
|
|
273
273
|
feeBridgeThresholdUSD: number;
|
|
274
|
-
vault?: {
|
|
275
|
-
enabled: boolean;
|
|
276
|
-
factoryAddress: string;
|
|
277
|
-
isVerified: boolean;
|
|
278
|
-
feeRecipient?: string | undefined;
|
|
279
|
-
feeCollectorAddress?: string | undefined;
|
|
280
|
-
vaultAddress?: string | undefined;
|
|
281
|
-
} | undefined;
|
|
282
274
|
polygonRpcUrl?: string | undefined;
|
|
283
275
|
clobApiKey?: string | undefined;
|
|
284
276
|
clobApiSecret?: string | undefined;
|
|
285
277
|
clobApiPassphrase?: string | undefined;
|
|
286
278
|
predictionRelayerKey?: string | undefined;
|
|
287
279
|
allowedCategories?: string[] | undefined;
|
|
288
|
-
}, {
|
|
289
280
|
vault?: {
|
|
281
|
+
enabled: boolean;
|
|
290
282
|
factoryAddress: string;
|
|
283
|
+
isVerified: boolean;
|
|
291
284
|
feeRecipient?: string | undefined;
|
|
292
|
-
enabled?: boolean | undefined;
|
|
293
285
|
feeCollectorAddress?: string | undefined;
|
|
294
286
|
vaultAddress?: string | undefined;
|
|
295
|
-
isVerified?: boolean | undefined;
|
|
296
287
|
} | undefined;
|
|
288
|
+
}, {
|
|
297
289
|
enabled?: boolean | undefined;
|
|
298
290
|
maxNotionalUSD?: number | undefined;
|
|
299
291
|
clobApiUrl?: string | undefined;
|
|
@@ -307,6 +299,14 @@ declare const PredictionConfigSchema: z.ZodOptional<z.ZodObject<{
|
|
|
307
299
|
polygonAllocationUSD?: number | undefined;
|
|
308
300
|
allowedCategories?: string[] | undefined;
|
|
309
301
|
feeBridgeThresholdUSD?: number | undefined;
|
|
302
|
+
vault?: {
|
|
303
|
+
factoryAddress: string;
|
|
304
|
+
feeRecipient?: string | undefined;
|
|
305
|
+
enabled?: boolean | undefined;
|
|
306
|
+
feeCollectorAddress?: string | undefined;
|
|
307
|
+
vaultAddress?: string | undefined;
|
|
308
|
+
isVerified?: boolean | undefined;
|
|
309
|
+
} | undefined;
|
|
310
310
|
}>>;
|
|
311
311
|
type PredictionConfig$1 = z.infer<typeof PredictionConfigSchema>;
|
|
312
312
|
declare const AgentConfigSchema: z.ZodObject<{
|
|
@@ -504,29 +504,21 @@ declare const AgentConfigSchema: z.ZodObject<{
|
|
|
504
504
|
maxTotalExposureUSD: number;
|
|
505
505
|
polygonAllocationUSD: number;
|
|
506
506
|
feeBridgeThresholdUSD: number;
|
|
507
|
-
vault?: {
|
|
508
|
-
enabled: boolean;
|
|
509
|
-
factoryAddress: string;
|
|
510
|
-
isVerified: boolean;
|
|
511
|
-
feeRecipient?: string | undefined;
|
|
512
|
-
feeCollectorAddress?: string | undefined;
|
|
513
|
-
vaultAddress?: string | undefined;
|
|
514
|
-
} | undefined;
|
|
515
507
|
polygonRpcUrl?: string | undefined;
|
|
516
508
|
clobApiKey?: string | undefined;
|
|
517
509
|
clobApiSecret?: string | undefined;
|
|
518
510
|
clobApiPassphrase?: string | undefined;
|
|
519
511
|
predictionRelayerKey?: string | undefined;
|
|
520
512
|
allowedCategories?: string[] | undefined;
|
|
521
|
-
}, {
|
|
522
513
|
vault?: {
|
|
514
|
+
enabled: boolean;
|
|
523
515
|
factoryAddress: string;
|
|
516
|
+
isVerified: boolean;
|
|
524
517
|
feeRecipient?: string | undefined;
|
|
525
|
-
enabled?: boolean | undefined;
|
|
526
518
|
feeCollectorAddress?: string | undefined;
|
|
527
519
|
vaultAddress?: string | undefined;
|
|
528
|
-
isVerified?: boolean | undefined;
|
|
529
520
|
} | undefined;
|
|
521
|
+
}, {
|
|
530
522
|
enabled?: boolean | undefined;
|
|
531
523
|
maxNotionalUSD?: number | undefined;
|
|
532
524
|
clobApiUrl?: string | undefined;
|
|
@@ -540,12 +532,27 @@ declare const AgentConfigSchema: z.ZodObject<{
|
|
|
540
532
|
polygonAllocationUSD?: number | undefined;
|
|
541
533
|
allowedCategories?: string[] | undefined;
|
|
542
534
|
feeBridgeThresholdUSD?: number | undefined;
|
|
535
|
+
vault?: {
|
|
536
|
+
factoryAddress: string;
|
|
537
|
+
feeRecipient?: string | undefined;
|
|
538
|
+
enabled?: boolean | undefined;
|
|
539
|
+
feeCollectorAddress?: string | undefined;
|
|
540
|
+
vaultAddress?: string | undefined;
|
|
541
|
+
isVerified?: boolean | undefined;
|
|
542
|
+
} | undefined;
|
|
543
543
|
}>>;
|
|
544
544
|
allowedTokens: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
545
545
|
}, "strip", z.ZodTypeAny, {
|
|
546
|
-
agentId: string | number;
|
|
547
546
|
name: string;
|
|
548
547
|
network: "mainnet";
|
|
548
|
+
vault: {
|
|
549
|
+
policy: "disabled" | "manual";
|
|
550
|
+
preferVaultTrading: boolean;
|
|
551
|
+
defaultName?: string | undefined;
|
|
552
|
+
defaultSymbol?: string | undefined;
|
|
553
|
+
feeRecipient?: string | undefined;
|
|
554
|
+
};
|
|
555
|
+
agentId: string | number;
|
|
549
556
|
llm: {
|
|
550
557
|
provider: "custom" | "openai" | "anthropic" | "google" | "deepseek" | "mistral" | "groq" | "together" | "ollama";
|
|
551
558
|
temperature: number;
|
|
@@ -564,13 +571,6 @@ declare const AgentConfigSchema: z.ZodObject<{
|
|
|
564
571
|
maxSlippageBps: number;
|
|
565
572
|
minTradeValueUSD: number;
|
|
566
573
|
};
|
|
567
|
-
vault: {
|
|
568
|
-
policy: "disabled" | "manual";
|
|
569
|
-
preferVaultTrading: boolean;
|
|
570
|
-
defaultName?: string | undefined;
|
|
571
|
-
defaultSymbol?: string | undefined;
|
|
572
|
-
feeRecipient?: string | undefined;
|
|
573
|
-
};
|
|
574
574
|
wallet?: {
|
|
575
575
|
setup: "generate" | "provide";
|
|
576
576
|
} | undefined;
|
|
@@ -598,6 +598,12 @@ declare const AgentConfigSchema: z.ZodObject<{
|
|
|
598
598
|
maxTotalExposureUSD: number;
|
|
599
599
|
polygonAllocationUSD: number;
|
|
600
600
|
feeBridgeThresholdUSD: number;
|
|
601
|
+
polygonRpcUrl?: string | undefined;
|
|
602
|
+
clobApiKey?: string | undefined;
|
|
603
|
+
clobApiSecret?: string | undefined;
|
|
604
|
+
clobApiPassphrase?: string | undefined;
|
|
605
|
+
predictionRelayerKey?: string | undefined;
|
|
606
|
+
allowedCategories?: string[] | undefined;
|
|
601
607
|
vault?: {
|
|
602
608
|
enabled: boolean;
|
|
603
609
|
factoryAddress: string;
|
|
@@ -606,17 +612,11 @@ declare const AgentConfigSchema: z.ZodObject<{
|
|
|
606
612
|
feeCollectorAddress?: string | undefined;
|
|
607
613
|
vaultAddress?: string | undefined;
|
|
608
614
|
} | undefined;
|
|
609
|
-
polygonRpcUrl?: string | undefined;
|
|
610
|
-
clobApiKey?: string | undefined;
|
|
611
|
-
clobApiSecret?: string | undefined;
|
|
612
|
-
clobApiPassphrase?: string | undefined;
|
|
613
|
-
predictionRelayerKey?: string | undefined;
|
|
614
|
-
allowedCategories?: string[] | undefined;
|
|
615
615
|
} | undefined;
|
|
616
616
|
allowedTokens?: string[] | undefined;
|
|
617
617
|
}, {
|
|
618
|
-
agentId: string | number;
|
|
619
618
|
name: string;
|
|
619
|
+
agentId: string | number;
|
|
620
620
|
llm: {
|
|
621
621
|
provider: "custom" | "openai" | "anthropic" | "google" | "deepseek" | "mistral" | "groq" | "together" | "ollama";
|
|
622
622
|
model?: string | undefined;
|
|
@@ -626,6 +626,13 @@ declare const AgentConfigSchema: z.ZodObject<{
|
|
|
626
626
|
maxTokens?: number | undefined;
|
|
627
627
|
};
|
|
628
628
|
network?: "mainnet" | undefined;
|
|
629
|
+
vault?: {
|
|
630
|
+
policy?: "disabled" | "manual" | undefined;
|
|
631
|
+
defaultName?: string | undefined;
|
|
632
|
+
defaultSymbol?: string | undefined;
|
|
633
|
+
feeRecipient?: string | undefined;
|
|
634
|
+
preferVaultTrading?: boolean | undefined;
|
|
635
|
+
} | undefined;
|
|
629
636
|
wallet?: {
|
|
630
637
|
setup?: "generate" | "provide" | undefined;
|
|
631
638
|
} | undefined;
|
|
@@ -639,13 +646,6 @@ declare const AgentConfigSchema: z.ZodObject<{
|
|
|
639
646
|
maxSlippageBps?: number | undefined;
|
|
640
647
|
minTradeValueUSD?: number | undefined;
|
|
641
648
|
} | undefined;
|
|
642
|
-
vault?: {
|
|
643
|
-
policy?: "disabled" | "manual" | undefined;
|
|
644
|
-
defaultName?: string | undefined;
|
|
645
|
-
defaultSymbol?: string | undefined;
|
|
646
|
-
feeRecipient?: string | undefined;
|
|
647
|
-
preferVaultTrading?: boolean | undefined;
|
|
648
|
-
} | undefined;
|
|
649
649
|
relay?: {
|
|
650
650
|
apiUrl: string;
|
|
651
651
|
enabled?: boolean | undefined;
|
|
@@ -663,14 +663,6 @@ declare const AgentConfigSchema: z.ZodObject<{
|
|
|
663
663
|
allowedInstruments?: string[] | undefined;
|
|
664
664
|
} | undefined;
|
|
665
665
|
prediction?: {
|
|
666
|
-
vault?: {
|
|
667
|
-
factoryAddress: string;
|
|
668
|
-
feeRecipient?: string | undefined;
|
|
669
|
-
enabled?: boolean | undefined;
|
|
670
|
-
feeCollectorAddress?: string | undefined;
|
|
671
|
-
vaultAddress?: string | undefined;
|
|
672
|
-
isVerified?: boolean | undefined;
|
|
673
|
-
} | undefined;
|
|
674
666
|
enabled?: boolean | undefined;
|
|
675
667
|
maxNotionalUSD?: number | undefined;
|
|
676
668
|
clobApiUrl?: string | undefined;
|
|
@@ -684,6 +676,14 @@ declare const AgentConfigSchema: z.ZodObject<{
|
|
|
684
676
|
polygonAllocationUSD?: number | undefined;
|
|
685
677
|
allowedCategories?: string[] | undefined;
|
|
686
678
|
feeBridgeThresholdUSD?: number | undefined;
|
|
679
|
+
vault?: {
|
|
680
|
+
factoryAddress: string;
|
|
681
|
+
feeRecipient?: string | undefined;
|
|
682
|
+
enabled?: boolean | undefined;
|
|
683
|
+
feeCollectorAddress?: string | undefined;
|
|
684
|
+
vaultAddress?: string | undefined;
|
|
685
|
+
isVerified?: boolean | undefined;
|
|
686
|
+
} | undefined;
|
|
687
687
|
} | undefined;
|
|
688
688
|
allowedTokens?: string[] | undefined;
|
|
689
689
|
}>;
|
|
@@ -3283,6 +3283,6 @@ declare function decryptEnvFile(encPath: string, passphrase: string): Record<str
|
|
|
3283
3283
|
declare function loadSecureEnv(basePath: string, passphrase?: string): boolean;
|
|
3284
3284
|
|
|
3285
3285
|
/** @exagent/agent package version — update alongside package.json */
|
|
3286
|
-
declare const AGENT_VERSION = "0.1.
|
|
3286
|
+
declare const AGENT_VERSION = "0.1.41";
|
|
3287
3287
|
|
|
3288
3288
|
export { AGENT_VERSION, type AccountSummary, type AgentConfig, AgentConfigSchema, type AgentMode, AgentRuntime, type AgentStatusPayload, AnthropicAdapter, BaseLLMAdapter, type BridgeResult, type BridgeStep, 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 LocalPosition, MARKET_CATEGORIES, MarketBrowser, type MarketCategory, 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, PolymarketClient, PositionManager, type PositionSummary, PositionTracker, type PredictionAccountSummary, type PredictionAction, type PredictionConfig$1 as PredictionConfig, PredictionConfigSchema, type PredictionFill, PredictionFunding, type PredictionFundingConfig, type PredictionMarket, PredictionOrderManager, type PredictionPosition, PredictionPositionManager, type PredictionStrategyFunction, PredictionTradeRecorder, type PredictionTradeSignal, type PredictionConfig as PredictionTradingConfig, type RecordPerpTradeParams, type RecordPredictionTradeParams, 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, calculatePredictionFee, createLLMAdapter, createSampleConfig, decodePredictionInstrument, decryptEnvFile, encodePredictionInstrument, encryptEnvFile, fillHashToBytes32, fillOidToBytes32, getAllStrategyTemplates, getNextNonce, getStrategyTemplate, loadConfig, loadSecureEnv, loadStrategy, orderIdToBytes32, tradeIdToBytes32, validateConfig, validateStrategy };
|