@exagent/sdk 0.1.0

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.
@@ -0,0 +1,2458 @@
1
+ import * as viem from 'viem';
2
+ import { Address, Hash, Chain, Account, WalletClient } from 'viem';
3
+ import * as viem_chains from 'viem/chains';
4
+
5
+ /**
6
+ * Agent profile as stored on-chain
7
+ */
8
+ interface AgentProfile {
9
+ agentId: bigint;
10
+ owner: Address;
11
+ name: string;
12
+ metadataURI: string;
13
+ registrationTime: bigint;
14
+ verified: boolean;
15
+ linkedWalletCount: bigint;
16
+ }
17
+ /**
18
+ * Agent metadata stored on IPFS
19
+ */
20
+ interface AgentMetadata {
21
+ name: string;
22
+ description: string;
23
+ capabilities: string[];
24
+ model?: string;
25
+ framework?: string;
26
+ avatar?: string;
27
+ website?: string;
28
+ social?: {
29
+ twitter?: string;
30
+ moltbook?: string;
31
+ };
32
+ }
33
+ /**
34
+ * Trade intent for broadcasting
35
+ */
36
+ interface TradeIntent {
37
+ action: 'BUY' | 'SELL';
38
+ tokenIn: Address;
39
+ tokenOut: Address;
40
+ amountIn: bigint;
41
+ minAmountOut?: bigint;
42
+ maxSlippageBps?: number;
43
+ deadline?: number;
44
+ }
45
+ /**
46
+ * M2M service request
47
+ */
48
+ interface ServiceRequest {
49
+ serviceType: string;
50
+ providerId?: bigint;
51
+ maxPriceAX: bigint;
52
+ payload: Record<string, unknown>;
53
+ deadline?: number;
54
+ }
55
+ /**
56
+ * Performance metrics snapshot
57
+ */
58
+ interface PerformanceSnapshot {
59
+ agentId: bigint;
60
+ timestamp: bigint;
61
+ pnlBps: number;
62
+ tradeCount: number;
63
+ volumeUSD: bigint;
64
+ sharpeRatio?: number;
65
+ sortinoRatio?: number;
66
+ maxDrawdownBps?: number;
67
+ }
68
+ /**
69
+ * DEX route quote from 0x API
70
+ */
71
+ interface RouteQuote {
72
+ tokenIn: Address;
73
+ tokenOut: Address;
74
+ amountIn: string;
75
+ amountOut: string;
76
+ minAmountOut: string;
77
+ priceImpactBps: number;
78
+ route: RouteStep[];
79
+ transaction: {
80
+ to: Address;
81
+ data: `0x${string}`;
82
+ value: string;
83
+ };
84
+ gasEstimate: string;
85
+ validUntil: number;
86
+ permit2?: {
87
+ eip712: unknown;
88
+ };
89
+ issues?: {
90
+ allowance?: {
91
+ spender: Address;
92
+ actual: string;
93
+ expected: string;
94
+ };
95
+ };
96
+ mock?: boolean;
97
+ }
98
+ /**
99
+ * Route step through a DEX
100
+ */
101
+ interface RouteStep {
102
+ dex: string;
103
+ pool: string;
104
+ share: number;
105
+ }
106
+ /**
107
+ * Price quote (no transaction data)
108
+ */
109
+ interface PriceQuote {
110
+ tokenIn: Address;
111
+ tokenOut: Address;
112
+ amountIn: string;
113
+ amountOut: string;
114
+ priceImpactBps: number;
115
+ mock?: boolean;
116
+ }
117
+ /**
118
+ * Router trade response - transaction routed through ExagentRouter
119
+ */
120
+ interface RouterTradeResponse {
121
+ agentId: number;
122
+ tokenIn: Address;
123
+ tokenOut: Address;
124
+ amountIn: string;
125
+ amountOut: string;
126
+ minAmountOut: string;
127
+ priceImpactBps: number;
128
+ route: RouteStep[];
129
+ transaction: {
130
+ to: Address;
131
+ data: `0x${string}`;
132
+ value: string;
133
+ };
134
+ approvals: Array<{
135
+ token: Address;
136
+ spender: Address;
137
+ amount: string;
138
+ }>;
139
+ gasEstimate: string;
140
+ validUntil: number;
141
+ attribution: {
142
+ router: Address;
143
+ aggregator: Address;
144
+ agentId: number;
145
+ };
146
+ mock?: boolean;
147
+ }
148
+ /**
149
+ * Trade execution result
150
+ */
151
+ interface TradeResult {
152
+ hash: Hash;
153
+ agentId: bigint;
154
+ tokenIn: Address;
155
+ tokenOut: Address;
156
+ amountIn: string;
157
+ expectedAmountOut: string;
158
+ }
159
+ /**
160
+ * Basic staking info (raw contract data)
161
+ */
162
+ interface StakeInfo {
163
+ amount: bigint;
164
+ unlockTime: bigint;
165
+ lockDuration: bigint;
166
+ vEXABalance: bigint;
167
+ }
168
+ /**
169
+ * Extended staking info with computed fields
170
+ */
171
+ interface StakingInfo$1 extends StakeInfo {
172
+ /** Current vEXA balance (with time decay applied) */
173
+ currentVeEXA: bigint;
174
+ /** Whether the lock has expired */
175
+ isUnlocked: boolean;
176
+ /** Remaining time until unlock in seconds */
177
+ remainingLockTime: bigint;
178
+ }
179
+ /**
180
+ * Delegation info for an agent
181
+ */
182
+ interface DelegationInfo$1 {
183
+ /** Total vEXA delegated to this agent */
184
+ totalVeEXA: bigint;
185
+ /** Number of unique delegators */
186
+ delegatorCount: bigint;
187
+ }
188
+ /**
189
+ * Discount tier for trading fee reductions based on vEXA holdings
190
+ * - none: 0% discount (0 vEXA)
191
+ * - bronze: 10% discount (10,000+ vEXA)
192
+ * - silver: 25% discount (50,000+ vEXA)
193
+ * - gold: 50% discount (100,000+ vEXA)
194
+ */
195
+ type DiscountTier$1 = 'none' | 'bronze' | 'silver' | 'gold';
196
+ /**
197
+ * Vault configuration for creating a new vault
198
+ */
199
+ interface VaultConfig {
200
+ agentId: bigint;
201
+ asset: Address;
202
+ name: string;
203
+ symbol: string;
204
+ feeRecipient: Address;
205
+ performanceFeeBps?: number;
206
+ managementFeeBps?: number;
207
+ }
208
+ /**
209
+ * Vault summary for listing
210
+ */
211
+ interface VaultSummary {
212
+ address: Address;
213
+ name: string;
214
+ symbol: string;
215
+ asset: Address;
216
+ agentId: bigint;
217
+ totalAssets: bigint;
218
+ sharePrice: bigint;
219
+ performanceFeeBps: number;
220
+ managementFeeBps: number;
221
+ depositorCount: number;
222
+ totalPnlBps: number;
223
+ isAcceptingDeposits: boolean;
224
+ }
225
+ /**
226
+ * User's vault position for portfolio display
227
+ */
228
+ interface UserVaultPosition {
229
+ vault: Address;
230
+ vaultName: string;
231
+ shares: bigint;
232
+ assetsValue: bigint;
233
+ entryPrice: bigint;
234
+ currentPrice: bigint;
235
+ pnlBps: number;
236
+ pnlUsd: bigint;
237
+ pendingWithdrawals: bigint;
238
+ }
239
+ /**
240
+ * Vault deposit/withdrawal history entry
241
+ */
242
+ interface VaultActivityEntry {
243
+ type: 'deposit' | 'withdraw' | 'request_withdrawal' | 'claim_withdrawal' | 'emergency_withdraw';
244
+ user: Address;
245
+ vault: Address;
246
+ shares: bigint;
247
+ assets: bigint;
248
+ timestamp: bigint;
249
+ txHash: Hash;
250
+ }
251
+ /**
252
+ * Vault trade executed by agent
253
+ */
254
+ interface VaultTradeEntry {
255
+ agentId: bigint;
256
+ vault: Address;
257
+ tokenIn: Address;
258
+ tokenOut: Address;
259
+ amountIn: bigint;
260
+ amountOut: bigint;
261
+ aggregator: Address;
262
+ timestamp: bigint;
263
+ txHash: Hash;
264
+ }
265
+
266
+ /**
267
+ * Wrapper for ExagentRegistry contract interactions
268
+ */
269
+ declare class ExagentRegistry {
270
+ private readonly address;
271
+ private readonly publicClient;
272
+ private readonly walletClient?;
273
+ private readonly chain;
274
+ private readonly account?;
275
+ constructor(address: Address, publicClient: any, walletClient: any | undefined, chain: Chain, account?: Account);
276
+ /**
277
+ * Register a new agent
278
+ * @param name Unique agent name (3-32 chars, alphanumeric + spaces/hyphens/underscores)
279
+ * @param metadataURI IPFS URI for agent metadata
280
+ * @returns Transaction hash
281
+ */
282
+ register(name: string, metadataURI: string): Promise<Hash>;
283
+ /**
284
+ * Check if a name is available for registration
285
+ * @param name The name to check
286
+ * @returns True if the name can be used
287
+ */
288
+ isNameAvailable(name: string): Promise<boolean>;
289
+ /**
290
+ * Get the agent ID that owns a specific name
291
+ * @param name The name to look up
292
+ * @returns Agent ID (0 if not taken)
293
+ */
294
+ getAgentByName(name: string): Promise<bigint>;
295
+ /**
296
+ * Link the wallet used by the agent to their agent ID
297
+ * @param agentId The agent's ID
298
+ * @returns Transaction hash
299
+ */
300
+ linkOwnWallet(agentId: bigint): Promise<Hash>;
301
+ /**
302
+ * Link an external wallet with signature proof
303
+ * @param agentId The agent's ID
304
+ * @param wallet The wallet to link
305
+ * @param signature Signature from the wallet proving ownership
306
+ * @returns Transaction hash
307
+ */
308
+ linkWallet(agentId: bigint, wallet: Address, signature: `0x${string}`): Promise<Hash>;
309
+ /**
310
+ * Unlink a wallet from an agent
311
+ * @param agentId The agent's ID
312
+ * @param wallet The wallet to unlink
313
+ * @returns Transaction hash
314
+ */
315
+ unlinkWallet(agentId: bigint, wallet: Address): Promise<Hash>;
316
+ /**
317
+ * Update agent metadata
318
+ * @param agentId The agent's ID
319
+ * @param newURI New IPFS URI for metadata
320
+ * @returns Transaction hash
321
+ */
322
+ updateMetadata(agentId: bigint, newURI: string): Promise<Hash>;
323
+ /**
324
+ * Get agent profile by ID
325
+ * @param agentId The agent's ID
326
+ * @returns Agent profile data
327
+ */
328
+ getAgent(agentId: bigint): Promise<AgentProfile>;
329
+ /**
330
+ * Get all linked wallets for an agent
331
+ * @param agentId The agent's ID
332
+ * @returns Array of linked wallet addresses
333
+ */
334
+ getLinkedWallets(agentId: bigint): Promise<Address[]>;
335
+ /**
336
+ * Get agent ID for a wallet (for trade attribution)
337
+ * @param wallet The wallet address
338
+ * @returns Agent ID (0 if not linked)
339
+ */
340
+ getAgentForWallet(wallet: Address): Promise<bigint>;
341
+ /**
342
+ * Check if a wallet is linked to a specific agent
343
+ * @param agentId The agent's ID
344
+ * @param wallet The wallet address to check
345
+ * @returns True if the wallet is linked to the agent
346
+ */
347
+ isLinkedWallet(agentId: bigint, wallet: Address): Promise<boolean>;
348
+ /**
349
+ * Get the nonce for wallet linking signature
350
+ * @param wallet The wallet address
351
+ * @returns Current nonce
352
+ */
353
+ getNonce(wallet: Address): Promise<bigint>;
354
+ /**
355
+ * Get the next agent ID that will be assigned
356
+ * @returns Next agent ID
357
+ */
358
+ getNextAgentId(): Promise<bigint>;
359
+ /**
360
+ * Generate the message to sign for wallet linking
361
+ * @param wallet The wallet to link
362
+ * @param agentId The agent ID to link to
363
+ * @param nonce The current nonce for the wallet
364
+ * @returns Message to sign
365
+ */
366
+ static generateLinkMessage(wallet: Address, agentId: bigint, nonce: bigint): string;
367
+ /**
368
+ * Get the agent owned by a wallet (not linked, owned)
369
+ * @param wallet The wallet to look up
370
+ * @returns Agent ID (0 if wallet doesn't own an agent)
371
+ */
372
+ getAgentByOwner(wallet: Address): Promise<bigint>;
373
+ /**
374
+ * Check if a wallet can register a new agent
375
+ * @param wallet The wallet to check
376
+ * @returns Object with canRegister boolean and existingAgentId (0 if none)
377
+ */
378
+ canWalletRegister(wallet: Address): Promise<{
379
+ canRegister: boolean;
380
+ existingAgentId: bigint;
381
+ }>;
382
+ /**
383
+ * Get the registry contract version
384
+ * @returns Version string (e.g., "4.0.0")
385
+ */
386
+ getVersion(): Promise<string>;
387
+ /**
388
+ * Update the agent's LLM config hash on-chain
389
+ * @param agentId The agent's ID
390
+ * @param configHash The keccak256 hash of (provider, model)
391
+ * @returns Transaction hash
392
+ */
393
+ updateConfig(agentId: bigint, configHash: `0x${string}`): Promise<Hash>;
394
+ /**
395
+ * Get the current config hash for an agent
396
+ * @param agentId The agent's ID
397
+ * @returns Config hash (bytes32(0) if never set)
398
+ */
399
+ getConfigHash(agentId: bigint): Promise<`0x${string}`>;
400
+ /**
401
+ * Get the current epoch ID for an agent
402
+ * @param agentId The agent's ID
403
+ * @returns Current epoch (0 if never configured)
404
+ */
405
+ getCurrentEpoch(agentId: bigint): Promise<bigint>;
406
+ /**
407
+ * Get full config info for an agent
408
+ * @param agentId The agent's ID
409
+ * @returns AgentConfig struct (configHash, epochId, epochStartBlock)
410
+ */
411
+ getAgentConfig(agentId: bigint): Promise<{
412
+ configHash: `0x${string}`;
413
+ epochId: bigint;
414
+ epochStartBlock: bigint;
415
+ }>;
416
+ /**
417
+ * Get the config hash for a specific epoch
418
+ * @param agentId The agent's ID
419
+ * @param epochId The epoch to look up
420
+ * @returns Config hash for that epoch
421
+ */
422
+ getEpochConfigHash(agentId: bigint, epochId: bigint): Promise<`0x${string}`>;
423
+ /**
424
+ * Calculate the config hash for a provider and model
425
+ * @param provider The LLM provider name (e.g., "openai", "anthropic")
426
+ * @param model The model name (e.g., "gpt-4", "claude-opus-4.5")
427
+ * @returns keccak256 hash of the config
428
+ */
429
+ static calculateConfigHash(provider: string, model: string): `0x${string}`;
430
+ }
431
+
432
+ /**
433
+ * Vault info
434
+ */
435
+ interface VaultInfo {
436
+ address: Address;
437
+ name: string;
438
+ symbol: string;
439
+ asset: Address;
440
+ agentId: bigint;
441
+ totalAssets: bigint;
442
+ totalSupply: bigint;
443
+ sharePrice: bigint;
444
+ highWaterMark: bigint;
445
+ performanceFeeBps: bigint;
446
+ managementFeeBps: bigint;
447
+ feeRecipient: Address;
448
+ depositsPaused: boolean;
449
+ withdrawalsPaused: boolean;
450
+ circuitBreakerActive: boolean;
451
+ }
452
+ /**
453
+ * User's vault position
454
+ */
455
+ interface VaultPosition {
456
+ shares: bigint;
457
+ effectiveShares: bigint;
458
+ pendingWithdrawals: bigint;
459
+ assetsValue: bigint;
460
+ userHighWaterMark: bigint;
461
+ canWithdraw: boolean;
462
+ cooldownRemaining: bigint;
463
+ }
464
+ /**
465
+ * Withdrawal request details
466
+ */
467
+ interface WithdrawalRequest {
468
+ requestId: bigint;
469
+ owner: Address;
470
+ receiver: Address;
471
+ shares: bigint;
472
+ requestTime: bigint;
473
+ processed: boolean;
474
+ claimableAt: bigint;
475
+ }
476
+ /**
477
+ * ExagentVault SDK interface for ERC-4626 copy trading vaults
478
+ */
479
+ declare class ExagentVault {
480
+ readonly address: Address;
481
+ private readonly publicClient;
482
+ private readonly walletClient?;
483
+ private readonly chain;
484
+ private readonly account?;
485
+ constructor(vaultAddress: Address, publicClient: any, walletClient?: any, chain?: Chain, account?: Account);
486
+ /**
487
+ * Get comprehensive vault info
488
+ */
489
+ getVaultInfo(): Promise<VaultInfo>;
490
+ /**
491
+ * Get user's position in the vault
492
+ */
493
+ getPosition(user: Address): Promise<VaultPosition>;
494
+ /**
495
+ * Get current share price (assets per share, scaled to 1e18)
496
+ */
497
+ getSharePrice(): Promise<bigint>;
498
+ /**
499
+ * Preview deposit - get shares for given assets
500
+ */
501
+ previewDeposit(assets: bigint): Promise<bigint>;
502
+ /**
503
+ * Preview withdrawal - get assets for given shares
504
+ */
505
+ previewRedeem(shares: bigint): Promise<bigint>;
506
+ /**
507
+ * Get max deposit amount
508
+ */
509
+ maxDeposit(receiver: Address): Promise<bigint>;
510
+ /**
511
+ * Get max withdrawal amount
512
+ */
513
+ maxWithdraw(owner: Address): Promise<bigint>;
514
+ /**
515
+ * Get rate limit status
516
+ */
517
+ getRateLimitStatus(): Promise<{
518
+ remaining: bigint;
519
+ periodEnds: bigint;
520
+ }>;
521
+ /**
522
+ * Get pending withdrawal request
523
+ */
524
+ getPendingWithdrawal(requestId: bigint): Promise<WithdrawalRequest>;
525
+ /**
526
+ * Deposit assets into the vault
527
+ * @param assets Amount of underlying asset to deposit
528
+ * @param receiver Address to receive vault shares
529
+ * @returns Transaction hash
530
+ */
531
+ deposit(assets: bigint, receiver?: Address): Promise<Hash>;
532
+ /**
533
+ * Withdraw assets from the vault
534
+ * @param assets Amount of underlying asset to withdraw
535
+ * @param receiver Address to receive assets
536
+ * @param owner Address whose shares to burn (defaults to caller)
537
+ * @returns Transaction hash
538
+ */
539
+ withdraw(assets: bigint, receiver?: Address, owner?: Address): Promise<Hash>;
540
+ /**
541
+ * Redeem shares for assets
542
+ * @param shares Amount of shares to redeem
543
+ * @param receiver Address to receive assets
544
+ * @param owner Address whose shares to burn (defaults to caller)
545
+ * @returns Transaction hash
546
+ */
547
+ redeem(shares: bigint, receiver?: Address, owner?: Address): Promise<Hash>;
548
+ /**
549
+ * Request a queued withdrawal (for large amounts)
550
+ * @param shares Amount of shares to withdraw
551
+ * @param receiver Address to receive assets
552
+ * @returns Transaction hash
553
+ */
554
+ requestWithdrawal(shares: bigint, receiver?: Address): Promise<Hash>;
555
+ /**
556
+ * Claim a pending withdrawal request
557
+ * @param requestId The withdrawal request ID
558
+ * @returns Transaction hash
559
+ */
560
+ claimWithdrawal(requestId: bigint): Promise<Hash>;
561
+ /**
562
+ * Cancel a pending withdrawal request
563
+ * @param requestId The withdrawal request ID
564
+ * @returns Transaction hash
565
+ */
566
+ cancelWithdrawal(requestId: bigint): Promise<Hash>;
567
+ /**
568
+ * Emergency withdrawal (bypasses cooldown, forfeits pending rewards)
569
+ * @returns Transaction hash
570
+ */
571
+ emergencyWithdraw(): Promise<Hash>;
572
+ /**
573
+ * Approve vault to spend underlying asset
574
+ * @param assetAddress The asset token address
575
+ * @param amount Amount to approve
576
+ * @returns Transaction hash
577
+ */
578
+ approveAsset(assetAddress: Address, amount: bigint): Promise<Hash>;
579
+ }
580
+
581
+ /**
582
+ * ExagentStaking ABI
583
+ */
584
+ declare const EXAGENT_STAKING_ABI: readonly [{
585
+ readonly type: "function";
586
+ readonly name: "exaToken";
587
+ readonly inputs: readonly [];
588
+ readonly outputs: readonly [{
589
+ readonly type: "address";
590
+ }];
591
+ readonly stateMutability: "view";
592
+ }, {
593
+ readonly type: "function";
594
+ readonly name: "totalStaked";
595
+ readonly inputs: readonly [];
596
+ readonly outputs: readonly [{
597
+ readonly type: "uint256";
598
+ }];
599
+ readonly stateMutability: "view";
600
+ }, {
601
+ readonly type: "function";
602
+ readonly name: "totalVeEXA";
603
+ readonly inputs: readonly [];
604
+ readonly outputs: readonly [{
605
+ readonly type: "uint256";
606
+ }];
607
+ readonly stateMutability: "view";
608
+ }, {
609
+ readonly type: "function";
610
+ readonly name: "registry";
611
+ readonly inputs: readonly [];
612
+ readonly outputs: readonly [{
613
+ readonly type: "address";
614
+ }];
615
+ readonly stateMutability: "view";
616
+ }, {
617
+ readonly type: "function";
618
+ readonly name: "MIN_LOCK_DURATION";
619
+ readonly inputs: readonly [];
620
+ readonly outputs: readonly [{
621
+ readonly type: "uint256";
622
+ }];
623
+ readonly stateMutability: "view";
624
+ }, {
625
+ readonly type: "function";
626
+ readonly name: "MAX_LOCK_DURATION";
627
+ readonly inputs: readonly [];
628
+ readonly outputs: readonly [{
629
+ readonly type: "uint256";
630
+ }];
631
+ readonly stateMutability: "view";
632
+ }, {
633
+ readonly type: "function";
634
+ readonly name: "PRECISION";
635
+ readonly inputs: readonly [];
636
+ readonly outputs: readonly [{
637
+ readonly type: "uint256";
638
+ }];
639
+ readonly stateMutability: "view";
640
+ }, {
641
+ readonly type: "function";
642
+ readonly name: "stake";
643
+ readonly inputs: readonly [{
644
+ readonly name: "amount";
645
+ readonly type: "uint256";
646
+ }, {
647
+ readonly name: "lockDuration";
648
+ readonly type: "uint256";
649
+ }];
650
+ readonly outputs: readonly [];
651
+ readonly stateMutability: "nonpayable";
652
+ }, {
653
+ readonly type: "function";
654
+ readonly name: "unstake";
655
+ readonly inputs: readonly [];
656
+ readonly outputs: readonly [];
657
+ readonly stateMutability: "nonpayable";
658
+ }, {
659
+ readonly type: "function";
660
+ readonly name: "extendLock";
661
+ readonly inputs: readonly [{
662
+ readonly name: "newLockDuration";
663
+ readonly type: "uint256";
664
+ }];
665
+ readonly outputs: readonly [];
666
+ readonly stateMutability: "nonpayable";
667
+ }, {
668
+ readonly type: "function";
669
+ readonly name: "claimRewards";
670
+ readonly inputs: readonly [];
671
+ readonly outputs: readonly [];
672
+ readonly stateMutability: "nonpayable";
673
+ }, {
674
+ readonly type: "function";
675
+ readonly name: "claimRewardsMulti";
676
+ readonly inputs: readonly [];
677
+ readonly outputs: readonly [];
678
+ readonly stateMutability: "nonpayable";
679
+ }, {
680
+ readonly type: "function";
681
+ readonly name: "claimRewardsToken";
682
+ readonly inputs: readonly [{
683
+ readonly name: "token";
684
+ readonly type: "address";
685
+ }];
686
+ readonly outputs: readonly [];
687
+ readonly stateMutability: "nonpayable";
688
+ }, {
689
+ readonly type: "function";
690
+ readonly name: "delegate";
691
+ readonly inputs: readonly [{
692
+ readonly name: "agentId";
693
+ readonly type: "uint256";
694
+ }];
695
+ readonly outputs: readonly [];
696
+ readonly stateMutability: "nonpayable";
697
+ }, {
698
+ readonly type: "function";
699
+ readonly name: "undelegate";
700
+ readonly inputs: readonly [];
701
+ readonly outputs: readonly [];
702
+ readonly stateMutability: "nonpayable";
703
+ }, {
704
+ readonly type: "function";
705
+ readonly name: "redelegate";
706
+ readonly inputs: readonly [{
707
+ readonly name: "newAgentId";
708
+ readonly type: "uint256";
709
+ }];
710
+ readonly outputs: readonly [];
711
+ readonly stateMutability: "nonpayable";
712
+ }, {
713
+ readonly type: "function";
714
+ readonly name: "stakes";
715
+ readonly inputs: readonly [{
716
+ readonly name: "user";
717
+ readonly type: "address";
718
+ }];
719
+ readonly outputs: readonly [{
720
+ readonly name: "amount";
721
+ readonly type: "uint256";
722
+ }, {
723
+ readonly name: "unlockTime";
724
+ readonly type: "uint256";
725
+ }, {
726
+ readonly name: "lockDuration";
727
+ readonly type: "uint256";
728
+ }, {
729
+ readonly name: "vEXABalance";
730
+ readonly type: "uint256";
731
+ }];
732
+ readonly stateMutability: "view";
733
+ }, {
734
+ readonly type: "function";
735
+ readonly name: "getVeEXABalance";
736
+ readonly inputs: readonly [{
737
+ readonly name: "user";
738
+ readonly type: "address";
739
+ }];
740
+ readonly outputs: readonly [{
741
+ readonly type: "uint256";
742
+ }];
743
+ readonly stateMutability: "view";
744
+ }, {
745
+ readonly type: "function";
746
+ readonly name: "calculateVeEXA";
747
+ readonly inputs: readonly [{
748
+ readonly name: "amount";
749
+ readonly type: "uint256";
750
+ }, {
751
+ readonly name: "lockDuration";
752
+ readonly type: "uint256";
753
+ }];
754
+ readonly outputs: readonly [{
755
+ readonly type: "uint256";
756
+ }];
757
+ readonly stateMutability: "pure";
758
+ }, {
759
+ readonly type: "function";
760
+ readonly name: "pendingRewards";
761
+ readonly inputs: readonly [{
762
+ readonly name: "user";
763
+ readonly type: "address";
764
+ }];
765
+ readonly outputs: readonly [{
766
+ readonly type: "uint256";
767
+ }];
768
+ readonly stateMutability: "view";
769
+ }, {
770
+ readonly type: "function";
771
+ readonly name: "pendingRewardsForToken";
772
+ readonly inputs: readonly [{
773
+ readonly name: "user";
774
+ readonly type: "address";
775
+ }, {
776
+ readonly name: "token";
777
+ readonly type: "address";
778
+ }];
779
+ readonly outputs: readonly [{
780
+ readonly type: "uint256";
781
+ }];
782
+ readonly stateMutability: "view";
783
+ }, {
784
+ readonly type: "function";
785
+ readonly name: "getDelegatedAgent";
786
+ readonly inputs: readonly [{
787
+ readonly name: "user";
788
+ readonly type: "address";
789
+ }];
790
+ readonly outputs: readonly [{
791
+ readonly type: "uint256";
792
+ }];
793
+ readonly stateMutability: "view";
794
+ }, {
795
+ readonly type: "function";
796
+ readonly name: "getAgentDelegation";
797
+ readonly inputs: readonly [{
798
+ readonly name: "agentId";
799
+ readonly type: "uint256";
800
+ }];
801
+ readonly outputs: readonly [{
802
+ readonly name: "vexa";
803
+ readonly type: "uint256";
804
+ }, {
805
+ readonly name: "count";
806
+ readonly type: "uint256";
807
+ }];
808
+ readonly stateMutability: "view";
809
+ }, {
810
+ readonly type: "function";
811
+ readonly name: "getDiscountTier";
812
+ readonly inputs: readonly [{
813
+ readonly name: "user";
814
+ readonly type: "address";
815
+ }];
816
+ readonly outputs: readonly [{
817
+ readonly name: "discountBps";
818
+ readonly type: "uint256";
819
+ }];
820
+ readonly stateMutability: "view";
821
+ }, {
822
+ readonly type: "function";
823
+ readonly name: "getRewardTokens";
824
+ readonly inputs: readonly [];
825
+ readonly outputs: readonly [{
826
+ readonly type: "address[]";
827
+ }];
828
+ readonly stateMutability: "view";
829
+ }, {
830
+ readonly type: "function";
831
+ readonly name: "delegatedTo";
832
+ readonly inputs: readonly [{
833
+ readonly name: "user";
834
+ readonly type: "address";
835
+ }];
836
+ readonly outputs: readonly [{
837
+ readonly type: "uint256";
838
+ }];
839
+ readonly stateMutability: "view";
840
+ }, {
841
+ readonly type: "function";
842
+ readonly name: "userDelegatedVeEXA";
843
+ readonly inputs: readonly [{
844
+ readonly name: "user";
845
+ readonly type: "address";
846
+ }];
847
+ readonly outputs: readonly [{
848
+ readonly type: "uint256";
849
+ }];
850
+ readonly stateMutability: "view";
851
+ }, {
852
+ readonly type: "function";
853
+ readonly name: "agentDelegatedVeEXA";
854
+ readonly inputs: readonly [{
855
+ readonly name: "agentId";
856
+ readonly type: "uint256";
857
+ }];
858
+ readonly outputs: readonly [{
859
+ readonly type: "uint256";
860
+ }];
861
+ readonly stateMutability: "view";
862
+ }, {
863
+ readonly type: "function";
864
+ readonly name: "agentDelegatorCount";
865
+ readonly inputs: readonly [{
866
+ readonly name: "agentId";
867
+ readonly type: "uint256";
868
+ }];
869
+ readonly outputs: readonly [{
870
+ readonly type: "uint256";
871
+ }];
872
+ readonly stateMutability: "view";
873
+ }, {
874
+ readonly type: "function";
875
+ readonly name: "isRewardToken";
876
+ readonly inputs: readonly [{
877
+ readonly name: "token";
878
+ readonly type: "address";
879
+ }];
880
+ readonly outputs: readonly [{
881
+ readonly type: "bool";
882
+ }];
883
+ readonly stateMutability: "view";
884
+ }, {
885
+ readonly type: "event";
886
+ readonly name: "Staked";
887
+ readonly inputs: readonly [{
888
+ readonly name: "user";
889
+ readonly type: "address";
890
+ readonly indexed: true;
891
+ }, {
892
+ readonly name: "amount";
893
+ readonly type: "uint256";
894
+ readonly indexed: false;
895
+ }, {
896
+ readonly name: "lockDuration";
897
+ readonly type: "uint256";
898
+ readonly indexed: false;
899
+ }, {
900
+ readonly name: "unlockTime";
901
+ readonly type: "uint256";
902
+ readonly indexed: false;
903
+ }, {
904
+ readonly name: "vEXABalance";
905
+ readonly type: "uint256";
906
+ readonly indexed: false;
907
+ }];
908
+ }, {
909
+ readonly type: "event";
910
+ readonly name: "Unstaked";
911
+ readonly inputs: readonly [{
912
+ readonly name: "user";
913
+ readonly type: "address";
914
+ readonly indexed: true;
915
+ }, {
916
+ readonly name: "amount";
917
+ readonly type: "uint256";
918
+ readonly indexed: false;
919
+ }];
920
+ }, {
921
+ readonly type: "event";
922
+ readonly name: "LockExtended";
923
+ readonly inputs: readonly [{
924
+ readonly name: "user";
925
+ readonly type: "address";
926
+ readonly indexed: true;
927
+ }, {
928
+ readonly name: "newUnlockTime";
929
+ readonly type: "uint256";
930
+ readonly indexed: false;
931
+ }, {
932
+ readonly name: "newVeEXABalance";
933
+ readonly type: "uint256";
934
+ readonly indexed: false;
935
+ }];
936
+ }, {
937
+ readonly type: "event";
938
+ readonly name: "RewardsClaimed";
939
+ readonly inputs: readonly [{
940
+ readonly name: "user";
941
+ readonly type: "address";
942
+ readonly indexed: true;
943
+ }, {
944
+ readonly name: "amount";
945
+ readonly type: "uint256";
946
+ readonly indexed: false;
947
+ }];
948
+ }, {
949
+ readonly type: "event";
950
+ readonly name: "Delegated";
951
+ readonly inputs: readonly [{
952
+ readonly name: "delegator";
953
+ readonly type: "address";
954
+ readonly indexed: true;
955
+ }, {
956
+ readonly name: "agentId";
957
+ readonly type: "uint256";
958
+ readonly indexed: true;
959
+ }, {
960
+ readonly name: "veEXAAmount";
961
+ readonly type: "uint256";
962
+ readonly indexed: false;
963
+ }];
964
+ }, {
965
+ readonly type: "event";
966
+ readonly name: "Undelegated";
967
+ readonly inputs: readonly [{
968
+ readonly name: "delegator";
969
+ readonly type: "address";
970
+ readonly indexed: true;
971
+ }, {
972
+ readonly name: "agentId";
973
+ readonly type: "uint256";
974
+ readonly indexed: true;
975
+ }, {
976
+ readonly name: "veEXAAmount";
977
+ readonly type: "uint256";
978
+ readonly indexed: false;
979
+ }];
980
+ }, {
981
+ readonly type: "event";
982
+ readonly name: "MultiTokenRewardsClaimed";
983
+ readonly inputs: readonly [{
984
+ readonly name: "user";
985
+ readonly type: "address";
986
+ readonly indexed: true;
987
+ }, {
988
+ readonly name: "token";
989
+ readonly type: "address";
990
+ readonly indexed: true;
991
+ }, {
992
+ readonly name: "amount";
993
+ readonly type: "uint256";
994
+ readonly indexed: false;
995
+ }];
996
+ }];
997
+ /**
998
+ * Staking info for a user
999
+ */
1000
+ interface StakingInfo {
1001
+ /** Amount of EXA staked */
1002
+ amount: bigint;
1003
+ /** Timestamp when stake can be withdrawn */
1004
+ unlockTime: bigint;
1005
+ /** Original lock duration in seconds */
1006
+ lockDuration: bigint;
1007
+ /** vEXA balance at stake time (before time decay) */
1008
+ vEXABalance: bigint;
1009
+ /** Current vEXA balance (with time decay applied) */
1010
+ currentVeEXA: bigint;
1011
+ /** Whether the lock has expired */
1012
+ isUnlocked: boolean;
1013
+ /** Remaining time until unlock in seconds */
1014
+ remainingLockTime: bigint;
1015
+ }
1016
+ /**
1017
+ * Delegation info for an agent
1018
+ */
1019
+ interface DelegationInfo {
1020
+ /** Total vEXA delegated to this agent */
1021
+ totalVeEXA: bigint;
1022
+ /** Number of unique delegators */
1023
+ delegatorCount: bigint;
1024
+ }
1025
+ /**
1026
+ * Discount tier for trading fee reductions
1027
+ */
1028
+ type DiscountTier = 'none' | 'bronze' | 'silver' | 'gold';
1029
+ /**
1030
+ * Discount tier thresholds in basis points
1031
+ */
1032
+ declare const DISCOUNT_TIERS: {
1033
+ readonly none: 0;
1034
+ readonly bronze: 1000;
1035
+ readonly silver: 2500;
1036
+ readonly gold: 5000;
1037
+ };
1038
+ /**
1039
+ * ExagentStaking SDK interface for vEXA staking, rewards, and delegation
1040
+ */
1041
+ declare class ExagentStaking {
1042
+ readonly address: Address;
1043
+ private readonly publicClient;
1044
+ private readonly walletClient?;
1045
+ private readonly chain;
1046
+ private readonly account?;
1047
+ constructor(stakingAddress: Address, publicClient: any, walletClient?: any, chain?: Chain, account?: Account);
1048
+ /**
1049
+ * Stake EXA tokens to receive vEXA voting power
1050
+ * @param amount Amount of EXA to stake (in wei)
1051
+ * @param lockDuration Lock duration in seconds (30 days to 2 years)
1052
+ * @returns Transaction hash
1053
+ *
1054
+ * @example
1055
+ * ```typescript
1056
+ * // Stake 1000 EXA for 6 months
1057
+ * const tx = await staking.stake(
1058
+ * parseEther('1000'),
1059
+ * BigInt(180 * 24 * 60 * 60) // 180 days in seconds
1060
+ * );
1061
+ * ```
1062
+ */
1063
+ stake(amount: bigint, lockDuration: bigint): Promise<Hash>;
1064
+ /**
1065
+ * Unstake EXA tokens after lock expires
1066
+ * @returns Transaction hash
1067
+ * @throws Error if lock has not expired
1068
+ */
1069
+ unstake(): Promise<Hash>;
1070
+ /**
1071
+ * Extend lock duration for additional voting power
1072
+ * @param newLockDuration New lock duration in seconds (must be longer than remaining)
1073
+ * @returns Transaction hash
1074
+ */
1075
+ extendLock(newLockDuration: bigint): Promise<Hash>;
1076
+ /**
1077
+ * Claim accumulated EXA rewards
1078
+ * @returns Transaction hash
1079
+ */
1080
+ claimRewards(): Promise<Hash>;
1081
+ /**
1082
+ * Claim all pending multi-token rewards (ETH, USDC, etc.)
1083
+ * @returns Transaction hash
1084
+ */
1085
+ claimRewardsMulti(): Promise<Hash>;
1086
+ /**
1087
+ * Claim pending rewards for a specific token
1088
+ * @param token The reward token address to claim
1089
+ * @returns Transaction hash
1090
+ */
1091
+ claimRewardsToken(token: Address): Promise<Hash>;
1092
+ /**
1093
+ * Delegate vEXA voting power to an agent ("Agent Wars")
1094
+ * @param agentId The agent ID to delegate to
1095
+ * @returns Transaction hash
1096
+ */
1097
+ delegate(agentId: bigint): Promise<Hash>;
1098
+ /**
1099
+ * Remove delegation from current agent
1100
+ * @returns Transaction hash
1101
+ */
1102
+ undelegate(): Promise<Hash>;
1103
+ /**
1104
+ * Re-delegate to a different agent (undelegate + delegate in one tx)
1105
+ * @param newAgentId The new agent ID to delegate to
1106
+ * @returns Transaction hash
1107
+ */
1108
+ redelegate(newAgentId: bigint): Promise<Hash>;
1109
+ /**
1110
+ * Get comprehensive staking info for a user
1111
+ * @param userAddress Address to check (defaults to connected wallet)
1112
+ * @returns Staking info with amount, unlock time, and vEXA balance
1113
+ */
1114
+ getStakeInfo(userAddress?: Address): Promise<StakingInfo>;
1115
+ /**
1116
+ * Get current vEXA balance (with time decay applied)
1117
+ * @param userAddress Address to check (defaults to connected wallet)
1118
+ * @returns Current vEXA balance
1119
+ */
1120
+ getVeEXABalance(userAddress?: Address): Promise<bigint>;
1121
+ /**
1122
+ * Get the agent ID a user is delegating to
1123
+ * @param userAddress Address to check (defaults to connected wallet)
1124
+ * @returns Agent ID (0 if not delegating)
1125
+ */
1126
+ getDelegatedAgent(userAddress?: Address): Promise<bigint>;
1127
+ /**
1128
+ * Get delegation stats for an agent
1129
+ * @param agentId The agent ID to check
1130
+ * @returns Delegation info with total vEXA and delegator count
1131
+ */
1132
+ getAgentDelegation(agentId: bigint): Promise<DelegationInfo>;
1133
+ /**
1134
+ * Get trading fee discount tier for a user
1135
+ * @param userAddress Address to check (defaults to connected wallet)
1136
+ * @returns Discount tier name and basis points
1137
+ */
1138
+ getDiscountTier(userAddress?: Address): Promise<{
1139
+ tier: DiscountTier;
1140
+ discountBps: bigint;
1141
+ }>;
1142
+ /**
1143
+ * Get pending EXA rewards for a user
1144
+ * @param userAddress Address to check (defaults to connected wallet)
1145
+ * @returns Pending reward amount in wei
1146
+ */
1147
+ pendingRewards(userAddress?: Address): Promise<bigint>;
1148
+ /**
1149
+ * Get pending rewards for a specific token
1150
+ * @param token The reward token address
1151
+ * @param userAddress Address to check (defaults to connected wallet)
1152
+ * @returns Pending reward amount in wei
1153
+ */
1154
+ pendingRewardsMulti(token: Address, userAddress?: Address): Promise<bigint>;
1155
+ /**
1156
+ * Get list of whitelisted reward tokens
1157
+ * @returns Array of reward token addresses
1158
+ */
1159
+ getRewardTokens(): Promise<Address[]>;
1160
+ /**
1161
+ * Check if a token is whitelisted for rewards
1162
+ * @param token The token address to check
1163
+ * @returns True if token is whitelisted
1164
+ */
1165
+ isRewardToken(token: Address): Promise<boolean>;
1166
+ /**
1167
+ * Get total staked EXA across all users
1168
+ * @returns Total staked amount in wei
1169
+ */
1170
+ getTotalStaked(): Promise<bigint>;
1171
+ /**
1172
+ * Get total vEXA supply across all users
1173
+ * @returns Total vEXA supply
1174
+ */
1175
+ getTotalVeEXA(): Promise<bigint>;
1176
+ /**
1177
+ * Calculate vEXA balance for a given stake (preview)
1178
+ * @param amount Amount of EXA to stake
1179
+ * @param lockDuration Lock duration in seconds
1180
+ * @returns Expected vEXA balance
1181
+ */
1182
+ calculateVeEXA(amount: bigint, lockDuration: bigint): Promise<bigint>;
1183
+ /**
1184
+ * Get the EXA token address
1185
+ * @returns EXA token contract address
1186
+ */
1187
+ getExaTokenAddress(): Promise<Address>;
1188
+ /**
1189
+ * Approve EXA token spending for staking
1190
+ * @param amount Amount to approve
1191
+ * @returns Transaction hash
1192
+ */
1193
+ approveExa(amount: bigint): Promise<Hash>;
1194
+ /** Minimum lock duration: 30 days in seconds */
1195
+ static readonly MIN_LOCK_DURATION: bigint;
1196
+ /** Maximum lock duration: 2 years in seconds */
1197
+ static readonly MAX_LOCK_DURATION: bigint;
1198
+ /** 1 month lock duration in seconds */
1199
+ static readonly LOCK_1_MONTH: bigint;
1200
+ /** 3 months lock duration in seconds */
1201
+ static readonly LOCK_3_MONTHS: bigint;
1202
+ /** 6 months lock duration in seconds */
1203
+ static readonly LOCK_6_MONTHS: bigint;
1204
+ /** 1 year lock duration in seconds */
1205
+ static readonly LOCK_1_YEAR: bigint;
1206
+ /** 2 years lock duration in seconds */
1207
+ static readonly LOCK_2_YEARS: bigint;
1208
+ }
1209
+
1210
+ declare const CHAIN_CONFIG: {
1211
+ readonly mainnet: {
1212
+ blockExplorers: {
1213
+ readonly default: {
1214
+ readonly name: "Basescan";
1215
+ readonly url: "https://basescan.org";
1216
+ readonly apiUrl: "https://api.basescan.org/api";
1217
+ };
1218
+ };
1219
+ blockTime: 2000;
1220
+ contracts: {
1221
+ readonly disputeGameFactory: {
1222
+ readonly 1: {
1223
+ readonly address: "0x43edB88C4B80fDD2AdFF2412A7BebF9dF42cB40e";
1224
+ };
1225
+ };
1226
+ readonly l2OutputOracle: {
1227
+ readonly 1: {
1228
+ readonly address: "0x56315b90c40730925ec5485cf004d835058518A0";
1229
+ };
1230
+ };
1231
+ readonly multicall3: {
1232
+ readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
1233
+ readonly blockCreated: 5022;
1234
+ };
1235
+ readonly portal: {
1236
+ readonly 1: {
1237
+ readonly address: "0x49048044D57e1C92A77f79988d21Fa8fAF74E97e";
1238
+ readonly blockCreated: 17482143;
1239
+ };
1240
+ };
1241
+ readonly l1StandardBridge: {
1242
+ readonly 1: {
1243
+ readonly address: "0x3154Cf16ccdb4C6d922629664174b904d80F2C35";
1244
+ readonly blockCreated: 17482143;
1245
+ };
1246
+ };
1247
+ readonly gasPriceOracle: {
1248
+ readonly address: "0x420000000000000000000000000000000000000F";
1249
+ };
1250
+ readonly l1Block: {
1251
+ readonly address: "0x4200000000000000000000000000000000000015";
1252
+ };
1253
+ readonly l2CrossDomainMessenger: {
1254
+ readonly address: "0x4200000000000000000000000000000000000007";
1255
+ };
1256
+ readonly l2Erc721Bridge: {
1257
+ readonly address: "0x4200000000000000000000000000000000000014";
1258
+ };
1259
+ readonly l2StandardBridge: {
1260
+ readonly address: "0x4200000000000000000000000000000000000010";
1261
+ };
1262
+ readonly l2ToL1MessagePasser: {
1263
+ readonly address: "0x4200000000000000000000000000000000000016";
1264
+ };
1265
+ };
1266
+ ensTlds?: readonly string[] | undefined;
1267
+ id: 8453;
1268
+ name: "Base";
1269
+ nativeCurrency: {
1270
+ readonly name: "Ether";
1271
+ readonly symbol: "ETH";
1272
+ readonly decimals: 18;
1273
+ };
1274
+ experimental_preconfirmationTime?: number | undefined | undefined;
1275
+ rpcUrls: {
1276
+ readonly default: {
1277
+ readonly http: readonly ["https://mainnet.base.org"];
1278
+ };
1279
+ };
1280
+ sourceId: 1;
1281
+ testnet?: boolean | undefined | undefined;
1282
+ custom?: Record<string, unknown> | undefined;
1283
+ extendSchema?: Record<string, unknown> | undefined;
1284
+ fees?: viem.ChainFees<undefined> | undefined;
1285
+ formatters: {
1286
+ readonly block: {
1287
+ exclude: [] | undefined;
1288
+ format: (args: viem_chains.OpStackRpcBlock, action?: string | undefined) => {
1289
+ baseFeePerGas: bigint | null;
1290
+ blobGasUsed: bigint;
1291
+ difficulty: bigint;
1292
+ excessBlobGas: bigint;
1293
+ extraData: viem.Hex;
1294
+ gasLimit: bigint;
1295
+ gasUsed: bigint;
1296
+ hash: `0x${string}` | null;
1297
+ logsBloom: `0x${string}` | null;
1298
+ miner: `0x${string}`;
1299
+ mixHash: viem.Hash;
1300
+ nonce: `0x${string}` | null;
1301
+ number: bigint | null;
1302
+ parentBeaconBlockRoot?: `0x${string}` | undefined;
1303
+ parentHash: viem.Hash;
1304
+ receiptsRoot: viem.Hex;
1305
+ sealFields: viem.Hex[];
1306
+ sha3Uncles: viem.Hash;
1307
+ size: bigint;
1308
+ stateRoot: viem.Hash;
1309
+ timestamp: bigint;
1310
+ totalDifficulty: bigint | null;
1311
+ transactions: `0x${string}`[] | viem_chains.OpStackTransaction<boolean>[];
1312
+ transactionsRoot: viem.Hash;
1313
+ uncles: viem.Hash[];
1314
+ withdrawals?: viem.Withdrawal[] | undefined | undefined;
1315
+ withdrawalsRoot?: `0x${string}` | undefined;
1316
+ } & {};
1317
+ type: "block";
1318
+ };
1319
+ readonly transaction: {
1320
+ exclude: [] | undefined;
1321
+ format: (args: viem_chains.OpStackRpcTransaction, action?: string | undefined) => ({
1322
+ blockHash: `0x${string}` | null;
1323
+ blockNumber: bigint | null;
1324
+ from: `0x${string}`;
1325
+ gas: bigint;
1326
+ hash: viem.Hash;
1327
+ input: viem.Hex;
1328
+ nonce: number;
1329
+ r: viem.Hex;
1330
+ s: viem.Hex;
1331
+ to: `0x${string}` | null;
1332
+ transactionIndex: number | null;
1333
+ typeHex: viem.Hex | null;
1334
+ v: bigint;
1335
+ value: bigint;
1336
+ yParity: number;
1337
+ gasPrice?: undefined | undefined;
1338
+ maxFeePerBlobGas?: undefined | undefined;
1339
+ maxFeePerGas: bigint;
1340
+ maxPriorityFeePerGas: bigint;
1341
+ isSystemTx?: boolean;
1342
+ mint?: bigint | undefined | undefined;
1343
+ sourceHash: viem.Hex;
1344
+ type: "deposit";
1345
+ } | {
1346
+ r: viem.Hex;
1347
+ s: viem.Hex;
1348
+ v: bigint;
1349
+ to: `0x${string}` | null;
1350
+ from: `0x${string}`;
1351
+ gas: bigint;
1352
+ nonce: number;
1353
+ value: bigint;
1354
+ blockHash: `0x${string}` | null;
1355
+ blockNumber: bigint | null;
1356
+ hash: viem.Hash;
1357
+ input: viem.Hex;
1358
+ transactionIndex: number | null;
1359
+ typeHex: viem.Hex | null;
1360
+ accessList?: undefined | undefined;
1361
+ authorizationList?: undefined | undefined;
1362
+ blobVersionedHashes?: undefined | undefined;
1363
+ chainId?: number | undefined;
1364
+ yParity?: undefined | undefined;
1365
+ type: "legacy";
1366
+ gasPrice: bigint;
1367
+ maxFeePerBlobGas?: undefined | undefined;
1368
+ maxFeePerGas?: undefined | undefined;
1369
+ maxPriorityFeePerGas?: undefined | undefined;
1370
+ isSystemTx?: undefined | undefined;
1371
+ mint?: undefined | undefined;
1372
+ sourceHash?: undefined | undefined;
1373
+ } | {
1374
+ blockHash: `0x${string}` | null;
1375
+ blockNumber: bigint | null;
1376
+ from: `0x${string}`;
1377
+ gas: bigint;
1378
+ hash: viem.Hash;
1379
+ input: viem.Hex;
1380
+ nonce: number;
1381
+ r: viem.Hex;
1382
+ s: viem.Hex;
1383
+ to: `0x${string}` | null;
1384
+ transactionIndex: number | null;
1385
+ typeHex: viem.Hex | null;
1386
+ v: bigint;
1387
+ value: bigint;
1388
+ yParity: number;
1389
+ accessList: viem.AccessList;
1390
+ authorizationList?: undefined | undefined;
1391
+ blobVersionedHashes?: undefined | undefined;
1392
+ chainId: number;
1393
+ type: "eip2930";
1394
+ gasPrice: bigint;
1395
+ maxFeePerBlobGas?: undefined | undefined;
1396
+ maxFeePerGas?: undefined | undefined;
1397
+ maxPriorityFeePerGas?: undefined | undefined;
1398
+ isSystemTx?: undefined | undefined;
1399
+ mint?: undefined | undefined;
1400
+ sourceHash?: undefined | undefined;
1401
+ } | {
1402
+ blockHash: `0x${string}` | null;
1403
+ blockNumber: bigint | null;
1404
+ from: `0x${string}`;
1405
+ gas: bigint;
1406
+ hash: viem.Hash;
1407
+ input: viem.Hex;
1408
+ nonce: number;
1409
+ r: viem.Hex;
1410
+ s: viem.Hex;
1411
+ to: `0x${string}` | null;
1412
+ transactionIndex: number | null;
1413
+ typeHex: viem.Hex | null;
1414
+ v: bigint;
1415
+ value: bigint;
1416
+ yParity: number;
1417
+ accessList: viem.AccessList;
1418
+ authorizationList?: undefined | undefined;
1419
+ blobVersionedHashes?: undefined | undefined;
1420
+ chainId: number;
1421
+ type: "eip1559";
1422
+ gasPrice?: undefined | undefined;
1423
+ maxFeePerBlobGas?: undefined | undefined;
1424
+ maxFeePerGas: bigint;
1425
+ maxPriorityFeePerGas: bigint;
1426
+ isSystemTx?: undefined | undefined;
1427
+ mint?: undefined | undefined;
1428
+ sourceHash?: undefined | undefined;
1429
+ } | {
1430
+ blockHash: `0x${string}` | null;
1431
+ blockNumber: bigint | null;
1432
+ from: `0x${string}`;
1433
+ gas: bigint;
1434
+ hash: viem.Hash;
1435
+ input: viem.Hex;
1436
+ nonce: number;
1437
+ r: viem.Hex;
1438
+ s: viem.Hex;
1439
+ to: `0x${string}` | null;
1440
+ transactionIndex: number | null;
1441
+ typeHex: viem.Hex | null;
1442
+ v: bigint;
1443
+ value: bigint;
1444
+ yParity: number;
1445
+ accessList: viem.AccessList;
1446
+ authorizationList?: undefined | undefined;
1447
+ blobVersionedHashes: readonly viem.Hex[];
1448
+ chainId: number;
1449
+ type: "eip4844";
1450
+ gasPrice?: undefined | undefined;
1451
+ maxFeePerBlobGas: bigint;
1452
+ maxFeePerGas: bigint;
1453
+ maxPriorityFeePerGas: bigint;
1454
+ isSystemTx?: undefined | undefined;
1455
+ mint?: undefined | undefined;
1456
+ sourceHash?: undefined | undefined;
1457
+ } | {
1458
+ blockHash: `0x${string}` | null;
1459
+ blockNumber: bigint | null;
1460
+ from: `0x${string}`;
1461
+ gas: bigint;
1462
+ hash: viem.Hash;
1463
+ input: viem.Hex;
1464
+ nonce: number;
1465
+ r: viem.Hex;
1466
+ s: viem.Hex;
1467
+ to: `0x${string}` | null;
1468
+ transactionIndex: number | null;
1469
+ typeHex: viem.Hex | null;
1470
+ v: bigint;
1471
+ value: bigint;
1472
+ yParity: number;
1473
+ accessList: viem.AccessList;
1474
+ authorizationList: viem.SignedAuthorizationList;
1475
+ blobVersionedHashes?: undefined | undefined;
1476
+ chainId: number;
1477
+ type: "eip7702";
1478
+ gasPrice?: undefined | undefined;
1479
+ maxFeePerBlobGas?: undefined | undefined;
1480
+ maxFeePerGas: bigint;
1481
+ maxPriorityFeePerGas: bigint;
1482
+ isSystemTx?: undefined | undefined;
1483
+ mint?: undefined | undefined;
1484
+ sourceHash?: undefined | undefined;
1485
+ }) & {};
1486
+ type: "transaction";
1487
+ };
1488
+ readonly transactionReceipt: {
1489
+ exclude: [] | undefined;
1490
+ format: (args: viem_chains.OpStackRpcTransactionReceipt, action?: string | undefined) => {
1491
+ blobGasPrice?: bigint | undefined;
1492
+ blobGasUsed?: bigint | undefined;
1493
+ blockHash: viem.Hash;
1494
+ blockNumber: bigint;
1495
+ contractAddress: `0x${string}` | null | undefined;
1496
+ cumulativeGasUsed: bigint;
1497
+ effectiveGasPrice: bigint;
1498
+ from: `0x${string}`;
1499
+ gasUsed: bigint;
1500
+ logs: viem.Log<bigint, number, false>[];
1501
+ logsBloom: viem.Hex;
1502
+ root?: `0x${string}` | undefined;
1503
+ status: "success" | "reverted";
1504
+ to: `0x${string}` | null;
1505
+ transactionHash: viem.Hash;
1506
+ transactionIndex: number;
1507
+ type: viem.TransactionType;
1508
+ l1GasPrice: bigint | null;
1509
+ l1GasUsed: bigint | null;
1510
+ l1Fee: bigint | null;
1511
+ l1FeeScalar: number | null;
1512
+ } & {};
1513
+ type: "transactionReceipt";
1514
+ };
1515
+ };
1516
+ prepareTransactionRequest?: ((args: viem.PrepareTransactionRequestParameters, options: {
1517
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
1518
+ }) => Promise<viem.PrepareTransactionRequestParameters>) | [fn: ((args: viem.PrepareTransactionRequestParameters, options: {
1519
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
1520
+ }) => Promise<viem.PrepareTransactionRequestParameters>) | undefined, options: {
1521
+ runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
1522
+ }] | undefined;
1523
+ serializers: {
1524
+ readonly transaction: typeof viem_chains.serializeTransactionOpStack;
1525
+ };
1526
+ verifyHash?: ((client: viem.Client, parameters: viem.VerifyHashActionParameters) => Promise<viem.VerifyHashActionReturnType>) | undefined;
1527
+ };
1528
+ readonly testnet: {
1529
+ blockExplorers: {
1530
+ readonly default: {
1531
+ readonly name: "Basescan";
1532
+ readonly url: "https://sepolia.basescan.org";
1533
+ readonly apiUrl: "https://api-sepolia.basescan.org/api";
1534
+ };
1535
+ };
1536
+ blockTime: 2000;
1537
+ contracts: {
1538
+ readonly disputeGameFactory: {
1539
+ readonly 11155111: {
1540
+ readonly address: "0xd6E6dBf4F7EA0ac412fD8b65ED297e64BB7a06E1";
1541
+ };
1542
+ };
1543
+ readonly l2OutputOracle: {
1544
+ readonly 11155111: {
1545
+ readonly address: "0x84457ca9D0163FbC4bbfe4Dfbb20ba46e48DF254";
1546
+ };
1547
+ };
1548
+ readonly portal: {
1549
+ readonly 11155111: {
1550
+ readonly address: "0x49f53e41452c74589e85ca1677426ba426459e85";
1551
+ readonly blockCreated: 4446677;
1552
+ };
1553
+ };
1554
+ readonly l1StandardBridge: {
1555
+ readonly 11155111: {
1556
+ readonly address: "0xfd0Bf71F60660E2f608ed56e1659C450eB113120";
1557
+ readonly blockCreated: 4446677;
1558
+ };
1559
+ };
1560
+ readonly multicall3: {
1561
+ readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
1562
+ readonly blockCreated: 1059647;
1563
+ };
1564
+ readonly gasPriceOracle: {
1565
+ readonly address: "0x420000000000000000000000000000000000000F";
1566
+ };
1567
+ readonly l1Block: {
1568
+ readonly address: "0x4200000000000000000000000000000000000015";
1569
+ };
1570
+ readonly l2CrossDomainMessenger: {
1571
+ readonly address: "0x4200000000000000000000000000000000000007";
1572
+ };
1573
+ readonly l2Erc721Bridge: {
1574
+ readonly address: "0x4200000000000000000000000000000000000014";
1575
+ };
1576
+ readonly l2StandardBridge: {
1577
+ readonly address: "0x4200000000000000000000000000000000000010";
1578
+ };
1579
+ readonly l2ToL1MessagePasser: {
1580
+ readonly address: "0x4200000000000000000000000000000000000016";
1581
+ };
1582
+ };
1583
+ ensTlds?: readonly string[] | undefined;
1584
+ id: 84532;
1585
+ name: "Base Sepolia";
1586
+ nativeCurrency: {
1587
+ readonly name: "Sepolia Ether";
1588
+ readonly symbol: "ETH";
1589
+ readonly decimals: 18;
1590
+ };
1591
+ experimental_preconfirmationTime?: number | undefined | undefined;
1592
+ rpcUrls: {
1593
+ readonly default: {
1594
+ readonly http: readonly ["https://sepolia.base.org"];
1595
+ };
1596
+ };
1597
+ sourceId: 11155111;
1598
+ testnet: true;
1599
+ custom?: Record<string, unknown> | undefined;
1600
+ extendSchema?: Record<string, unknown> | undefined;
1601
+ fees?: viem.ChainFees<undefined> | undefined;
1602
+ formatters: {
1603
+ readonly block: {
1604
+ exclude: [] | undefined;
1605
+ format: (args: viem_chains.OpStackRpcBlock, action?: string | undefined) => {
1606
+ baseFeePerGas: bigint | null;
1607
+ blobGasUsed: bigint;
1608
+ difficulty: bigint;
1609
+ excessBlobGas: bigint;
1610
+ extraData: viem.Hex;
1611
+ gasLimit: bigint;
1612
+ gasUsed: bigint;
1613
+ hash: `0x${string}` | null;
1614
+ logsBloom: `0x${string}` | null;
1615
+ miner: `0x${string}`;
1616
+ mixHash: viem.Hash;
1617
+ nonce: `0x${string}` | null;
1618
+ number: bigint | null;
1619
+ parentBeaconBlockRoot?: `0x${string}` | undefined;
1620
+ parentHash: viem.Hash;
1621
+ receiptsRoot: viem.Hex;
1622
+ sealFields: viem.Hex[];
1623
+ sha3Uncles: viem.Hash;
1624
+ size: bigint;
1625
+ stateRoot: viem.Hash;
1626
+ timestamp: bigint;
1627
+ totalDifficulty: bigint | null;
1628
+ transactions: `0x${string}`[] | viem_chains.OpStackTransaction<boolean>[];
1629
+ transactionsRoot: viem.Hash;
1630
+ uncles: viem.Hash[];
1631
+ withdrawals?: viem.Withdrawal[] | undefined | undefined;
1632
+ withdrawalsRoot?: `0x${string}` | undefined;
1633
+ } & {};
1634
+ type: "block";
1635
+ };
1636
+ readonly transaction: {
1637
+ exclude: [] | undefined;
1638
+ format: (args: viem_chains.OpStackRpcTransaction, action?: string | undefined) => ({
1639
+ blockHash: `0x${string}` | null;
1640
+ blockNumber: bigint | null;
1641
+ from: `0x${string}`;
1642
+ gas: bigint;
1643
+ hash: viem.Hash;
1644
+ input: viem.Hex;
1645
+ nonce: number;
1646
+ r: viem.Hex;
1647
+ s: viem.Hex;
1648
+ to: `0x${string}` | null;
1649
+ transactionIndex: number | null;
1650
+ typeHex: viem.Hex | null;
1651
+ v: bigint;
1652
+ value: bigint;
1653
+ yParity: number;
1654
+ gasPrice?: undefined | undefined;
1655
+ maxFeePerBlobGas?: undefined | undefined;
1656
+ maxFeePerGas: bigint;
1657
+ maxPriorityFeePerGas: bigint;
1658
+ isSystemTx?: boolean;
1659
+ mint?: bigint | undefined | undefined;
1660
+ sourceHash: viem.Hex;
1661
+ type: "deposit";
1662
+ } | {
1663
+ r: viem.Hex;
1664
+ s: viem.Hex;
1665
+ v: bigint;
1666
+ to: `0x${string}` | null;
1667
+ from: `0x${string}`;
1668
+ gas: bigint;
1669
+ nonce: number;
1670
+ value: bigint;
1671
+ blockHash: `0x${string}` | null;
1672
+ blockNumber: bigint | null;
1673
+ hash: viem.Hash;
1674
+ input: viem.Hex;
1675
+ transactionIndex: number | null;
1676
+ typeHex: viem.Hex | null;
1677
+ accessList?: undefined | undefined;
1678
+ authorizationList?: undefined | undefined;
1679
+ blobVersionedHashes?: undefined | undefined;
1680
+ chainId?: number | undefined;
1681
+ yParity?: undefined | undefined;
1682
+ type: "legacy";
1683
+ gasPrice: bigint;
1684
+ maxFeePerBlobGas?: undefined | undefined;
1685
+ maxFeePerGas?: undefined | undefined;
1686
+ maxPriorityFeePerGas?: undefined | undefined;
1687
+ isSystemTx?: undefined | undefined;
1688
+ mint?: undefined | undefined;
1689
+ sourceHash?: undefined | undefined;
1690
+ } | {
1691
+ blockHash: `0x${string}` | null;
1692
+ blockNumber: bigint | null;
1693
+ from: `0x${string}`;
1694
+ gas: bigint;
1695
+ hash: viem.Hash;
1696
+ input: viem.Hex;
1697
+ nonce: number;
1698
+ r: viem.Hex;
1699
+ s: viem.Hex;
1700
+ to: `0x${string}` | null;
1701
+ transactionIndex: number | null;
1702
+ typeHex: viem.Hex | null;
1703
+ v: bigint;
1704
+ value: bigint;
1705
+ yParity: number;
1706
+ accessList: viem.AccessList;
1707
+ authorizationList?: undefined | undefined;
1708
+ blobVersionedHashes?: undefined | undefined;
1709
+ chainId: number;
1710
+ type: "eip2930";
1711
+ gasPrice: bigint;
1712
+ maxFeePerBlobGas?: undefined | undefined;
1713
+ maxFeePerGas?: undefined | undefined;
1714
+ maxPriorityFeePerGas?: undefined | undefined;
1715
+ isSystemTx?: undefined | undefined;
1716
+ mint?: undefined | undefined;
1717
+ sourceHash?: undefined | undefined;
1718
+ } | {
1719
+ blockHash: `0x${string}` | null;
1720
+ blockNumber: bigint | null;
1721
+ from: `0x${string}`;
1722
+ gas: bigint;
1723
+ hash: viem.Hash;
1724
+ input: viem.Hex;
1725
+ nonce: number;
1726
+ r: viem.Hex;
1727
+ s: viem.Hex;
1728
+ to: `0x${string}` | null;
1729
+ transactionIndex: number | null;
1730
+ typeHex: viem.Hex | null;
1731
+ v: bigint;
1732
+ value: bigint;
1733
+ yParity: number;
1734
+ accessList: viem.AccessList;
1735
+ authorizationList?: undefined | undefined;
1736
+ blobVersionedHashes?: undefined | undefined;
1737
+ chainId: number;
1738
+ type: "eip1559";
1739
+ gasPrice?: undefined | undefined;
1740
+ maxFeePerBlobGas?: undefined | undefined;
1741
+ maxFeePerGas: bigint;
1742
+ maxPriorityFeePerGas: bigint;
1743
+ isSystemTx?: undefined | undefined;
1744
+ mint?: undefined | undefined;
1745
+ sourceHash?: undefined | undefined;
1746
+ } | {
1747
+ blockHash: `0x${string}` | null;
1748
+ blockNumber: bigint | null;
1749
+ from: `0x${string}`;
1750
+ gas: bigint;
1751
+ hash: viem.Hash;
1752
+ input: viem.Hex;
1753
+ nonce: number;
1754
+ r: viem.Hex;
1755
+ s: viem.Hex;
1756
+ to: `0x${string}` | null;
1757
+ transactionIndex: number | null;
1758
+ typeHex: viem.Hex | null;
1759
+ v: bigint;
1760
+ value: bigint;
1761
+ yParity: number;
1762
+ accessList: viem.AccessList;
1763
+ authorizationList?: undefined | undefined;
1764
+ blobVersionedHashes: readonly viem.Hex[];
1765
+ chainId: number;
1766
+ type: "eip4844";
1767
+ gasPrice?: undefined | undefined;
1768
+ maxFeePerBlobGas: bigint;
1769
+ maxFeePerGas: bigint;
1770
+ maxPriorityFeePerGas: bigint;
1771
+ isSystemTx?: undefined | undefined;
1772
+ mint?: undefined | undefined;
1773
+ sourceHash?: undefined | undefined;
1774
+ } | {
1775
+ blockHash: `0x${string}` | null;
1776
+ blockNumber: bigint | null;
1777
+ from: `0x${string}`;
1778
+ gas: bigint;
1779
+ hash: viem.Hash;
1780
+ input: viem.Hex;
1781
+ nonce: number;
1782
+ r: viem.Hex;
1783
+ s: viem.Hex;
1784
+ to: `0x${string}` | null;
1785
+ transactionIndex: number | null;
1786
+ typeHex: viem.Hex | null;
1787
+ v: bigint;
1788
+ value: bigint;
1789
+ yParity: number;
1790
+ accessList: viem.AccessList;
1791
+ authorizationList: viem.SignedAuthorizationList;
1792
+ blobVersionedHashes?: undefined | undefined;
1793
+ chainId: number;
1794
+ type: "eip7702";
1795
+ gasPrice?: undefined | undefined;
1796
+ maxFeePerBlobGas?: undefined | undefined;
1797
+ maxFeePerGas: bigint;
1798
+ maxPriorityFeePerGas: bigint;
1799
+ isSystemTx?: undefined | undefined;
1800
+ mint?: undefined | undefined;
1801
+ sourceHash?: undefined | undefined;
1802
+ }) & {};
1803
+ type: "transaction";
1804
+ };
1805
+ readonly transactionReceipt: {
1806
+ exclude: [] | undefined;
1807
+ format: (args: viem_chains.OpStackRpcTransactionReceipt, action?: string | undefined) => {
1808
+ blobGasPrice?: bigint | undefined;
1809
+ blobGasUsed?: bigint | undefined;
1810
+ blockHash: viem.Hash;
1811
+ blockNumber: bigint;
1812
+ contractAddress: `0x${string}` | null | undefined;
1813
+ cumulativeGasUsed: bigint;
1814
+ effectiveGasPrice: bigint;
1815
+ from: `0x${string}`;
1816
+ gasUsed: bigint;
1817
+ logs: viem.Log<bigint, number, false>[];
1818
+ logsBloom: viem.Hex;
1819
+ root?: `0x${string}` | undefined;
1820
+ status: "success" | "reverted";
1821
+ to: `0x${string}` | null;
1822
+ transactionHash: viem.Hash;
1823
+ transactionIndex: number;
1824
+ type: viem.TransactionType;
1825
+ l1GasPrice: bigint | null;
1826
+ l1GasUsed: bigint | null;
1827
+ l1Fee: bigint | null;
1828
+ l1FeeScalar: number | null;
1829
+ } & {};
1830
+ type: "transactionReceipt";
1831
+ };
1832
+ };
1833
+ prepareTransactionRequest?: ((args: viem.PrepareTransactionRequestParameters, options: {
1834
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
1835
+ }) => Promise<viem.PrepareTransactionRequestParameters>) | [fn: ((args: viem.PrepareTransactionRequestParameters, options: {
1836
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
1837
+ }) => Promise<viem.PrepareTransactionRequestParameters>) | undefined, options: {
1838
+ runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
1839
+ }] | undefined;
1840
+ serializers: {
1841
+ readonly transaction: typeof viem_chains.serializeTransactionOpStack;
1842
+ };
1843
+ verifyHash?: ((client: viem.Client, parameters: viem.VerifyHashActionParameters) => Promise<viem.VerifyHashActionReturnType>) | undefined;
1844
+ readonly network: "base-sepolia";
1845
+ };
1846
+ };
1847
+ type NetworkType = keyof typeof CHAIN_CONFIG;
1848
+ /**
1849
+ * Contract addresses by network
1850
+ */
1851
+ declare const CONTRACT_ADDRESSES: Record<NetworkType, {
1852
+ agentRegistry: Address;
1853
+ exaToken: Address;
1854
+ staking: Address;
1855
+ router: Address;
1856
+ vaultFactory: Address;
1857
+ feeCollector: Address;
1858
+ buyback: Address;
1859
+ serviceEscrow: Address;
1860
+ }>;
1861
+ /**
1862
+ * DEX router addresses on Base
1863
+ */
1864
+ declare const DEX_ADDRESSES: {
1865
+ readonly aerodromeRouter: Address;
1866
+ readonly aerodromeSlipstream: Address;
1867
+ readonly uniswapUniversalRouter: Address;
1868
+ readonly uniswapV4Router: Address;
1869
+ readonly WETH: Address;
1870
+ readonly USDC: Address;
1871
+ };
1872
+ /**
1873
+ * 0x API configuration
1874
+ */
1875
+ declare const ZERO_X_CONFIG: {
1876
+ readonly baseUrl: "https://api.0x.org";
1877
+ readonly chainId: 8453;
1878
+ };
1879
+ /**
1880
+ * Exagent API configuration
1881
+ */
1882
+ declare const EXAGENT_API_CONFIG: {
1883
+ readonly mainnet: "https://api.exagent.io";
1884
+ readonly testnet: "https://api.testnet.exagent.io";
1885
+ };
1886
+
1887
+ /**
1888
+ * Configuration for ExagentClient
1889
+ */
1890
+ interface ExagentClientConfig {
1891
+ /** Network to connect to */
1892
+ network?: NetworkType;
1893
+ /** Private key for the agent's wallet */
1894
+ privateKey?: `0x${string}`;
1895
+ /** Pre-configured wallet client */
1896
+ walletClient?: WalletClient;
1897
+ /** RPC URL override */
1898
+ rpcUrl?: string;
1899
+ /** Exagent API key (optional, for enhanced features) */
1900
+ apiKey?: string;
1901
+ }
1902
+ /**
1903
+ * Main client for interacting with Exagent
1904
+ *
1905
+ * @example
1906
+ * ```typescript
1907
+ * import { ExagentClient } from '@exagent/sdk';
1908
+ *
1909
+ * const exagent = new ExagentClient({
1910
+ * privateKey: process.env.AGENT_PRIVATE_KEY,
1911
+ * network: 'mainnet',
1912
+ * });
1913
+ *
1914
+ * // Register agent
1915
+ * const agentId = await exagent.register({
1916
+ * name: 'My Trading Agent',
1917
+ * description: 'Momentum-based trading strategy',
1918
+ * capabilities: ['spot_trading'],
1919
+ * });
1920
+ *
1921
+ * // Execute trade
1922
+ * const route = await exagent.getRoute({
1923
+ * tokenIn: WETH,
1924
+ * tokenOut: USDC,
1925
+ * amountIn: parseEther('1'),
1926
+ * });
1927
+ * await exagent.executeTrade(route);
1928
+ * ```
1929
+ */
1930
+ declare class ExagentClient {
1931
+ private readonly publicClient;
1932
+ private readonly walletClient;
1933
+ private readonly account;
1934
+ private readonly network;
1935
+ private readonly apiKey?;
1936
+ readonly registry: ExagentRegistry;
1937
+ readonly staking: ExagentStaking;
1938
+ private _agentId?;
1939
+ constructor(config: ExagentClientConfig);
1940
+ /**
1941
+ * Register as a new agent on Exagent
1942
+ * @param metadata Agent metadata (will be uploaded to IPFS)
1943
+ * @returns The assigned agent ID
1944
+ * @throws Error if wallet already owns an agent (one agent per wallet rule)
1945
+ */
1946
+ register(metadata: AgentMetadata): Promise<bigint>;
1947
+ /**
1948
+ * Check if an agent name is available for registration
1949
+ * @param name The name to check
1950
+ * @returns True if the name is available
1951
+ */
1952
+ isNameAvailable(name: string): Promise<boolean>;
1953
+ /**
1954
+ * Get agent by name (returns 0 if not found)
1955
+ * @param name The agent name to look up
1956
+ * @returns Agent ID or 0 if not found
1957
+ */
1958
+ getAgentByName(name: string): Promise<bigint>;
1959
+ /**
1960
+ * Get the current agent's ID (if registered)
1961
+ */
1962
+ getAgentId(): Promise<bigint | undefined>;
1963
+ /**
1964
+ * Get agent profile
1965
+ * @param agentId Optional agent ID (defaults to current agent)
1966
+ */
1967
+ getAgent(agentId?: bigint): Promise<AgentProfile>;
1968
+ /**
1969
+ * Link an additional wallet to this agent
1970
+ * @param wallet Wallet address to link
1971
+ * @param signMessage Function to sign a message with the wallet
1972
+ */
1973
+ linkWallet(wallet: Address, signMessage: (message: string) => Promise<`0x${string}`>): Promise<Hash>;
1974
+ /**
1975
+ * Get all wallets linked to this agent
1976
+ */
1977
+ getLinkedWallets(): Promise<Address[]>;
1978
+ /**
1979
+ * Get optimal DEX route for a trade
1980
+ * Uses 0x API for aggregation across Aerodrome, Uniswap, etc.
1981
+ */
1982
+ getRoute(intent: TradeIntent): Promise<RouteQuote>;
1983
+ /**
1984
+ * Get price quote without transaction data (faster)
1985
+ */
1986
+ getPrice(tokenIn: Address, tokenOut: Address, amountIn: bigint): Promise<PriceQuote>;
1987
+ /**
1988
+ * Execute a trade using a pre-fetched route
1989
+ * @param route Route quote from getRoute()
1990
+ * @param options Trade execution options
1991
+ * @returns Transaction hash
1992
+ */
1993
+ executeTrade(route: RouteQuote, options?: {
1994
+ validateSlippage?: boolean;
1995
+ }): Promise<Hash>;
1996
+ /**
1997
+ * Get and execute a trade in one call
1998
+ * Convenience method that fetches route and executes
1999
+ */
2000
+ swap(intent: TradeIntent): Promise<{
2001
+ hash: Hash;
2002
+ route: RouteQuote;
2003
+ }>;
2004
+ /**
2005
+ * Broadcast a trade intent to the network
2006
+ * Other agents can see this and potentially provide better execution
2007
+ */
2008
+ broadcastIntent(intent: TradeIntent): Promise<void>;
2009
+ /**
2010
+ * Execute a trade through ExagentRouter for full attribution
2011
+ *
2012
+ * This is the recommended way for agents to trade. All trades routed through
2013
+ * the ExagentRouter emit TradeExecuted events that are captured by the indexer
2014
+ * for accurate performance tracking and rankings.
2015
+ *
2016
+ * @param intent Trade parameters
2017
+ * @returns Trade result with transaction hash
2018
+ *
2019
+ * @example
2020
+ * ```typescript
2021
+ * const result = await exagent.trade({
2022
+ * tokenIn: WETH,
2023
+ * tokenOut: USDC,
2024
+ * amountIn: parseEther('1'),
2025
+ * maxSlippageBps: 50,
2026
+ * });
2027
+ * console.log('Trade submitted:', result.hash);
2028
+ * ```
2029
+ */
2030
+ trade(intent: Omit<TradeIntent, 'action'>): Promise<TradeResult>;
2031
+ /**
2032
+ * Build a router trade transaction without executing
2033
+ * Useful for simulation or multi-step workflows
2034
+ */
2035
+ buildRouterTrade(intent: Omit<TradeIntent, 'action'>, agentId?: bigint): Promise<RouterTradeResponse>;
2036
+ /**
2037
+ * Approve token spending for router
2038
+ */
2039
+ private approveToken;
2040
+ /**
2041
+ * Encode ERC20 approve calldata
2042
+ */
2043
+ private encodeApprove;
2044
+ /**
2045
+ * Request a service from another agent
2046
+ */
2047
+ requestService(request: ServiceRequest): Promise<{
2048
+ requestId: string;
2049
+ }>;
2050
+ /**
2051
+ * List available services
2052
+ */
2053
+ listServices(serviceType?: string): Promise<unknown[]>;
2054
+ /**
2055
+ * Get agent leaderboard
2056
+ */
2057
+ getLeaderboard(options?: {
2058
+ category?: string;
2059
+ limit?: number;
2060
+ offset?: number;
2061
+ }): Promise<AgentProfile[]>;
2062
+ /**
2063
+ * Get a vault interface for interacting with an ExagentVault
2064
+ * @param vaultAddress The vault contract address
2065
+ * @returns ExagentVault instance
2066
+ */
2067
+ getVault(vaultAddress: Address): ExagentVault;
2068
+ /**
2069
+ * List all vaults for a given agent
2070
+ * @param agentId Agent ID to get vaults for
2071
+ * @returns Array of vault summaries
2072
+ */
2073
+ getAgentVaults(agentId?: bigint): Promise<VaultSummary[]>;
2074
+ /**
2075
+ * List all vaults the user has positions in
2076
+ * @param userAddress User address (defaults to connected wallet)
2077
+ * @returns Array of vault summaries with user position info
2078
+ */
2079
+ getUserVaults(userAddress?: Address): Promise<VaultSummary[]>;
2080
+ /**
2081
+ * List top performing vaults
2082
+ * @param options Filter options
2083
+ * @returns Array of vault summaries sorted by performance
2084
+ */
2085
+ getTopVaults(options?: {
2086
+ asset?: Address;
2087
+ minTvl?: bigint;
2088
+ period?: '7d' | '30d' | '90d' | 'all';
2089
+ limit?: number;
2090
+ }): Promise<VaultSummary[]>;
2091
+ /**
2092
+ * Deposit into a vault
2093
+ * @param vaultAddress Vault contract address
2094
+ * @param amount Amount of underlying asset to deposit
2095
+ * @returns Transaction hash
2096
+ */
2097
+ depositToVault(vaultAddress: Address, amount: bigint): Promise<Hash>;
2098
+ /**
2099
+ * Withdraw from a vault
2100
+ * @param vaultAddress Vault contract address
2101
+ * @param assets Amount of underlying asset to withdraw
2102
+ * @returns Transaction hash
2103
+ */
2104
+ withdrawFromVault(vaultAddress: Address, assets: bigint): Promise<Hash>;
2105
+ /**
2106
+ * Redeem shares from a vault
2107
+ * @param vaultAddress Vault contract address
2108
+ * @param shares Amount of shares to redeem
2109
+ * @returns Transaction hash
2110
+ */
2111
+ redeemFromVault(vaultAddress: Address, shares: bigint): Promise<Hash>;
2112
+ /**
2113
+ * Stake EXA tokens to receive vEXA voting power
2114
+ * @param amount Amount of EXA to stake (in wei)
2115
+ * @param lockDuration Lock duration in seconds (30 days to 2 years)
2116
+ * @returns Transaction hash
2117
+ *
2118
+ * @example
2119
+ * ```typescript
2120
+ * // Stake 1000 EXA for 6 months
2121
+ * const tx = await exagent.stakeExa(
2122
+ * parseEther('1000'),
2123
+ * ExagentStaking.LOCK_6_MONTHS
2124
+ * );
2125
+ * ```
2126
+ */
2127
+ stakeExa(amount: bigint, lockDuration: bigint): Promise<Hash>;
2128
+ /**
2129
+ * Unstake EXA tokens after lock expires
2130
+ * @returns Transaction hash
2131
+ */
2132
+ unstakeExa(): Promise<Hash>;
2133
+ /**
2134
+ * Get staking info for the connected wallet
2135
+ * @returns Staking info including amount, unlock time, and vEXA balance
2136
+ */
2137
+ getStakingInfo(): Promise<StakingInfo>;
2138
+ /**
2139
+ * Get current vEXA balance for the connected wallet
2140
+ * @returns Current vEXA balance (with time decay applied)
2141
+ */
2142
+ getVeEXABalance(): Promise<bigint>;
2143
+ /**
2144
+ * Delegate vEXA voting power to an agent
2145
+ * @param agentId The agent ID to delegate to
2146
+ * @returns Transaction hash
2147
+ */
2148
+ delegateToAgent(agentId: bigint): Promise<Hash>;
2149
+ /**
2150
+ * Get delegation stats for an agent
2151
+ * @param agentId The agent ID to check
2152
+ * @returns Delegation info with total vEXA and delegator count
2153
+ */
2154
+ getAgentDelegation(agentId: bigint): Promise<DelegationInfo>;
2155
+ /**
2156
+ * Claim all pending staking rewards (EXA + multi-token)
2157
+ * @returns Transaction hashes for EXA and multi-token claims
2158
+ */
2159
+ claimAllRewards(): Promise<{
2160
+ exaRewards: Hash;
2161
+ multiTokenRewards: Hash;
2162
+ }>;
2163
+ /**
2164
+ * Get the agent's wallet address
2165
+ */
2166
+ get address(): Address;
2167
+ private uploadMetadata;
2168
+ private signIntent;
2169
+ private parseAgentIdFromReceipt;
2170
+ }
2171
+
2172
+ /**
2173
+ * ExagentVaultFactory ABI
2174
+ */
2175
+ declare const EXAGENT_VAULT_FACTORY_ABI: readonly [{
2176
+ readonly type: "function";
2177
+ readonly name: "owner";
2178
+ readonly inputs: readonly [];
2179
+ readonly outputs: readonly [{
2180
+ readonly type: "address";
2181
+ }];
2182
+ readonly stateMutability: "view";
2183
+ }, {
2184
+ readonly type: "function";
2185
+ readonly name: "registry";
2186
+ readonly inputs: readonly [];
2187
+ readonly outputs: readonly [{
2188
+ readonly type: "address";
2189
+ }];
2190
+ readonly stateMutability: "view";
2191
+ }, {
2192
+ readonly type: "function";
2193
+ readonly name: "router";
2194
+ readonly inputs: readonly [];
2195
+ readonly outputs: readonly [{
2196
+ readonly type: "address";
2197
+ }];
2198
+ readonly stateMutability: "view";
2199
+ }, {
2200
+ readonly type: "function";
2201
+ readonly name: "minimumVeEXARequired";
2202
+ readonly inputs: readonly [];
2203
+ readonly outputs: readonly [{
2204
+ readonly type: "uint256";
2205
+ }];
2206
+ readonly stateMutability: "view";
2207
+ }, {
2208
+ readonly type: "function";
2209
+ readonly name: "eXABurnFee";
2210
+ readonly inputs: readonly [];
2211
+ readonly outputs: readonly [{
2212
+ readonly type: "uint256";
2213
+ }];
2214
+ readonly stateMutability: "view";
2215
+ }, {
2216
+ readonly type: "function";
2217
+ readonly name: "allowedAssets";
2218
+ readonly inputs: readonly [{
2219
+ readonly name: "asset";
2220
+ readonly type: "address";
2221
+ }];
2222
+ readonly outputs: readonly [{
2223
+ readonly type: "bool";
2224
+ }];
2225
+ readonly stateMutability: "view";
2226
+ }, {
2227
+ readonly type: "function";
2228
+ readonly name: "vaults";
2229
+ readonly inputs: readonly [{
2230
+ readonly name: "agentId";
2231
+ readonly type: "uint256";
2232
+ }, {
2233
+ readonly name: "asset";
2234
+ readonly type: "address";
2235
+ }];
2236
+ readonly outputs: readonly [{
2237
+ readonly type: "address";
2238
+ }];
2239
+ readonly stateMutability: "view";
2240
+ }, {
2241
+ readonly type: "function";
2242
+ readonly name: "agentVaultCount";
2243
+ readonly inputs: readonly [{
2244
+ readonly name: "agentId";
2245
+ readonly type: "uint256";
2246
+ }];
2247
+ readonly outputs: readonly [{
2248
+ readonly type: "uint256";
2249
+ }];
2250
+ readonly stateMutability: "view";
2251
+ }, {
2252
+ readonly type: "function";
2253
+ readonly name: "canCreateVault";
2254
+ readonly inputs: readonly [{
2255
+ readonly name: "creator";
2256
+ readonly type: "address";
2257
+ }];
2258
+ readonly outputs: readonly [{
2259
+ readonly name: "canCreate";
2260
+ readonly type: "bool";
2261
+ }, {
2262
+ readonly name: "reason";
2263
+ readonly type: "string";
2264
+ }];
2265
+ readonly stateMutability: "view";
2266
+ }, {
2267
+ readonly type: "function";
2268
+ readonly name: "getVaultCreationRequirements";
2269
+ readonly inputs: readonly [];
2270
+ readonly outputs: readonly [{
2271
+ readonly name: "veXARequired";
2272
+ readonly type: "uint256";
2273
+ }, {
2274
+ readonly name: "burnFee";
2275
+ readonly type: "uint256";
2276
+ }, {
2277
+ readonly name: "stakingContract";
2278
+ readonly type: "address";
2279
+ }, {
2280
+ readonly name: "exaToken";
2281
+ readonly type: "address";
2282
+ }];
2283
+ readonly stateMutability: "view";
2284
+ }, {
2285
+ readonly type: "function";
2286
+ readonly name: "createVault";
2287
+ readonly inputs: readonly [{
2288
+ readonly name: "agentId";
2289
+ readonly type: "uint256";
2290
+ }, {
2291
+ readonly name: "asset";
2292
+ readonly type: "address";
2293
+ }, {
2294
+ readonly name: "name";
2295
+ readonly type: "string";
2296
+ }, {
2297
+ readonly name: "symbol";
2298
+ readonly type: "string";
2299
+ }, {
2300
+ readonly name: "feeRecipient";
2301
+ readonly type: "address";
2302
+ }];
2303
+ readonly outputs: readonly [{
2304
+ readonly type: "address";
2305
+ }];
2306
+ readonly stateMutability: "nonpayable";
2307
+ }, {
2308
+ readonly type: "event";
2309
+ readonly name: "VaultCreated";
2310
+ readonly inputs: readonly [{
2311
+ readonly name: "vault";
2312
+ readonly type: "address";
2313
+ readonly indexed: true;
2314
+ }, {
2315
+ readonly name: "agentId";
2316
+ readonly type: "uint256";
2317
+ readonly indexed: true;
2318
+ }, {
2319
+ readonly name: "asset";
2320
+ readonly type: "address";
2321
+ readonly indexed: true;
2322
+ }, {
2323
+ readonly name: "creator";
2324
+ readonly type: "address";
2325
+ readonly indexed: false;
2326
+ }, {
2327
+ readonly name: "name";
2328
+ readonly type: "string";
2329
+ readonly indexed: false;
2330
+ }, {
2331
+ readonly name: "symbol";
2332
+ readonly type: "string";
2333
+ readonly indexed: false;
2334
+ }];
2335
+ }, {
2336
+ readonly type: "event";
2337
+ readonly name: "AllowedAssetUpdated";
2338
+ readonly inputs: readonly [{
2339
+ readonly name: "asset";
2340
+ readonly type: "address";
2341
+ readonly indexed: true;
2342
+ }, {
2343
+ readonly name: "allowed";
2344
+ readonly type: "bool";
2345
+ readonly indexed: false;
2346
+ }];
2347
+ }];
2348
+ /**
2349
+ * Vault creation requirements from the factory
2350
+ */
2351
+ interface VaultCreationRequirements {
2352
+ veXARequired: bigint;
2353
+ burnFee: bigint;
2354
+ stakingContract: Address;
2355
+ exaToken: Address;
2356
+ /** Whether requirements are effectively bypassed (testnet mode) */
2357
+ isBypassed: boolean;
2358
+ }
2359
+ /**
2360
+ * Result of checking if an address can create a vault
2361
+ */
2362
+ interface CanCreateVaultResult {
2363
+ canCreate: boolean;
2364
+ reason: string;
2365
+ }
2366
+ /**
2367
+ * Options for creating a vault
2368
+ */
2369
+ interface CreateVaultOptions {
2370
+ agentId: bigint;
2371
+ asset: Address;
2372
+ name: string;
2373
+ symbol: string;
2374
+ feeRecipient?: Address;
2375
+ }
2376
+ /**
2377
+ * ExagentVaultFactory SDK class for vault creation and management
2378
+ */
2379
+ declare class ExagentVaultFactory {
2380
+ readonly address: Address;
2381
+ private readonly publicClient;
2382
+ private readonly walletClient?;
2383
+ private readonly chain;
2384
+ private readonly account?;
2385
+ constructor(factoryAddress: Address, publicClient: any, walletClient?: any, chain?: Chain, account?: Account);
2386
+ /**
2387
+ * Get vault creation requirements
2388
+ */
2389
+ getRequirements(): Promise<VaultCreationRequirements>;
2390
+ /**
2391
+ * Check if an address can create a vault
2392
+ * @param creator Address to check
2393
+ */
2394
+ canCreateVault(creator: Address): Promise<CanCreateVaultResult>;
2395
+ /**
2396
+ * Check if an asset is whitelisted for vault creation
2397
+ * @param asset Asset address to check
2398
+ */
2399
+ isAssetAllowed(asset: Address): Promise<boolean>;
2400
+ /**
2401
+ * Get existing vault for an agent and asset
2402
+ * @param agentId Agent ID
2403
+ * @param asset Asset address
2404
+ * @returns Vault address or zero address if none exists
2405
+ */
2406
+ getVault(agentId: bigint, asset: Address): Promise<Address>;
2407
+ /**
2408
+ * Get count of vaults for an agent
2409
+ * @param agentId Agent ID
2410
+ */
2411
+ getAgentVaultCount(agentId: bigint): Promise<bigint>;
2412
+ /**
2413
+ * Check if agent already has a vault for an asset
2414
+ * @param agentId Agent ID
2415
+ * @param asset Asset address
2416
+ */
2417
+ hasVault(agentId: bigint, asset: Address): Promise<boolean>;
2418
+ /**
2419
+ * Create a new vault for an agent
2420
+ * @param options Vault creation options
2421
+ * @returns Transaction hash
2422
+ */
2423
+ createVault(options: CreateVaultOptions): Promise<Hash>;
2424
+ /**
2425
+ * Check all requirements and create a vault if possible
2426
+ * Returns detailed status about each requirement
2427
+ */
2428
+ checkAndCreateVault(agentId: bigint, asset: Address, name: string, symbol: string, feeRecipient?: Address): Promise<{
2429
+ success: boolean;
2430
+ vaultAddress?: Address;
2431
+ txHash?: Hash;
2432
+ error?: string;
2433
+ checks: {
2434
+ canCreate: boolean;
2435
+ canCreateReason: string;
2436
+ assetAllowed: boolean;
2437
+ hasExistingVault: boolean;
2438
+ };
2439
+ }>;
2440
+ }
2441
+
2442
+ /**
2443
+ * Quick access to testnet (Base Sepolia) contract addresses
2444
+ * Use these when interacting with contracts directly via viem
2445
+ */
2446
+ declare const TESTNET_ADDRESSES: {
2447
+ readonly registry: "0xCF48C341e3FebeCA5ECB7eb2535f61A2Ba855d9C";
2448
+ readonly token: "0x66c39b0ad96B3f5eE198Fef913c6636353a48A87";
2449
+ readonly staking: "0x439441468e1b1b616E9D36b80969C241F261A011";
2450
+ readonly router: "0xc0c27eEE047E414CD716D06C2444CF2073113d5C";
2451
+ readonly vaultFactory: "0x5c099daaE33801a907Bb57011c6749655b55dc75";
2452
+ readonly feeCollector: "0xcB57b03a50df054b9C738Df1324C17A4fDe4fe46";
2453
+ readonly buyback: "0x35cdEa810A130A846265682e5c71A68A507aB895";
2454
+ readonly serviceEscrow: "0x74a3496b148DEE735ac388299aF9Ac2F7C4EdCBf";
2455
+ readonly usdc: "0x036CbD53842c5426634e7929541eC2318f3dCF7e";
2456
+ };
2457
+
2458
+ export { type AgentMetadata, type AgentProfile, CHAIN_CONFIG, CONTRACT_ADDRESSES, type CanCreateVaultResult, type CreateVaultOptions, DEX_ADDRESSES, DISCOUNT_TIERS, type DelegationInfo$1 as DelegationInfo, type DelegationInfo as DelegationInfoExtended, type DiscountTier$1 as DiscountTier, type DiscountTier as DiscountTierType, EXAGENT_API_CONFIG, EXAGENT_STAKING_ABI, EXAGENT_VAULT_FACTORY_ABI, ExagentClient, type ExagentClientConfig, ExagentRegistry, ExagentStaking, ExagentVault, ExagentVaultFactory, type NetworkType, type PerformanceSnapshot, type PriceQuote, type RouteQuote, type RouteStep, type RouterTradeResponse, type ServiceRequest, type StakeInfo, type StakingInfo$1 as StakingInfo, type StakingInfo as StakingInfoExtended, TESTNET_ADDRESSES, type TradeIntent, type TradeResult, type UserVaultPosition, type VaultActivityEntry, type VaultConfig, type VaultCreationRequirements, type VaultInfo, type VaultPosition, type VaultSummary, type VaultTradeEntry, type WithdrawalRequest, ZERO_X_CONFIG };