@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.
Files changed (95) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/dist/cache.d.ts +1 -0
  3. package/dist/cache.d.ts.map +1 -1
  4. package/dist/cache.js +1 -0
  5. package/dist/client.d.ts +1 -0
  6. package/dist/client.d.ts.map +1 -1
  7. package/dist/client.js +16 -0
  8. package/dist/http.js +55 -0
  9. package/dist/index.js +30 -0
  10. package/dist/tools/account.d.ts +19 -0
  11. package/dist/tools/account.d.ts.map +1 -0
  12. package/dist/tools/account.js +49 -0
  13. package/dist/tools/balance.d.ts +29 -0
  14. package/dist/tools/balance.d.ts.map +1 -0
  15. package/dist/tools/balance.js +72 -0
  16. package/dist/tools/banks.d.ts +28 -0
  17. package/dist/tools/banks.d.ts.map +1 -0
  18. package/dist/tools/banks.js +68 -0
  19. package/dist/tools/batch_orders.d.ts +77 -0
  20. package/dist/tools/batch_orders.d.ts.map +1 -0
  21. package/dist/tools/batch_orders.js +154 -0
  22. package/dist/tools/cancel_all_orders.d.ts +34 -0
  23. package/dist/tools/cancel_all_orders.d.ts.map +1 -0
  24. package/dist/tools/cancel_all_orders.js +89 -0
  25. package/dist/tools/cancel_order_by_client_id.d.ts +34 -0
  26. package/dist/tools/cancel_order_by_client_id.d.ts.map +1 -0
  27. package/dist/tools/cancel_order_by_client_id.js +102 -0
  28. package/dist/tools/deposits.d.ts +83 -0
  29. package/dist/tools/deposits.d.ts.map +1 -0
  30. package/dist/tools/deposits.js +174 -0
  31. package/dist/tools/fees.d.ts +34 -0
  32. package/dist/tools/fees.d.ts.map +1 -0
  33. package/dist/tools/fees.js +72 -0
  34. package/dist/tools/lightning.d.ts +68 -0
  35. package/dist/tools/lightning.d.ts.map +1 -0
  36. package/dist/tools/lightning.js +171 -0
  37. package/dist/tools/order_lookup.d.ts +50 -0
  38. package/dist/tools/order_lookup.d.ts.map +1 -0
  39. package/dist/tools/order_lookup.js +112 -0
  40. package/dist/tools/place_order.d.ts +30 -0
  41. package/dist/tools/place_order.d.ts.map +1 -1
  42. package/dist/tools/place_order.js +100 -2
  43. package/dist/tools/quotation.d.ts +44 -0
  44. package/dist/tools/quotation.d.ts.map +1 -0
  45. package/dist/tools/quotation.js +99 -0
  46. package/dist/tools/receive_addresses.d.ts +78 -0
  47. package/dist/tools/receive_addresses.d.ts.map +1 -0
  48. package/dist/tools/receive_addresses.js +161 -0
  49. package/dist/tools/remittance_recipients.d.ts +54 -0
  50. package/dist/tools/remittance_recipients.d.ts.map +1 -0
  51. package/dist/tools/remittance_recipients.js +106 -0
  52. package/dist/tools/remittances.d.ts +115 -0
  53. package/dist/tools/remittances.d.ts.map +1 -0
  54. package/dist/tools/remittances.js +237 -0
  55. package/dist/tools/simulate_order.d.ts.map +1 -1
  56. package/dist/tools/simulate_order.js +2 -1
  57. package/dist/tools/withdrawals.d.ts +93 -0
  58. package/dist/tools/withdrawals.d.ts.map +1 -0
  59. package/dist/tools/withdrawals.js +215 -0
  60. package/dist/types.d.ts +155 -0
  61. package/dist/types.d.ts.map +1 -1
  62. package/dist/validation.d.ts +5 -0
  63. package/dist/validation.d.ts.map +1 -1
  64. package/dist/validation.js +12 -0
  65. package/marketplace/README.md +1 -1
  66. package/marketplace/claude-listing.md +30 -2
  67. package/marketplace/gemini-tools.json +155 -1
  68. package/marketplace/openapi.yaml +1 -1
  69. package/package.json +1 -1
  70. package/server.json +2 -2
  71. package/src/cache.ts +1 -0
  72. package/src/client.ts +20 -0
  73. package/src/http.ts +55 -0
  74. package/src/index.ts +30 -0
  75. package/src/tools/account.ts +66 -0
  76. package/src/tools/balance.ts +94 -0
  77. package/src/tools/banks.ts +94 -0
  78. package/src/tools/batch_orders.ts +199 -0
  79. package/src/tools/cancel_all_orders.ts +117 -0
  80. package/src/tools/cancel_order_by_client_id.ts +132 -0
  81. package/src/tools/deposits.ts +230 -0
  82. package/src/tools/fees.ts +91 -0
  83. package/src/tools/lightning.ts +231 -0
  84. package/src/tools/order_lookup.ts +139 -0
  85. package/src/tools/place_order.ts +119 -2
  86. package/src/tools/quotation.ts +124 -0
  87. package/src/tools/receive_addresses.ts +216 -0
  88. package/src/tools/remittance_recipients.ts +139 -0
  89. package/src/tools/remittances.ts +299 -0
  90. package/src/tools/simulate_order.ts +1 -0
  91. package/src/tools/withdrawals.ts +276 -0
  92. package/src/types.ts +210 -0
  93. package/src/validation.ts +16 -0
  94. package/test/run-all.ts +16 -0
  95. package/test/unit.ts +1905 -0
