mantle-agent-kit-sdk 1.0.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,782 @@
1
+ import * as viem from 'viem';
2
+ import { WalletClient, Transport, Chain, PublicActions, Address as Address$1, Hex } from 'viem';
3
+ import { PrivateKeyAccount, Address } from 'viem/accounts';
4
+
5
+ interface SquidRoute {
6
+ route: {
7
+ estimate: {
8
+ fromAmount: string;
9
+ toAmount: string;
10
+ toAmountMin: string;
11
+ route: {
12
+ actionType: string;
13
+ chainType: string;
14
+ data: {
15
+ tokenIn: string;
16
+ tokenOut: string;
17
+ amountIn: string;
18
+ amountOut: string;
19
+ path: string[];
20
+ };
21
+ }[];
22
+ estimatedRouteDuration: number;
23
+ aggregatePriceImpact: string;
24
+ feeCosts: {
25
+ name: string;
26
+ description: string;
27
+ percentage: string;
28
+ amount: string;
29
+ amountUSD: string;
30
+ }[];
31
+ gasCosts: {
32
+ type: string;
33
+ amount: string;
34
+ amountUSD: string;
35
+ gasPrice: string;
36
+ maxFeePerGas: string;
37
+ maxPriorityFeePerGas: string;
38
+ estimate: string;
39
+ }[];
40
+ };
41
+ transactionRequest: {
42
+ routeType: string;
43
+ targetAddress: string;
44
+ data: string;
45
+ value: string;
46
+ gasLimit: string;
47
+ gasPrice: string;
48
+ maxFeePerGas: string;
49
+ maxPriorityFeePerGas: string;
50
+ };
51
+ };
52
+ }
53
+
54
+ declare const SWAP_ROUTER_ADDRESS = "0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45";
55
+ declare const QUOTER_V2_ADDRESS = "0x61fFE014bA17989E743c5F6cB21bF9697530B21e";
56
+ declare const FACTORY_ADDRESS = "0x1F98431c8aD98523631AE4a59f267346ea31F984";
57
+ declare const WMNT_ADDRESS$1 = "0x78c1b0C915c4FAA5FffA6CAbf0219DA63d7f4cb8";
58
+ declare const NATIVE_TOKEN_ADDRESS$3 = "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE";
59
+ declare const FEE_TIERS$1: {
60
+ readonly LOWEST: 100;
61
+ readonly LOW: 500;
62
+ readonly MEDIUM: 3000;
63
+ readonly HIGH: 10000;
64
+ };
65
+ declare const DEFAULT_POOL_FEE: 3000;
66
+
67
+ declare const index$8_DEFAULT_POOL_FEE: typeof DEFAULT_POOL_FEE;
68
+ declare const index$8_FACTORY_ADDRESS: typeof FACTORY_ADDRESS;
69
+ declare const index$8_QUOTER_V2_ADDRESS: typeof QUOTER_V2_ADDRESS;
70
+ declare const index$8_SWAP_ROUTER_ADDRESS: typeof SWAP_ROUTER_ADDRESS;
71
+ declare namespace index$8 {
72
+ export { index$8_DEFAULT_POOL_FEE as DEFAULT_POOL_FEE, index$8_FACTORY_ADDRESS as FACTORY_ADDRESS, FEE_TIERS$1 as FEE_TIERS, NATIVE_TOKEN_ADDRESS$3 as NATIVE_TOKEN_ADDRESS, index$8_QUOTER_V2_ADDRESS as QUOTER_V2_ADDRESS, index$8_SWAP_ROUTER_ADDRESS as SWAP_ROUTER_ADDRESS, WMNT_ADDRESS$1 as WMNT_ADDRESS };
73
+ }
74
+
75
+ interface UniswapQuoteResult {
76
+ amountOut: bigint;
77
+ sqrtPriceX96After: bigint;
78
+ gasEstimate: bigint;
79
+ }
80
+
81
+ interface OneInchQuote {
82
+ srcToken: {
83
+ address: string;
84
+ symbol: string;
85
+ decimals: number;
86
+ };
87
+ dstToken: {
88
+ address: string;
89
+ symbol: string;
90
+ decimals: number;
91
+ };
92
+ srcAmount: string;
93
+ dstAmount: string;
94
+ gas: number;
95
+ }
96
+
97
+ interface OpenOceanQuote {
98
+ inToken: {
99
+ address: string;
100
+ decimals: number;
101
+ symbol: string;
102
+ name: string;
103
+ };
104
+ outToken: {
105
+ address: string;
106
+ decimals: number;
107
+ symbol: string;
108
+ name: string;
109
+ };
110
+ inAmount: string;
111
+ outAmount: string;
112
+ estimatedGas: string;
113
+ }
114
+
115
+ /**
116
+ * Platform Configuration & Validation
117
+ *
118
+ * Validates APP_ID with Mantle platform API
119
+ */
120
+ /** Project configuration from platform */
121
+ interface ProjectConfig {
122
+ appId: string;
123
+ name: string;
124
+ payTo: string;
125
+ network: string;
126
+ status: string;
127
+ }
128
+ /**
129
+ * Initialize platform validation
130
+ *
131
+ * Reads APP_ID from environment and validates with platform API.
132
+ * Uses singleton pattern - multiple calls return same promise.
133
+ *
134
+ * @returns Project configuration from platform
135
+ * @throws Error if APP_ID is not set or validation fails
136
+ */
137
+ declare function initializePlatform(): Promise<ProjectConfig>;
138
+ /**
139
+ * Get cached project configuration
140
+ *
141
+ * @throws Error if platform not initialized
142
+ */
143
+ declare function getProjectConfig(): ProjectConfig;
144
+
145
+ declare class MNTAgentKit {
146
+ account: PrivateKeyAccount;
147
+ client: WalletClient<Transport, Chain, PrivateKeyAccount> & PublicActions;
148
+ chain: "testnet" | "mainnet";
149
+ projectConfig?: ProjectConfig;
150
+ constructor(privateKey: Address, chain: "mainnet" | "testnet");
151
+ /**
152
+ * Initialize the agent with platform validation
153
+ *
154
+ * Validates APP_ID with the platform API.
155
+ * Must be called after creating the agent instance.
156
+ *
157
+ * @returns The initialized agent instance
158
+ * @throws Error if APP_ID is not set or validation fails
159
+ *
160
+ * @example
161
+ * ```typescript
162
+ * const agent = new MNTAgentKit(privateKey, "mainnet");
163
+ * await agent.initialize(); // Validates APP_ID
164
+ * ```
165
+ */
166
+ initialize(): Promise<MNTAgentKit>;
167
+ sendTransaction(to: Address, amount: string): Promise<viem.TransactionReceipt<bigint, number, "success" | "reverted", viem.TransactionType>>;
168
+ getSwapQuote(fromTokenAddress: string, toTokenAddress: string, amount: string, slippagePercentage?: string): Promise<any>;
169
+ executeSwap(fromTokenAddress: string, toTokenAddress: string, amount: string, slippagePercentage?: string): Promise<{
170
+ data: any;
171
+ } | undefined>;
172
+ getOpenOceanQuote(fromToken: Address, toToken: Address, amount: string): Promise<OpenOceanQuote>;
173
+ swapOnOpenOcean(fromToken: Address, toToken: Address, amount: string, slippage?: number): Promise<{
174
+ txHash: string;
175
+ outAmount: string;
176
+ }>;
177
+ get1inchQuote(fromToken: Address, toToken: Address, amount: string): Promise<OneInchQuote>;
178
+ swapOn1inch(fromToken: Address, toToken: Address, amount: string, slippage?: number): Promise<{
179
+ txHash: string;
180
+ dstAmount: string;
181
+ }>;
182
+ getUniswapQuote(fromToken: Address, toToken: Address, amount: string): Promise<UniswapQuoteResult>;
183
+ swapOnUniswap(fromToken: Address, toToken: Address, amount: string, slippage?: number): Promise<{
184
+ txHash: string;
185
+ amountOut: string;
186
+ }>;
187
+ lendleSupply(tokenAddress: Address, amount: string): Promise<`0x${string}`>;
188
+ lendleWithdraw(tokenAddress: Address, amount: string, to?: Address): Promise<`0x${string}`>;
189
+ lendleBorrow(tokenAddress: Address, amount: string, interestRateMode?: 1 | 2, onBehalfOf?: Address): Promise<`0x${string}`>;
190
+ lendleRepay(tokenAddress: Address, amount: string, rateMode?: 1 | 2, onBehalfOf?: Address): Promise<`0x${string}`>;
191
+ agniSwap(tokenIn: Address, tokenOut: Address, amountIn: string, slippagePercent?: number, feeTier?: number): Promise<`0x${string}`>;
192
+ merchantMoeSwap(tokenIn: Address, tokenOut: Address, amountIn: string, slippagePercent?: number): Promise<`0x${string}`>;
193
+ getMethTokenAddress(): "0x0000000000000000000000000000000000000000" | "0xcDA86A272531e8640cD7F1a92c01839911B90bb0";
194
+ getSquidRoute(fromToken: Address, toToken: Address, fromChain: number, toChain: number, amount: string, slippage?: number): Promise<SquidRoute>;
195
+ crossChainSwapViaSquid(fromToken: Address, toToken: Address, fromChain: number, toChain: number, amount: string, slippage?: number): Promise<`0x${string}`>;
196
+ }
197
+
198
+ declare const sendTransaction: (agent: MNTAgentKit, to: Address$1, amount: string) => Promise<viem.TransactionReceipt<bigint, number, "success" | "reverted", viem.TransactionType>>;
199
+
200
+ /**
201
+ * Check allowance and get approve tx data if needed
202
+ * @param agent - MNTAgentKit instance
203
+ * @param tokenAddress - Token to approve
204
+ * @param amount - Amount to approve
205
+ * @returns Allowance status and tx data
206
+ */
207
+ declare function approveToken(agent: MNTAgentKit, tokenAddress: string, amount: string): Promise<{
208
+ allowanceExists: boolean;
209
+ data: any;
210
+ }>;
211
+
212
+ /**
213
+ * Execute token swap
214
+ * @param fromTokenAddress - Source token address
215
+ * @param toTokenAddress - Destination token address
216
+ * @param amount - Amount to swap
217
+ * @param slippagePercent - Maximum slippagePercent
218
+ * @returns Transaction hash
219
+ */
220
+ declare function executeSwap(agent: MNTAgentKit, fromTokenAddress: string, toTokenAddress: string, amount: string, slippagePercent: string): Promise<{
221
+ data: any;
222
+ }>;
223
+
224
+ /**
225
+ * Get swap quote from OpenOcean
226
+ * @param agent - MNTAgentKit instance
227
+ * @param fromToken - Source token address
228
+ * @param toToken - Destination token address
229
+ * @param amount - Amount to swap (in smallest units)
230
+ * @returns Quote data including estimated output amount
231
+ */
232
+ declare function getOpenOceanQuote(agent: MNTAgentKit, fromToken: string, toToken: string, amount: string): Promise<OpenOceanQuote>;
233
+
234
+ /**
235
+ * Execute token swap on OpenOcean
236
+ * @param agent - MNTAgentKit instance
237
+ * @param fromToken - Source token address
238
+ * @param toToken - Destination token address
239
+ * @param amount - Amount to swap (in smallest units)
240
+ * @param slippage - Slippage percentage (e.g., "1" for 1%)
241
+ * @returns Transaction hash
242
+ */
243
+ declare function swapOnOpenOcean(agent: MNTAgentKit, fromToken: string, toToken: string, amount: string, slippage?: string): Promise<{
244
+ txHash: string;
245
+ outAmount: string;
246
+ }>;
247
+
248
+ /**
249
+ * Get swap quote from 1inch
250
+ * @param agent - MNTAgentKit instance
251
+ * @param fromToken - Source token address
252
+ * @param toToken - Destination token address
253
+ * @param amount - Amount to swap (in smallest units)
254
+ * @returns Quote data including estimated output amount
255
+ */
256
+ declare function get1inchQuote(agent: MNTAgentKit, fromToken: string, toToken: string, amount: string): Promise<OneInchQuote>;
257
+
258
+ /**
259
+ * Execute token swap on 1inch
260
+ * @param agent - MNTAgentKit instance
261
+ * @param fromToken - Source token address
262
+ * @param toToken - Destination token address
263
+ * @param amount - Amount to swap (in smallest units)
264
+ * @param slippage - Slippage percentage (e.g., "1" for 1%)
265
+ * @returns Transaction hash and output amount
266
+ */
267
+ declare function swapOn1inch(agent: MNTAgentKit, fromToken: string, toToken: string, amount: string, slippage?: string): Promise<{
268
+ txHash: string;
269
+ dstAmount: string;
270
+ }>;
271
+
272
+ /**
273
+ * Get swap quote from Uniswap V3
274
+ * @param agent - MNTAgentKit instance
275
+ * @param fromToken - Source token address
276
+ * @param toToken - Destination token address
277
+ * @param amount - Amount to swap (in smallest units)
278
+ * @param fee - Pool fee tier (default: 3000 = 0.3%)
279
+ * @returns Quote with expected output amount
280
+ */
281
+ declare function getUniswapQuote(agent: MNTAgentKit, fromToken: string, toToken: string, amount: string, fee?: number): Promise<UniswapQuoteResult>;
282
+
283
+ /**
284
+ * Execute token swap on Uniswap V3
285
+ * @param agent - MNTAgentKit instance
286
+ * @param fromToken - Source token address
287
+ * @param toToken - Destination token address
288
+ * @param amount - Amount to swap (in smallest units)
289
+ * @param slippage - Slippage percentage (e.g., "0.5" for 0.5%)
290
+ * @param fee - Pool fee tier (default: 3000 = 0.3%)
291
+ * @returns Transaction hash and output amount
292
+ */
293
+ declare function swapOnUniswap(agent: MNTAgentKit, fromToken: string, toToken: string, amount: string, slippage?: string, fee?: number): Promise<{
294
+ txHash: string;
295
+ amountOut: string;
296
+ }>;
297
+
298
+ /**
299
+ * Execute cross-chain swap via Squid Router
300
+ * @param agent - MNTAgentKit instance
301
+ * @param fromToken - Source token address
302
+ * @param toToken - Destination token address
303
+ * @param fromChain - Source chain ID (LayerZero chain ID)
304
+ * @param toChain - Destination chain ID (LayerZero chain ID)
305
+ * @param amount - Amount to swap (in smallest units)
306
+ * @param slippage - Slippage tolerance percentage (default: 1%)
307
+ * @returns Transaction hash
308
+ */
309
+ declare function crossChainSwapViaSquid(agent: MNTAgentKit, fromToken: Address$1, toToken: Address$1, fromChain: number, toChain: number, amount: string, slippage?: number): Promise<Hex>;
310
+ /**
311
+ * Get cross-chain swap route from Squid Router
312
+ * @param agent - MNTAgentKit instance
313
+ * @param fromToken - Source token address
314
+ * @param toToken - Destination token address
315
+ * @param fromChain - Source chain ID (LayerZero chain ID)
316
+ * @param toChain - Destination chain ID (LayerZero chain ID)
317
+ * @param amount - Amount to swap (in smallest units)
318
+ * @param slippage - Slippage tolerance percentage (default: 1%)
319
+ * @returns Route data including estimated output and fees
320
+ */
321
+ declare function getSquidRoute(agent: MNTAgentKit, fromToken: Address$1, toToken: Address$1, fromChain: number, toChain: number, amount: string, slippage?: number): Promise<SquidRoute>;
322
+
323
+ /**
324
+ * Supply (deposit) tokens to Lendle Protocol
325
+ * @param agent - MNTAgentKit instance
326
+ * @param tokenAddress - Token address to supply
327
+ * @param amount - Amount to supply (in smallest units)
328
+ * @returns Transaction hash
329
+ */
330
+ declare function lendleSupply(agent: MNTAgentKit, tokenAddress: Address$1, amount: string): Promise<Hex>;
331
+
332
+ /**
333
+ * Withdraw tokens from Lendle Protocol
334
+ * @param agent - MNTAgentKit instance
335
+ * @param tokenAddress - Token address to withdraw
336
+ * @param amount - Amount to withdraw (in smallest units, use max uint256 for max)
337
+ * @param to - Address to receive withdrawn tokens (optional, defaults to agent address)
338
+ * @returns Transaction hash
339
+ */
340
+ declare function lendleWithdraw(agent: MNTAgentKit, tokenAddress: Address$1, amount: string, to?: Address$1): Promise<Hex>;
341
+
342
+ /**
343
+ * Borrow tokens from Lendle Protocol
344
+ * @param agent - MNTAgentKit instance
345
+ * @param tokenAddress - Token address to borrow
346
+ * @param amount - Amount to borrow (in smallest units)
347
+ * @param interestRateMode - Interest rate mode (1 = stable, 2 = variable)
348
+ * @param onBehalfOf - Address to receive borrowed tokens (optional, defaults to agent address)
349
+ * @returns Transaction hash
350
+ */
351
+ declare function lendleBorrow(agent: MNTAgentKit, tokenAddress: Address$1, amount: string, interestRateMode?: 1 | 2, onBehalfOf?: Address$1): Promise<Hex>;
352
+
353
+ /**
354
+ * Repay borrowed tokens to Lendle Protocol
355
+ * @param agent - MNTAgentKit instance
356
+ * @param tokenAddress - Token address to repay
357
+ * @param amount - Amount to repay (in smallest units, use max uint256 for full repayment)
358
+ * @param rateMode - Interest rate mode (1 = stable, 2 = variable)
359
+ * @param onBehalfOf - Address whose debt to repay (optional, defaults to agent address)
360
+ * @returns Transaction hash
361
+ */
362
+ declare function lendleRepay(agent: MNTAgentKit, tokenAddress: Address$1, amount: string, rateMode?: 1 | 2, onBehalfOf?: Address$1): Promise<Hex>;
363
+
364
+ /**
365
+ * Swap tokens on Agni Finance DEX
366
+ * @param agent - MNTAgentKit instance
367
+ * @param tokenIn - Input token address
368
+ * @param tokenOut - Output token address
369
+ * @param amountIn - Amount to swap (in smallest units)
370
+ * @param slippagePercent - Slippage tolerance (default: 0.5%)
371
+ * @param feeTier - Pool fee tier (default: MEDIUM = 0.3%)
372
+ * @returns Transaction hash
373
+ */
374
+ declare function agniSwap(agent: MNTAgentKit, tokenIn: Address$1, tokenOut: Address$1, amountIn: string, slippagePercent?: number, feeTier?: number): Promise<Hex>;
375
+
376
+ /**
377
+ * Swap tokens on Merchant Moe DEX
378
+ * @param agent - MNTAgentKit instance
379
+ * @param tokenIn - Input token address
380
+ * @param tokenOut - Output token address
381
+ * @param amountIn - Amount to swap (in smallest units)
382
+ * @param slippagePercent - Slippage tolerance (default: 0.5%)
383
+ * @returns Transaction hash
384
+ */
385
+ declare function merchantMoeSwap(agent: MNTAgentKit, tokenIn: Address$1, tokenOut: Address$1, amountIn: string, slippagePercent?: number): Promise<Hex>;
386
+
387
+ declare const METH_TOKEN: {
388
+ readonly mainnet: "0xcDA86A272531e8640cD7F1a92c01839911B90bb0";
389
+ readonly testnet: "0x0000000000000000000000000000000000000000";
390
+ };
391
+
392
+ declare const index$7_METH_TOKEN: typeof METH_TOKEN;
393
+ declare namespace index$7 {
394
+ export { index$7_METH_TOKEN as METH_TOKEN };
395
+ }
396
+
397
+ declare const FACTORY: {
398
+ readonly mainnet: "0x25780dc8Fc3cfBD75F33bFDAB65e969b603b2035";
399
+ readonly testnet: "0x0000000000000000000000000000000000000000";
400
+ };
401
+ declare const SWAP_ROUTER: {
402
+ readonly mainnet: "0x319B69888b0d11cEC22caA5034e25FfFBDc88421";
403
+ readonly testnet: "0x0000000000000000000000000000000000000000";
404
+ };
405
+ declare const POSITION_MANAGER: {
406
+ readonly mainnet: "0x218bf598d1453383e2f4aa7b14ffb9bfb102d637";
407
+ readonly testnet: "0x0000000000000000000000000000000000000000";
408
+ };
409
+ declare const SWAP_ROUTER_ABI: readonly [{
410
+ readonly inputs: readonly [{
411
+ readonly components: readonly [{
412
+ readonly name: "tokenIn";
413
+ readonly type: "address";
414
+ }, {
415
+ readonly name: "tokenOut";
416
+ readonly type: "address";
417
+ }, {
418
+ readonly name: "fee";
419
+ readonly type: "uint24";
420
+ }, {
421
+ readonly name: "recipient";
422
+ readonly type: "address";
423
+ }, {
424
+ readonly name: "deadline";
425
+ readonly type: "uint256";
426
+ }, {
427
+ readonly name: "amountIn";
428
+ readonly type: "uint256";
429
+ }, {
430
+ readonly name: "amountOutMinimum";
431
+ readonly type: "uint256";
432
+ }, {
433
+ readonly name: "sqrtPriceLimitX96";
434
+ readonly type: "uint160";
435
+ }];
436
+ readonly name: "params";
437
+ readonly type: "tuple";
438
+ }];
439
+ readonly name: "exactInputSingle";
440
+ readonly outputs: readonly [{
441
+ readonly name: "amountOut";
442
+ readonly type: "uint256";
443
+ }];
444
+ readonly stateMutability: "payable";
445
+ readonly type: "function";
446
+ }];
447
+ declare const FEE_TIERS: {
448
+ readonly LOWEST: 100;
449
+ readonly LOW: 500;
450
+ readonly MEDIUM: 3000;
451
+ readonly HIGH: 10000;
452
+ };
453
+
454
+ declare const index$6_FACTORY: typeof FACTORY;
455
+ declare const index$6_FEE_TIERS: typeof FEE_TIERS;
456
+ declare const index$6_POSITION_MANAGER: typeof POSITION_MANAGER;
457
+ declare const index$6_SWAP_ROUTER: typeof SWAP_ROUTER;
458
+ declare const index$6_SWAP_ROUTER_ABI: typeof SWAP_ROUTER_ABI;
459
+ declare namespace index$6 {
460
+ export { index$6_FACTORY as FACTORY, index$6_FEE_TIERS as FEE_TIERS, index$6_POSITION_MANAGER as POSITION_MANAGER, index$6_SWAP_ROUTER as SWAP_ROUTER, index$6_SWAP_ROUTER_ABI as SWAP_ROUTER_ABI };
461
+ }
462
+
463
+ declare const LENDING_POOL: {
464
+ readonly mainnet: "0xCFa5aE7c2CE8Fadc6426C1ff872cA45378Fb7cF3";
465
+ readonly testnet: "0x0000000000000000000000000000000000000000";
466
+ };
467
+ declare const LENDING_POOL_ADDRESSES_PROVIDER: {
468
+ readonly mainnet: "0xAb94Bedd21ae3411eB2698945dfCab1D5C19C3d4";
469
+ readonly testnet: "0x0000000000000000000000000000000000000000";
470
+ };
471
+ declare const PROTOCOL_DATA_PROVIDER: {
472
+ readonly mainnet: "0x552b9e4bae485C4B7F540777d7D25614CdB84773";
473
+ readonly testnet: "0x0000000000000000000000000000000000000000";
474
+ };
475
+ declare const ORACLE: {
476
+ readonly mainnet: "0x870c9692Ab04944C86ec6FEeF63F261226506EfC";
477
+ readonly testnet: "0x0000000000000000000000000000000000000000";
478
+ };
479
+ declare const WMNT_ADDRESS: "0x78c1b0C915c4FAA5FffA6CAbf0219DA63d7f4cb8";
480
+ declare const INTEREST_RATE_MODE: {
481
+ readonly STABLE: 1;
482
+ readonly VARIABLE: 2;
483
+ };
484
+ declare const LENDING_POOL_ABI: readonly [{
485
+ readonly inputs: readonly [{
486
+ readonly name: "asset";
487
+ readonly type: "address";
488
+ }, {
489
+ readonly name: "amount";
490
+ readonly type: "uint256";
491
+ }, {
492
+ readonly name: "onBehalfOf";
493
+ readonly type: "address";
494
+ }, {
495
+ readonly name: "referralCode";
496
+ readonly type: "uint16";
497
+ }];
498
+ readonly name: "deposit";
499
+ readonly outputs: readonly [];
500
+ readonly stateMutability: "nonpayable";
501
+ readonly type: "function";
502
+ }, {
503
+ readonly inputs: readonly [{
504
+ readonly name: "asset";
505
+ readonly type: "address";
506
+ }, {
507
+ readonly name: "amount";
508
+ readonly type: "uint256";
509
+ }, {
510
+ readonly name: "to";
511
+ readonly type: "address";
512
+ }];
513
+ readonly name: "withdraw";
514
+ readonly outputs: readonly [{
515
+ readonly name: "";
516
+ readonly type: "uint256";
517
+ }];
518
+ readonly stateMutability: "nonpayable";
519
+ readonly type: "function";
520
+ }, {
521
+ readonly inputs: readonly [{
522
+ readonly name: "asset";
523
+ readonly type: "address";
524
+ }, {
525
+ readonly name: "amount";
526
+ readonly type: "uint256";
527
+ }, {
528
+ readonly name: "interestRateMode";
529
+ readonly type: "uint256";
530
+ }, {
531
+ readonly name: "referralCode";
532
+ readonly type: "uint16";
533
+ }, {
534
+ readonly name: "onBehalfOf";
535
+ readonly type: "address";
536
+ }];
537
+ readonly name: "borrow";
538
+ readonly outputs: readonly [];
539
+ readonly stateMutability: "nonpayable";
540
+ readonly type: "function";
541
+ }, {
542
+ readonly inputs: readonly [{
543
+ readonly name: "asset";
544
+ readonly type: "address";
545
+ }, {
546
+ readonly name: "amount";
547
+ readonly type: "uint256";
548
+ }, {
549
+ readonly name: "rateMode";
550
+ readonly type: "uint256";
551
+ }, {
552
+ readonly name: "onBehalfOf";
553
+ readonly type: "address";
554
+ }];
555
+ readonly name: "repay";
556
+ readonly outputs: readonly [{
557
+ readonly name: "";
558
+ readonly type: "uint256";
559
+ }];
560
+ readonly stateMutability: "nonpayable";
561
+ readonly type: "function";
562
+ }, {
563
+ readonly inputs: readonly [{
564
+ readonly name: "user";
565
+ readonly type: "address";
566
+ }];
567
+ readonly name: "getUserAccountData";
568
+ readonly outputs: readonly [{
569
+ readonly name: "totalCollateralETH";
570
+ readonly type: "uint256";
571
+ }, {
572
+ readonly name: "totalDebtETH";
573
+ readonly type: "uint256";
574
+ }, {
575
+ readonly name: "availableBorrowsETH";
576
+ readonly type: "uint256";
577
+ }, {
578
+ readonly name: "currentLiquidationThreshold";
579
+ readonly type: "uint256";
580
+ }, {
581
+ readonly name: "ltv";
582
+ readonly type: "uint256";
583
+ }, {
584
+ readonly name: "healthFactor";
585
+ readonly type: "uint256";
586
+ }];
587
+ readonly stateMutability: "view";
588
+ readonly type: "function";
589
+ }, {
590
+ readonly inputs: readonly [{
591
+ readonly name: "asset";
592
+ readonly type: "address";
593
+ }];
594
+ readonly name: "getReserveData";
595
+ readonly outputs: readonly [{
596
+ readonly components: readonly [{
597
+ readonly name: "configuration";
598
+ readonly type: "uint256";
599
+ }, {
600
+ readonly name: "liquidityIndex";
601
+ readonly type: "uint128";
602
+ }, {
603
+ readonly name: "variableBorrowIndex";
604
+ readonly type: "uint128";
605
+ }, {
606
+ readonly name: "currentLiquidityRate";
607
+ readonly type: "uint128";
608
+ }, {
609
+ readonly name: "currentVariableBorrowRate";
610
+ readonly type: "uint128";
611
+ }, {
612
+ readonly name: "currentStableBorrowRate";
613
+ readonly type: "uint128";
614
+ }, {
615
+ readonly name: "lastUpdateTimestamp";
616
+ readonly type: "uint40";
617
+ }, {
618
+ readonly name: "aTokenAddress";
619
+ readonly type: "address";
620
+ }, {
621
+ readonly name: "stableDebtTokenAddress";
622
+ readonly type: "address";
623
+ }, {
624
+ readonly name: "variableDebtTokenAddress";
625
+ readonly type: "address";
626
+ }, {
627
+ readonly name: "interestRateStrategyAddress";
628
+ readonly type: "address";
629
+ }, {
630
+ readonly name: "id";
631
+ readonly type: "uint8";
632
+ }];
633
+ readonly name: "";
634
+ readonly type: "tuple";
635
+ }];
636
+ readonly stateMutability: "view";
637
+ readonly type: "function";
638
+ }];
639
+
640
+ declare const index$5_INTEREST_RATE_MODE: typeof INTEREST_RATE_MODE;
641
+ declare const index$5_LENDING_POOL: typeof LENDING_POOL;
642
+ declare const index$5_LENDING_POOL_ABI: typeof LENDING_POOL_ABI;
643
+ declare const index$5_LENDING_POOL_ADDRESSES_PROVIDER: typeof LENDING_POOL_ADDRESSES_PROVIDER;
644
+ declare const index$5_ORACLE: typeof ORACLE;
645
+ declare const index$5_PROTOCOL_DATA_PROVIDER: typeof PROTOCOL_DATA_PROVIDER;
646
+ declare const index$5_WMNT_ADDRESS: typeof WMNT_ADDRESS;
647
+ declare namespace index$5 {
648
+ export { index$5_INTEREST_RATE_MODE as INTEREST_RATE_MODE, index$5_LENDING_POOL as LENDING_POOL, index$5_LENDING_POOL_ABI as LENDING_POOL_ABI, index$5_LENDING_POOL_ADDRESSES_PROVIDER as LENDING_POOL_ADDRESSES_PROVIDER, index$5_ORACLE as ORACLE, index$5_PROTOCOL_DATA_PROVIDER as PROTOCOL_DATA_PROVIDER, index$5_WMNT_ADDRESS as WMNT_ADDRESS };
649
+ }
650
+
651
+ declare const LB_ROUTER: {
652
+ readonly mainnet: "0x013e138EF6008ae5FDFDE29700e3f2Bc61d21E3a";
653
+ readonly testnet: "0x0000000000000000000000000000000000000000";
654
+ };
655
+ declare const LB_FACTORY: {
656
+ readonly mainnet: "0xa6630671775c4EA2743840F9A5016dCf2A104054";
657
+ readonly testnet: "0x0000000000000000000000000000000000000000";
658
+ };
659
+ declare const LB_QUOTER: {
660
+ readonly mainnet: "0x501b8AFd35df20f531fF45F6f695793AC3316c85";
661
+ readonly testnet: "0x0000000000000000000000000000000000000000";
662
+ };
663
+ declare const MOE_TOKEN: "0x4515a45337f461a11ff0fe8abf3c606ae5dc00c9";
664
+ declare const LB_ROUTER_ABI: readonly [{
665
+ readonly inputs: readonly [{
666
+ readonly name: "amountIn";
667
+ readonly type: "uint256";
668
+ }, {
669
+ readonly name: "amountOutMin";
670
+ readonly type: "uint256";
671
+ }, {
672
+ readonly name: "path";
673
+ readonly type: "uint256[]";
674
+ }, {
675
+ readonly name: "to";
676
+ readonly type: "address";
677
+ }, {
678
+ readonly name: "deadline";
679
+ readonly type: "uint256";
680
+ }];
681
+ readonly name: "swapExactTokensForTokens";
682
+ readonly outputs: readonly [{
683
+ readonly name: "amountOut";
684
+ readonly type: "uint256";
685
+ }];
686
+ readonly stateMutability: "nonpayable";
687
+ readonly type: "function";
688
+ }];
689
+
690
+ declare const index$4_LB_FACTORY: typeof LB_FACTORY;
691
+ declare const index$4_LB_QUOTER: typeof LB_QUOTER;
692
+ declare const index$4_LB_ROUTER: typeof LB_ROUTER;
693
+ declare const index$4_LB_ROUTER_ABI: typeof LB_ROUTER_ABI;
694
+ declare const index$4_MOE_TOKEN: typeof MOE_TOKEN;
695
+ declare namespace index$4 {
696
+ export { index$4_LB_FACTORY as LB_FACTORY, index$4_LB_QUOTER as LB_QUOTER, index$4_LB_ROUTER as LB_ROUTER, index$4_LB_ROUTER_ABI as LB_ROUTER_ABI, index$4_MOE_TOKEN as MOE_TOKEN };
697
+ }
698
+
699
+ declare const configs$1: {
700
+ apiKey: string | undefined;
701
+ secretKey: string | undefined;
702
+ apiPassphrase: string | undefined;
703
+ projectId: string | undefined;
704
+ };
705
+ declare const baseUrl: string;
706
+ declare const ETH_ADDRESS = "0xdeaddeaddeaddeaddeaddeaddeaddeaddead0000";
707
+
708
+ declare const index$3_ETH_ADDRESS: typeof ETH_ADDRESS;
709
+ declare const index$3_baseUrl: typeof baseUrl;
710
+ declare namespace index$3 {
711
+ export { index$3_ETH_ADDRESS as ETH_ADDRESS, index$3_baseUrl as baseUrl, configs$1 as configs };
712
+ }
713
+
714
+ declare const ONEINCH_BASE_URL = "https://api.1inch.dev/swap/v6.0";
715
+ declare const ONEINCH_CHAIN_ID: {
716
+ readonly mainnet: "5000";
717
+ readonly testnet: "5003";
718
+ };
719
+ declare const NATIVE_TOKEN_ADDRESS$2 = "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE";
720
+ declare const ONEINCH_ROUTER_ADDRESS = "0x111111125421cA6dc452d289314280a0f8842A65";
721
+ declare const configs: {
722
+ apiKey: string | undefined;
723
+ };
724
+
725
+ declare const index$2_ONEINCH_BASE_URL: typeof ONEINCH_BASE_URL;
726
+ declare const index$2_ONEINCH_CHAIN_ID: typeof ONEINCH_CHAIN_ID;
727
+ declare const index$2_ONEINCH_ROUTER_ADDRESS: typeof ONEINCH_ROUTER_ADDRESS;
728
+ declare const index$2_configs: typeof configs;
729
+ declare namespace index$2 {
730
+ export { NATIVE_TOKEN_ADDRESS$2 as NATIVE_TOKEN_ADDRESS, index$2_ONEINCH_BASE_URL as ONEINCH_BASE_URL, index$2_ONEINCH_CHAIN_ID as ONEINCH_CHAIN_ID, index$2_ONEINCH_ROUTER_ADDRESS as ONEINCH_ROUTER_ADDRESS, index$2_configs as configs };
731
+ }
732
+
733
+ declare const OPENOCEAN_BASE_URL = "https://open-api.openocean.finance/v4";
734
+ declare const OPENOCEAN_CHAIN: {
735
+ readonly mainnet: "mantle";
736
+ readonly testnet: "mantle";
737
+ };
738
+ declare const NATIVE_TOKEN_ADDRESS$1 = "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE";
739
+ declare const OPENOCEAN_EXCHANGE_PROXY = "0x6352a56caadC4F1E25CD6c75970Fa768A3304e64";
740
+
741
+ declare const index$1_OPENOCEAN_BASE_URL: typeof OPENOCEAN_BASE_URL;
742
+ declare const index$1_OPENOCEAN_CHAIN: typeof OPENOCEAN_CHAIN;
743
+ declare const index$1_OPENOCEAN_EXCHANGE_PROXY: typeof OPENOCEAN_EXCHANGE_PROXY;
744
+ declare namespace index$1 {
745
+ export { NATIVE_TOKEN_ADDRESS$1 as NATIVE_TOKEN_ADDRESS, index$1_OPENOCEAN_BASE_URL as OPENOCEAN_BASE_URL, index$1_OPENOCEAN_CHAIN as OPENOCEAN_CHAIN, index$1_OPENOCEAN_EXCHANGE_PROXY as OPENOCEAN_EXCHANGE_PROXY };
746
+ }
747
+
748
+ declare const SQUID_BASE_URL = "https://api.squidrouter.com/v2";
749
+ declare const SQUID_CHAIN_ID: {
750
+ readonly mainnet: 5000;
751
+ readonly testnet: 5003;
752
+ };
753
+ declare const DESTINATION_CHAINS: {
754
+ readonly ethereum: 101;
755
+ readonly arbitrum: 110;
756
+ readonly optimism: 111;
757
+ readonly polygon: 109;
758
+ readonly base: 184;
759
+ readonly bsc: 102;
760
+ readonly avalanche: 106;
761
+ readonly mantle: 5000;
762
+ };
763
+ declare const NATIVE_TOKEN_ADDRESS = "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE";
764
+
765
+ declare const index_DESTINATION_CHAINS: typeof DESTINATION_CHAINS;
766
+ declare const index_NATIVE_TOKEN_ADDRESS: typeof NATIVE_TOKEN_ADDRESS;
767
+ declare const index_SQUID_BASE_URL: typeof SQUID_BASE_URL;
768
+ declare const index_SQUID_CHAIN_ID: typeof SQUID_CHAIN_ID;
769
+ declare namespace index {
770
+ export { index_DESTINATION_CHAINS as DESTINATION_CHAINS, index_NATIVE_TOKEN_ADDRESS as NATIVE_TOKEN_ADDRESS, index_SQUID_BASE_URL as SQUID_BASE_URL, index_SQUID_CHAIN_ID as SQUID_CHAIN_ID };
771
+ }
772
+
773
+ interface UserAccountData {
774
+ totalCollateralETH: bigint;
775
+ totalDebtETH: bigint;
776
+ availableBorrowsETH: bigint;
777
+ currentLiquidationThreshold: bigint;
778
+ ltv: bigint;
779
+ healthFactor: bigint;
780
+ }
781
+
782
+ export { index$6 as AgniConstants, index$5 as LendleConstants, METH_TOKEN, MNTAgentKit, index$4 as MerchantMoeConstants, index$7 as MethConstants, index$3 as OKXConstants, index$2 as OneInchConstants, index$1 as OpenOceanConstants, type ProjectConfig, index as SquidConstants, index$8 as UniswapConstants, type UserAccountData, agniSwap, approveToken, crossChainSwapViaSquid, executeSwap, get1inchQuote, getOpenOceanQuote, getProjectConfig, getSquidRoute, getUniswapQuote, initializePlatform, lendleBorrow, lendleRepay, lendleSupply, lendleWithdraw, merchantMoeSwap, sendTransaction, swapOn1inch, swapOnOpenOcean, swapOnUniswap };