@aibtc/mcp-server 1.70.1 → 1.72.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/README.md +45 -8
- package/dist/bridge/index.js +4 -4
- package/dist/config/contracts.d.ts +4 -4
- package/dist/config/contracts.js +2 -2
- package/dist/config/networks.js +4 -1
- package/dist/endpoints/registry.d.ts +8 -26
- package/dist/endpoints/registry.js +7 -932
- package/dist/index.js +118 -42
- package/dist/services/stacking.service.d.ts +144 -45
- package/dist/services/stacking.service.js +416 -123
- package/dist/services/x402-discovery.service.d.ts +81 -0
- package/dist/services/x402-discovery.service.js +170 -0
- package/dist/tools/arxiv-research.tools.d.ts +1 -1
- package/dist/tools/arxiv-research.tools.js +6 -6
- package/dist/tools/at-stake-legion.tools.d.ts +1 -1
- package/dist/tools/at-stake-legion.tools.js +14 -14
- package/dist/tools/at-stake.tools.d.ts +1 -1
- package/dist/tools/at-stake.tools.js +17 -17
- package/dist/tools/bitcoin.tools.d.ts +1 -1
- package/dist/tools/bitcoin.tools.js +12 -12
- package/dist/tools/bitflow.tools.d.ts +1 -1
- package/dist/tools/bitflow.tools.js +21 -21
- package/dist/tools/bns.tools.d.ts +1 -1
- package/dist/tools/bns.tools.js +18 -18
- package/dist/tools/bounty-hint.d.ts +1 -1
- package/dist/tools/bounty-scanner.tools.d.ts +1 -1
- package/dist/tools/bounty-scanner.tools.js +20 -20
- package/dist/tools/child-inscription.tools.d.ts +1 -1
- package/dist/tools/child-inscription.tools.js +6 -6
- package/dist/tools/competition.tools.d.ts +1 -1
- package/dist/tools/competition.tools.js +4 -4
- package/dist/tools/contract.tools.d.ts +1 -1
- package/dist/tools/contract.tools.js +8 -8
- package/dist/tools/credentials.tools.d.ts +1 -1
- package/dist/tools/credentials.tools.js +8 -8
- package/dist/tools/defi.tools.d.ts +1 -1
- package/dist/tools/defi.tools.js +21 -21
- package/dist/tools/dual-stacking.tools.d.ts +1 -1
- package/dist/tools/dual-stacking.tools.js +7 -7
- package/dist/tools/earning.tools.d.ts +1 -1
- package/dist/tools/earning.tools.js +5 -5
- package/dist/tools/endpoint.tools.d.ts +1 -1
- package/dist/tools/endpoint.tools.js +92 -49
- package/dist/tools/identity.tools.d.ts +1 -1
- package/dist/tools/identity.tools.js +19 -19
- package/dist/tools/inbox-x402.tools.d.ts +1 -1
- package/dist/tools/inbox-x402.tools.js +2 -2
- package/dist/tools/inbox.tools.d.ts +1 -1
- package/dist/tools/inbox.tools.js +2 -2
- package/dist/tools/index.d.ts +6 -3
- package/dist/tools/index.js +69 -58
- package/dist/tools/inference-marketplace.tools.d.ts +1 -1
- package/dist/tools/inference-marketplace.tools.js +10 -10
- package/dist/tools/jingswap.tools.d.ts +1 -1
- package/dist/tools/jingswap.tools.js +30 -30
- package/dist/tools/legion.tools.d.ts +1 -1
- package/dist/tools/legion.tools.js +20 -20
- package/dist/tools/lightning.tools.d.ts +1 -1
- package/dist/tools/lightning.tools.js +14 -14
- package/dist/tools/mempool.tools.d.ts +1 -1
- package/dist/tools/mempool.tools.js +5 -5
- package/dist/tools/news.tools.d.ts +1 -1
- package/dist/tools/news.tools.js +2 -1
- package/dist/tools/nft.tools.d.ts +1 -1
- package/dist/tools/nft.tools.js +12 -12
- package/dist/tools/nonce.tools.d.ts +1 -1
- package/dist/tools/nonce.tools.js +8 -8
- package/dist/tools/nostr.tools.d.ts +1 -1
- package/dist/tools/nostr.tools.js +12 -12
- package/dist/tools/openrouter.tools.d.ts +1 -1
- package/dist/tools/openrouter.tools.js +4 -4
- package/dist/tools/ordinals-marketplace.tools.d.ts +1 -1
- package/dist/tools/ordinals-marketplace.tools.js +10 -10
- package/dist/tools/ordinals-p2p.tools.d.ts +1 -1
- package/dist/tools/ordinals-p2p.tools.js +18 -18
- package/dist/tools/ordinals.tools.d.ts +1 -1
- package/dist/tools/ordinals.tools.js +8 -8
- package/dist/tools/pillar-direct.tools.d.ts +1 -1
- package/dist/tools/pillar-direct.tools.js +59 -38
- package/dist/tools/pillar.tools.d.ts +1 -1
- package/dist/tools/pillar.tools.js +28 -26
- package/dist/tools/profiles.d.ts +51 -0
- package/dist/tools/profiles.js +111 -0
- package/dist/tools/psbt.tools.d.ts +1 -1
- package/dist/tools/psbt.tools.js +8 -8
- package/dist/tools/query.tools.d.ts +1 -1
- package/dist/tools/query.tools.js +12 -12
- package/dist/tools/relay-diagnostic.tools.d.ts +1 -1
- package/dist/tools/relay-diagnostic.tools.js +3 -3
- package/dist/tools/reputation.tools.d.ts +1 -1
- package/dist/tools/reputation.tools.js +22 -22
- package/dist/tools/runes.tools.d.ts +1 -1
- package/dist/tools/runes.tools.js +18 -18
- package/dist/tools/sbtc.tools.d.ts +1 -1
- package/dist/tools/sbtc.tools.js +14 -33
- package/dist/tools/scaffold.tools.d.ts +1 -1
- package/dist/tools/scaffold.tools.js +4 -4
- package/dist/tools/settings.tools.d.ts +1 -1
- package/dist/tools/settings.tools.js +9 -9
- package/dist/tools/signing.tools.d.ts +1 -1
- package/dist/tools/signing.tools.js +20 -20
- package/dist/tools/skill-mappings.js +4 -0
- package/dist/tools/souldinals.tools.d.ts +1 -1
- package/dist/tools/souldinals.tools.js +10 -10
- package/dist/tools/stacking-lottery.tools.d.ts +1 -1
- package/dist/tools/stacking-lottery.tools.js +11 -11
- package/dist/tools/stacking.tools.d.ts +1 -1
- package/dist/tools/stacking.tools.js +358 -50
- package/dist/tools/stacks-market.tools.d.ts +1 -1
- package/dist/tools/stacks-market.tools.js +22 -22
- package/dist/tools/styx.tools.d.ts +1 -1
- package/dist/tools/styx.tools.js +11 -11
- package/dist/tools/taproot-multisig.tools.d.ts +1 -1
- package/dist/tools/taproot-multisig.tools.js +5 -5
- package/dist/tools/tenero.tools.d.ts +1 -1
- package/dist/tools/tenero.tools.js +22 -22
- package/dist/tools/tokens.tools.d.ts +1 -1
- package/dist/tools/tokens.tools.js +10 -10
- package/dist/tools/transfer.tools.d.ts +1 -1
- package/dist/tools/transfer.tools.js +4 -4
- package/dist/tools/wallet-management.tools.d.ts +1 -1
- package/dist/tools/wallet-management.tools.js +16 -16
- package/dist/tools/wallet.tools.d.ts +1 -1
- package/dist/tools/wallet.tools.js +2 -2
- package/dist/tools/yield-dashboard.tools.d.ts +1 -1
- package/dist/tools/yield-dashboard.tools.js +18 -27
- package/dist/tools/yield-hunter.tools.d.ts +1 -1
- package/dist/tools/yield-hunter.tools.js +6 -6
- package/dist/utils/bitcoin.d.ts +8 -0
- package/dist/utils/bitcoin.js +24 -0
- package/dist/utils/fee.js +1 -1
- package/package.json +8 -7
- package/skill/SKILL.md +1 -1
- package/skill/references/stacks-defi.md +1 -1
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
2
|
+
* Static x402 endpoint entries for hosts that do not publish an OpenAPI spec.
|
|
3
|
+
*
|
|
4
|
+
* x402.aibtc.com and stx402.com publish `openapi.json`, so their endpoints are
|
|
5
|
+
* discovered live (see services/x402-discovery.service.ts) instead of listed here.
|
|
4
6
|
*/
|
|
5
7
|
// =============================================================================
|
|
6
8
|
// x402.biwas.xyz ENDPOINTS
|
|
@@ -243,228 +245,6 @@ const BIWAS_FREE_ENDPOINTS = [
|
|
|
243
245
|
},
|
|
244
246
|
];
|
|
245
247
|
// =============================================================================
|
|
246
|
-
// x402.aibtc.com ENDPOINTS
|
|
247
|
-
// =============================================================================
|
|
248
|
-
const AIBTC_PAID_ENDPOINTS = [
|
|
249
|
-
// Inference
|
|
250
|
-
{
|
|
251
|
-
path: "/inference/openrouter/chat",
|
|
252
|
-
method: "POST",
|
|
253
|
-
description: "Chat completion via OpenRouter (Claude, GPT-4, etc.)",
|
|
254
|
-
cost: "Dynamic",
|
|
255
|
-
category: "Inference",
|
|
256
|
-
source: "x402.aibtc.com",
|
|
257
|
-
body: { model: "Model name", messages: "Chat messages array" },
|
|
258
|
-
},
|
|
259
|
-
{
|
|
260
|
-
path: "/inference/cloudflare/chat",
|
|
261
|
-
method: "POST",
|
|
262
|
-
description: "Chat completion via Cloudflare Workers AI",
|
|
263
|
-
cost: "Dynamic",
|
|
264
|
-
category: "Inference",
|
|
265
|
-
source: "x402.aibtc.com",
|
|
266
|
-
body: { model: "Model name", messages: "Chat messages array" },
|
|
267
|
-
},
|
|
268
|
-
// Stacks Utilities
|
|
269
|
-
{
|
|
270
|
-
path: "/stacks/address",
|
|
271
|
-
method: "POST",
|
|
272
|
-
description: "Convert Stacks address between networks",
|
|
273
|
-
cost: "0.001 STX",
|
|
274
|
-
category: "Stacks Utilities",
|
|
275
|
-
source: "x402.aibtc.com",
|
|
276
|
-
body: { address: "Stacks address" },
|
|
277
|
-
},
|
|
278
|
-
{
|
|
279
|
-
path: "/stacks/decode",
|
|
280
|
-
method: "POST",
|
|
281
|
-
description: "Decode raw Stacks transaction",
|
|
282
|
-
cost: "0.001 STX",
|
|
283
|
-
category: "Stacks Utilities",
|
|
284
|
-
source: "x402.aibtc.com",
|
|
285
|
-
body: { tx: "Raw transaction hex" },
|
|
286
|
-
},
|
|
287
|
-
{
|
|
288
|
-
path: "/stacks/profile",
|
|
289
|
-
method: "POST",
|
|
290
|
-
description: "Get aggregated profile data (BNS, balances, NFTs)",
|
|
291
|
-
cost: "0.001 STX",
|
|
292
|
-
category: "Stacks Utilities",
|
|
293
|
-
source: "x402.aibtc.com",
|
|
294
|
-
body: { address: "Stacks address" },
|
|
295
|
-
},
|
|
296
|
-
// Hashing
|
|
297
|
-
{
|
|
298
|
-
path: "/hashing/sha256",
|
|
299
|
-
method: "POST",
|
|
300
|
-
description: "SHA-256 hash",
|
|
301
|
-
cost: "0.0005 STX",
|
|
302
|
-
category: "Hashing",
|
|
303
|
-
source: "x402.aibtc.com",
|
|
304
|
-
body: { data: "Data to hash" },
|
|
305
|
-
},
|
|
306
|
-
{
|
|
307
|
-
path: "/hashing/keccak256",
|
|
308
|
-
method: "POST",
|
|
309
|
-
description: "Keccak-256 hash",
|
|
310
|
-
cost: "0.0005 STX",
|
|
311
|
-
category: "Hashing",
|
|
312
|
-
source: "x402.aibtc.com",
|
|
313
|
-
body: { data: "Data to hash" },
|
|
314
|
-
},
|
|
315
|
-
{
|
|
316
|
-
path: "/hashing/hash160",
|
|
317
|
-
method: "POST",
|
|
318
|
-
description: "RIPEMD160(SHA256) hash",
|
|
319
|
-
cost: "0.0005 STX",
|
|
320
|
-
category: "Hashing",
|
|
321
|
-
source: "x402.aibtc.com",
|
|
322
|
-
body: { data: "Data to hash" },
|
|
323
|
-
},
|
|
324
|
-
// Storage - KV
|
|
325
|
-
{
|
|
326
|
-
path: "/storage/kv/set",
|
|
327
|
-
method: "POST",
|
|
328
|
-
description: "Store key-value pair",
|
|
329
|
-
cost: "0.001 STX",
|
|
330
|
-
category: "Storage",
|
|
331
|
-
source: "x402.aibtc.com",
|
|
332
|
-
body: { key: "Key name", value: "Value", ttl: "TTL in seconds (optional)" },
|
|
333
|
-
},
|
|
334
|
-
{
|
|
335
|
-
path: "/storage/kv/get",
|
|
336
|
-
method: "POST",
|
|
337
|
-
description: "Retrieve value by key",
|
|
338
|
-
cost: "0.0005 STX",
|
|
339
|
-
category: "Storage",
|
|
340
|
-
source: "x402.aibtc.com",
|
|
341
|
-
body: { key: "Key name" },
|
|
342
|
-
},
|
|
343
|
-
{
|
|
344
|
-
path: "/storage/kv/delete",
|
|
345
|
-
method: "POST",
|
|
346
|
-
description: "Delete key-value pair",
|
|
347
|
-
cost: "0.0005 STX",
|
|
348
|
-
category: "Storage",
|
|
349
|
-
source: "x402.aibtc.com",
|
|
350
|
-
body: { key: "Key name" },
|
|
351
|
-
},
|
|
352
|
-
// Storage - Paste
|
|
353
|
-
{
|
|
354
|
-
path: "/storage/paste/create",
|
|
355
|
-
method: "POST",
|
|
356
|
-
description: "Create a paste/snippet",
|
|
357
|
-
cost: "0.001 STX",
|
|
358
|
-
category: "Storage",
|
|
359
|
-
source: "x402.aibtc.com",
|
|
360
|
-
body: { content: "Content", language: "Language (optional)" },
|
|
361
|
-
},
|
|
362
|
-
{
|
|
363
|
-
path: "/storage/paste/get",
|
|
364
|
-
method: "POST",
|
|
365
|
-
description: "Retrieve paste by ID",
|
|
366
|
-
cost: "0.0005 STX",
|
|
367
|
-
category: "Storage",
|
|
368
|
-
source: "x402.aibtc.com",
|
|
369
|
-
body: { id: "Paste ID" },
|
|
370
|
-
},
|
|
371
|
-
// Storage - DB
|
|
372
|
-
{
|
|
373
|
-
path: "/storage/db/query",
|
|
374
|
-
method: "POST",
|
|
375
|
-
description: "Execute read-only SELECT query",
|
|
376
|
-
cost: "0.001 STX",
|
|
377
|
-
category: "Storage",
|
|
378
|
-
source: "x402.aibtc.com",
|
|
379
|
-
body: { sql: "SELECT query" },
|
|
380
|
-
},
|
|
381
|
-
{
|
|
382
|
-
path: "/storage/db/execute",
|
|
383
|
-
method: "POST",
|
|
384
|
-
description: "Execute write operations (INSERT, UPDATE, DELETE)",
|
|
385
|
-
cost: "0.001 STX",
|
|
386
|
-
category: "Storage",
|
|
387
|
-
source: "x402.aibtc.com",
|
|
388
|
-
body: { sql: "SQL statement" },
|
|
389
|
-
},
|
|
390
|
-
// Storage - Memory
|
|
391
|
-
{
|
|
392
|
-
path: "/storage/memory/store",
|
|
393
|
-
method: "POST",
|
|
394
|
-
description: "Store memory with optional embedding",
|
|
395
|
-
cost: "0.002 STX",
|
|
396
|
-
category: "Storage",
|
|
397
|
-
source: "x402.aibtc.com",
|
|
398
|
-
body: { key: "Memory key", content: "Content", embed: "Generate embedding (bool)" },
|
|
399
|
-
},
|
|
400
|
-
{
|
|
401
|
-
path: "/storage/memory/recall",
|
|
402
|
-
method: "POST",
|
|
403
|
-
description: "Retrieve memory by key",
|
|
404
|
-
cost: "0.0005 STX",
|
|
405
|
-
category: "Storage",
|
|
406
|
-
source: "x402.aibtc.com",
|
|
407
|
-
body: { key: "Memory key" },
|
|
408
|
-
},
|
|
409
|
-
{
|
|
410
|
-
path: "/storage/memory/search",
|
|
411
|
-
method: "POST",
|
|
412
|
-
description: "Semantic search across memories",
|
|
413
|
-
cost: "0.002 STX",
|
|
414
|
-
category: "Storage",
|
|
415
|
-
source: "x402.aibtc.com",
|
|
416
|
-
body: { query: "Search query", limit: "Max results" },
|
|
417
|
-
},
|
|
418
|
-
];
|
|
419
|
-
const AIBTC_FREE_ENDPOINTS = [
|
|
420
|
-
{
|
|
421
|
-
path: "/health",
|
|
422
|
-
method: "GET",
|
|
423
|
-
description: "Service health status",
|
|
424
|
-
cost: "FREE",
|
|
425
|
-
category: "System",
|
|
426
|
-
source: "x402.aibtc.com",
|
|
427
|
-
},
|
|
428
|
-
];
|
|
429
|
-
// =============================================================================
|
|
430
|
-
// stx402.com ENDPOINTS
|
|
431
|
-
// =============================================================================
|
|
432
|
-
const STX402_FREE_ENDPOINTS = [
|
|
433
|
-
{
|
|
434
|
-
path: "/health",
|
|
435
|
-
method: "GET",
|
|
436
|
-
description: "Service health status",
|
|
437
|
-
cost: "FREE",
|
|
438
|
-
category: "System",
|
|
439
|
-
source: "stx402.com",
|
|
440
|
-
},
|
|
441
|
-
{
|
|
442
|
-
path: "/registry/list",
|
|
443
|
-
method: "GET",
|
|
444
|
-
description: "List all registered x402 endpoints",
|
|
445
|
-
cost: "FREE",
|
|
446
|
-
category: "Registry",
|
|
447
|
-
source: "stx402.com",
|
|
448
|
-
},
|
|
449
|
-
{
|
|
450
|
-
path: "/links/expand/{slug}",
|
|
451
|
-
method: "GET",
|
|
452
|
-
description: "Expand short link with click tracking",
|
|
453
|
-
cost: "FREE",
|
|
454
|
-
category: "Links",
|
|
455
|
-
source: "stx402.com",
|
|
456
|
-
params: { slug: "Short link slug" },
|
|
457
|
-
},
|
|
458
|
-
{
|
|
459
|
-
path: "/agent/registry",
|
|
460
|
-
method: "GET",
|
|
461
|
-
description: "Agent registry contract info (ERC-8004)",
|
|
462
|
-
cost: "FREE",
|
|
463
|
-
category: "Agent Registry",
|
|
464
|
-
source: "stx402.com",
|
|
465
|
-
},
|
|
466
|
-
];
|
|
467
|
-
// =============================================================================
|
|
468
248
|
// aibtc.com ENDPOINTS (Inbox Messaging)
|
|
469
249
|
// =============================================================================
|
|
470
250
|
const AIBTC_INBOX_FREE_ENDPOINTS = [
|
|
@@ -499,630 +279,14 @@ const AIBTC_INBOX_PAID_ENDPOINTS = [
|
|
|
499
279
|
body: { from: "Sender address or identifier", message: "Message content" },
|
|
500
280
|
},
|
|
501
281
|
];
|
|
502
|
-
const
|
|
503
|
-
// Data Operations
|
|
504
|
-
{
|
|
505
|
-
path: "/data/json-minify",
|
|
506
|
-
method: "POST",
|
|
507
|
-
description: "Remove JSON whitespace and minify",
|
|
508
|
-
cost: "Paid",
|
|
509
|
-
category: "Data Operations",
|
|
510
|
-
source: "stx402.com",
|
|
511
|
-
body: { json: "JSON string to minify" },
|
|
512
|
-
},
|
|
513
|
-
{
|
|
514
|
-
path: "/data/json-validate",
|
|
515
|
-
method: "POST",
|
|
516
|
-
description: "Validate JSON syntax",
|
|
517
|
-
cost: "Paid",
|
|
518
|
-
category: "Data Operations",
|
|
519
|
-
source: "stx402.com",
|
|
520
|
-
body: { json: "JSON string to validate" },
|
|
521
|
-
},
|
|
522
|
-
// Stacks Blockchain
|
|
523
|
-
{
|
|
524
|
-
path: "/stacks/convert-address/{address}",
|
|
525
|
-
method: "GET",
|
|
526
|
-
description: "Convert Stacks address between networks",
|
|
527
|
-
cost: "Paid",
|
|
528
|
-
category: "Stacks Blockchain",
|
|
529
|
-
source: "stx402.com",
|
|
530
|
-
params: { address: "Stacks address" },
|
|
531
|
-
},
|
|
532
|
-
{
|
|
533
|
-
path: "/stacks/decode-clarity-hex",
|
|
534
|
-
method: "POST",
|
|
535
|
-
description: "Decode Clarity hex values",
|
|
536
|
-
cost: "Paid",
|
|
537
|
-
category: "Stacks Blockchain",
|
|
538
|
-
source: "stx402.com",
|
|
539
|
-
body: { hex: "Clarity hex value" },
|
|
540
|
-
},
|
|
541
|
-
{
|
|
542
|
-
path: "/stacks/to-consensus-buff",
|
|
543
|
-
method: "POST",
|
|
544
|
-
description: "Serialize Clarity value to consensus buffer",
|
|
545
|
-
cost: "Paid",
|
|
546
|
-
category: "Stacks Blockchain",
|
|
547
|
-
source: "stx402.com",
|
|
548
|
-
body: { value: "Clarity value" },
|
|
549
|
-
},
|
|
550
|
-
{
|
|
551
|
-
path: "/stacks/from-consensus-buff",
|
|
552
|
-
method: "POST",
|
|
553
|
-
description: "Deserialize from consensus buffer",
|
|
554
|
-
cost: "Paid",
|
|
555
|
-
category: "Stacks Blockchain",
|
|
556
|
-
source: "stx402.com",
|
|
557
|
-
body: { buffer: "Consensus buffer hex" },
|
|
558
|
-
},
|
|
559
|
-
{
|
|
560
|
-
path: "/stacks/decode-tx",
|
|
561
|
-
method: "POST",
|
|
562
|
-
description: "Decode raw Stacks transaction",
|
|
563
|
-
cost: "Paid",
|
|
564
|
-
category: "Stacks Blockchain",
|
|
565
|
-
source: "stx402.com",
|
|
566
|
-
body: { tx: "Raw transaction hex" },
|
|
567
|
-
},
|
|
568
|
-
{
|
|
569
|
-
path: "/stacks/profile/{address}",
|
|
570
|
-
method: "GET",
|
|
571
|
-
description: "Aggregated profile data (BNS, balances, NFT counts)",
|
|
572
|
-
cost: "Paid",
|
|
573
|
-
category: "Stacks Blockchain",
|
|
574
|
-
source: "stx402.com",
|
|
575
|
-
params: { address: "Stacks address" },
|
|
576
|
-
},
|
|
577
|
-
{
|
|
578
|
-
path: "/stacks/contract-info/{contract_id}",
|
|
579
|
-
method: "GET",
|
|
580
|
-
description: "Contract source code and ABI",
|
|
581
|
-
cost: "Paid",
|
|
582
|
-
category: "Stacks Blockchain",
|
|
583
|
-
source: "stx402.com",
|
|
584
|
-
params: { contract_id: "Contract ID (address.name)" },
|
|
585
|
-
},
|
|
586
|
-
// AI Services
|
|
587
|
-
{
|
|
588
|
-
path: "/ai/dad-joke",
|
|
589
|
-
method: "GET",
|
|
590
|
-
description: "Generate a dad joke",
|
|
591
|
-
cost: "Paid",
|
|
592
|
-
category: "AI Services",
|
|
593
|
-
source: "stx402.com",
|
|
594
|
-
},
|
|
595
|
-
{
|
|
596
|
-
path: "/ai/image-describe",
|
|
597
|
-
method: "POST",
|
|
598
|
-
description: "Vision analysis - describe an image",
|
|
599
|
-
cost: "Paid",
|
|
600
|
-
category: "AI Services",
|
|
601
|
-
source: "stx402.com",
|
|
602
|
-
body: { image: "Image URL or base64" },
|
|
603
|
-
},
|
|
604
|
-
{
|
|
605
|
-
path: "/ai/tts",
|
|
606
|
-
method: "POST",
|
|
607
|
-
description: "Text-to-speech (English/Spanish)",
|
|
608
|
-
cost: "Paid",
|
|
609
|
-
category: "AI Services",
|
|
610
|
-
source: "stx402.com",
|
|
611
|
-
body: { text: "Text to speak", language: "en | es" },
|
|
612
|
-
},
|
|
613
|
-
{
|
|
614
|
-
path: "/ai/summarize",
|
|
615
|
-
method: "POST",
|
|
616
|
-
description: "Summarize text content",
|
|
617
|
-
cost: "Paid",
|
|
618
|
-
category: "AI Services",
|
|
619
|
-
source: "stx402.com",
|
|
620
|
-
body: { text: "Text to summarize" },
|
|
621
|
-
},
|
|
622
|
-
{
|
|
623
|
-
path: "/ai/generate-image",
|
|
624
|
-
method: "POST",
|
|
625
|
-
description: "Generate image from text (Flux model)",
|
|
626
|
-
cost: "Paid",
|
|
627
|
-
category: "AI Services",
|
|
628
|
-
source: "stx402.com",
|
|
629
|
-
body: { prompt: "Image description" },
|
|
630
|
-
},
|
|
631
|
-
{
|
|
632
|
-
path: "/ai/explain-contract/{contract_id}",
|
|
633
|
-
method: "GET",
|
|
634
|
-
description: "AI explanation of smart contract",
|
|
635
|
-
cost: "Paid",
|
|
636
|
-
category: "AI Services",
|
|
637
|
-
source: "stx402.com",
|
|
638
|
-
params: { contract_id: "Contract ID (address.name)" },
|
|
639
|
-
},
|
|
640
|
-
{
|
|
641
|
-
path: "/ai/translate",
|
|
642
|
-
method: "POST",
|
|
643
|
-
description: "Multi-language translation",
|
|
644
|
-
cost: "Paid",
|
|
645
|
-
category: "AI Services",
|
|
646
|
-
source: "stx402.com",
|
|
647
|
-
body: { text: "Text to translate", target: "Target language" },
|
|
648
|
-
},
|
|
649
|
-
{
|
|
650
|
-
path: "/ai/sentiment",
|
|
651
|
-
method: "POST",
|
|
652
|
-
description: "Sentiment analysis of text",
|
|
653
|
-
cost: "Paid",
|
|
654
|
-
category: "AI Services",
|
|
655
|
-
source: "stx402.com",
|
|
656
|
-
body: { text: "Text to analyze" },
|
|
657
|
-
},
|
|
658
|
-
{
|
|
659
|
-
path: "/ai/keywords",
|
|
660
|
-
method: "POST",
|
|
661
|
-
description: "Extract keywords from text",
|
|
662
|
-
cost: "Paid",
|
|
663
|
-
category: "AI Services",
|
|
664
|
-
source: "stx402.com",
|
|
665
|
-
body: { text: "Text to extract keywords from" },
|
|
666
|
-
},
|
|
667
|
-
{
|
|
668
|
-
path: "/ai/language-detect",
|
|
669
|
-
method: "POST",
|
|
670
|
-
description: "Detect language of text",
|
|
671
|
-
cost: "Paid",
|
|
672
|
-
category: "AI Services",
|
|
673
|
-
source: "stx402.com",
|
|
674
|
-
body: { text: "Text to detect" },
|
|
675
|
-
},
|
|
676
|
-
{
|
|
677
|
-
path: "/ai/paraphrase",
|
|
678
|
-
method: "POST",
|
|
679
|
-
description: "Paraphrase text in different styles",
|
|
680
|
-
cost: "Paid",
|
|
681
|
-
category: "AI Services",
|
|
682
|
-
source: "stx402.com",
|
|
683
|
-
body: { text: "Text to paraphrase", style: "Style" },
|
|
684
|
-
},
|
|
685
|
-
{
|
|
686
|
-
path: "/ai/grammar-check",
|
|
687
|
-
method: "POST",
|
|
688
|
-
description: "Check and correct grammar",
|
|
689
|
-
cost: "Paid",
|
|
690
|
-
category: "AI Services",
|
|
691
|
-
source: "stx402.com",
|
|
692
|
-
body: { text: "Text to check" },
|
|
693
|
-
},
|
|
694
|
-
{
|
|
695
|
-
path: "/ai/question-answer",
|
|
696
|
-
method: "POST",
|
|
697
|
-
description: "Answer questions based on context",
|
|
698
|
-
cost: "Paid",
|
|
699
|
-
category: "AI Services",
|
|
700
|
-
source: "stx402.com",
|
|
701
|
-
body: { context: "Context text", question: "Question" },
|
|
702
|
-
},
|
|
703
|
-
// Cryptography
|
|
704
|
-
{
|
|
705
|
-
path: "/hash/sha256",
|
|
706
|
-
method: "POST",
|
|
707
|
-
description: "SHA-256 hash",
|
|
708
|
-
cost: "Paid",
|
|
709
|
-
category: "Cryptography",
|
|
710
|
-
source: "stx402.com",
|
|
711
|
-
body: { data: "Data to hash" },
|
|
712
|
-
},
|
|
713
|
-
{
|
|
714
|
-
path: "/hash/sha512",
|
|
715
|
-
method: "POST",
|
|
716
|
-
description: "SHA-512 hash",
|
|
717
|
-
cost: "Paid",
|
|
718
|
-
category: "Cryptography",
|
|
719
|
-
source: "stx402.com",
|
|
720
|
-
body: { data: "Data to hash" },
|
|
721
|
-
},
|
|
722
|
-
{
|
|
723
|
-
path: "/hash/keccak256",
|
|
724
|
-
method: "POST",
|
|
725
|
-
description: "Keccak-256 hash",
|
|
726
|
-
cost: "Paid",
|
|
727
|
-
category: "Cryptography",
|
|
728
|
-
source: "stx402.com",
|
|
729
|
-
body: { data: "Data to hash" },
|
|
730
|
-
},
|
|
731
|
-
{
|
|
732
|
-
path: "/hash/hash160",
|
|
733
|
-
method: "POST",
|
|
734
|
-
description: "RIPEMD160(SHA256) hash",
|
|
735
|
-
cost: "Paid",
|
|
736
|
-
category: "Cryptography",
|
|
737
|
-
source: "stx402.com",
|
|
738
|
-
body: { data: "Data to hash" },
|
|
739
|
-
},
|
|
740
|
-
{
|
|
741
|
-
path: "/hash/ripemd160",
|
|
742
|
-
method: "POST",
|
|
743
|
-
description: "RIPEMD-160 hash",
|
|
744
|
-
cost: "Paid",
|
|
745
|
-
category: "Cryptography",
|
|
746
|
-
source: "stx402.com",
|
|
747
|
-
body: { data: "Data to hash" },
|
|
748
|
-
},
|
|
749
|
-
{
|
|
750
|
-
path: "/hash/hmac",
|
|
751
|
-
method: "POST",
|
|
752
|
-
description: "HMAC signature generation",
|
|
753
|
-
cost: "Paid",
|
|
754
|
-
category: "Cryptography",
|
|
755
|
-
source: "stx402.com",
|
|
756
|
-
body: { data: "Data", key: "Secret key", algorithm: "sha256 | sha512" },
|
|
757
|
-
},
|
|
758
|
-
// Utilities
|
|
759
|
-
{
|
|
760
|
-
path: "/util/qr-generate",
|
|
761
|
-
method: "POST",
|
|
762
|
-
description: "Generate QR code",
|
|
763
|
-
cost: "Paid",
|
|
764
|
-
category: "Utilities",
|
|
765
|
-
source: "stx402.com",
|
|
766
|
-
body: { data: "Data to encode", size: "Size in pixels" },
|
|
767
|
-
},
|
|
768
|
-
{
|
|
769
|
-
path: "/util/verify-signature",
|
|
770
|
-
method: "POST",
|
|
771
|
-
description: "Verify SIP-018 signature",
|
|
772
|
-
cost: "Paid",
|
|
773
|
-
category: "Utilities",
|
|
774
|
-
source: "stx402.com",
|
|
775
|
-
body: { message: "Message", signature: "Signature", publicKey: "Public key" },
|
|
776
|
-
},
|
|
777
|
-
// Registry
|
|
778
|
-
{
|
|
779
|
-
path: "/registry/probe",
|
|
780
|
-
method: "POST",
|
|
781
|
-
description: "Discover x402 payment info for an endpoint",
|
|
782
|
-
cost: "Paid",
|
|
783
|
-
category: "Registry",
|
|
784
|
-
source: "stx402.com",
|
|
785
|
-
body: { url: "Endpoint URL to probe" },
|
|
786
|
-
},
|
|
787
|
-
{
|
|
788
|
-
path: "/registry/register",
|
|
789
|
-
method: "POST",
|
|
790
|
-
description: "Register a new x402 endpoint",
|
|
791
|
-
cost: "Paid",
|
|
792
|
-
category: "Registry",
|
|
793
|
-
source: "stx402.com",
|
|
794
|
-
body: { url: "Endpoint URL", description: "Description" },
|
|
795
|
-
},
|
|
796
|
-
{
|
|
797
|
-
path: "/registry/details",
|
|
798
|
-
method: "POST",
|
|
799
|
-
description: "Get full details of registered endpoint",
|
|
800
|
-
cost: "Paid",
|
|
801
|
-
category: "Registry",
|
|
802
|
-
source: "stx402.com",
|
|
803
|
-
body: { url: "Endpoint URL" },
|
|
804
|
-
},
|
|
805
|
-
// Key-Value Storage
|
|
806
|
-
{
|
|
807
|
-
path: "/kv/set",
|
|
808
|
-
method: "POST",
|
|
809
|
-
description: "Store key-value with optional TTL",
|
|
810
|
-
cost: "Paid",
|
|
811
|
-
category: "Storage",
|
|
812
|
-
source: "stx402.com",
|
|
813
|
-
body: { key: "Key name", value: "Value", ttl: "TTL in seconds (optional)" },
|
|
814
|
-
},
|
|
815
|
-
{
|
|
816
|
-
path: "/kv/get",
|
|
817
|
-
method: "POST",
|
|
818
|
-
description: "Retrieve value by key",
|
|
819
|
-
cost: "Paid",
|
|
820
|
-
category: "Storage",
|
|
821
|
-
source: "stx402.com",
|
|
822
|
-
body: { key: "Key name" },
|
|
823
|
-
},
|
|
824
|
-
{
|
|
825
|
-
path: "/kv/delete",
|
|
826
|
-
method: "POST",
|
|
827
|
-
description: "Delete key-value pair",
|
|
828
|
-
cost: "Paid",
|
|
829
|
-
category: "Storage",
|
|
830
|
-
source: "stx402.com",
|
|
831
|
-
body: { key: "Key name" },
|
|
832
|
-
},
|
|
833
|
-
{
|
|
834
|
-
path: "/kv/list",
|
|
835
|
-
method: "POST",
|
|
836
|
-
description: "List keys with pagination",
|
|
837
|
-
cost: "Paid",
|
|
838
|
-
category: "Storage",
|
|
839
|
-
source: "stx402.com",
|
|
840
|
-
body: { prefix: "Key prefix (optional)", limit: "Max results" },
|
|
841
|
-
},
|
|
842
|
-
// Paste Service
|
|
843
|
-
{
|
|
844
|
-
path: "/paste/create",
|
|
845
|
-
method: "POST",
|
|
846
|
-
description: "Create a paste/snippet",
|
|
847
|
-
cost: "Paid",
|
|
848
|
-
category: "Paste",
|
|
849
|
-
source: "stx402.com",
|
|
850
|
-
body: { content: "Content to paste", language: "Language (optional)" },
|
|
851
|
-
},
|
|
852
|
-
{
|
|
853
|
-
path: "/paste/{code}",
|
|
854
|
-
method: "GET",
|
|
855
|
-
description: "Retrieve paste by code",
|
|
856
|
-
cost: "Paid",
|
|
857
|
-
category: "Paste",
|
|
858
|
-
source: "stx402.com",
|
|
859
|
-
params: { code: "Paste code" },
|
|
860
|
-
},
|
|
861
|
-
// Counters
|
|
862
|
-
{
|
|
863
|
-
path: "/counter/increment",
|
|
864
|
-
method: "POST",
|
|
865
|
-
description: "Atomically increment counter",
|
|
866
|
-
cost: "Paid",
|
|
867
|
-
category: "Counters",
|
|
868
|
-
source: "stx402.com",
|
|
869
|
-
body: { name: "Counter name", amount: "Increment amount (default 1)" },
|
|
870
|
-
},
|
|
871
|
-
{
|
|
872
|
-
path: "/counter/decrement",
|
|
873
|
-
method: "POST",
|
|
874
|
-
description: "Atomically decrement counter",
|
|
875
|
-
cost: "Paid",
|
|
876
|
-
category: "Counters",
|
|
877
|
-
source: "stx402.com",
|
|
878
|
-
body: { name: "Counter name", amount: "Decrement amount (default 1)" },
|
|
879
|
-
},
|
|
880
|
-
{
|
|
881
|
-
path: "/counter/get",
|
|
882
|
-
method: "GET",
|
|
883
|
-
description: "Get counter value",
|
|
884
|
-
cost: "Paid",
|
|
885
|
-
category: "Counters",
|
|
886
|
-
source: "stx402.com",
|
|
887
|
-
params: { name: "Counter name" },
|
|
888
|
-
},
|
|
889
|
-
// SQL Database
|
|
890
|
-
{
|
|
891
|
-
path: "/sql/query",
|
|
892
|
-
method: "POST",
|
|
893
|
-
description: "Execute read-only SELECT query",
|
|
894
|
-
cost: "Paid",
|
|
895
|
-
category: "SQL Database",
|
|
896
|
-
source: "stx402.com",
|
|
897
|
-
body: { sql: "SELECT query" },
|
|
898
|
-
},
|
|
899
|
-
{
|
|
900
|
-
path: "/sql/execute",
|
|
901
|
-
method: "POST",
|
|
902
|
-
description: "Execute write operations (CREATE, INSERT, UPDATE, DELETE)",
|
|
903
|
-
cost: "Paid",
|
|
904
|
-
category: "SQL Database",
|
|
905
|
-
source: "stx402.com",
|
|
906
|
-
body: { sql: "SQL statement" },
|
|
907
|
-
},
|
|
908
|
-
{
|
|
909
|
-
path: "/sql/schema",
|
|
910
|
-
method: "GET",
|
|
911
|
-
description: "Get database schema",
|
|
912
|
-
cost: "Paid",
|
|
913
|
-
category: "SQL Database",
|
|
914
|
-
source: "stx402.com",
|
|
915
|
-
},
|
|
916
|
-
// Links
|
|
917
|
-
{
|
|
918
|
-
path: "/links/create",
|
|
919
|
-
method: "POST",
|
|
920
|
-
description: "Create a short link",
|
|
921
|
-
cost: "Paid",
|
|
922
|
-
category: "Links",
|
|
923
|
-
source: "stx402.com",
|
|
924
|
-
body: { url: "URL to shorten", slug: "Custom slug (optional)" },
|
|
925
|
-
},
|
|
926
|
-
{
|
|
927
|
-
path: "/links/stats",
|
|
928
|
-
method: "POST",
|
|
929
|
-
description: "Get link analytics",
|
|
930
|
-
cost: "Paid",
|
|
931
|
-
category: "Links",
|
|
932
|
-
source: "stx402.com",
|
|
933
|
-
body: { slug: "Link slug" },
|
|
934
|
-
},
|
|
935
|
-
{
|
|
936
|
-
path: "/links/list",
|
|
937
|
-
method: "GET",
|
|
938
|
-
description: "List all your links",
|
|
939
|
-
cost: "Paid",
|
|
940
|
-
category: "Links",
|
|
941
|
-
source: "stx402.com",
|
|
942
|
-
},
|
|
943
|
-
// Synchronization (Locks)
|
|
944
|
-
{
|
|
945
|
-
path: "/sync/lock",
|
|
946
|
-
method: "POST",
|
|
947
|
-
description: "Acquire a named lock",
|
|
948
|
-
cost: "Paid",
|
|
949
|
-
category: "Synchronization",
|
|
950
|
-
source: "stx402.com",
|
|
951
|
-
body: { name: "Lock name", ttl: "TTL in seconds" },
|
|
952
|
-
},
|
|
953
|
-
{
|
|
954
|
-
path: "/sync/unlock",
|
|
955
|
-
method: "POST",
|
|
956
|
-
description: "Release a lock",
|
|
957
|
-
cost: "Paid",
|
|
958
|
-
category: "Synchronization",
|
|
959
|
-
source: "stx402.com",
|
|
960
|
-
body: { name: "Lock name", token: "Lock token" },
|
|
961
|
-
},
|
|
962
|
-
{
|
|
963
|
-
path: "/sync/check",
|
|
964
|
-
method: "POST",
|
|
965
|
-
description: "Check lock status",
|
|
966
|
-
cost: "Paid",
|
|
967
|
-
category: "Synchronization",
|
|
968
|
-
source: "stx402.com",
|
|
969
|
-
body: { name: "Lock name" },
|
|
970
|
-
},
|
|
971
|
-
// Job Queue
|
|
972
|
-
{
|
|
973
|
-
path: "/queue/push",
|
|
974
|
-
method: "POST",
|
|
975
|
-
description: "Add job to queue",
|
|
976
|
-
cost: "Paid",
|
|
977
|
-
category: "Job Queue",
|
|
978
|
-
source: "stx402.com",
|
|
979
|
-
body: { queue: "Queue name", payload: "Job payload" },
|
|
980
|
-
},
|
|
981
|
-
{
|
|
982
|
-
path: "/queue/pop",
|
|
983
|
-
method: "POST",
|
|
984
|
-
description: "Claim next job from queue",
|
|
985
|
-
cost: "Paid",
|
|
986
|
-
category: "Job Queue",
|
|
987
|
-
source: "stx402.com",
|
|
988
|
-
body: { queue: "Queue name" },
|
|
989
|
-
},
|
|
990
|
-
{
|
|
991
|
-
path: "/queue/complete",
|
|
992
|
-
method: "POST",
|
|
993
|
-
description: "Mark job as complete",
|
|
994
|
-
cost: "Paid",
|
|
995
|
-
category: "Job Queue",
|
|
996
|
-
source: "stx402.com",
|
|
997
|
-
body: { jobId: "Job ID" },
|
|
998
|
-
},
|
|
999
|
-
{
|
|
1000
|
-
path: "/queue/status",
|
|
1001
|
-
method: "POST",
|
|
1002
|
-
description: "Get queue statistics",
|
|
1003
|
-
cost: "Paid",
|
|
1004
|
-
category: "Job Queue",
|
|
1005
|
-
source: "stx402.com",
|
|
1006
|
-
body: { queue: "Queue name" },
|
|
1007
|
-
},
|
|
1008
|
-
// Memory & Embeddings
|
|
1009
|
-
{
|
|
1010
|
-
path: "/memory/store",
|
|
1011
|
-
method: "POST",
|
|
1012
|
-
description: "Store memory with optional embedding",
|
|
1013
|
-
cost: "Paid",
|
|
1014
|
-
category: "Memory",
|
|
1015
|
-
source: "stx402.com",
|
|
1016
|
-
body: { key: "Memory key", content: "Content", embed: "Generate embedding (bool)" },
|
|
1017
|
-
},
|
|
1018
|
-
{
|
|
1019
|
-
path: "/memory/recall",
|
|
1020
|
-
method: "POST",
|
|
1021
|
-
description: "Retrieve memory by key",
|
|
1022
|
-
cost: "Paid",
|
|
1023
|
-
category: "Memory",
|
|
1024
|
-
source: "stx402.com",
|
|
1025
|
-
body: { key: "Memory key" },
|
|
1026
|
-
},
|
|
1027
|
-
{
|
|
1028
|
-
path: "/memory/search",
|
|
1029
|
-
method: "POST",
|
|
1030
|
-
description: "Semantic search across memories",
|
|
1031
|
-
cost: "Paid",
|
|
1032
|
-
category: "Memory",
|
|
1033
|
-
source: "stx402.com",
|
|
1034
|
-
body: { query: "Search query", limit: "Max results" },
|
|
1035
|
-
},
|
|
1036
|
-
{
|
|
1037
|
-
path: "/memory/list",
|
|
1038
|
-
method: "POST",
|
|
1039
|
-
description: "List memories with filters",
|
|
1040
|
-
cost: "Paid",
|
|
1041
|
-
category: "Memory",
|
|
1042
|
-
source: "stx402.com",
|
|
1043
|
-
body: { prefix: "Key prefix (optional)" },
|
|
1044
|
-
},
|
|
1045
|
-
{
|
|
1046
|
-
path: "/memory/forget",
|
|
1047
|
-
method: "POST",
|
|
1048
|
-
description: "Delete a memory",
|
|
1049
|
-
cost: "Paid",
|
|
1050
|
-
category: "Memory",
|
|
1051
|
-
source: "stx402.com",
|
|
1052
|
-
body: { key: "Memory key" },
|
|
1053
|
-
},
|
|
1054
|
-
// Agent Registry (ERC-8004)
|
|
1055
|
-
{
|
|
1056
|
-
path: "/agent/info",
|
|
1057
|
-
method: "POST",
|
|
1058
|
-
description: "Get agent info by ID",
|
|
1059
|
-
cost: "Paid",
|
|
1060
|
-
category: "Agent Registry",
|
|
1061
|
-
source: "stx402.com",
|
|
1062
|
-
body: { agentId: "Agent ID" },
|
|
1063
|
-
},
|
|
1064
|
-
{
|
|
1065
|
-
path: "/agent/lookup",
|
|
1066
|
-
method: "POST",
|
|
1067
|
-
description: "Lookup agent by owner address",
|
|
1068
|
-
cost: "Paid",
|
|
1069
|
-
category: "Agent Registry",
|
|
1070
|
-
source: "stx402.com",
|
|
1071
|
-
body: { owner: "Owner address" },
|
|
1072
|
-
},
|
|
1073
|
-
// Agent Reputation
|
|
1074
|
-
{
|
|
1075
|
-
path: "/agent/reputation/summary",
|
|
1076
|
-
method: "POST",
|
|
1077
|
-
description: "Get agent reputation summary",
|
|
1078
|
-
cost: "Paid",
|
|
1079
|
-
category: "Agent Reputation",
|
|
1080
|
-
source: "stx402.com",
|
|
1081
|
-
body: { agentId: "Agent ID" },
|
|
1082
|
-
},
|
|
1083
|
-
{
|
|
1084
|
-
path: "/agent/reputation/list",
|
|
1085
|
-
method: "POST",
|
|
1086
|
-
description: "List all feedback for agent",
|
|
1087
|
-
cost: "Paid",
|
|
1088
|
-
category: "Agent Reputation",
|
|
1089
|
-
source: "stx402.com",
|
|
1090
|
-
body: { agentId: "Agent ID" },
|
|
1091
|
-
},
|
|
1092
|
-
];
|
|
1093
|
-
// =============================================================================
|
|
1094
|
-
// EXPORTS
|
|
1095
|
-
// =============================================================================
|
|
1096
|
-
const PAID_ENDPOINTS = [
|
|
282
|
+
export const STATIC_ENDPOINTS = [
|
|
1097
283
|
...BIWAS_PAID_ENDPOINTS,
|
|
1098
|
-
...AIBTC_PAID_ENDPOINTS,
|
|
1099
|
-
...AIBTC_INBOX_PAID_ENDPOINTS,
|
|
1100
|
-
...STX402_PAID_ENDPOINTS,
|
|
1101
|
-
];
|
|
1102
|
-
const FREE_ENDPOINTS = [
|
|
1103
284
|
...BIWAS_FREE_ENDPOINTS,
|
|
1104
|
-
...
|
|
285
|
+
...AIBTC_INBOX_PAID_ENDPOINTS,
|
|
1105
286
|
...AIBTC_INBOX_FREE_ENDPOINTS,
|
|
1106
|
-
...STX402_FREE_ENDPOINTS,
|
|
1107
287
|
];
|
|
1108
|
-
export const ALL_ENDPOINTS = [...PAID_ENDPOINTS, ...FREE_ENDPOINTS];
|
|
1109
288
|
/**
|
|
1110
|
-
*
|
|
1111
|
-
*/
|
|
1112
|
-
export function searchEndpoints(query) {
|
|
1113
|
-
const lowerQuery = query.toLowerCase();
|
|
1114
|
-
return ALL_ENDPOINTS.filter((endpoint) => endpoint.path.toLowerCase().includes(lowerQuery) ||
|
|
1115
|
-
endpoint.description.toLowerCase().includes(lowerQuery) ||
|
|
1116
|
-
endpoint.category.toLowerCase().includes(lowerQuery));
|
|
1117
|
-
}
|
|
1118
|
-
/**
|
|
1119
|
-
* Get endpoints by source
|
|
1120
|
-
*/
|
|
1121
|
-
export function getEndpointsBySource(source) {
|
|
1122
|
-
return ALL_ENDPOINTS.filter((endpoint) => endpoint.source === source);
|
|
1123
|
-
}
|
|
1124
|
-
/**
|
|
1125
|
-
* Format endpoints for display
|
|
289
|
+
* Format endpoints for display, grouped by category and source.
|
|
1126
290
|
*/
|
|
1127
291
|
export function formatEndpointsTable(endpoints) {
|
|
1128
292
|
const grouped = endpoints.reduce((acc, endpoint) => {
|
|
@@ -1148,93 +312,4 @@ export function formatEndpointsTable(endpoints) {
|
|
|
1148
312
|
}
|
|
1149
313
|
return output.trim();
|
|
1150
314
|
}
|
|
1151
|
-
/**
|
|
1152
|
-
* Get all unique categories
|
|
1153
|
-
*/
|
|
1154
|
-
export function getCategories() {
|
|
1155
|
-
const categories = new Set(ALL_ENDPOINTS.map((ep) => ep.category));
|
|
1156
|
-
return Array.from(categories).sort();
|
|
1157
|
-
}
|
|
1158
|
-
function matchesDomain(host, domain) {
|
|
1159
|
-
return host === domain || host.endsWith(`.${domain}`);
|
|
1160
|
-
}
|
|
1161
|
-
function normalizeSource(url) {
|
|
1162
|
-
let hostname;
|
|
1163
|
-
try {
|
|
1164
|
-
hostname = new URL(url).hostname.toLowerCase();
|
|
1165
|
-
}
|
|
1166
|
-
catch {
|
|
1167
|
-
try {
|
|
1168
|
-
hostname = new URL(`https://${url}`).hostname.toLowerCase();
|
|
1169
|
-
}
|
|
1170
|
-
catch {
|
|
1171
|
-
return undefined;
|
|
1172
|
-
}
|
|
1173
|
-
}
|
|
1174
|
-
if (matchesDomain(hostname, "x402.biwas.xyz"))
|
|
1175
|
-
return "x402.biwas.xyz";
|
|
1176
|
-
if (matchesDomain(hostname, "x402.aibtc.com"))
|
|
1177
|
-
return "x402.aibtc.com";
|
|
1178
|
-
if (matchesDomain(hostname, "stx402.com"))
|
|
1179
|
-
return "stx402.com";
|
|
1180
|
-
if (matchesDomain(hostname, "aibtc.com"))
|
|
1181
|
-
return "aibtc.com";
|
|
1182
|
-
return undefined;
|
|
1183
|
-
}
|
|
1184
|
-
// Memoization cache for path pattern regexes
|
|
1185
|
-
const pathRegexCache = new Map();
|
|
1186
|
-
/**
|
|
1187
|
-
* Convert a path pattern with placeholders to a regex.
|
|
1188
|
-
* Example: "/api/inbox/{address}" → /^\/api\/inbox\/([^/]+)$/
|
|
1189
|
-
*/
|
|
1190
|
-
function pathToRegex(pattern) {
|
|
1191
|
-
const cached = pathRegexCache.get(pattern);
|
|
1192
|
-
if (cached) {
|
|
1193
|
-
return cached;
|
|
1194
|
-
}
|
|
1195
|
-
// Split on {paramName} placeholders, escape literal segments, rejoin with capture groups
|
|
1196
|
-
const parts = pattern.split(/\{[^}]+\}/);
|
|
1197
|
-
const escaped = parts.map(p => p.replace(/[.*+?^$|()[\]{}\\]/g, '\\$&')).join('([^/]+)');
|
|
1198
|
-
const regex = new RegExp(`^${escaped}$`);
|
|
1199
|
-
pathRegexCache.set(pattern, regex);
|
|
1200
|
-
return regex;
|
|
1201
|
-
}
|
|
1202
|
-
/**
|
|
1203
|
-
* Lookup an endpoint in the registry by method, path, and source URL.
|
|
1204
|
-
* Used to determine if an endpoint is known-FREE or known-PAID before
|
|
1205
|
-
* deciding whether to use a payment-capable client.
|
|
1206
|
-
*
|
|
1207
|
-
* Supports path patterns with placeholders like {address}, {messageId}, etc.
|
|
1208
|
-
*/
|
|
1209
|
-
export function lookupEndpoint(method, path, sourceUrl) {
|
|
1210
|
-
const source = normalizeSource(sourceUrl);
|
|
1211
|
-
if (!source) {
|
|
1212
|
-
return undefined;
|
|
1213
|
-
}
|
|
1214
|
-
const pathWithoutQuery = path.split("?")[0];
|
|
1215
|
-
const normalizedPath = pathWithoutQuery.startsWith("/") ? pathWithoutQuery : `/${pathWithoutQuery}`;
|
|
1216
|
-
const normalizedMethod = method.toUpperCase();
|
|
1217
|
-
// Fast path: try exact match first
|
|
1218
|
-
const exactMatch = ALL_ENDPOINTS.find((ep) => ep.method === normalizedMethod &&
|
|
1219
|
-
ep.path === normalizedPath &&
|
|
1220
|
-
ep.source === source);
|
|
1221
|
-
if (exactMatch) {
|
|
1222
|
-
return exactMatch;
|
|
1223
|
-
}
|
|
1224
|
-
// Slow path: try pattern matching for endpoints with placeholders
|
|
1225
|
-
for (const ep of ALL_ENDPOINTS) {
|
|
1226
|
-
if (ep.method !== normalizedMethod || ep.source !== source) {
|
|
1227
|
-
continue;
|
|
1228
|
-
}
|
|
1229
|
-
// Skip if pattern has no placeholders (already tried exact match)
|
|
1230
|
-
if (!ep.path.includes('{')) {
|
|
1231
|
-
continue;
|
|
1232
|
-
}
|
|
1233
|
-
const regex = pathToRegex(ep.path);
|
|
1234
|
-
if (regex.test(normalizedPath)) {
|
|
1235
|
-
return ep;
|
|
1236
|
-
}
|
|
1237
|
-
}
|
|
1238
|
-
return undefined;
|
|
1239
|
-
}
|
|
1240
315
|
//# sourceMappingURL=registry.js.map
|