mantle-agent-kit-sdk 1.1.0 → 1.2.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.
package/.env.example CHANGED
@@ -13,6 +13,3 @@ PRIVATE_KEY=0xYOUR_PRIVATE_KEY_HERE
13
13
  # OKX_SECRET_KEY=your_okx_secret_key
14
14
  # OKX_API_PASSPHRASE=your_okx_passphrase
15
15
  # OKX_PROJECT_ID=your_okx_project_id
16
-
17
- # 1inch API Key (Optional - for higher rate limits)
18
- # ONEINCH_API_KEY=your_1inch_api_key
package/README.md CHANGED
@@ -35,7 +35,6 @@ const txHash = await agent.sendTransaction(
35
35
  | Protocol | Network | Description |
36
36
  |----------|---------|-------------|
37
37
  | **OKX DEX** | Mainnet | Multi-source liquidity aggregation |
38
- | **1inch** | Mainnet | Pathfinder algorithm for optimal routes |
39
38
  | **OpenOcean** | Mainnet | Cross-DEX aggregation |
40
39
  | **Agni Finance** | Mainnet | Concentrated liquidity DEX (Uniswap V3) |
41
40
  | **Merchant Moe** | Mainnet | Liquidity Book DEX (TraderJoe V2.1) |
@@ -44,6 +43,9 @@ const txHash = await agent.sendTransaction(
44
43
  | **mETH Protocol** | Mainnet | Liquid staking token |
45
44
  | **PikePerps** | Testnet | Perpetual futures trading (up to 100x) |
46
45
  | **Squid Router** | Mainnet | Cross-chain swaps via Axelar |
46
+ | **Pyth Network** | Both | Real-time price oracles (80+ assets) |
47
+ | **Token Launchpad** | Both | Deploy ERC20 tokens & RWAs |
48
+ | **NFT Launchpad** | Both | Deploy & mint ERC721 NFT collections |
47
49
 
48
50
  ## API Reference
49
51
 
@@ -80,23 +82,6 @@ const txHash = await agent.executeSwap(
80
82
  );
81
83
  ```
82
84
 
83
- #### 1inch
84
-
85
- ```typescript
86
- const quote = await agent.get1inchQuote(
87
- fromToken: Address,
88
- toToken: Address,
89
- amount: string
90
- );
91
-
92
- const txHash = await agent.swapOn1inch(
93
- fromToken: Address,
94
- toToken: Address,
95
- amount: string,
96
- slippage?: number // default: 0.5
97
- );
98
- ```
99
-
100
85
  #### OpenOcean
101
86
 
102
87
  ```typescript
@@ -356,6 +341,402 @@ const txHash = await agent.crossChainSwapViaSquid(
356
341
 
357
342
  ---
358
343
 
344
+ ### Pyth Network - Price Oracles
345
+
346
+ Real-time price feeds for 80+ assets including crypto, forex, commodities, and equities.
347
+
348
+ **All Pyth functions accept three input types:**
349
+ - **Pair name**: `"ETH/USD"`, `"BTC/USD"`, `"MNT/USD"`
350
+ - **Token address**: `"0x09Bc4E0D10C81b3a3766c49F0f98a8aaa7adA8D2"` (USDC on Mantle)
351
+ - **Price feed ID**: `"0xff61491a931112ddf1bd8147cd1b641375f79f5825126d665480874634fd0ace"`
352
+
353
+ #### Get Single Price
354
+
355
+ ```typescript
356
+ // Using pair name
357
+ const price = await agent.pythGetPrice("ETH/USD");
358
+
359
+ // Using token address (USDC on Mantle)
360
+ const usdcPrice = await agent.pythGetPrice("0x09Bc4E0D10C81b3a3766c49F0f98a8aaa7adA8D2");
361
+
362
+ // Using mETH token address
363
+ const methPrice = await agent.pythGetPrice("0xcDA86A272531e8640cD7F1a92c01839911B90bb0");
364
+
365
+ // Returns: PythPriceResponse
366
+ // {
367
+ // priceFeedId: string, // "0xff61491a..."
368
+ // pair: string, // "ETH/USD"
369
+ // price: string, // Raw price (e.g., "345000000000")
370
+ // confidence: string, // Confidence interval
371
+ // exponent: number, // Price exponent (e.g., -8)
372
+ // publishTime: number, // Unix timestamp
373
+ // formattedPrice: string // Human readable (e.g., "3450.00")
374
+ // }
375
+ ```
376
+
377
+ #### Get EMA Price
378
+
379
+ ```typescript
380
+ const emaPrice = await agent.pythGetEmaPrice("ETH/USD");
381
+ // Also accepts token addresses
382
+ const emaByAddress = await agent.pythGetEmaPrice("0x09Bc4E0D10C81b3a3766c49F0f98a8aaa7adA8D2");
383
+ // Returns: PythPriceResponse (same structure as above)
384
+ ```
385
+
386
+ #### Get Token Price by Address
387
+
388
+ Pass any token contract address and get full price details:
389
+
390
+ ```typescript
391
+ const price = await agent.pythGetTokenPrice("0x09Bc4E0D10C81b3a3766c49F0f98a8aaa7adA8D2");
392
+
393
+ // Returns: PythTokenPriceResponse
394
+ // {
395
+ // tokenAddress: "0x09Bc4E0D10C81b3a3766c49F0f98a8aaa7adA8D2",
396
+ // tokenSymbol: "USDC",
397
+ // pair: "USDC/USD",
398
+ // priceFeedId: "0xeaa020c61cc479712813461ce153894a96a6c00b21ed0cfc2798d1f9a9e9c94a",
399
+ // priceUsd: "1.00",
400
+ // confidence: "50000",
401
+ // exponent: -8,
402
+ // publishTime: 1704700800,
403
+ // lastUpdated: "2024-01-08T12:00:00.000Z"
404
+ // }
405
+
406
+ // More examples
407
+ const methPrice = await agent.pythGetTokenPrice("0xcDA86A272531e8640cD7F1a92c01839911B90bb0"); // mETH
408
+ const wethPrice = await agent.pythGetTokenPrice("0xdEAddEaDdeadDEadDEADDEAddEADDEAddead1111"); // WETH
409
+ const wmntPrice = await agent.pythGetTokenPrice("0x78c1b0C915c4FAA5FffA6CAbf0219DA63d7f4cb8"); // WMNT
410
+ ```
411
+
412
+ #### Get Multiple Prices
413
+
414
+ ```typescript
415
+ // Mix pair names and token addresses
416
+ const prices = await agent.pythGetMultiplePrices([
417
+ "BTC/USD", // pair name
418
+ "ETH/USD", // pair name
419
+ "0x09Bc4E0D10C81b3a3766c49F0f98a8aaa7adA8D2", // USDC address
420
+ "0xcDA86A272531e8640cD7F1a92c01839911B90bb0", // mETH address
421
+ ]);
422
+ // Returns: PythPriceResponse[]
423
+ ```
424
+
425
+ #### Get Supported Price Feeds
426
+
427
+ ```typescript
428
+ const feeds = agent.pythGetSupportedPriceFeeds();
429
+ // Returns: Record<string, string>
430
+ // {
431
+ // "BTC/USD": "e62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43",
432
+ // "ETH/USD": "ff61491a931112ddf1bd8147cd1b641375f79f5825126d665480874634fd0ace",
433
+ // ... 80+ more
434
+ // }
435
+ ```
436
+
437
+ #### Get Supported Token Addresses
438
+
439
+ ```typescript
440
+ const addresses = agent.pythGetSupportedTokenAddresses();
441
+ // Returns: Record<string, string>
442
+ // {
443
+ // "0x09Bc4E0D10C81b3a3766c49F0f98a8aaa7adA8D2": "USDC/USD",
444
+ // "0xcDA86A272531e8640cD7F1a92c01839911B90bb0": "mETH/USD",
445
+ // "0x78c1b0C915c4FAA5FffA6CAbf0219DA63d7f4cb8": "MNT/USD",
446
+ // ... more Mantle tokens
447
+ // }
448
+ ```
449
+
450
+ #### Check Price Feed Exists
451
+
452
+ ```typescript
453
+ // Works with pair names or token addresses
454
+ const exists = await agent.pythPriceFeedExists("ETH/USD");
455
+ const existsByAddress = await agent.pythPriceFeedExists("0x09Bc4E0D10C81b3a3766c49F0f98a8aaa7adA8D2");
456
+ // Returns: boolean
457
+ ```
458
+
459
+ #### Supported Token Addresses (Mantle Network)
460
+
461
+ | Token | Address | Price Feed |
462
+ |-------|---------|------------|
463
+ | WMNT | `0x78c1b0C915c4FAA5FffA6CAbf0219DA63d7f4cb8` | MNT/USD |
464
+ | WETH | `0xdEAddEaDdeadDEadDEADDEAddEADDEAddead1111` | ETH/USD |
465
+ | USDC | `0x09Bc4E0D10C81b3a3766c49F0f98a8aaa7adA8D2` | USDC/USD |
466
+ | USDT | `0x201EBa5CC46D216Ce6DC03F6a759e8E766e956aE` | USDT/USD |
467
+ | mETH | `0xcDA86A272531e8640cD7F1a92c01839911B90bb0` | mETH/USD |
468
+ | WBTC | `0xCAbAE6f6Ea1ecaB08Ad02fE02ce9A44F09aebfA2` | WBTC/USD |
469
+ | FBTC | `0xc96de26018a54d51c097160568752c4e3bd6c364` | BTC/USD |
470
+ | PENDLE | `0xf83bcc06D6A4A5682adeCA11CF9500f67bFe61AE` | PENDLE/USD |
471
+
472
+ #### Supported Asset Categories
473
+
474
+ | Category | Examples |
475
+ |----------|----------|
476
+ | **Crypto (50+)** | BTC, ETH, SOL, BNB, XRP, ADA, DOGE, AVAX, LINK, UNI, AAVE... |
477
+ | **Layer 2** | ARB, OP, MNT, STRK, IMX |
478
+ | **DeFi** | AAVE, CRV, MKR, SNX, LDO, GMX, PENDLE |
479
+ | **Stablecoins** | USDC, USDT, DAI, FRAX, BUSD |
480
+ | **LST Tokens** | stETH, wstETH, cbETH, rETH, mETH |
481
+ | **Meme Coins** | SHIB, PEPE, BONK, WIF, FLOKI |
482
+ | **Forex** | EUR/USD, GBP/USD, JPY/USD |
483
+ | **Commodities** | XAU (Gold), XAG (Silver), WTI, BRENT |
484
+ | **Equities** | AAPL, NVDA, TSLA, MSFT, GOOGL, AMZN |
485
+
486
+ ---
487
+
488
+ ### Token Launchpad
489
+
490
+ Deploy ERC20 tokens and RWA (Real World Asset) tokens with supply minted to your address.
491
+
492
+ #### Deploy Standard Token
493
+
494
+ ```typescript
495
+ const result = await agent.deployStandardToken(
496
+ name: string, // e.g., "My Token"
497
+ symbol: string, // e.g., "MTK"
498
+ supply: string // Human readable, e.g., "1000000" (1M tokens)
499
+ );
500
+
501
+ // Returns: TokenDeploymentResult
502
+ // {
503
+ // tokenAddress: string, // Deployed contract address
504
+ // txHash: string, // Transaction hash
505
+ // name: string,
506
+ // symbol: string,
507
+ // decimals: number, // Always 18
508
+ // totalSupply: string, // Supply in wei
509
+ // mintedTo: string, // Your wallet address
510
+ // tokenType: "standard"
511
+ // }
512
+ ```
513
+
514
+ #### Deploy RWA Token
515
+
516
+ ```typescript
517
+ const result = await agent.deployRWAToken(
518
+ name: string, // e.g., "Manhattan Property Token"
519
+ symbol: string, // e.g., "MPT"
520
+ supply: string, // Fractional shares, e.g., "10000"
521
+ assetType: string, // "Real Estate" | "Commodities" | "Securities" | "Art"
522
+ assetId?: string // External reference, e.g., "PROP-NYC-001"
523
+ );
524
+
525
+ // Returns: TokenDeploymentResult
526
+ // {
527
+ // tokenAddress: string,
528
+ // txHash: string,
529
+ // name: string,
530
+ // symbol: string,
531
+ // decimals: number,
532
+ // totalSupply: string,
533
+ // mintedTo: string,
534
+ // tokenType: "rwa",
535
+ // assetType: string, // "Real Estate"
536
+ // assetId: string // "PROP-NYC-001"
537
+ // }
538
+ ```
539
+
540
+ #### Generic Token Deployment
541
+
542
+ ```typescript
543
+ const result = await agent.deployToken(
544
+ name: string,
545
+ symbol: string,
546
+ supply: string,
547
+ tokenType?: "standard" | "rwa", // default: "standard"
548
+ assetType?: string, // For RWA only
549
+ assetId?: string // For RWA only
550
+ );
551
+ ```
552
+
553
+ #### Get Token Info
554
+
555
+ ```typescript
556
+ const info = await agent.getTokenInfo(
557
+ tokenAddress: Address,
558
+ holder?: Address // Optional: get balance for this address
559
+ );
560
+
561
+ // Returns: TokenInfo
562
+ // {
563
+ // address: string,
564
+ // name: string,
565
+ // symbol: string,
566
+ // decimals: number,
567
+ // totalSupply: string,
568
+ // balance?: string // If holder provided
569
+ // }
570
+ ```
571
+
572
+ #### Get Token Balance
573
+
574
+ ```typescript
575
+ const balance = await agent.getTokenBalance(
576
+ tokenAddress: Address,
577
+ holder?: Address // Defaults to agent address
578
+ );
579
+ // Returns: string (balance in wei)
580
+ ```
581
+
582
+ #### Transfer Tokens
583
+
584
+ ```typescript
585
+ const txHash = await agent.transferToken(
586
+ tokenAddress: Address,
587
+ to: Address,
588
+ amount: string // Amount in wei
589
+ );
590
+ // Returns: Hex (transaction hash)
591
+ ```
592
+
593
+ ---
594
+
595
+ ### NFT Launchpad
596
+
597
+ Deploy ERC721 NFT collections and mint NFTs.
598
+
599
+ #### Deploy NFT Collection
600
+
601
+ ```typescript
602
+ const result = await agent.deployNFTCollection({
603
+ name: string, // e.g., "My NFT Collection"
604
+ symbol: string, // e.g., "MNFT"
605
+ baseURI: string, // e.g., "ipfs://QmXXX/"
606
+ maxSupply?: number // 0 for unlimited
607
+ });
608
+
609
+ // Returns: NFTCollectionDeploymentResult
610
+ // {
611
+ // collectionAddress: string,
612
+ // txHash: string,
613
+ // name: string,
614
+ // symbol: string,
615
+ // baseURI: string,
616
+ // maxSupply: number,
617
+ // deployer: string
618
+ // }
619
+ ```
620
+
621
+ #### Deploy with Preset
622
+
623
+ ```typescript
624
+ const result = await agent.deployNFTCollectionWithPreset(
625
+ preset: "pfp" | "art" | "membership" | "unlimited",
626
+ name: string,
627
+ symbol: string,
628
+ baseURI: string
629
+ );
630
+ // Presets: pfp=10000, art=1000, membership=100, unlimited=0
631
+ ```
632
+
633
+ #### Mint NFT
634
+
635
+ ```typescript
636
+ const result = await agent.mintNFT(
637
+ collectionAddress: Address,
638
+ to?: Address // Defaults to agent address
639
+ );
640
+
641
+ // Returns: NFTMintResult
642
+ // {
643
+ // txHash: string,
644
+ // tokenId: string,
645
+ // collectionAddress: string,
646
+ // to: string
647
+ // }
648
+ ```
649
+
650
+ #### Batch Mint
651
+
652
+ ```typescript
653
+ const result = await agent.batchMintNFT(
654
+ collectionAddress: Address,
655
+ to: Address,
656
+ quantity: number
657
+ );
658
+
659
+ // Returns:
660
+ // {
661
+ // txHash: Hex,
662
+ // startTokenId: string,
663
+ // quantity: number
664
+ // }
665
+ ```
666
+
667
+ #### Get Collection Info
668
+
669
+ ```typescript
670
+ const info = await agent.getNFTCollectionInfo(
671
+ collectionAddress: Address,
672
+ holder?: Address
673
+ );
674
+
675
+ // Returns: NFTCollectionInfo
676
+ // {
677
+ // address: string,
678
+ // name: string,
679
+ // symbol: string,
680
+ // totalSupply: string,
681
+ // balanceOf?: string // If holder provided
682
+ // }
683
+ ```
684
+
685
+ #### Get Token Info
686
+
687
+ ```typescript
688
+ const info = await agent.getNFTTokenInfo(
689
+ collectionAddress: Address,
690
+ tokenId: string
691
+ );
692
+
693
+ // Returns: NFTTokenInfo
694
+ // {
695
+ // collectionAddress: string,
696
+ // tokenId: string,
697
+ // owner: string,
698
+ // tokenURI: string
699
+ // }
700
+ ```
701
+
702
+ #### Transfer NFT
703
+
704
+ ```typescript
705
+ // Standard transfer
706
+ const txHash = await agent.transferNFT(
707
+ collectionAddress: Address,
708
+ to: Address,
709
+ tokenId: string
710
+ );
711
+
712
+ // Safe transfer (checks recipient)
713
+ const txHash = await agent.safeTransferNFT(
714
+ collectionAddress: Address,
715
+ to: Address,
716
+ tokenId: string
717
+ );
718
+ ```
719
+
720
+ #### Approve NFT
721
+
722
+ ```typescript
723
+ // Approve single NFT
724
+ const txHash = await agent.approveNFT(
725
+ collectionAddress: Address,
726
+ approved: Address,
727
+ tokenId: string
728
+ );
729
+
730
+ // Approve all NFTs in collection
731
+ const txHash = await agent.setApprovalForAllNFT(
732
+ collectionAddress: Address,
733
+ operator: Address,
734
+ approved: boolean
735
+ );
736
+ ```
737
+
738
+ ---
739
+
359
740
  ## Configuration
360
741
 
361
742
  ### Environment Variables
@@ -378,12 +759,6 @@ OKX_API_PASSPHRASE=your_passphrase
378
759
  OKX_PROJECT_ID=your_project_id
379
760
  ```
380
761
 
381
- #### 1inch (Optional - Higher rate limits)
382
-
383
- ```env
384
- ONEINCH_API_KEY=your_api_key
385
- ```
386
-
387
762
  ### Network Configuration
388
763
 
389
764
  | Network | Chain ID | Usage |
@@ -415,6 +790,7 @@ const result = await demoAgent.swapOnUniswap(tokenA, tokenB, amount);
415
790
 
416
791
  | Protocol | Contract | Address |
417
792
  |----------|----------|---------|
793
+ | **Pyth Network** | Oracle | `0xA2aa501b19aff244D90cc15a4Cf739D2725B5729` |
418
794
  | **mETH** | Token | `0xcDA86A272531e8640cD7F1a92c01839911B90bb0` |
419
795
  | **WETH** | Token | `0xdEAddEaDdeadDEadDEADDEAddEADDEAddead1111` |
420
796
  | **WMNT** | Token | `0x78c1b0C915c4FAA5FffA6CAbf0219DA63d7f4cb8` |
@@ -429,6 +805,7 @@ const result = await demoAgent.swapOnUniswap(tokenA, tokenB, amount);
429
805
 
430
806
  | Protocol | Contract | Address |
431
807
  |----------|----------|---------|
808
+ | **Pyth Network** | Oracle | `0x98046Bd286715D3B0BC227Dd7a956b83D8978603` |
432
809
  | **PikePerps** | PerpetualTrading | `0x8081b646f349c049f2d5e8a400057d411dd657bd` |
433
810
  | **PikePerps** | BondingCurveMarket | `0x93b268325A9862645c82b32229f3B52264750Ca2` |
434
811