@mangrove-ai/sdk 0.2.0 → 0.3.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/dist/index.cjs +434 -2
- package/dist/index.d.cts +467 -1
- package/dist/index.d.ts +467 -1
- package/dist/index.js +430 -1
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -145,6 +145,65 @@ function normalizeTransactionStatus(raw) {
|
|
|
145
145
|
...raw.gas_used != null || raw.gasUsed != null ? { gasUsed: String(raw.gas_used ?? raw.gasUsed) } : {}
|
|
146
146
|
};
|
|
147
147
|
}
|
|
148
|
+
function normalizeTokenBalance(raw) {
|
|
149
|
+
return {
|
|
150
|
+
address: raw.address ?? "",
|
|
151
|
+
balance: String(raw.balance ?? "0"),
|
|
152
|
+
decimals: raw.decimals ?? 0,
|
|
153
|
+
symbol: raw.symbol ?? "",
|
|
154
|
+
name: raw.name ?? ""
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
function normalizeGasPrice(raw) {
|
|
158
|
+
return {
|
|
159
|
+
baseFee: String(raw.baseFee ?? raw.base_fee ?? "0"),
|
|
160
|
+
maxPriorityFeePerGas: String(raw.maxPriorityFeePerGas ?? raw.max_priority_fee_per_gas ?? "0"),
|
|
161
|
+
maxFeePerGas: String(raw.maxFeePerGas ?? raw.max_fee_per_gas ?? "0")
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
function normalizeTokenInfo(raw) {
|
|
165
|
+
return {
|
|
166
|
+
address: raw.address ?? "",
|
|
167
|
+
symbol: raw.symbol ?? "",
|
|
168
|
+
name: raw.name ?? "",
|
|
169
|
+
decimals: raw.decimals ?? 0,
|
|
170
|
+
logoURI: raw.logoURI ?? raw.logo_uri ?? raw.logoUrl ?? raw.logo_url ?? ""
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
function normalizeCreateListingResult(raw) {
|
|
174
|
+
return {
|
|
175
|
+
listingId: raw.listing_id ?? raw.listingId,
|
|
176
|
+
status: raw.status ?? "active",
|
|
177
|
+
createdAt: raw.created_at ?? raw.createdAt ?? ""
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
function normalizeListing(raw) {
|
|
181
|
+
return {
|
|
182
|
+
listingId: raw.listing_id ?? raw.listingId,
|
|
183
|
+
sellerAddress: raw.seller_address ?? raw.sellerAddress,
|
|
184
|
+
title: raw.title ?? "",
|
|
185
|
+
description: raw.description ?? "",
|
|
186
|
+
category: raw.category ?? "other",
|
|
187
|
+
subcategory: raw.subcategory ?? null,
|
|
188
|
+
priceXrp: raw.price_xrp ?? raw.priceXrp ?? 0,
|
|
189
|
+
listingType: raw.listing_type ?? raw.listingType ?? "static",
|
|
190
|
+
status: raw.status ?? "active",
|
|
191
|
+
tags: raw.tags ?? [],
|
|
192
|
+
storageUri: raw.storage_uri ?? raw.storageUri ?? null,
|
|
193
|
+
contentHash: raw.content_hash ?? raw.contentHash ?? null,
|
|
194
|
+
createdAt: raw.created_at ?? raw.createdAt ?? "",
|
|
195
|
+
updatedAt: raw.updated_at ?? raw.updatedAt ?? "",
|
|
196
|
+
expiresAt: raw.expires_at ?? raw.expiresAt ?? null
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
function normalizeSearchResult(raw) {
|
|
200
|
+
const rawListings = raw.listings ?? [];
|
|
201
|
+
return {
|
|
202
|
+
listings: rawListings.map(normalizeListing),
|
|
203
|
+
totalCount: raw.total_count ?? raw.totalCount ?? 0,
|
|
204
|
+
nextCursor: raw.next_cursor ?? raw.nextCursor ?? null
|
|
205
|
+
};
|
|
206
|
+
}
|
|
148
207
|
|
|
149
208
|
// src/dex/service.ts
|
|
150
209
|
var DexService = class {
|
|
@@ -348,6 +407,350 @@ var SwapOrchestrator = class {
|
|
|
348
407
|
}
|
|
349
408
|
};
|
|
350
409
|
|
|
410
|
+
// src/oneinch/service.ts
|
|
411
|
+
var OneInchService = class {
|
|
412
|
+
constructor(transport) {
|
|
413
|
+
this.transport = transport;
|
|
414
|
+
}
|
|
415
|
+
/**
|
|
416
|
+
* Get ERC-20 token balances for a wallet.
|
|
417
|
+
* @param params - Chain ID and wallet address.
|
|
418
|
+
* @returns Array of token balances with symbol, decimals, and name.
|
|
419
|
+
*/
|
|
420
|
+
async getBalances(params) {
|
|
421
|
+
const result = await this.transport.callTool("oneinch_balances", {
|
|
422
|
+
chain_id: params.chainId,
|
|
423
|
+
wallet: params.wallet
|
|
424
|
+
});
|
|
425
|
+
const raw = result;
|
|
426
|
+
const balances = raw.balances;
|
|
427
|
+
if (Array.isArray(balances)) {
|
|
428
|
+
return balances.map((b) => normalizeTokenBalance(b));
|
|
429
|
+
}
|
|
430
|
+
if (balances && typeof balances === "object") {
|
|
431
|
+
return Object.entries(balances).map(
|
|
432
|
+
([address, balance]) => normalizeTokenBalance({ address, balance: String(balance) })
|
|
433
|
+
);
|
|
434
|
+
}
|
|
435
|
+
return [];
|
|
436
|
+
}
|
|
437
|
+
/**
|
|
438
|
+
* Get ERC-20 token allowances for a wallet and spender.
|
|
439
|
+
* @param params - Chain ID, wallet address, and spender identifier.
|
|
440
|
+
* @returns Token address to allowance mapping.
|
|
441
|
+
*/
|
|
442
|
+
async getAllowances(params) {
|
|
443
|
+
return this.transport.callTool("oneinch_allowances", {
|
|
444
|
+
chain_id: params.chainId,
|
|
445
|
+
wallet: params.wallet,
|
|
446
|
+
spender: params.spender
|
|
447
|
+
});
|
|
448
|
+
}
|
|
449
|
+
/**
|
|
450
|
+
* Get current spot prices for one or more tokens.
|
|
451
|
+
* @param params - Chain ID and comma-separated token addresses.
|
|
452
|
+
* @returns Token address to USD price mapping.
|
|
453
|
+
*/
|
|
454
|
+
async getSpotPrice(params) {
|
|
455
|
+
return this.transport.callTool("oneinch_spot_price", {
|
|
456
|
+
chain_id: params.chainId,
|
|
457
|
+
tokens: params.tokens
|
|
458
|
+
});
|
|
459
|
+
}
|
|
460
|
+
/**
|
|
461
|
+
* Get current gas price estimates for a chain.
|
|
462
|
+
* @param params - Chain ID.
|
|
463
|
+
* @returns Typed gas price data (baseFee, maxPriorityFeePerGas, maxFeePerGas).
|
|
464
|
+
*/
|
|
465
|
+
async getGasPrice(params) {
|
|
466
|
+
const result = await this.transport.callTool("oneinch_gas_price", {
|
|
467
|
+
chain_id: params.chainId
|
|
468
|
+
});
|
|
469
|
+
return normalizeGasPrice(result);
|
|
470
|
+
}
|
|
471
|
+
/**
|
|
472
|
+
* Search for tokens by name or symbol on a given chain.
|
|
473
|
+
* @param params - Chain ID and search query string.
|
|
474
|
+
* @returns Matching token metadata.
|
|
475
|
+
*/
|
|
476
|
+
async searchTokens(params) {
|
|
477
|
+
return this.transport.callTool("oneinch_token_search", {
|
|
478
|
+
chain_id: params.chainId,
|
|
479
|
+
query: params.query
|
|
480
|
+
});
|
|
481
|
+
}
|
|
482
|
+
/**
|
|
483
|
+
* Get detailed metadata for a specific token.
|
|
484
|
+
* @param params - Chain ID and token contract address.
|
|
485
|
+
* @returns Typed token info (address, symbol, name, decimals, logoURI).
|
|
486
|
+
*/
|
|
487
|
+
async getTokenInfo(params) {
|
|
488
|
+
const result = await this.transport.callTool("oneinch_token_info", {
|
|
489
|
+
chain_id: params.chainId,
|
|
490
|
+
address: params.address
|
|
491
|
+
});
|
|
492
|
+
return normalizeTokenInfo(result);
|
|
493
|
+
}
|
|
494
|
+
/**
|
|
495
|
+
* Get total portfolio value in USD for one or more wallet addresses.
|
|
496
|
+
* @param params - Comma-separated wallet addresses and optional chain ID filter.
|
|
497
|
+
* @returns Aggregated portfolio value.
|
|
498
|
+
*/
|
|
499
|
+
async getPortfolioValue(params) {
|
|
500
|
+
return this.transport.callTool("oneinch_portfolio_value", {
|
|
501
|
+
addresses: params.addresses,
|
|
502
|
+
...params.chainId ? { chain_id: params.chainId } : {}
|
|
503
|
+
});
|
|
504
|
+
}
|
|
505
|
+
/**
|
|
506
|
+
* Get profit and loss data for a portfolio.
|
|
507
|
+
* @param params - Comma-separated wallet addresses and optional chain ID filter.
|
|
508
|
+
* @returns PnL breakdown by token and chain.
|
|
509
|
+
*/
|
|
510
|
+
async getPortfolioPnl(params) {
|
|
511
|
+
return this.transport.callTool("oneinch_portfolio_pnl", {
|
|
512
|
+
addresses: params.addresses,
|
|
513
|
+
...params.chainId ? { chain_id: params.chainId } : {}
|
|
514
|
+
});
|
|
515
|
+
}
|
|
516
|
+
/**
|
|
517
|
+
* Get token holdings breakdown for a portfolio.
|
|
518
|
+
* @param params - Comma-separated wallet addresses and optional chain ID filter.
|
|
519
|
+
* @returns Per-token balances and values.
|
|
520
|
+
*/
|
|
521
|
+
async getPortfolioTokens(params) {
|
|
522
|
+
return this.transport.callTool("oneinch_portfolio_tokens", {
|
|
523
|
+
addresses: params.addresses,
|
|
524
|
+
...params.chainId ? { chain_id: params.chainId } : {}
|
|
525
|
+
});
|
|
526
|
+
}
|
|
527
|
+
/**
|
|
528
|
+
* Get DeFi protocol positions for a portfolio.
|
|
529
|
+
* @param params - Comma-separated wallet addresses and optional chain ID filter.
|
|
530
|
+
* @returns DeFi positions by protocol.
|
|
531
|
+
*/
|
|
532
|
+
async getPortfolioDefi(params) {
|
|
533
|
+
return this.transport.callTool("oneinch_portfolio_defi", {
|
|
534
|
+
addresses: params.addresses,
|
|
535
|
+
...params.chainId ? { chain_id: params.chainId } : {}
|
|
536
|
+
});
|
|
537
|
+
}
|
|
538
|
+
/**
|
|
539
|
+
* Get portfolio value chart data over time.
|
|
540
|
+
* @param params - Chain ID, wallet address, and optional time range (default '1month').
|
|
541
|
+
* @returns Time-series chart data points.
|
|
542
|
+
*/
|
|
543
|
+
async getChart(params) {
|
|
544
|
+
return this.transport.callTool("oneinch_chart", {
|
|
545
|
+
chain_id: params.chainId,
|
|
546
|
+
address: params.address,
|
|
547
|
+
timerange: params.timerange || "1month"
|
|
548
|
+
});
|
|
549
|
+
}
|
|
550
|
+
/**
|
|
551
|
+
* Get transaction history for a wallet address.
|
|
552
|
+
* @param params - Wallet address and optional result limit (default 50).
|
|
553
|
+
* @returns Recent transaction records.
|
|
554
|
+
*/
|
|
555
|
+
async getHistory(params) {
|
|
556
|
+
return this.transport.callTool("oneinch_history", {
|
|
557
|
+
address: params.address,
|
|
558
|
+
limit: params.limit || 50
|
|
559
|
+
});
|
|
560
|
+
}
|
|
561
|
+
};
|
|
562
|
+
|
|
563
|
+
// src/wallet/service.ts
|
|
564
|
+
var WalletService = class {
|
|
565
|
+
constructor(transport) {
|
|
566
|
+
this.transport = transport;
|
|
567
|
+
}
|
|
568
|
+
/**
|
|
569
|
+
* Get chain configuration: supported networks, RPC URLs, native token info.
|
|
570
|
+
* Call this before creating a wallet to understand chain requirements.
|
|
571
|
+
* @param params - Optional chain family filter (defaults to 'xrpl').
|
|
572
|
+
*/
|
|
573
|
+
async chainInfo(params = {}) {
|
|
574
|
+
const result = await this.transport.callTool("wallet_chain_info", {
|
|
575
|
+
chain: params.chain ?? "xrpl"
|
|
576
|
+
});
|
|
577
|
+
return normalizeChainInfo(result);
|
|
578
|
+
}
|
|
579
|
+
/**
|
|
580
|
+
* Create a new wallet. XRPL wallets are funded via testnet/devnet faucet.
|
|
581
|
+
* EVM wallets generate a random keypair. Solana is Phase 3.
|
|
582
|
+
* @param params - Chain, network, and optional chain ID.
|
|
583
|
+
*/
|
|
584
|
+
async create(params = {}) {
|
|
585
|
+
const toolParams = {
|
|
586
|
+
chain: params.chain ?? "xrpl",
|
|
587
|
+
network: params.network ?? "testnet"
|
|
588
|
+
};
|
|
589
|
+
if (params.chainId !== void 0) {
|
|
590
|
+
toolParams.chain_id = params.chainId;
|
|
591
|
+
}
|
|
592
|
+
const result = await this.transport.callTool("wallet_create", toolParams);
|
|
593
|
+
return normalizeCreateResult(result);
|
|
594
|
+
}
|
|
595
|
+
/**
|
|
596
|
+
* Check wallet balance. Currently returns NOT_IMPLEMENTED from the server.
|
|
597
|
+
* @param params - Address, chain, and optional chain ID.
|
|
598
|
+
*/
|
|
599
|
+
async balance(params) {
|
|
600
|
+
const toolParams = {
|
|
601
|
+
address: params.address,
|
|
602
|
+
chain: params.chain ?? "xrpl"
|
|
603
|
+
};
|
|
604
|
+
if (params.chainId !== void 0) {
|
|
605
|
+
toolParams.chain_id = params.chainId;
|
|
606
|
+
}
|
|
607
|
+
return this.transport.callTool("wallet_balance", toolParams);
|
|
608
|
+
}
|
|
609
|
+
/**
|
|
610
|
+
* List recent transactions for an address. Currently returns NOT_IMPLEMENTED from the server.
|
|
611
|
+
* @param params - Address, chain, optional chain ID and limit.
|
|
612
|
+
*/
|
|
613
|
+
async transactions(params) {
|
|
614
|
+
const toolParams = {
|
|
615
|
+
address: params.address,
|
|
616
|
+
chain: params.chain ?? "xrpl",
|
|
617
|
+
limit: params.limit ?? 20
|
|
618
|
+
};
|
|
619
|
+
if (params.chainId !== void 0) {
|
|
620
|
+
toolParams.chain_id = params.chainId;
|
|
621
|
+
}
|
|
622
|
+
return this.transport.callTool("wallet_transactions", toolParams);
|
|
623
|
+
}
|
|
624
|
+
};
|
|
625
|
+
function normalizeChainInfo(raw) {
|
|
626
|
+
return {
|
|
627
|
+
chain: raw.chain,
|
|
628
|
+
chainFamily: raw.chain_family ?? raw.chainFamily,
|
|
629
|
+
nativeToken: raw.native_token ?? raw.nativeToken,
|
|
630
|
+
walletCreation: raw.wallet_creation ?? raw.walletCreation,
|
|
631
|
+
networks: raw.networks,
|
|
632
|
+
supportedChainIds: raw.supported_chain_ids ?? raw.supportedChainIds,
|
|
633
|
+
sdkMethod: raw.sdk_method ?? raw.sdkMethod
|
|
634
|
+
};
|
|
635
|
+
}
|
|
636
|
+
function normalizeCreateResult(raw) {
|
|
637
|
+
return {
|
|
638
|
+
address: raw.address,
|
|
639
|
+
chain: raw.chain,
|
|
640
|
+
network: raw.network,
|
|
641
|
+
isFunded: raw.is_funded ?? raw.isFunded ?? false,
|
|
642
|
+
warnings: raw.warnings ?? [],
|
|
643
|
+
secret: raw.secret,
|
|
644
|
+
seedPhrase: raw.seed_phrase ?? raw.seedPhrase,
|
|
645
|
+
privateKey: raw.private_key ?? raw.privateKey,
|
|
646
|
+
chainId: raw.chain_id ?? raw.chainId
|
|
647
|
+
};
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
// src/marketplace/service.ts
|
|
651
|
+
var MarketplaceService = class {
|
|
652
|
+
constructor(transport) {
|
|
653
|
+
this.transport = transport;
|
|
654
|
+
}
|
|
655
|
+
/**
|
|
656
|
+
* Create a new listing on the Mangrove Marketplace.
|
|
657
|
+
* @param params - Listing details (seller address, title, category, price, etc.).
|
|
658
|
+
* @returns Compact result with listing ID, status, and creation timestamp.
|
|
659
|
+
*/
|
|
660
|
+
async createListing(params) {
|
|
661
|
+
const result = await this.transport.callTool("marketplace_create_listing", {
|
|
662
|
+
seller_address: params.sellerAddress,
|
|
663
|
+
title: params.title,
|
|
664
|
+
description: params.description,
|
|
665
|
+
category: params.category,
|
|
666
|
+
price_xrp: params.priceXrp,
|
|
667
|
+
...params.listingType ? { listing_type: params.listingType } : {},
|
|
668
|
+
...params.storageUri ? { storage_uri: params.storageUri } : {},
|
|
669
|
+
...params.contentHash ? { content_hash: params.contentHash } : {},
|
|
670
|
+
...params.subcategory ? { subcategory: params.subcategory } : {},
|
|
671
|
+
...params.tags ? { tags: params.tags } : {}
|
|
672
|
+
});
|
|
673
|
+
return normalizeCreateListingResult(result);
|
|
674
|
+
}
|
|
675
|
+
/**
|
|
676
|
+
* Search the Mangrove Marketplace for listings.
|
|
677
|
+
* @param params - Optional filters (query, category, price range, type, limit).
|
|
678
|
+
* @returns Paginated search results with listings and total count.
|
|
679
|
+
*/
|
|
680
|
+
async search(params = {}) {
|
|
681
|
+
const result = await this.transport.callTool("marketplace_search", {
|
|
682
|
+
...params.query != null ? { query: params.query } : {},
|
|
683
|
+
...params.category != null ? { category: params.category } : {},
|
|
684
|
+
...params.minPrice != null ? { min_price: params.minPrice } : {},
|
|
685
|
+
...params.maxPrice != null ? { max_price: params.maxPrice } : {},
|
|
686
|
+
...params.listingType != null ? { listing_type: params.listingType } : {},
|
|
687
|
+
...params.limit != null ? { limit: params.limit } : {}
|
|
688
|
+
});
|
|
689
|
+
return normalizeSearchResult(result);
|
|
690
|
+
}
|
|
691
|
+
/**
|
|
692
|
+
* Get full details of a specific listing by ID.
|
|
693
|
+
* @param listingId - The listing's unique identifier.
|
|
694
|
+
* @returns Full listing details.
|
|
695
|
+
*/
|
|
696
|
+
async getListing(listingId) {
|
|
697
|
+
const result = await this.transport.callTool("marketplace_get_listing", {
|
|
698
|
+
listing_id: listingId
|
|
699
|
+
});
|
|
700
|
+
return normalizeListing(result);
|
|
701
|
+
}
|
|
702
|
+
/**
|
|
703
|
+
* Make an offer on a marketplace listing.
|
|
704
|
+
* Note: This tool is a stub on the server (returns NOT_IMPLEMENTED).
|
|
705
|
+
* @param params - Listing ID and buyer address.
|
|
706
|
+
* @returns Raw server response.
|
|
707
|
+
*/
|
|
708
|
+
async makeOffer(params) {
|
|
709
|
+
return this.transport.callTool("marketplace_make_offer", {
|
|
710
|
+
listing_id: params.listingId,
|
|
711
|
+
buyer_address: params.buyerAddress
|
|
712
|
+
});
|
|
713
|
+
}
|
|
714
|
+
/**
|
|
715
|
+
* Accept an offer, creating XRPL escrow.
|
|
716
|
+
* Note: This tool is a stub on the server (returns NOT_IMPLEMENTED).
|
|
717
|
+
* @param params - Offer ID and seller address.
|
|
718
|
+
* @returns Raw server response.
|
|
719
|
+
*/
|
|
720
|
+
async acceptOffer(params) {
|
|
721
|
+
return this.transport.callTool("marketplace_accept_offer", {
|
|
722
|
+
offer_id: params.offerId,
|
|
723
|
+
seller_address: params.sellerAddress
|
|
724
|
+
});
|
|
725
|
+
}
|
|
726
|
+
/**
|
|
727
|
+
* Confirm delivery and release escrow to seller.
|
|
728
|
+
* Note: This tool is a stub on the server (returns NOT_IMPLEMENTED).
|
|
729
|
+
* @param params - Offer ID and buyer address.
|
|
730
|
+
* @returns Raw server response.
|
|
731
|
+
*/
|
|
732
|
+
async confirmDelivery(params) {
|
|
733
|
+
return this.transport.callTool("marketplace_confirm_delivery", {
|
|
734
|
+
offer_id: params.offerId,
|
|
735
|
+
buyer_address: params.buyerAddress
|
|
736
|
+
});
|
|
737
|
+
}
|
|
738
|
+
/**
|
|
739
|
+
* Rate a completed marketplace transaction.
|
|
740
|
+
* Note: This tool is a stub on the server (returns NOT_IMPLEMENTED).
|
|
741
|
+
* @param params - Offer ID, rater address, score (1-5), optional comment.
|
|
742
|
+
* @returns Raw server response.
|
|
743
|
+
*/
|
|
744
|
+
async rate(params) {
|
|
745
|
+
return this.transport.callTool("marketplace_rate", {
|
|
746
|
+
offer_id: params.offerId,
|
|
747
|
+
rater_address: params.raterAddress,
|
|
748
|
+
score: params.score,
|
|
749
|
+
...params.comment != null ? { comment: params.comment } : {}
|
|
750
|
+
});
|
|
751
|
+
}
|
|
752
|
+
};
|
|
753
|
+
|
|
351
754
|
// src/client.ts
|
|
352
755
|
var MangroveClient = class {
|
|
353
756
|
/**
|
|
@@ -362,6 +765,9 @@ var MangroveClient = class {
|
|
|
362
765
|
this.transport = new McpTransport(config.url, config.apiKey);
|
|
363
766
|
}
|
|
364
767
|
this._dex = new DexService(this.transport);
|
|
768
|
+
this._oneinch = new OneInchService(this.transport);
|
|
769
|
+
this._wallet = new WalletService(this.transport);
|
|
770
|
+
this._marketplace = new MarketplaceService(this.transport);
|
|
365
771
|
if (config.signer) {
|
|
366
772
|
this._swapOrchestrator = new SwapOrchestrator(this._dex, config.signer, this.transport);
|
|
367
773
|
}
|
|
@@ -387,6 +793,26 @@ var MangroveClient = class {
|
|
|
387
793
|
}
|
|
388
794
|
});
|
|
389
795
|
}
|
|
796
|
+
/**
|
|
797
|
+
* Access 1inch ancillary operations: balances, gas prices, token info,
|
|
798
|
+
* portfolio data, charts, and history.
|
|
799
|
+
*/
|
|
800
|
+
get oneinch() {
|
|
801
|
+
return this._oneinch;
|
|
802
|
+
}
|
|
803
|
+
/**
|
|
804
|
+
* Access wallet operations: chain info, wallet creation, balance, and transaction history.
|
|
805
|
+
*/
|
|
806
|
+
get wallet() {
|
|
807
|
+
return this._wallet;
|
|
808
|
+
}
|
|
809
|
+
/**
|
|
810
|
+
* Access marketplace operations: create listings, search, get details,
|
|
811
|
+
* make offers, accept offers, confirm delivery, and rate transactions.
|
|
812
|
+
*/
|
|
813
|
+
get marketplace() {
|
|
814
|
+
return this._marketplace;
|
|
815
|
+
}
|
|
390
816
|
/** Open the transport connection. Must be called before making any tool calls. */
|
|
391
817
|
async connect() {
|
|
392
818
|
await this.transport.connect();
|
|
@@ -435,6 +861,9 @@ export {
|
|
|
435
861
|
DexService,
|
|
436
862
|
EthersSigner,
|
|
437
863
|
MangroveClient,
|
|
864
|
+
MarketplaceService,
|
|
438
865
|
McpTransport,
|
|
439
|
-
|
|
866
|
+
OneInchService,
|
|
867
|
+
RestTransport,
|
|
868
|
+
WalletService
|
|
440
869
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mangrove-ai/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "TypeScript SDK for MangroveMarkets -- DEX aggregation and agent marketplace with pluggable signing",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
},
|
|
39
39
|
"license": "MIT",
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@modelcontextprotocol/sdk": "^1.
|
|
41
|
+
"@modelcontextprotocol/sdk": "^1.27.1"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"ethers": "^6.0.0"
|
|
@@ -49,11 +49,11 @@
|
|
|
49
49
|
}
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@types/node": "^20.
|
|
52
|
+
"@types/node": "^20.19.37",
|
|
53
53
|
"dotenv": "^17.3.1",
|
|
54
|
-
"ethers": "^6.
|
|
55
|
-
"tsup": "^8.
|
|
56
|
-
"typescript": "^5.3
|
|
57
|
-
"vitest": "^1.
|
|
54
|
+
"ethers": "^6.16.0",
|
|
55
|
+
"tsup": "^8.5.1",
|
|
56
|
+
"typescript": "^5.9.3",
|
|
57
|
+
"vitest": "^1.6.1"
|
|
58
58
|
}
|
|
59
59
|
}
|