@guiie/buda-mcp 1.4.2 → 1.5.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/CHANGELOG.md +39 -0
- package/dist/cache.d.ts +1 -0
- package/dist/cache.d.ts.map +1 -1
- package/dist/cache.js +1 -0
- package/dist/client.d.ts +1 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +16 -0
- package/dist/http.js +55 -0
- package/dist/index.js +30 -0
- package/dist/tools/account.d.ts +19 -0
- package/dist/tools/account.d.ts.map +1 -0
- package/dist/tools/account.js +49 -0
- package/dist/tools/balance.d.ts +29 -0
- package/dist/tools/balance.d.ts.map +1 -0
- package/dist/tools/balance.js +72 -0
- package/dist/tools/banks.d.ts +28 -0
- package/dist/tools/banks.d.ts.map +1 -0
- package/dist/tools/banks.js +68 -0
- package/dist/tools/batch_orders.d.ts +77 -0
- package/dist/tools/batch_orders.d.ts.map +1 -0
- package/dist/tools/batch_orders.js +154 -0
- package/dist/tools/cancel_all_orders.d.ts +34 -0
- package/dist/tools/cancel_all_orders.d.ts.map +1 -0
- package/dist/tools/cancel_all_orders.js +89 -0
- package/dist/tools/cancel_order_by_client_id.d.ts +34 -0
- package/dist/tools/cancel_order_by_client_id.d.ts.map +1 -0
- package/dist/tools/cancel_order_by_client_id.js +102 -0
- package/dist/tools/deposits.d.ts +83 -0
- package/dist/tools/deposits.d.ts.map +1 -0
- package/dist/tools/deposits.js +174 -0
- package/dist/tools/fees.d.ts +34 -0
- package/dist/tools/fees.d.ts.map +1 -0
- package/dist/tools/fees.js +72 -0
- package/dist/tools/lightning.d.ts +68 -0
- package/dist/tools/lightning.d.ts.map +1 -0
- package/dist/tools/lightning.js +171 -0
- package/dist/tools/order_lookup.d.ts +50 -0
- package/dist/tools/order_lookup.d.ts.map +1 -0
- package/dist/tools/order_lookup.js +112 -0
- package/dist/tools/place_order.d.ts +30 -0
- package/dist/tools/place_order.d.ts.map +1 -1
- package/dist/tools/place_order.js +100 -2
- package/dist/tools/quotation.d.ts +44 -0
- package/dist/tools/quotation.d.ts.map +1 -0
- package/dist/tools/quotation.js +99 -0
- package/dist/tools/receive_addresses.d.ts +78 -0
- package/dist/tools/receive_addresses.d.ts.map +1 -0
- package/dist/tools/receive_addresses.js +161 -0
- package/dist/tools/remittance_recipients.d.ts +54 -0
- package/dist/tools/remittance_recipients.d.ts.map +1 -0
- package/dist/tools/remittance_recipients.js +106 -0
- package/dist/tools/remittances.d.ts +115 -0
- package/dist/tools/remittances.d.ts.map +1 -0
- package/dist/tools/remittances.js +237 -0
- package/dist/tools/simulate_order.d.ts.map +1 -1
- package/dist/tools/simulate_order.js +2 -1
- package/dist/tools/withdrawals.d.ts +93 -0
- package/dist/tools/withdrawals.d.ts.map +1 -0
- package/dist/tools/withdrawals.js +215 -0
- package/dist/types.d.ts +155 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/validation.d.ts +5 -0
- package/dist/validation.d.ts.map +1 -1
- package/dist/validation.js +12 -0
- package/marketplace/README.md +1 -1
- package/marketplace/claude-listing.md +30 -2
- package/marketplace/gemini-tools.json +155 -1
- package/marketplace/openapi.yaml +1 -1
- package/package.json +1 -1
- package/server.json +2 -2
- package/src/cache.ts +1 -0
- package/src/client.ts +20 -0
- package/src/http.ts +55 -0
- package/src/index.ts +30 -0
- package/src/tools/account.ts +66 -0
- package/src/tools/balance.ts +94 -0
- package/src/tools/banks.ts +94 -0
- package/src/tools/batch_orders.ts +199 -0
- package/src/tools/cancel_all_orders.ts +117 -0
- package/src/tools/cancel_order_by_client_id.ts +132 -0
- package/src/tools/deposits.ts +230 -0
- package/src/tools/fees.ts +91 -0
- package/src/tools/lightning.ts +231 -0
- package/src/tools/order_lookup.ts +139 -0
- package/src/tools/place_order.ts +119 -2
- package/src/tools/quotation.ts +124 -0
- package/src/tools/receive_addresses.ts +216 -0
- package/src/tools/remittance_recipients.ts +139 -0
- package/src/tools/remittances.ts +299 -0
- package/src/tools/simulate_order.ts +1 -0
- package/src/tools/withdrawals.ts +276 -0
- package/src/types.ts +210 -0
- package/src/validation.ts +16 -0
- package/test/run-all.ts +16 -0
- package/test/unit.ts +1905 -0
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,45 @@ This project uses [Semantic Versioning](https://semver.org/).
|
|
|
7
7
|
|
|
8
8
|
---
|
|
9
9
|
|
|
10
|
+
## [1.5.0] – 2026-04-11
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- **`cancel_all_orders`** (`src/tools/cancel_all_orders.ts`) — auth-gated tool to cancel all open orders in a specific market or across all markets (`market_id="*"`). Confirmation guard fires before market validation or API call. Uses new `DELETE /orders` endpoint via `client.delete<T>()`. Exports `handleCancelAllOrders` for unit testing.
|
|
15
|
+
|
|
16
|
+
- **`cancel_order_by_client_id`** (`src/tools/cancel_order_by_client_id.ts`) — auth-gated tool to cancel an open order by its client-assigned string ID (`PUT /orders/by-client-id/{client_id}`). Confirmation guard first; returns the same flat order shape as `get_order`. Exports `handleCancelOrderByClientId` for unit testing.
|
|
17
|
+
|
|
18
|
+
- **`place_batch_orders`** (`src/tools/batch_orders.ts`) — auth-gated tool to place up to 20 orders sequentially. Pre-validates **all** orders (market ID format + `limit_price` presence) before any API call — a single validation failure aborts with zero orders placed. API failures mid-batch do not roll back placed orders; a `warning` field surfaces this. Returns `{ results, total, succeeded, failed, warning? }`. Exports `handlePlaceBatchOrders` for unit testing.
|
|
19
|
+
|
|
20
|
+
- **`place_order` extended (optional TIF + stop fields)** — backward-compatible additions:
|
|
21
|
+
- **Time-in-force flags**: `ioc` (immediate-or-cancel), `fok` (fill-or-kill), `post_only`, `gtd_timestamp` (ISO 8601 expiry). Mutually exclusive — specifying more than one returns `VALIDATION_ERROR`.
|
|
22
|
+
- **Stop orders**: `stop_price` + `stop_type` (`">="` or `"<="`) — both must be present together or both absent, otherwise `VALIDATION_ERROR`.
|
|
23
|
+
- All validation happens after the confirmation guard but before the API call.
|
|
24
|
+
|
|
25
|
+
- **`create_withdrawal`** (added to `src/tools/withdrawals.ts`) — auth-gated `POST /currencies/{currency}/withdrawals`. Supports crypto (via `address` + optional `network`) and fiat (via `bank_account_id`). Exactly one destination must be provided; both or neither → `VALIDATION_ERROR`. Confirmation guard preview includes `{ currency, amount, destination }`. Returns flat `Withdrawal` shape. Exports `handleCreateWithdrawal` and `createWithdrawalToolSchema`.
|
|
26
|
+
|
|
27
|
+
- **`create_fiat_deposit`** (added to `src/tools/deposits.ts`) — auth-gated `POST /currencies/{currency}/deposits`. Guard is critical — calling twice creates duplicate records. Validates currency before API call. Returns flat `Deposit` shape. Exports `handleCreateFiatDeposit` and `createFiatDepositToolSchema`.
|
|
28
|
+
|
|
29
|
+
- **`lightning_withdrawal`** + **`create_lightning_invoice`** (`src/tools/lightning.ts`) — two auth-gated Lightning Network tools:
|
|
30
|
+
- `lightning_withdrawal` — pays a BOLT-11 invoice from the LN-BTC reserve (`POST /reserves/ln-btc/withdrawals`). Confirmation guard truncates the invoice in the preview (`invoice_preview: first 20 chars + "..."`). Returns `{ id, state, amount, amount_currency, fee, fee_currency, payment_hash, created_at }`.
|
|
31
|
+
- `create_lightning_invoice` — creates a receive invoice (`POST /lightning_network_invoices`). No confirmation required. Inputs: `amount_satoshis`, optional `description` (max 140 chars), optional `expiry_seconds` (60–86400). Returns `{ id, payment_request, amount_satoshis, description, expires_at, state, created_at }`.
|
|
32
|
+
|
|
33
|
+
- **`delete<T>()` on `BudaClient`** (`src/client.ts`) — follows the same HMAC auth headers + 429 retry pattern as `put<T>()`. Supports optional query params.
|
|
34
|
+
|
|
35
|
+
- **New types** in `src/types.ts`: `CancelAllOrdersResponse`, `LightningWithdrawal`, `LightningWithdrawalResponse`, `LightningInvoice`, `LightningInvoiceResponse`.
|
|
36
|
+
|
|
37
|
+
- **Unit tests (32 new, 138 total)** in `test/unit.ts`:
|
|
38
|
+
- `cancel_all_orders` (5 tests): no confirmation; `*` + CONFIRM; specific market + CONFIRM; invalid market with CONFIRM; 404 passthrough.
|
|
39
|
+
- `cancel_order_by_client_id` (3 tests): no confirmation; happy path with flat order; 404 passthrough.
|
|
40
|
+
- `place_batch_orders` (5 tests): no confirmation; all valid; invalid market pre-validation; missing limit_price pre-validation; mid-batch API error partial success.
|
|
41
|
+
- `place_order extended` (4 tests): existing limit order unchanged; IOC → `limit.type='ioc'`; stop_price without stop_type; mutually exclusive TIF flags.
|
|
42
|
+
- `create_withdrawal` (6 tests): no confirmation; both address+bank_account_id; neither; crypto path; fiat path; 422 passthrough.
|
|
43
|
+
- `create_fiat_deposit` (4 tests): no confirmation; invalid currency; happy path; 422 passthrough.
|
|
44
|
+
- `lightning_withdrawal` (3 tests): no confirmation with preview; happy path; 422 passthrough.
|
|
45
|
+
- `create_lightning_invoice` (2 tests): happy path; 422 passthrough.
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
10
49
|
## [1.4.2] – 2026-04-11
|
|
11
50
|
|
|
12
51
|
### Added
|
package/dist/cache.d.ts
CHANGED
package/dist/cache.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../src/cache.ts"],"names":[],"mappings":"AAKA,qBAAa,WAAW;IACtB,OAAO,CAAC,KAAK,CAA0C;IACvD,OAAO,CAAC,QAAQ,CAAuC;IAEjD,UAAU,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;IAyBtF,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAI7B,KAAK,IAAI,IAAI;CAGd;AAED,eAAO,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../src/cache.ts"],"names":[],"mappings":"AAKA,qBAAa,WAAW;IACtB,OAAO,CAAC,KAAK,CAA0C;IACvD,OAAO,CAAC,QAAQ,CAAuC;IAEjD,UAAU,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;IAyBtF,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAI7B,KAAK,IAAI,IAAI;CAGd;AAED,eAAO,MAAM,SAAS;;;;;CAKZ,CAAC;AAEX,eAAO,MAAM,KAAK,aAAoB,CAAC"}
|
package/dist/cache.js
CHANGED
package/dist/client.d.ts
CHANGED
|
@@ -29,5 +29,6 @@ export declare class BudaClient {
|
|
|
29
29
|
get<T>(path: string, params?: Record<string, string | number>): Promise<T>;
|
|
30
30
|
post<T>(path: string, payload: unknown): Promise<T>;
|
|
31
31
|
put<T>(path: string, payload: unknown): Promise<T>;
|
|
32
|
+
delete<T>(path: string, params?: Record<string, string | number>): Promise<T>;
|
|
32
33
|
}
|
|
33
34
|
//# sourceMappingURL=client.d.ts.map
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAKA,qBAAa,YAAa,SAAQ,KAAK;aAEnB,MAAM,EAAE,MAAM;aACd,IAAI,EAAE,MAAM;aAEZ,YAAY,CAAC,EAAE,MAAM;gBAHrB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EAC5B,OAAO,EAAE,MAAM,EACC,YAAY,CAAC,EAAE,MAAM,YAAA;CAKxC;AAED,qBAAa,UAAU;IACrB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAqB;IAC5C,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAqB;gBAG7C,OAAO,GAAE,MAAiB,EAC1B,MAAM,CAAC,EAAE,MAAM,EACf,SAAS,CAAC,EAAE,MAAM;IAOpB,OAAO,IAAI,OAAO;IAIlB,OAAO,CAAC,KAAK;IAIb,OAAO,CAAC,IAAI;IASZ,OAAO,CAAC,WAAW;IAWnB;;;;OAIG;IACH,OAAO,CAAC,iBAAiB;IAOzB;;;;OAIG;YACW,cAAc;YA2Bd,cAAc;IActB,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;IAoB1E,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC;IAmBnD,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAKA,qBAAa,YAAa,SAAQ,KAAK;aAEnB,MAAM,EAAE,MAAM;aACd,IAAI,EAAE,MAAM;aAEZ,YAAY,CAAC,EAAE,MAAM;gBAHrB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EAC5B,OAAO,EAAE,MAAM,EACC,YAAY,CAAC,EAAE,MAAM,YAAA;CAKxC;AAED,qBAAa,UAAU;IACrB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAqB;IAC5C,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAqB;gBAG7C,OAAO,GAAE,MAAiB,EAC1B,MAAM,CAAC,EAAE,MAAM,EACf,SAAS,CAAC,EAAE,MAAM;IAOpB,OAAO,IAAI,OAAO;IAIlB,OAAO,CAAC,KAAK;IAIb,OAAO,CAAC,IAAI;IASZ,OAAO,CAAC,WAAW;IAWnB;;;;OAIG;IACH,OAAO,CAAC,iBAAiB;IAOzB;;;;OAIG;YACW,cAAc;YA2Bd,cAAc;IActB,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;IAoB1E,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC;IAmBnD,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC;IAmBlD,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;CAmBpF"}
|
package/dist/client.js
CHANGED
|
@@ -135,5 +135,21 @@ export class BudaClient {
|
|
|
135
135
|
const response = await this.fetchWithRetry(url, { method: "PUT", headers, body: bodyStr }, path);
|
|
136
136
|
return this.handleResponse(response, path);
|
|
137
137
|
}
|
|
138
|
+
async delete(path, params) {
|
|
139
|
+
const url = new URL(`${this.baseUrl}${path}.json`);
|
|
140
|
+
if (params) {
|
|
141
|
+
for (const [key, value] of Object.entries(params)) {
|
|
142
|
+
url.searchParams.set(key, String(value));
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
const urlPath = url.pathname + url.search;
|
|
146
|
+
const headers = {
|
|
147
|
+
Accept: "application/json",
|
|
148
|
+
"User-Agent": `buda-mcp/${VERSION}`,
|
|
149
|
+
...this.authHeaders("DELETE", urlPath),
|
|
150
|
+
};
|
|
151
|
+
const response = await this.fetchWithRetry(url, { method: "DELETE", headers }, path);
|
|
152
|
+
return this.handleResponse(response, path);
|
|
153
|
+
}
|
|
138
154
|
}
|
|
139
155
|
//# sourceMappingURL=client.js.map
|
package/dist/http.js
CHANGED
|
@@ -23,6 +23,21 @@ import * as positionSize from "./tools/calculate_position_size.js";
|
|
|
23
23
|
import * as marketSentiment from "./tools/market_sentiment.js";
|
|
24
24
|
import * as technicalIndicators from "./tools/technical_indicators.js";
|
|
25
25
|
import * as deadMansSwitch from "./tools/dead_mans_switch.js";
|
|
26
|
+
import * as banks from "./tools/banks.js";
|
|
27
|
+
import * as account from "./tools/account.js";
|
|
28
|
+
import * as balance from "./tools/balance.js";
|
|
29
|
+
import * as orderLookup from "./tools/order_lookup.js";
|
|
30
|
+
import * as networkFees from "./tools/fees.js";
|
|
31
|
+
import * as deposits from "./tools/deposits.js";
|
|
32
|
+
import * as withdrawals from "./tools/withdrawals.js";
|
|
33
|
+
import * as receiveAddresses from "./tools/receive_addresses.js";
|
|
34
|
+
import * as remittances from "./tools/remittances.js";
|
|
35
|
+
import * as remittanceRecipients from "./tools/remittance_recipients.js";
|
|
36
|
+
import * as quotation from "./tools/quotation.js";
|
|
37
|
+
import * as cancelAllOrders from "./tools/cancel_all_orders.js";
|
|
38
|
+
import * as cancelOrderByClientId from "./tools/cancel_order_by_client_id.js";
|
|
39
|
+
import * as batchOrders from "./tools/batch_orders.js";
|
|
40
|
+
import * as lightning from "./tools/lightning.js";
|
|
26
41
|
import { handleMarketSummary } from "./tools/market_summary.js";
|
|
27
42
|
const PORT = parseInt(process.env.PORT ?? "3000", 10);
|
|
28
43
|
const client = new BudaClient(undefined, process.env.BUDA_API_KEY, process.env.BUDA_API_SECRET);
|
|
@@ -41,9 +56,11 @@ const PUBLIC_TOOL_SCHEMAS = [
|
|
|
41
56
|
arbitrage.toolSchema,
|
|
42
57
|
marketSummary.toolSchema,
|
|
43
58
|
simulateOrder.toolSchema,
|
|
59
|
+
quotation.toolSchema,
|
|
44
60
|
positionSize.toolSchema,
|
|
45
61
|
marketSentiment.toolSchema,
|
|
46
62
|
technicalIndicators.toolSchema,
|
|
63
|
+
banks.toolSchema,
|
|
47
64
|
];
|
|
48
65
|
const AUTH_TOOL_SCHEMAS = [
|
|
49
66
|
balances.toolSchema,
|
|
@@ -53,6 +70,29 @@ const AUTH_TOOL_SCHEMAS = [
|
|
|
53
70
|
deadMansSwitch.toolSchema,
|
|
54
71
|
deadMansSwitch.renewToolSchema,
|
|
55
72
|
deadMansSwitch.disarmToolSchema,
|
|
73
|
+
account.toolSchema,
|
|
74
|
+
balance.toolSchema,
|
|
75
|
+
orderLookup.getOrderToolSchema,
|
|
76
|
+
orderLookup.getOrderByClientIdToolSchema,
|
|
77
|
+
networkFees.toolSchema,
|
|
78
|
+
deposits.getDepositHistoryToolSchema,
|
|
79
|
+
withdrawals.getWithdrawalHistoryToolSchema,
|
|
80
|
+
receiveAddresses.listReceiveAddressesToolSchema,
|
|
81
|
+
receiveAddresses.getReceiveAddressToolSchema,
|
|
82
|
+
remittances.listRemittancesToolSchema,
|
|
83
|
+
remittances.getRemittanceToolSchema,
|
|
84
|
+
remittances.quoteRemittanceToolSchema,
|
|
85
|
+
remittances.acceptRemittanceQuoteToolSchema,
|
|
86
|
+
remittanceRecipients.listToolSchema,
|
|
87
|
+
remittanceRecipients.getToolSchema,
|
|
88
|
+
receiveAddresses.createReceiveAddressToolSchema,
|
|
89
|
+
cancelAllOrders.toolSchema,
|
|
90
|
+
cancelOrderByClientId.toolSchema,
|
|
91
|
+
batchOrders.toolSchema,
|
|
92
|
+
withdrawals.createWithdrawalToolSchema,
|
|
93
|
+
deposits.createFiatDepositToolSchema,
|
|
94
|
+
lightning.lightningWithdrawalToolSchema,
|
|
95
|
+
lightning.createLightningInvoiceToolSchema,
|
|
56
96
|
];
|
|
57
97
|
function createServer() {
|
|
58
98
|
const server = new McpServer({ name: "buda-mcp", version: VERSION });
|
|
@@ -69,15 +109,30 @@ function createServer() {
|
|
|
69
109
|
arbitrage.register(server, client, reqCache);
|
|
70
110
|
marketSummary.register(server, client, reqCache);
|
|
71
111
|
simulateOrder.register(server, client, reqCache);
|
|
112
|
+
quotation.register(server, client);
|
|
72
113
|
positionSize.register(server);
|
|
73
114
|
marketSentiment.register(server, client, reqCache);
|
|
74
115
|
technicalIndicators.register(server, client);
|
|
116
|
+
banks.register(server, client, reqCache);
|
|
75
117
|
if (authEnabled) {
|
|
76
118
|
balances.register(server, client);
|
|
77
119
|
orders.register(server, client);
|
|
78
120
|
placeOrder.register(server, client);
|
|
79
121
|
cancelOrder.register(server, client);
|
|
80
122
|
deadMansSwitch.register(server, client);
|
|
123
|
+
account.register(server, client);
|
|
124
|
+
balance.register(server, client);
|
|
125
|
+
orderLookup.register(server, client);
|
|
126
|
+
networkFees.register(server, client);
|
|
127
|
+
deposits.register(server, client);
|
|
128
|
+
withdrawals.register(server, client);
|
|
129
|
+
receiveAddresses.register(server, client);
|
|
130
|
+
remittances.register(server, client);
|
|
131
|
+
remittanceRecipients.register(server, client);
|
|
132
|
+
cancelAllOrders.register(server, client);
|
|
133
|
+
cancelOrderByClientId.register(server, client);
|
|
134
|
+
batchOrders.register(server, client);
|
|
135
|
+
lightning.register(server, client);
|
|
81
136
|
}
|
|
82
137
|
// MCP Resources
|
|
83
138
|
server.resource("buda-markets", "buda://markets", async (uri) => {
|
package/dist/index.js
CHANGED
|
@@ -24,6 +24,21 @@ import * as positionSize from "./tools/calculate_position_size.js";
|
|
|
24
24
|
import * as marketSentiment from "./tools/market_sentiment.js";
|
|
25
25
|
import * as technicalIndicators from "./tools/technical_indicators.js";
|
|
26
26
|
import * as deadMansSwitch from "./tools/dead_mans_switch.js";
|
|
27
|
+
import * as banks from "./tools/banks.js";
|
|
28
|
+
import * as account from "./tools/account.js";
|
|
29
|
+
import * as balance from "./tools/balance.js";
|
|
30
|
+
import * as orderLookup from "./tools/order_lookup.js";
|
|
31
|
+
import * as networkFees from "./tools/fees.js";
|
|
32
|
+
import * as deposits from "./tools/deposits.js";
|
|
33
|
+
import * as withdrawals from "./tools/withdrawals.js";
|
|
34
|
+
import * as receiveAddresses from "./tools/receive_addresses.js";
|
|
35
|
+
import * as remittances from "./tools/remittances.js";
|
|
36
|
+
import * as remittanceRecipients from "./tools/remittance_recipients.js";
|
|
37
|
+
import * as quotation from "./tools/quotation.js";
|
|
38
|
+
import * as cancelAllOrders from "./tools/cancel_all_orders.js";
|
|
39
|
+
import * as cancelOrderByClientId from "./tools/cancel_order_by_client_id.js";
|
|
40
|
+
import * as batchOrders from "./tools/batch_orders.js";
|
|
41
|
+
import * as lightning from "./tools/lightning.js";
|
|
27
42
|
import { handleMarketSummary } from "./tools/market_summary.js";
|
|
28
43
|
const client = new BudaClient(undefined, process.env.BUDA_API_KEY, process.env.BUDA_API_SECRET);
|
|
29
44
|
const server = new McpServer({
|
|
@@ -42,9 +57,11 @@ priceHistory.register(server, client, cache);
|
|
|
42
57
|
arbitrage.register(server, client, cache);
|
|
43
58
|
marketSummary.register(server, client, cache);
|
|
44
59
|
simulateOrder.register(server, client, cache);
|
|
60
|
+
quotation.register(server, client);
|
|
45
61
|
positionSize.register(server);
|
|
46
62
|
marketSentiment.register(server, client, cache);
|
|
47
63
|
technicalIndicators.register(server, client);
|
|
64
|
+
banks.register(server, client, cache);
|
|
48
65
|
// Auth-gated tools — only registered when API credentials are present
|
|
49
66
|
if (client.hasAuth()) {
|
|
50
67
|
balances.register(server, client);
|
|
@@ -52,6 +69,19 @@ if (client.hasAuth()) {
|
|
|
52
69
|
placeOrder.register(server, client);
|
|
53
70
|
cancelOrder.register(server, client);
|
|
54
71
|
deadMansSwitch.register(server, client);
|
|
72
|
+
account.register(server, client);
|
|
73
|
+
balance.register(server, client);
|
|
74
|
+
orderLookup.register(server, client);
|
|
75
|
+
networkFees.register(server, client);
|
|
76
|
+
deposits.register(server, client);
|
|
77
|
+
withdrawals.register(server, client);
|
|
78
|
+
receiveAddresses.register(server, client);
|
|
79
|
+
remittances.register(server, client);
|
|
80
|
+
remittanceRecipients.register(server, client);
|
|
81
|
+
cancelAllOrders.register(server, client);
|
|
82
|
+
cancelOrderByClientId.register(server, client);
|
|
83
|
+
batchOrders.register(server, client);
|
|
84
|
+
lightning.register(server, client);
|
|
55
85
|
}
|
|
56
86
|
// MCP Resources
|
|
57
87
|
server.resource("buda-markets", "buda://markets", async (uri) => {
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import { BudaClient } from "../client.js";
|
|
3
|
+
export declare const toolSchema: {
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
inputSchema: {
|
|
7
|
+
type: "object";
|
|
8
|
+
properties: {};
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export declare function handleGetAccountInfo(client: BudaClient): Promise<{
|
|
12
|
+
content: Array<{
|
|
13
|
+
type: "text";
|
|
14
|
+
text: string;
|
|
15
|
+
}>;
|
|
16
|
+
isError?: boolean;
|
|
17
|
+
}>;
|
|
18
|
+
export declare function register(server: McpServer, client: BudaClient): void;
|
|
19
|
+
//# sourceMappingURL=account.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account.d.ts","sourceRoot":"","sources":["../../src/tools/account.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,UAAU,EAAgB,MAAM,cAAc,CAAC;AAIxD,eAAO,MAAM,UAAU;;;;;;;CAYtB,CAAC;AAEF,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,UAAU,GACjB,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC,CAmChF;AAED,wBAAgB,QAAQ,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,GAAG,IAAI,CAOpE"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { BudaApiError } from "../client.js";
|
|
2
|
+
import { flattenAmount } from "../utils.js";
|
|
3
|
+
export const toolSchema = {
|
|
4
|
+
name: "get_account_info",
|
|
5
|
+
description: "Returns the authenticated user's profile on Buda.com. " +
|
|
6
|
+
"Fetches account details including email, display name, pubsub key, and monthly transacted amounts. " +
|
|
7
|
+
"Read-only; no side effects. " +
|
|
8
|
+
"Requires BUDA_API_KEY and BUDA_API_SECRET. " +
|
|
9
|
+
"Example: 'What is my account email and how much have I transacted this month?'",
|
|
10
|
+
inputSchema: {
|
|
11
|
+
type: "object",
|
|
12
|
+
properties: {},
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
export async function handleGetAccountInfo(client) {
|
|
16
|
+
try {
|
|
17
|
+
const data = await client.get("/me");
|
|
18
|
+
const me = data.me;
|
|
19
|
+
const monthly = flattenAmount(me.monthly_transacted);
|
|
20
|
+
return {
|
|
21
|
+
content: [
|
|
22
|
+
{
|
|
23
|
+
type: "text",
|
|
24
|
+
text: JSON.stringify({
|
|
25
|
+
id: me.id,
|
|
26
|
+
email: me.email,
|
|
27
|
+
name: me.name ?? null,
|
|
28
|
+
monthly_transacted: monthly.value,
|
|
29
|
+
monthly_transacted_currency: monthly.currency,
|
|
30
|
+
pubsub_key: me.pubsub_key ?? null,
|
|
31
|
+
}, null, 2),
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
catch (err) {
|
|
37
|
+
const msg = err instanceof BudaApiError
|
|
38
|
+
? { error: err.message, code: err.status, path: err.path }
|
|
39
|
+
: { error: String(err), code: "UNKNOWN" };
|
|
40
|
+
return {
|
|
41
|
+
content: [{ type: "text", text: JSON.stringify(msg) }],
|
|
42
|
+
isError: true,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
export function register(server, client) {
|
|
47
|
+
server.tool(toolSchema.name, toolSchema.description, {}, () => handleGetAccountInfo(client));
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=account.js.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import { BudaClient } from "../client.js";
|
|
3
|
+
export declare const toolSchema: {
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
inputSchema: {
|
|
7
|
+
type: "object";
|
|
8
|
+
properties: {
|
|
9
|
+
currency: {
|
|
10
|
+
type: string;
|
|
11
|
+
description: string;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
required: string[];
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
type GetBalanceArgs = {
|
|
18
|
+
currency: string;
|
|
19
|
+
};
|
|
20
|
+
export declare function handleGetBalance(args: GetBalanceArgs, client: BudaClient): Promise<{
|
|
21
|
+
content: Array<{
|
|
22
|
+
type: "text";
|
|
23
|
+
text: string;
|
|
24
|
+
}>;
|
|
25
|
+
isError?: boolean;
|
|
26
|
+
}>;
|
|
27
|
+
export declare function register(server: McpServer, client: BudaClient): void;
|
|
28
|
+
export {};
|
|
29
|
+
//# sourceMappingURL=balance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"balance.d.ts","sourceRoot":"","sources":["../../src/tools/balance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,EAAE,UAAU,EAAgB,MAAM,cAAc,CAAC;AAKxD,eAAO,MAAM,UAAU;;;;;;;;;;;;;CAiBtB,CAAC;AAEF,KAAK,cAAc,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC;AAE3C,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,cAAc,EACpB,MAAM,EAAE,UAAU,GACjB,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC,CAmDhF;AAED,wBAAgB,QAAQ,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,GAAG,IAAI,CASpE"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { BudaApiError } from "../client.js";
|
|
3
|
+
import { validateCurrency } from "../validation.js";
|
|
4
|
+
import { flattenAmount } from "../utils.js";
|
|
5
|
+
export const toolSchema = {
|
|
6
|
+
name: "get_balance",
|
|
7
|
+
description: "Returns the balance for a single currency for the authenticated Buda.com account. " +
|
|
8
|
+
"Fetches total, available, frozen, and pending-withdrawal amounts as floats with separate _currency fields. " +
|
|
9
|
+
"Requires BUDA_API_KEY and BUDA_API_SECRET. " +
|
|
10
|
+
"Example: 'How much ETH do I have available?'",
|
|
11
|
+
inputSchema: {
|
|
12
|
+
type: "object",
|
|
13
|
+
properties: {
|
|
14
|
+
currency: {
|
|
15
|
+
type: "string",
|
|
16
|
+
description: "Currency code (e.g. 'BTC', 'CLP', 'USDC').",
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
required: ["currency"],
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
export async function handleGetBalance(args, client) {
|
|
23
|
+
const { currency } = args;
|
|
24
|
+
const validationError = validateCurrency(currency);
|
|
25
|
+
if (validationError) {
|
|
26
|
+
return {
|
|
27
|
+
content: [{ type: "text", text: JSON.stringify({ error: validationError, code: "INVALID_CURRENCY" }) }],
|
|
28
|
+
isError: true,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
try {
|
|
32
|
+
const data = await client.get(`/balances/${currency.toUpperCase()}`);
|
|
33
|
+
const b = data.balance;
|
|
34
|
+
const amount = flattenAmount(b.amount);
|
|
35
|
+
const available = flattenAmount(b.available_amount);
|
|
36
|
+
const frozen = flattenAmount(b.frozen_amount);
|
|
37
|
+
const pending = flattenAmount(b.pending_withdraw_amount);
|
|
38
|
+
return {
|
|
39
|
+
content: [
|
|
40
|
+
{
|
|
41
|
+
type: "text",
|
|
42
|
+
text: JSON.stringify({
|
|
43
|
+
id: b.id,
|
|
44
|
+
amount: amount.value,
|
|
45
|
+
amount_currency: amount.currency,
|
|
46
|
+
available_amount: available.value,
|
|
47
|
+
available_amount_currency: available.currency,
|
|
48
|
+
frozen_amount: frozen.value,
|
|
49
|
+
frozen_amount_currency: frozen.currency,
|
|
50
|
+
pending_withdraw_amount: pending.value,
|
|
51
|
+
pending_withdraw_amount_currency: pending.currency,
|
|
52
|
+
}, null, 2),
|
|
53
|
+
},
|
|
54
|
+
],
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
catch (err) {
|
|
58
|
+
const msg = err instanceof BudaApiError
|
|
59
|
+
? { error: err.message, code: err.status, path: err.path }
|
|
60
|
+
: { error: String(err), code: "UNKNOWN" };
|
|
61
|
+
return {
|
|
62
|
+
content: [{ type: "text", text: JSON.stringify(msg) }],
|
|
63
|
+
isError: true,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
export function register(server, client) {
|
|
68
|
+
server.tool(toolSchema.name, toolSchema.description, {
|
|
69
|
+
currency: z.string().min(2).max(10).describe("Currency code (e.g. 'BTC', 'CLP', 'USDC')."),
|
|
70
|
+
}, (args) => handleGetBalance(args, client));
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=balance.js.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import { BudaClient } from "../client.js";
|
|
3
|
+
import { MemoryCache } from "../cache.js";
|
|
4
|
+
export declare const toolSchema: {
|
|
5
|
+
name: string;
|
|
6
|
+
description: string;
|
|
7
|
+
inputSchema: {
|
|
8
|
+
type: "object";
|
|
9
|
+
properties: {
|
|
10
|
+
currency: {
|
|
11
|
+
type: string;
|
|
12
|
+
description: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
required: string[];
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export declare function handleGetAvailableBanks(args: {
|
|
19
|
+
currency: string;
|
|
20
|
+
}, client: BudaClient, cache: MemoryCache): Promise<{
|
|
21
|
+
content: Array<{
|
|
22
|
+
type: "text";
|
|
23
|
+
text: string;
|
|
24
|
+
}>;
|
|
25
|
+
isError?: boolean;
|
|
26
|
+
}>;
|
|
27
|
+
export declare function register(server: McpServer, client: BudaClient, cache: MemoryCache): void;
|
|
28
|
+
//# sourceMappingURL=banks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"banks.d.ts","sourceRoot":"","sources":["../../src/tools/banks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,EAAE,UAAU,EAAgB,MAAM,cAAc,CAAC;AACxD,OAAO,EAAE,WAAW,EAAa,MAAM,aAAa,CAAC;AAIrD,eAAO,MAAM,UAAU;;;;;;;;;;;;;CAkBtB,CAAC;AAEF,wBAAsB,uBAAuB,CAC3C,IAAI,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,EAC1B,MAAM,EAAE,UAAU,EAClB,KAAK,EAAE,WAAW,GACjB,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC,CAmDhF;AAED,wBAAgB,QAAQ,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,WAAW,GAAG,IAAI,CASxF"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { BudaApiError } from "../client.js";
|
|
3
|
+
import { CACHE_TTL } from "../cache.js";
|
|
4
|
+
import { validateCurrency } from "../validation.js";
|
|
5
|
+
export const toolSchema = {
|
|
6
|
+
name: "get_available_banks",
|
|
7
|
+
description: "Returns banks available for deposits and withdrawals of a fiat currency on Buda.com. " +
|
|
8
|
+
"Returns an empty banks array (not an error) if the currency has no associated banks " +
|
|
9
|
+
"(e.g. crypto currencies or unsupported fiat currencies). " +
|
|
10
|
+
"Results are cached for 60 seconds. " +
|
|
11
|
+
"Example: 'Which banks can I use for CLP deposits?'",
|
|
12
|
+
inputSchema: {
|
|
13
|
+
type: "object",
|
|
14
|
+
properties: {
|
|
15
|
+
currency: {
|
|
16
|
+
type: "string",
|
|
17
|
+
description: "Currency code (e.g. 'CLP', 'COP', 'PEN').",
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
required: ["currency"],
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
export async function handleGetAvailableBanks(args, client, cache) {
|
|
24
|
+
const { currency } = args;
|
|
25
|
+
const validationError = validateCurrency(currency);
|
|
26
|
+
if (validationError) {
|
|
27
|
+
return {
|
|
28
|
+
content: [{ type: "text", text: JSON.stringify({ error: validationError, code: "INVALID_CURRENCY" }) }],
|
|
29
|
+
isError: true,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
const currencyUpper = currency.toUpperCase();
|
|
33
|
+
try {
|
|
34
|
+
const data = await cache.getOrFetch(`banks:${currencyUpper}`, CACHE_TTL.BANKS, () => client.get(`/currencies/${currencyUpper}/banks`));
|
|
35
|
+
return {
|
|
36
|
+
content: [
|
|
37
|
+
{
|
|
38
|
+
type: "text",
|
|
39
|
+
text: JSON.stringify({
|
|
40
|
+
currency: currencyUpper,
|
|
41
|
+
banks: data.banks.map((b) => ({ id: b.id, name: b.name, country: b.country ?? null })),
|
|
42
|
+
}, null, 2),
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
catch (err) {
|
|
48
|
+
// 404 means no banks exist for this currency — return empty list (not an error)
|
|
49
|
+
if (err instanceof BudaApiError && err.status === 404) {
|
|
50
|
+
return {
|
|
51
|
+
content: [{ type: "text", text: JSON.stringify({ currency: currencyUpper, banks: [] }, null, 2) }],
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
const msg = err instanceof BudaApiError
|
|
55
|
+
? { error: err.message, code: err.status, path: err.path }
|
|
56
|
+
: { error: String(err), code: "UNKNOWN" };
|
|
57
|
+
return {
|
|
58
|
+
content: [{ type: "text", text: JSON.stringify(msg) }],
|
|
59
|
+
isError: true,
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
export function register(server, client, cache) {
|
|
64
|
+
server.tool(toolSchema.name, toolSchema.description, {
|
|
65
|
+
currency: z.string().min(2).max(10).describe("Currency code (e.g. 'CLP', 'COP', 'PEN')."),
|
|
66
|
+
}, (args) => handleGetAvailableBanks(args, client, cache));
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=banks.js.map
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { BudaClient } from "../client.js";
|
|
4
|
+
export declare const toolSchema: {
|
|
5
|
+
name: string;
|
|
6
|
+
description: string;
|
|
7
|
+
inputSchema: {
|
|
8
|
+
type: "object";
|
|
9
|
+
properties: {
|
|
10
|
+
orders: {
|
|
11
|
+
type: string;
|
|
12
|
+
description: string;
|
|
13
|
+
items: {
|
|
14
|
+
type: string;
|
|
15
|
+
properties: {
|
|
16
|
+
market_id: {
|
|
17
|
+
type: string;
|
|
18
|
+
description: string;
|
|
19
|
+
};
|
|
20
|
+
type: {
|
|
21
|
+
type: string;
|
|
22
|
+
enum: string[];
|
|
23
|
+
description: string;
|
|
24
|
+
};
|
|
25
|
+
price_type: {
|
|
26
|
+
type: string;
|
|
27
|
+
enum: string[];
|
|
28
|
+
description: string;
|
|
29
|
+
};
|
|
30
|
+
amount: {
|
|
31
|
+
type: string;
|
|
32
|
+
description: string;
|
|
33
|
+
};
|
|
34
|
+
limit_price: {
|
|
35
|
+
type: string;
|
|
36
|
+
description: string;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
required: string[];
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
confirmation_token: {
|
|
43
|
+
type: string;
|
|
44
|
+
description: string;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
required: string[];
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
declare const orderShape: z.ZodObject<{
|
|
51
|
+
market_id: z.ZodString;
|
|
52
|
+
type: z.ZodEnum<{
|
|
53
|
+
Bid: "Bid";
|
|
54
|
+
Ask: "Ask";
|
|
55
|
+
}>;
|
|
56
|
+
price_type: z.ZodEnum<{
|
|
57
|
+
limit: "limit";
|
|
58
|
+
market: "market";
|
|
59
|
+
}>;
|
|
60
|
+
amount: z.ZodNumber;
|
|
61
|
+
limit_price: z.ZodOptional<z.ZodNumber>;
|
|
62
|
+
}, z.core.$strip>;
|
|
63
|
+
type SingleOrderInput = z.infer<typeof orderShape>;
|
|
64
|
+
type BatchOrdersArgs = {
|
|
65
|
+
orders: SingleOrderInput[];
|
|
66
|
+
confirmation_token: string;
|
|
67
|
+
};
|
|
68
|
+
export declare function handlePlaceBatchOrders(args: BatchOrdersArgs, client: BudaClient): Promise<{
|
|
69
|
+
content: Array<{
|
|
70
|
+
type: "text";
|
|
71
|
+
text: string;
|
|
72
|
+
}>;
|
|
73
|
+
isError?: boolean;
|
|
74
|
+
}>;
|
|
75
|
+
export declare function register(server: McpServer, client: BudaClient): void;
|
|
76
|
+
export {};
|
|
77
|
+
//# sourceMappingURL=batch_orders.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"batch_orders.d.ts","sourceRoot":"","sources":["../../src/tools/batch_orders.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,UAAU,EAAgB,MAAM,cAAc,CAAC;AAIxD,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkCtB,CAAC;AAEF,QAAA,MAAM,UAAU;;;;;;;;;;;;iBAMd,CAAC;AAEH,KAAK,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAWnD,KAAK,eAAe,GAAG;IACrB,MAAM,EAAE,gBAAgB,EAAE,CAAC;IAC3B,kBAAkB,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,eAAe,EACrB,MAAM,EAAE,UAAU,GACjB,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC,CA6GhF;AAED,wBAAgB,QAAQ,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,GAAG,IAAI,CAkBpE"}
|