@@ -0,0 +1,106 @@
1
+ import { z } from "zod";
2
+ import { BudaApiError } from "../client.js";
3
+ export const listToolSchema = {
4
+ name: "list_remittance_recipients",
5
+ description: "Lists all saved remittance recipients (bank accounts) for the authenticated Buda.com account. " +
6
+ "Supports pagination. " +
7
+ "Requires BUDA_API_KEY and BUDA_API_SECRET. " +
8
+ "Example: 'Who are my saved remittance recipients?'",
9
+ inputSchema: {
10
+ type: "object",
11
+ properties: {
12
+ per: {
13
+ type: "number",
14
+ description: "Results per page (default: 20, max: 300).",
15
+ },
16
+ page: {
17
+ type: "number",
18
+ description: "Page number (default: 1).",
19
+ },
20
+ },
21
+ },
22
+ };
23
+ export const getToolSchema = {
24
+ name: "get_remittance_recipient",
25
+ description: "Returns a single saved remittance recipient by its ID on Buda.com. " +
26
+ "Fetches saved bank details for one recipient. " +
27
+ "Requires BUDA_API_KEY and BUDA_API_SECRET. " +
28
+ "Example: 'Show remittance recipient ID 5.'",
29
+ inputSchema: {
30
+ type: "object",
31
+ properties: {
32
+ id: {
33
+ type: "number",
34
+ description: "The numeric ID of the remittance recipient.",
35
+ },
36
+ },
37
+ required: ["id"],
38
+ },
39
+ };
40
+ function normalizeRecipient(r) {
41
+ return {
42
+ id: r.id,
43
+ name: r.name,
44
+ bank: r.bank,
45
+ account_number: r.account_number,
46
+ currency: r.currency,
47
+ country: r.country ?? null,
48
+ };
49
+ }
50
+ export async function handleListRemittanceRecipients(args, client) {
51
+ try {
52
+ const params = {};
53
+ if (args.per !== undefined)
54
+ params.per = args.per;
55
+ if (args.page !== undefined)
56
+ params.page = args.page;
57
+ const data = await client.get("/remittance_recipients", Object.keys(params).length > 0 ? params : undefined);
58
+ return {
59
+ content: [
60
+ {
61
+ type: "text",
62
+ text: JSON.stringify({
63
+ remittance_recipients: data.remittance_recipients.map(normalizeRecipient),
64
+ meta: data.meta,
65
+ }, null, 2),
66
+ },
67
+ ],
68
+ };
69
+ }
70
+ catch (err) {
71
+ const msg = err instanceof BudaApiError
72
+ ? { error: err.message, code: err.status, path: err.path }
73
+ : { error: String(err), code: "UNKNOWN" };
74
+ return {
75
+ content: [{ type: "text", text: JSON.stringify(msg) }],
76
+ isError: true,
77
+ };
78
+ }
79
+ }
80
+ export async function handleGetRemittanceRecipient(args, client) {
81
+ try {
82
+ const data = await client.get(`/remittance_recipients/${args.id}`);
83
+ return {
84
+ content: [{ type: "text", text: JSON.stringify(normalizeRecipient(data.remittance_recipient), null, 2) }],
85
+ };
86
+ }
87
+ catch (err) {
88
+ const msg = err instanceof BudaApiError
89
+ ? { error: err.message, code: err.status, path: err.path }
90
+ : { error: String(err), code: "UNKNOWN" };
91
+ return {
92
+ content: [{ type: "text", text: JSON.stringify(msg) }],
93
+ isError: true,
94
+ };
95
+ }
96
+ }
97
+ export function register(server, client) {
98
+ server.tool(listToolSchema.name, listToolSchema.description, {
99
+ per: z.number().int().min(1).max(300).optional().describe("Results per page (default: 20, max: 300)."),
100
+ page: z.number().int().min(1).optional().describe("Page number (default: 1)."),
101
+ }, (args) => handleListRemittanceRecipients(args, client));
102
+ server.tool(getToolSchema.name, getToolSchema.description, {
103
+ id: z.number().int().positive().describe("The numeric ID of the remittance recipient."),
104
+ }, (args) => handleGetRemittanceRecipient(args, client));
105
+ }
106
+ //# sourceMappingURL=remittance_recipients.js.map
@@ -0,0 +1,115 @@
1
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ import { BudaClient } from "../client.js";
3
+ export declare const listRemittancesToolSchema: {
4
+ name: string;
5
+ description: string;
6
+ inputSchema: {
7
+ type: "object";
8
+ properties: {
9
+ per: {
10
+ type: string;
11
+ description: string;
12
+ };
13
+ page: {
14
+ type: string;
15
+ description: string;
16
+ };
17
+ };
18
+ };
19
+ };
20
+ export declare const quoteRemittanceToolSchema: {
21
+ name: string;
22
+ description: string;
23
+ inputSchema: {
24
+ type: "object";
25
+ properties: {
26
+ currency: {
27
+ type: string;
28
+ description: string;
29
+ };
30
+ amount: {
31
+ type: string;
32
+ description: string;
33
+ };
34
+ recipient_id: {
35
+ type: string;
36
+ description: string;
37
+ };
38
+ };
39
+ required: string[];
40
+ };
41
+ };
42
+ export declare const acceptRemittanceQuoteToolSchema: {
43
+ name: string;
44
+ description: string;
45
+ inputSchema: {
46
+ type: "object";
47
+ properties: {
48
+ id: {
49
+ type: string;
50
+ description: string;
51
+ };
52
+ confirmation_token: {
53
+ type: string;
54
+ description: string;
55
+ };
56
+ };
57
+ required: string[];
58
+ };
59
+ };
60
+ export declare const getRemittanceToolSchema: {
61
+ name: string;
62
+ description: string;
63
+ inputSchema: {
64
+ type: "object";
65
+ properties: {
66
+ id: {
67
+ type: string;
68
+ description: string;
69
+ };
70
+ };
71
+ required: string[];
72
+ };
73
+ };
74
+ export declare function handleListRemittances(args: {
75
+ per?: number;
76
+ page?: number;
77
+ }, client: BudaClient): Promise<{
78
+ content: Array<{
79
+ type: "text";
80
+ text: string;
81
+ }>;
82
+ isError?: boolean;
83
+ }>;
84
+ export declare function handleGetRemittance(args: {
85
+ id: number;
86
+ }, client: BudaClient): Promise<{
87
+ content: Array<{
88
+ type: "text";
89
+ text: string;
90
+ }>;
91
+ isError?: boolean;
92
+ }>;
93
+ export declare function handleQuoteRemittance(args: {
94
+ currency: string;
95
+ amount: number;
96
+ recipient_id: number;
97
+ }, client: BudaClient): Promise<{
98
+ content: Array<{
99
+ type: "text";
100
+ text: string;
101
+ }>;
102
+ isError?: boolean;
103
+ }>;
104
+ export declare function handleAcceptRemittanceQuote(args: {
105
+ id: number;
106
+ confirmation_token: string;
107
+ }, client: BudaClient): Promise<{
108
+ content: Array<{
109
+ type: "text";
110
+ text: string;
111
+ }>;
112
+ isError?: boolean;
113
+ }>;
114
+ export declare function register(server: McpServer, client: BudaClient): void;
115
+ //# sourceMappingURL=remittances.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remittances.d.ts","sourceRoot":"","sources":["../../src/tools/remittances.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,EAAE,UAAU,EAAgB,MAAM,cAAc,CAAC;AAKxD,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;CAoBrC,CAAC;AAEF,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;CA4BrC,CAAC;AAEF,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;CAuB3C,CAAC;AAEF,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;CAiBnC,CAAC;AAgBF,wBAAsB,qBAAqB,CACzC,IAAI,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,EACrC,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,CAoChF;AAED,wBAAsB,mBAAmB,CACvC,IAAI,EAAE;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,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,CAgBhF;AAED,wBAAsB,qBAAqB,CACzC,IAAI,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,EAChE,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,CAgChF;AAED,wBAAsB,2BAA2B,CAC/C,IAAI,EAAE;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,kBAAkB,EAAE,MAAM,CAAA;CAAE,EAChD,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,CAqChF;AAED,wBAAgB,QAAQ,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,GAAG,IAAI,CAwCpE"}
@@ -0,0 +1,237 @@
1
+ import { z } from "zod";
2
+ import { BudaApiError } from "../client.js";
3
+ import { flattenAmount } from "../utils.js";
4
+ import { validateCurrency } from "../validation.js";
5
+ export const listRemittancesToolSchema = {
6
+ name: "list_remittances",
7
+ description: "Returns all fiat remittance transfers for the authenticated Buda.com account. " +
8
+ "Supports pagination. All amounts are floats with separate _currency fields. " +
9
+ "Requires BUDA_API_KEY and BUDA_API_SECRET. " +
10
+ "Example: 'List my recent remittances.'",
11
+ inputSchema: {
12
+ type: "object",
13
+ properties: {
14
+ per: {
15
+ type: "number",
16
+ description: "Results per page (default: 20, max: 300).",
17
+ },
18
+ page: {
19
+ type: "number",
20
+ description: "Page number (default: 1).",
21
+ },
22
+ },
23
+ },
24
+ };
25
+ export const quoteRemittanceToolSchema = {
26
+ name: "quote_remittance",
27
+ description: "Creates a time-limited remittance quote without committing funds. " +
28
+ "Requests a price quote for a fiat remittance to a saved recipient. " +
29
+ "Returns a remittance object in 'quoted' state with an expiry timestamp. " +
30
+ "NOT idempotent — creates a new remittance record each call. " +
31
+ "To execute, call accept_remittance_quote with the returned ID before it expires. " +
32
+ "Requires BUDA_API_KEY and BUDA_API_SECRET. " +
33
+ "Example: 'Get a remittance quote to send 100000 CLP to recipient 5.'",
34
+ inputSchema: {
35
+ type: "object",
36
+ properties: {
37
+ currency: {
38
+ type: "string",
39
+ description: "Fiat currency code (e.g. 'CLP', 'COP').",
40
+ },
41
+ amount: {
42
+ type: "number",
43
+ description: "Amount to remit (positive number).",
44
+ },
45
+ recipient_id: {
46
+ type: "number",
47
+ description: "ID of the saved remittance recipient.",
48
+ },
49
+ },
50
+ required: ["currency", "amount", "recipient_id"],
51
+ },
52
+ };
53
+ export const acceptRemittanceQuoteToolSchema = {
54
+ name: "accept_remittance_quote",
55
+ description: "Accepts and executes a pending remittance quote. " +
56
+ "Commits a previously quoted remittance, triggering a real fiat transfer. " +
57
+ "IRREVERSIBLE once the transfer is initiated. " +
58
+ "You must pass confirmation_token='CONFIRM' to proceed. " +
59
+ "Requires BUDA_API_KEY and BUDA_API_SECRET. " +
60
+ "Example: \"Accept remittance quote 77 — set confirmation_token='CONFIRM'.\"",
61
+ inputSchema: {
62
+ type: "object",
63
+ properties: {
64
+ id: {
65
+ type: "number",
66
+ description: "The numeric ID of the remittance quote to accept.",
67
+ },
68
+ confirmation_token: {
69
+ type: "string",
70
+ description: "Must be 'CONFIRM' to proceed. Any other value aborts.",
71
+ },
72
+ },
73
+ required: ["id", "confirmation_token"],
74
+ },
75
+ };
76
+ export const getRemittanceToolSchema = {
77
+ name: "get_remittance",
78
+ description: "Returns a single remittance by its ID on Buda.com. " +
79
+ "Fetches current state and details. " +
80
+ "Requires BUDA_API_KEY and BUDA_API_SECRET. " +
81
+ "Example: 'What is the status of remittance 77?'",
82
+ inputSchema: {
83
+ type: "object",
84
+ properties: {
85
+ id: {
86
+ type: "number",
87
+ description: "The numeric ID of the remittance.",
88
+ },
89
+ },
90
+ required: ["id"],
91
+ },
92
+ };
93
+ function normalizeRemittance(r) {
94
+ const amount = flattenAmount(r.amount);
95
+ return {
96
+ id: r.id,
97
+ state: r.state,
98
+ currency: r.currency,
99
+ amount: amount.value,
100
+ amount_currency: amount.currency,
101
+ recipient_id: r.recipient_id,
102
+ created_at: r.created_at,
103
+ expires_at: r.expires_at ?? null,
104
+ };
105
+ }
106
+ export async function handleListRemittances(args, client) {
107
+ try {
108
+ const params = {};
109
+ if (args.per !== undefined)
110
+ params.per = args.per;
111
+ if (args.page !== undefined)
112
+ params.page = args.page;
113
+ const data = await client.get("/remittances", Object.keys(params).length > 0 ? params : undefined);
114
+ return {
115
+ content: [
116
+ {
117
+ type: "text",
118
+ text: JSON.stringify({
119
+ remittances: data.remittances.map(normalizeRemittance),
120
+ meta: data.meta,
121
+ }, null, 2),
122
+ },
123
+ ],
124
+ };
125
+ }
126
+ catch (err) {
127
+ const msg = err instanceof BudaApiError
128
+ ? { error: err.message, code: err.status, path: err.path }
129
+ : { error: String(err), code: "UNKNOWN" };
130
+ return {
131
+ content: [{ type: "text", text: JSON.stringify(msg) }],
132
+ isError: true,
133
+ };
134
+ }
135
+ }
136
+ export async function handleGetRemittance(args, client) {
137
+ try {
138
+ const data = await client.get(`/remittances/${args.id}`);
139
+ return {
140
+ content: [{ type: "text", text: JSON.stringify(normalizeRemittance(data.remittance), null, 2) }],
141
+ };
142
+ }
143
+ catch (err) {
144
+ const msg = err instanceof BudaApiError
145
+ ? { error: err.message, code: err.status, path: err.path }
146
+ : { error: String(err), code: "UNKNOWN" };
147
+ return {
148
+ content: [{ type: "text", text: JSON.stringify(msg) }],
149
+ isError: true,
150
+ };
151
+ }
152
+ }
153
+ export async function handleQuoteRemittance(args, client) {
154
+ const { currency, amount, recipient_id } = args;
155
+ const validationError = validateCurrency(currency);
156
+ if (validationError) {
157
+ return {
158
+ content: [{ type: "text", text: JSON.stringify({ error: validationError, code: "INVALID_CURRENCY" }) }],
159
+ isError: true,
160
+ };
161
+ }
162
+ try {
163
+ const data = await client.post("/remittances", {
164
+ remittance: {
165
+ currency: currency.toUpperCase(),
166
+ amount: String(amount),
167
+ recipient_id,
168
+ },
169
+ });
170
+ return {
171
+ content: [{ type: "text", text: JSON.stringify(normalizeRemittance(data.remittance), null, 2) }],
172
+ };
173
+ }
174
+ catch (err) {
175
+ const msg = err instanceof BudaApiError
176
+ ? { error: err.message, code: err.status, path: err.path }
177
+ : { error: String(err), code: "UNKNOWN" };
178
+ return {
179
+ content: [{ type: "text", text: JSON.stringify(msg) }],
180
+ isError: true,
181
+ };
182
+ }
183
+ }
184
+ export async function handleAcceptRemittanceQuote(args, client) {
185
+ const { id, confirmation_token } = args;
186
+ if (confirmation_token !== "CONFIRM") {
187
+ return {
188
+ content: [
189
+ {
190
+ type: "text",
191
+ text: JSON.stringify({
192
+ error: "Accepting a remittance quote is irreversible. Pass confirmation_token='CONFIRM' to proceed.",
193
+ code: "CONFIRMATION_REQUIRED",
194
+ remittance_id: id,
195
+ }),
196
+ },
197
+ ],
198
+ isError: true,
199
+ };
200
+ }
201
+ try {
202
+ const data = await client.put(`/remittances/${id}`, {
203
+ remittance: { state: "confirming" },
204
+ });
205
+ return {
206
+ content: [{ type: "text", text: JSON.stringify(normalizeRemittance(data.remittance), null, 2) }],
207
+ };
208
+ }
209
+ catch (err) {
210
+ const msg = err instanceof BudaApiError
211
+ ? { error: err.message, code: err.status, path: err.path }
212
+ : { error: String(err), code: "UNKNOWN" };
213
+ return {
214
+ content: [{ type: "text", text: JSON.stringify(msg) }],
215
+ isError: true,
216
+ };
217
+ }
218
+ }
219
+ export function register(server, client) {
220
+ server.tool(listRemittancesToolSchema.name, listRemittancesToolSchema.description, {
221
+ per: z.number().int().min(1).max(300).optional().describe("Results per page (default: 20, max: 300)."),
222
+ page: z.number().int().min(1).optional().describe("Page number (default: 1)."),
223
+ }, (args) => handleListRemittances(args, client));
224
+ server.tool(getRemittanceToolSchema.name, getRemittanceToolSchema.description, {
225
+ id: z.number().int().positive().describe("The numeric ID of the remittance."),
226
+ }, (args) => handleGetRemittance(args, client));
227
+ server.tool(quoteRemittanceToolSchema.name, quoteRemittanceToolSchema.description, {
228
+ currency: z.string().min(2).max(10).describe("Fiat currency code (e.g. 'CLP', 'COP')."),
229
+ amount: z.number().positive().describe("Amount to remit (positive number)."),
230
+ recipient_id: z.number().int().positive().describe("ID of the saved remittance recipient."),
231
+ }, (args) => handleQuoteRemittance(args, client));
232
+ server.tool(acceptRemittanceQuoteToolSchema.name, acceptRemittanceQuoteToolSchema.description, {
233
+ id: z.number().int().positive().describe("The numeric ID of the remittance quote to accept."),
234
+ confirmation_token: z.string().describe("Must be 'CONFIRM' to proceed. Any other value aborts."),
235
+ }, (args) => handleAcceptRemittanceQuote(args, client));
236
+ }
237
+ //# sourceMappingURL=remittances.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"simulate_order.d.ts","sourceRoot":"","sources":["../../src/tools/simulate_order.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;;;;;;;;;;;;;;;;;;;;;;;;;CA+BtB,CAAC;AAEF,KAAK,iBAAiB,GAAG;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,KAAK,GAAG,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,iBAAiB,EACvB,MAAM,EAAE,UAAU,EAClB,KA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import { validateMarketId } from "../validation.js";
5
5
  export const toolSchema = {
6
6
  name: "simulate_order",
7
- description: "Simulates a buy or sell order on Buda.com using live ticker data — no order is placed. " +
7
+ description: "[DEPRECATED: prefer get_real_quotation for server-side accurate quotes] " +
8
+ "Simulates a buy or sell order on Buda.com using live ticker data — no order is placed. " +
8
9
  "Returns estimated fill price, fee, total cost, and slippage vs mid-price. " +
9
10
  "Omit 'price' for a market order simulation; supply 'price' for a limit order simulation. " +
10
11
  "All outputs are labelled simulation: true — this tool never places a real order. " +
@@ -0,0 +1,93 @@
1
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ import { BudaClient } from "../client.js";
3
+ export declare const getWithdrawalHistoryToolSchema: {
4
+ name: string;
5
+ description: string;
6
+ inputSchema: {
7
+ type: "object";
8
+ properties: {
9
+ currency: {
10
+ type: string;
11
+ description: string;
12
+ };
13
+ state: {
14
+ type: string;
15
+ description: string;
16
+ };
17
+ per: {
18
+ type: string;
19
+ description: string;
20
+ };
21
+ page: {
22
+ type: string;
23
+ description: string;
24
+ };
25
+ };
26
+ required: string[];
27
+ };
28
+ };
29
+ type GetWithdrawalHistoryArgs = {
30
+ currency: string;
31
+ state?: "pending_signature" | "pending" | "confirmed" | "rejected" | "anulled";
32
+ per?: number;
33
+ page?: number;
34
+ };
35
+ export declare function handleGetWithdrawalHistory(args: GetWithdrawalHistoryArgs, client: BudaClient): Promise<{
36
+ content: Array<{
37
+ type: "text";
38
+ text: string;
39
+ }>;
40
+ isError?: boolean;
41
+ }>;
42
+ export declare const createWithdrawalToolSchema: {
43
+ name: string;
44
+ description: string;
45
+ inputSchema: {
46
+ type: "object";
47
+ properties: {
48
+ currency: {
49
+ type: string;
50
+ description: string;
51
+ };
52
+ amount: {
53
+ type: string;
54
+ description: string;
55
+ };
56
+ address: {
57
+ type: string;
58
+ description: string;
59
+ };
60
+ network: {
61
+ type: string;
62
+ description: string;
63
+ };
64
+ bank_account_id: {
65
+ type: string;
66
+ description: string;
67
+ };
68
+ confirmation_token: {
69
+ type: string;
70
+ description: string;
71
+ };
72
+ };
73
+ required: string[];
74
+ };
75
+ };
76
+ type CreateWithdrawalArgs = {
77
+ currency: string;
78
+ amount: number;
79
+ address?: string;
80
+ network?: string;
81
+ bank_account_id?: number;
82
+ confirmation_token: string;
83
+ };
84
+ export declare function handleCreateWithdrawal(args: CreateWithdrawalArgs, client: BudaClient): Promise<{
85
+ content: Array<{
86
+ type: "text";
87
+ text: string;
88
+ }>;
89
+ isError?: boolean;
90
+ }>;
91
+ export declare function register(server: McpServer, client: BudaClient): void;
92
+ export {};
93
+ //# sourceMappingURL=withdrawals.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"withdrawals.d.ts","sourceRoot":"","sources":["../../src/tools/withdrawals.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,EAAE,UAAU,EAAgB,MAAM,cAAc,CAAC;AAKxD,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;CA8B1C,CAAC;AAEF,KAAK,wBAAwB,GAAG;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,mBAAmB,GAAG,SAAS,GAAG,WAAW,GAAG,UAAU,GAAG,SAAS,CAAC;IAC/E,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAqBF,wBAAsB,0BAA0B,CAC9C,IAAI,EAAE,wBAAwB,EAC9B,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,CA+ChF;AAED,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsBt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