@aibtc/mcp-server 1.36.0 → 1.37.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/services/defi.service.d.ts.map +1 -1
- package/dist/services/defi.service.js +4 -17
- package/dist/services/defi.service.js.map +1 -1
- package/dist/services/wallet-manager.d.ts.map +1 -1
- package/dist/services/wallet-manager.js +7 -0
- package/dist/services/wallet-manager.js.map +1 -1
- package/dist/tools/contract.tools.d.ts.map +1 -1
- package/dist/tools/contract.tools.js +3 -2
- package/dist/tools/contract.tools.js.map +1 -1
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +15 -0
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/jingswap.tools.d.ts +3 -0
- package/dist/tools/jingswap.tools.d.ts.map +1 -0
- package/dist/tools/jingswap.tools.js +471 -0
- package/dist/tools/jingswap.tools.js.map +1 -0
- package/dist/tools/nostr.tools.d.ts +3 -0
- package/dist/tools/nostr.tools.d.ts.map +1 -0
- package/dist/tools/nostr.tools.js +409 -0
- package/dist/tools/nostr.tools.js.map +1 -0
- package/dist/tools/ordinals-p2p.tools.d.ts +21 -0
- package/dist/tools/ordinals-p2p.tools.d.ts.map +1 -0
- package/dist/tools/ordinals-p2p.tools.js +621 -0
- package/dist/tools/ordinals-p2p.tools.js.map +1 -0
- package/dist/tools/relay-diagnostic.tools.d.ts.map +1 -1
- package/dist/tools/relay-diagnostic.tools.js +27 -4
- package/dist/tools/relay-diagnostic.tools.js.map +1 -1
- package/dist/tools/skill-mappings.d.ts.map +1 -1
- package/dist/tools/skill-mappings.js +13 -1
- package/dist/tools/skill-mappings.js.map +1 -1
- package/dist/tools/stacks-market.tools.d.ts +22 -0
- package/dist/tools/stacks-market.tools.d.ts.map +1 -0
- package/dist/tools/stacks-market.tools.js +630 -0
- package/dist/tools/stacks-market.tools.js.map +1 -0
- package/dist/tools/taproot-multisig.tools.d.ts +17 -0
- package/dist/tools/taproot-multisig.tools.d.ts.map +1 -0
- package/dist/tools/taproot-multisig.tools.js +236 -0
- package/dist/tools/taproot-multisig.tools.js.map +1 -0
- package/dist/tools/transfer.tools.js +1 -1
- package/dist/tools/transfer.tools.js.map +1 -1
- package/dist/transactions/builder.d.ts +35 -1
- package/dist/transactions/builder.d.ts.map +1 -1
- package/dist/transactions/builder.js +153 -4
- package/dist/transactions/builder.js.map +1 -1
- package/dist/utils/fee.d.ts +15 -0
- package/dist/utils/fee.d.ts.map +1 -1
- package/dist/utils/fee.js +36 -4
- package/dist/utils/fee.js.map +1 -1
- package/package.json +4 -1
- package/skill/SKILL.md +1 -1
|
@@ -0,0 +1,409 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import WebSocket from "ws";
|
|
3
|
+
import { createJsonResponse, createErrorResponse } from "../utils/index.js";
|
|
4
|
+
import { getWalletManager } from "../services/wallet-manager.js";
|
|
5
|
+
import { finalizeEvent, getPublicKey, } from "nostr-tools/pure";
|
|
6
|
+
import * as nip19 from "nostr-tools/nip19";
|
|
7
|
+
import { SimplePool } from "nostr-tools/pool";
|
|
8
|
+
// ---------------------------------------------------------------------------
|
|
9
|
+
// Constants
|
|
10
|
+
// ---------------------------------------------------------------------------
|
|
11
|
+
const DEFAULT_RELAYS = ["wss://relay.damus.io", "wss://nos.lol"];
|
|
12
|
+
const WS_TIMEOUT_MS = 10_000;
|
|
13
|
+
// ---------------------------------------------------------------------------
|
|
14
|
+
// Helper functions
|
|
15
|
+
// ---------------------------------------------------------------------------
|
|
16
|
+
function deriveNostrKeys() {
|
|
17
|
+
const walletManager = getWalletManager();
|
|
18
|
+
const account = walletManager.getActiveAccount();
|
|
19
|
+
if (!account) {
|
|
20
|
+
throw new Error("Wallet is not unlocked. Use wallet_unlock first.");
|
|
21
|
+
}
|
|
22
|
+
if (!account.nostrPrivateKey) {
|
|
23
|
+
throw new Error("Nostr private key not available. Re-unlock your wallet.");
|
|
24
|
+
}
|
|
25
|
+
const sk = account.nostrPrivateKey;
|
|
26
|
+
const pubkey = getPublicKey(sk);
|
|
27
|
+
const npub = nip19.npubEncode(pubkey);
|
|
28
|
+
return { sk, pubkey, npub };
|
|
29
|
+
}
|
|
30
|
+
function resolveHexPubkey(input) {
|
|
31
|
+
if (input.startsWith("npub")) {
|
|
32
|
+
const decoded = nip19.decode(input);
|
|
33
|
+
return decoded.data;
|
|
34
|
+
}
|
|
35
|
+
return input;
|
|
36
|
+
}
|
|
37
|
+
function createPool() {
|
|
38
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
39
|
+
globalThis.WebSocket = WebSocket;
|
|
40
|
+
return new SimplePool();
|
|
41
|
+
}
|
|
42
|
+
async function publishToRelays(pool, event, relays) {
|
|
43
|
+
const results = {};
|
|
44
|
+
await Promise.allSettled(relays.map(async (relay) => {
|
|
45
|
+
try {
|
|
46
|
+
const pubPromises = pool.publish([relay], event);
|
|
47
|
+
await Promise.race([
|
|
48
|
+
...pubPromises,
|
|
49
|
+
new Promise((_, reject) => setTimeout(() => reject(new Error("timeout")), WS_TIMEOUT_MS)),
|
|
50
|
+
]);
|
|
51
|
+
results[relay] = "ok";
|
|
52
|
+
}
|
|
53
|
+
catch (err) {
|
|
54
|
+
results[relay] = `error: ${err instanceof Error ? err.message : String(err)}`;
|
|
55
|
+
}
|
|
56
|
+
}));
|
|
57
|
+
return results;
|
|
58
|
+
}
|
|
59
|
+
async function queryRelays(pool, relays, filter) {
|
|
60
|
+
return Promise.race([
|
|
61
|
+
pool.querySync(relays, filter),
|
|
62
|
+
new Promise((_, reject) => setTimeout(() => reject(new Error("query timeout")), WS_TIMEOUT_MS * 2)),
|
|
63
|
+
]);
|
|
64
|
+
}
|
|
65
|
+
// ---------------------------------------------------------------------------
|
|
66
|
+
// Tool registration
|
|
67
|
+
// ---------------------------------------------------------------------------
|
|
68
|
+
export function registerNostrTools(server) {
|
|
69
|
+
// -------------------------------------------------------------------------
|
|
70
|
+
// nostr_get_pubkey
|
|
71
|
+
// -------------------------------------------------------------------------
|
|
72
|
+
server.registerTool("nostr_get_pubkey", {
|
|
73
|
+
description: "Derive the Nostr public key from the active wallet. " +
|
|
74
|
+
"Uses the NIP-06 derivation path (m/44'/1237'/0'/0/0). " +
|
|
75
|
+
"Returns both hex pubkey and npub (bech32) formats. " +
|
|
76
|
+
"Requires an unlocked wallet.",
|
|
77
|
+
inputSchema: {},
|
|
78
|
+
}, async () => {
|
|
79
|
+
try {
|
|
80
|
+
const { pubkey, npub } = deriveNostrKeys();
|
|
81
|
+
return createJsonResponse({ pubkey, npub });
|
|
82
|
+
}
|
|
83
|
+
catch (error) {
|
|
84
|
+
return createErrorResponse(error);
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
// -------------------------------------------------------------------------
|
|
88
|
+
// nostr_post
|
|
89
|
+
// -------------------------------------------------------------------------
|
|
90
|
+
server.registerTool("nostr_post", {
|
|
91
|
+
description: "Publish a short-text note (kind:1) to Nostr relays. " +
|
|
92
|
+
"Optionally include hashtag tags and specify target relays. " +
|
|
93
|
+
"Requires an unlocked wallet.",
|
|
94
|
+
inputSchema: {
|
|
95
|
+
content: z.string().describe("The note content to publish."),
|
|
96
|
+
tags: z
|
|
97
|
+
.string()
|
|
98
|
+
.optional()
|
|
99
|
+
.describe("Comma-separated hashtags to include (e.g., 'bitcoin,nostr,aibtc'). " +
|
|
100
|
+
"Do not include the '#' prefix."),
|
|
101
|
+
relays: z
|
|
102
|
+
.array(z.string().url())
|
|
103
|
+
.optional()
|
|
104
|
+
.describe(`Relay URLs to publish to. Defaults to ${DEFAULT_RELAYS.join(", ")}.`),
|
|
105
|
+
},
|
|
106
|
+
}, async ({ content, tags, relays }) => {
|
|
107
|
+
try {
|
|
108
|
+
const { sk } = deriveNostrKeys();
|
|
109
|
+
const targetRelays = relays && relays.length > 0 ? relays : DEFAULT_RELAYS;
|
|
110
|
+
const hashtagTags = tags
|
|
111
|
+
? tags
|
|
112
|
+
.split(",")
|
|
113
|
+
.map((t) => t.trim())
|
|
114
|
+
.filter(Boolean)
|
|
115
|
+
.map((t) => ["t", t.toLowerCase()])
|
|
116
|
+
: [];
|
|
117
|
+
const template = {
|
|
118
|
+
kind: 1,
|
|
119
|
+
created_at: Math.floor(Date.now() / 1000),
|
|
120
|
+
tags: hashtagTags,
|
|
121
|
+
content,
|
|
122
|
+
};
|
|
123
|
+
const event = finalizeEvent(template, sk);
|
|
124
|
+
const pool = createPool();
|
|
125
|
+
const publishResults = await publishToRelays(pool, event, targetRelays);
|
|
126
|
+
pool.close(targetRelays);
|
|
127
|
+
return createJsonResponse({
|
|
128
|
+
eventId: event.id,
|
|
129
|
+
pubkey: event.pubkey,
|
|
130
|
+
createdAt: event.created_at,
|
|
131
|
+
content: event.content,
|
|
132
|
+
tags: event.tags,
|
|
133
|
+
relays: publishResults,
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
catch (error) {
|
|
137
|
+
return createErrorResponse(error);
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
// -------------------------------------------------------------------------
|
|
141
|
+
// nostr_read_feed
|
|
142
|
+
// -------------------------------------------------------------------------
|
|
143
|
+
server.registerTool("nostr_read_feed", {
|
|
144
|
+
description: "Read recent kind:1 notes from Nostr relays. " +
|
|
145
|
+
"Optionally filter by author pubkey. " +
|
|
146
|
+
"No wallet required.",
|
|
147
|
+
inputSchema: {
|
|
148
|
+
pubkey: z
|
|
149
|
+
.string()
|
|
150
|
+
.optional()
|
|
151
|
+
.describe("Author public key (hex or npub) to filter by."),
|
|
152
|
+
limit: z
|
|
153
|
+
.number()
|
|
154
|
+
.int()
|
|
155
|
+
.positive()
|
|
156
|
+
.optional()
|
|
157
|
+
.describe("Maximum number of notes to return (default: 20)."),
|
|
158
|
+
relay: z
|
|
159
|
+
.string()
|
|
160
|
+
.url()
|
|
161
|
+
.optional()
|
|
162
|
+
.describe("Single relay URL to query. Defaults to all DEFAULT_RELAYS."),
|
|
163
|
+
},
|
|
164
|
+
}, async ({ pubkey, limit, relay }) => {
|
|
165
|
+
try {
|
|
166
|
+
const pool = createPool();
|
|
167
|
+
const targetRelays = relay ? [relay] : DEFAULT_RELAYS;
|
|
168
|
+
const queryLimit = limit ?? 20;
|
|
169
|
+
const filter = {
|
|
170
|
+
kinds: [1],
|
|
171
|
+
limit: queryLimit,
|
|
172
|
+
};
|
|
173
|
+
if (pubkey) {
|
|
174
|
+
filter.authors = [resolveHexPubkey(pubkey)];
|
|
175
|
+
}
|
|
176
|
+
const events = await queryRelays(pool, targetRelays, filter);
|
|
177
|
+
pool.close(targetRelays);
|
|
178
|
+
// Sort descending by created_at
|
|
179
|
+
const sorted = events
|
|
180
|
+
.sort((a, b) => b.created_at - a.created_at)
|
|
181
|
+
.slice(0, queryLimit)
|
|
182
|
+
.map((e) => ({
|
|
183
|
+
id: e.id,
|
|
184
|
+
pubkey: e.pubkey,
|
|
185
|
+
npub: nip19.npubEncode(e.pubkey),
|
|
186
|
+
createdAt: e.created_at,
|
|
187
|
+
content: e.content,
|
|
188
|
+
tags: e.tags,
|
|
189
|
+
}));
|
|
190
|
+
return createJsonResponse({
|
|
191
|
+
count: sorted.length,
|
|
192
|
+
events: sorted,
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
catch (error) {
|
|
196
|
+
return createErrorResponse(error);
|
|
197
|
+
}
|
|
198
|
+
});
|
|
199
|
+
// -------------------------------------------------------------------------
|
|
200
|
+
// nostr_search_tags
|
|
201
|
+
// -------------------------------------------------------------------------
|
|
202
|
+
server.registerTool("nostr_search_tags", {
|
|
203
|
+
description: "Search Nostr for kind:1 notes matching hashtags using NIP-12 #t filter. " +
|
|
204
|
+
"No wallet required.",
|
|
205
|
+
inputSchema: {
|
|
206
|
+
tags: z
|
|
207
|
+
.string()
|
|
208
|
+
.describe("Comma-separated hashtags to search for (e.g., 'bitcoin,nostr'). " +
|
|
209
|
+
"Do not include the '#' prefix."),
|
|
210
|
+
limit: z
|
|
211
|
+
.number()
|
|
212
|
+
.int()
|
|
213
|
+
.positive()
|
|
214
|
+
.optional()
|
|
215
|
+
.describe("Maximum number of notes to return (default: 20)."),
|
|
216
|
+
relay: z
|
|
217
|
+
.string()
|
|
218
|
+
.url()
|
|
219
|
+
.optional()
|
|
220
|
+
.describe("Single relay URL to query. Defaults to all DEFAULT_RELAYS."),
|
|
221
|
+
},
|
|
222
|
+
}, async ({ tags, limit, relay }) => {
|
|
223
|
+
try {
|
|
224
|
+
const pool = createPool();
|
|
225
|
+
const targetRelays = relay ? [relay] : DEFAULT_RELAYS;
|
|
226
|
+
const queryLimit = limit ?? 20;
|
|
227
|
+
const tagList = tags
|
|
228
|
+
.split(",")
|
|
229
|
+
.map((t) => t.trim().toLowerCase())
|
|
230
|
+
.filter(Boolean);
|
|
231
|
+
const filter = {
|
|
232
|
+
kinds: [1],
|
|
233
|
+
"#t": tagList,
|
|
234
|
+
limit: queryLimit,
|
|
235
|
+
};
|
|
236
|
+
const events = await queryRelays(pool, targetRelays, filter);
|
|
237
|
+
pool.close(targetRelays);
|
|
238
|
+
const sorted = events
|
|
239
|
+
.sort((a, b) => b.created_at - a.created_at)
|
|
240
|
+
.slice(0, queryLimit)
|
|
241
|
+
.map((e) => ({
|
|
242
|
+
id: e.id,
|
|
243
|
+
pubkey: e.pubkey,
|
|
244
|
+
npub: nip19.npubEncode(e.pubkey),
|
|
245
|
+
createdAt: e.created_at,
|
|
246
|
+
content: e.content,
|
|
247
|
+
tags: e.tags,
|
|
248
|
+
}));
|
|
249
|
+
return createJsonResponse({
|
|
250
|
+
searchTags: tagList,
|
|
251
|
+
count: sorted.length,
|
|
252
|
+
events: sorted,
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
catch (error) {
|
|
256
|
+
return createErrorResponse(error);
|
|
257
|
+
}
|
|
258
|
+
});
|
|
259
|
+
// -------------------------------------------------------------------------
|
|
260
|
+
// nostr_get_profile
|
|
261
|
+
// -------------------------------------------------------------------------
|
|
262
|
+
server.registerTool("nostr_get_profile", {
|
|
263
|
+
description: "Get a Nostr profile (kind:0 metadata) for any public key. " +
|
|
264
|
+
"No wallet required.",
|
|
265
|
+
inputSchema: {
|
|
266
|
+
pubkey: z
|
|
267
|
+
.string()
|
|
268
|
+
.describe("Public key to look up (hex or npub bech32 format)."),
|
|
269
|
+
relay: z
|
|
270
|
+
.string()
|
|
271
|
+
.url()
|
|
272
|
+
.optional()
|
|
273
|
+
.describe("Single relay URL to query. Defaults to all DEFAULT_RELAYS."),
|
|
274
|
+
},
|
|
275
|
+
}, async ({ pubkey, relay }) => {
|
|
276
|
+
try {
|
|
277
|
+
const pool = createPool();
|
|
278
|
+
const targetRelays = relay ? [relay] : DEFAULT_RELAYS;
|
|
279
|
+
const hexPubkey = resolveHexPubkey(pubkey);
|
|
280
|
+
const filter = {
|
|
281
|
+
kinds: [0],
|
|
282
|
+
authors: [hexPubkey],
|
|
283
|
+
limit: 1,
|
|
284
|
+
};
|
|
285
|
+
const events = await queryRelays(pool, targetRelays, filter);
|
|
286
|
+
pool.close(targetRelays);
|
|
287
|
+
if (events.length === 0) {
|
|
288
|
+
return createJsonResponse({
|
|
289
|
+
pubkey: hexPubkey,
|
|
290
|
+
npub: nip19.npubEncode(hexPubkey),
|
|
291
|
+
found: false,
|
|
292
|
+
profile: null,
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
// Use most recent kind:0 event
|
|
296
|
+
const latest = events.sort((a, b) => b.created_at - a.created_at)[0];
|
|
297
|
+
let profile = {};
|
|
298
|
+
try {
|
|
299
|
+
profile = JSON.parse(latest.content);
|
|
300
|
+
}
|
|
301
|
+
catch {
|
|
302
|
+
// content was not valid JSON — return as-is
|
|
303
|
+
profile = { raw: latest.content };
|
|
304
|
+
}
|
|
305
|
+
return createJsonResponse({
|
|
306
|
+
pubkey: hexPubkey,
|
|
307
|
+
npub: nip19.npubEncode(hexPubkey),
|
|
308
|
+
found: true,
|
|
309
|
+
updatedAt: latest.created_at,
|
|
310
|
+
profile,
|
|
311
|
+
});
|
|
312
|
+
}
|
|
313
|
+
catch (error) {
|
|
314
|
+
return createErrorResponse(error);
|
|
315
|
+
}
|
|
316
|
+
});
|
|
317
|
+
// -------------------------------------------------------------------------
|
|
318
|
+
// nostr_set_profile
|
|
319
|
+
// -------------------------------------------------------------------------
|
|
320
|
+
server.registerTool("nostr_set_profile", {
|
|
321
|
+
description: "Update the agent's Nostr profile (kind:0 metadata event). " +
|
|
322
|
+
"Only provided fields are updated; existing fields are preserved by fetching " +
|
|
323
|
+
"the current profile first. " +
|
|
324
|
+
"Requires an unlocked wallet.",
|
|
325
|
+
inputSchema: {
|
|
326
|
+
name: z.string().optional().describe("Display name."),
|
|
327
|
+
about: z.string().optional().describe("Bio / about text."),
|
|
328
|
+
picture: z.string().url().optional().describe("Profile picture URL."),
|
|
329
|
+
website: z.string().url().optional().describe("Website URL."),
|
|
330
|
+
nip05: z
|
|
331
|
+
.string()
|
|
332
|
+
.optional()
|
|
333
|
+
.describe("NIP-05 identifier (e.g., user@example.com)."),
|
|
334
|
+
relays: z
|
|
335
|
+
.array(z.string().url())
|
|
336
|
+
.optional()
|
|
337
|
+
.describe(`Relay URLs to publish to. Defaults to ${DEFAULT_RELAYS.join(", ")}.`),
|
|
338
|
+
},
|
|
339
|
+
}, async ({ name, about, picture, website, nip05, relays }) => {
|
|
340
|
+
try {
|
|
341
|
+
const { sk, pubkey } = deriveNostrKeys();
|
|
342
|
+
const targetRelays = relays && relays.length > 0 ? relays : DEFAULT_RELAYS;
|
|
343
|
+
const pool = createPool();
|
|
344
|
+
// Fetch existing profile to preserve fields
|
|
345
|
+
let existingProfile = {};
|
|
346
|
+
try {
|
|
347
|
+
const existing = await queryRelays(pool, targetRelays, {
|
|
348
|
+
kinds: [0],
|
|
349
|
+
authors: [pubkey],
|
|
350
|
+
limit: 1,
|
|
351
|
+
});
|
|
352
|
+
if (existing.length > 0) {
|
|
353
|
+
const latest = existing.sort((a, b) => b.created_at - a.created_at)[0];
|
|
354
|
+
existingProfile = JSON.parse(latest.content);
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
catch {
|
|
358
|
+
// Ignore fetch errors — publish with just the new fields
|
|
359
|
+
}
|
|
360
|
+
// Merge: only override fields that were explicitly provided
|
|
361
|
+
const updates = {};
|
|
362
|
+
if (name !== undefined)
|
|
363
|
+
updates.name = name;
|
|
364
|
+
if (about !== undefined)
|
|
365
|
+
updates.about = about;
|
|
366
|
+
if (picture !== undefined)
|
|
367
|
+
updates.picture = picture;
|
|
368
|
+
if (website !== undefined)
|
|
369
|
+
updates.website = website;
|
|
370
|
+
if (nip05 !== undefined)
|
|
371
|
+
updates.nip05 = nip05;
|
|
372
|
+
const mergedProfile = { ...existingProfile, ...updates };
|
|
373
|
+
const template = {
|
|
374
|
+
kind: 0,
|
|
375
|
+
created_at: Math.floor(Date.now() / 1000),
|
|
376
|
+
tags: [],
|
|
377
|
+
content: JSON.stringify(mergedProfile),
|
|
378
|
+
};
|
|
379
|
+
const event = finalizeEvent(template, sk);
|
|
380
|
+
const publishResults = await publishToRelays(pool, event, targetRelays);
|
|
381
|
+
pool.close(targetRelays);
|
|
382
|
+
return createJsonResponse({
|
|
383
|
+
eventId: event.id,
|
|
384
|
+
pubkey: event.pubkey,
|
|
385
|
+
createdAt: event.created_at,
|
|
386
|
+
profile: mergedProfile,
|
|
387
|
+
relays: publishResults,
|
|
388
|
+
});
|
|
389
|
+
}
|
|
390
|
+
catch (error) {
|
|
391
|
+
return createErrorResponse(error);
|
|
392
|
+
}
|
|
393
|
+
});
|
|
394
|
+
// -------------------------------------------------------------------------
|
|
395
|
+
// nostr_relay_list
|
|
396
|
+
// -------------------------------------------------------------------------
|
|
397
|
+
server.registerTool("nostr_relay_list", {
|
|
398
|
+
description: "List the configured default Nostr relay URLs. No wallet required.",
|
|
399
|
+
inputSchema: {},
|
|
400
|
+
}, async () => {
|
|
401
|
+
try {
|
|
402
|
+
return createJsonResponse({ relays: DEFAULT_RELAYS });
|
|
403
|
+
}
|
|
404
|
+
catch (error) {
|
|
405
|
+
return createErrorResponse(error);
|
|
406
|
+
}
|
|
407
|
+
});
|
|
408
|
+
}
|
|
409
|
+
//# sourceMappingURL=nostr.tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nostr.tools.js","sourceRoot":"","sources":["../../src/tools/nostr.tools.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,SAAS,MAAM,IAAI,CAAC;AAC3B,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EACL,aAAa,EACb,YAAY,GAGb,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAG9C,8EAA8E;AAC9E,YAAY;AACZ,8EAA8E;AAE9E,MAAM,cAAc,GAAG,CAAC,sBAAsB,EAAE,eAAe,CAAC,CAAC;AACjE,MAAM,aAAa,GAAG,MAAM,CAAC;AAE7B,8EAA8E;AAC9E,mBAAmB;AACnB,8EAA8E;AAE9E,SAAS,eAAe;IACtB,MAAM,aAAa,GAAG,gBAAgB,EAAE,CAAC;IACzC,MAAM,OAAO,GAAG,aAAa,CAAC,gBAAgB,EAAE,CAAC;IACjD,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAC;IACtE,CAAC;IACD,IAAI,CAAC,OAAO,CAAC,eAAe,EAAE,CAAC;QAC7B,MAAM,IAAI,KAAK,CAAC,yDAAyD,CAAC,CAAC;IAC7E,CAAC;IACD,MAAM,EAAE,GAAG,OAAO,CAAC,eAAe,CAAC;IACnC,MAAM,MAAM,GAAG,YAAY,CAAC,EAAE,CAAC,CAAC;IAChC,MAAM,IAAI,GAAG,KAAK,CAAC,UAAU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MCP tools for peer-to-peer ordinals trading via the public trade ledger at ledger.drx4.xyz.
|
|
5
|
+
* Supports listing trades, creating offers, countering, transferring, cancelling, and
|
|
6
|
+
* recording PSBT atomic swaps. All write operations are authenticated with BIP-137 signatures.
|
|
7
|
+
*
|
|
8
|
+
* Tools:
|
|
9
|
+
* - ordinals_p2p_list_trades: Browse trade ledger with optional filters
|
|
10
|
+
* - ordinals_p2p_get_trade: Fetch full details for a single trade
|
|
11
|
+
* - ordinals_p2p_my_trades: List trades for the active wallet's BTC address
|
|
12
|
+
* - ordinals_p2p_agents: List active agents on the ledger
|
|
13
|
+
* - ordinals_p2p_create_offer: Post a new inscription offer (BIP-137 signed)
|
|
14
|
+
* - ordinals_p2p_counter: Counter an existing offer (BIP-137 signed)
|
|
15
|
+
* - ordinals_p2p_transfer: Record a completed transfer (BIP-137 signed)
|
|
16
|
+
* - ordinals_p2p_cancel: Cancel an open offer or counter (BIP-137 signed)
|
|
17
|
+
* - ordinals_p2p_psbt_swap: Record a completed PSBT atomic swap (BIP-137 signed)
|
|
18
|
+
*/
|
|
19
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
20
|
+
export declare function registerOrdinalsP2PTools(server: McpServer): void;
|
|
21
|
+
//# sourceMappingURL=ordinals-p2p.tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ordinals-p2p.tools.d.ts","sourceRoot":"","sources":["../../src/tools/ordinals-p2p.tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAkMpE,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CA+ehE"}
|