@aibtc/mcp-server 1.0.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 (178) hide show
  1. package/README.md +340 -0
  2. package/dist/api.d.ts +9 -0
  3. package/dist/api.d.ts.map +1 -0
  4. package/dist/api.js +79 -0
  5. package/dist/api.js.map +1 -0
  6. package/dist/config/contracts.d.ts +169 -0
  7. package/dist/config/contracts.d.ts.map +1 -0
  8. package/dist/config/contracts.js +250 -0
  9. package/dist/config/contracts.js.map +1 -0
  10. package/dist/config/index.d.ts +3 -0
  11. package/dist/config/index.d.ts.map +1 -0
  12. package/dist/config/index.js +3 -0
  13. package/dist/config/index.js.map +1 -0
  14. package/dist/config/networks.d.ts +11 -0
  15. package/dist/config/networks.d.ts.map +1 -0
  16. package/dist/config/networks.js +21 -0
  17. package/dist/config/networks.js.map +1 -0
  18. package/dist/endpoints/index.d.ts +2 -0
  19. package/dist/endpoints/index.d.ts.map +1 -0
  20. package/dist/endpoints/index.js +2 -0
  21. package/dist/endpoints/index.js.map +1 -0
  22. package/dist/endpoints/registry.d.ts +38 -0
  23. package/dist/endpoints/registry.d.ts.map +1 -0
  24. package/dist/endpoints/registry.js +935 -0
  25. package/dist/endpoints/registry.js.map +1 -0
  26. package/dist/index.d.ts +3 -0
  27. package/dist/index.d.ts.map +1 -0
  28. package/dist/index.js +79 -0
  29. package/dist/index.js.map +1 -0
  30. package/dist/services/bitflow.service.d.ts +159 -0
  31. package/dist/services/bitflow.service.d.ts.map +1 -0
  32. package/dist/services/bitflow.service.js +325 -0
  33. package/dist/services/bitflow.service.js.map +1 -0
  34. package/dist/services/bns.service.d.ts +87 -0
  35. package/dist/services/bns.service.d.ts.map +1 -0
  36. package/dist/services/bns.service.js +312 -0
  37. package/dist/services/bns.service.js.map +1 -0
  38. package/dist/services/defi.service.d.ts +146 -0
  39. package/dist/services/defi.service.d.ts.map +1 -0
  40. package/dist/services/defi.service.js +461 -0
  41. package/dist/services/defi.service.js.map +1 -0
  42. package/dist/services/hiro-api.d.ts +438 -0
  43. package/dist/services/hiro-api.d.ts.map +1 -0
  44. package/dist/services/hiro-api.js +376 -0
  45. package/dist/services/hiro-api.js.map +1 -0
  46. package/dist/services/nft.service.d.ts +70 -0
  47. package/dist/services/nft.service.d.ts.map +1 -0
  48. package/dist/services/nft.service.js +148 -0
  49. package/dist/services/nft.service.js.map +1 -0
  50. package/dist/services/sbtc.service.d.ts +44 -0
  51. package/dist/services/sbtc.service.d.ts.map +1 -0
  52. package/dist/services/sbtc.service.js +100 -0
  53. package/dist/services/sbtc.service.js.map +1 -0
  54. package/dist/services/scaffold.service.d.ts +41 -0
  55. package/dist/services/scaffold.service.d.ts.map +1 -0
  56. package/dist/services/scaffold.service.js +1055 -0
  57. package/dist/services/scaffold.service.js.map +1 -0
  58. package/dist/services/stacking.service.d.ts +58 -0
  59. package/dist/services/stacking.service.d.ts.map +1 -0
  60. package/dist/services/stacking.service.js +153 -0
  61. package/dist/services/stacking.service.js.map +1 -0
  62. package/dist/services/tokens.service.d.ts +62 -0
  63. package/dist/services/tokens.service.d.ts.map +1 -0
  64. package/dist/services/tokens.service.js +119 -0
  65. package/dist/services/tokens.service.js.map +1 -0
  66. package/dist/services/wallet-manager.d.ts +107 -0
  67. package/dist/services/wallet-manager.d.ts.map +1 -0
  68. package/dist/services/wallet-manager.js +389 -0
  69. package/dist/services/wallet-manager.js.map +1 -0
  70. package/dist/services/x402.service.d.ts +26 -0
  71. package/dist/services/x402.service.d.ts.map +1 -0
  72. package/dist/services/x402.service.js +125 -0
  73. package/dist/services/x402.service.js.map +1 -0
  74. package/dist/tools/bitflow.tools.d.ts +3 -0
  75. package/dist/tools/bitflow.tools.d.ts.map +1 -0
  76. package/dist/tools/bitflow.tools.js +501 -0
  77. package/dist/tools/bitflow.tools.js.map +1 -0
  78. package/dist/tools/bns.tools.d.ts +3 -0
  79. package/dist/tools/bns.tools.d.ts.map +1 -0
  80. package/dist/tools/bns.tools.js +164 -0
  81. package/dist/tools/bns.tools.js.map +1 -0
  82. package/dist/tools/contract.tools.d.ts +3 -0
  83. package/dist/tools/contract.tools.d.ts.map +1 -0
  84. package/dist/tools/contract.tools.js +126 -0
  85. package/dist/tools/contract.tools.js.map +1 -0
  86. package/dist/tools/defi.tools.d.ts +3 -0
  87. package/dist/tools/defi.tools.d.ts.map +1 -0
  88. package/dist/tools/defi.tools.js +425 -0
  89. package/dist/tools/defi.tools.js.map +1 -0
  90. package/dist/tools/endpoint.tools.d.ts +3 -0
  91. package/dist/tools/endpoint.tools.d.ts.map +1 -0
  92. package/dist/tools/endpoint.tools.js +157 -0
  93. package/dist/tools/endpoint.tools.js.map +1 -0
  94. package/dist/tools/index.d.ts +6 -0
  95. package/dist/tools/index.d.ts.map +1 -0
  96. package/dist/tools/index.js +52 -0
  97. package/dist/tools/index.js.map +1 -0
  98. package/dist/tools/nft.tools.d.ts +3 -0
  99. package/dist/tools/nft.tools.d.ts.map +1 -0
  100. package/dist/tools/nft.tools.js +154 -0
  101. package/dist/tools/nft.tools.js.map +1 -0
  102. package/dist/tools/openrouter.tools.d.ts +3 -0
  103. package/dist/tools/openrouter.tools.d.ts.map +1 -0
  104. package/dist/tools/openrouter.tools.js +664 -0
  105. package/dist/tools/openrouter.tools.js.map +1 -0
  106. package/dist/tools/query.tools.d.ts +3 -0
  107. package/dist/tools/query.tools.d.ts.map +1 -0
  108. package/dist/tools/query.tools.js +209 -0
  109. package/dist/tools/query.tools.js.map +1 -0
  110. package/dist/tools/sbtc.tools.d.ts +3 -0
  111. package/dist/tools/sbtc.tools.d.ts.map +1 -0
  112. package/dist/tools/sbtc.tools.js +103 -0
  113. package/dist/tools/sbtc.tools.js.map +1 -0
  114. package/dist/tools/scaffold.tools.d.ts +3 -0
  115. package/dist/tools/scaffold.tools.d.ts.map +1 -0
  116. package/dist/tools/scaffold.tools.js +216 -0
  117. package/dist/tools/scaffold.tools.js.map +1 -0
  118. package/dist/tools/stacking.tools.d.ts +3 -0
  119. package/dist/tools/stacking.tools.d.ts.map +1 -0
  120. package/dist/tools/stacking.tools.js +112 -0
  121. package/dist/tools/stacking.tools.js.map +1 -0
  122. package/dist/tools/tokens.tools.d.ts +3 -0
  123. package/dist/tools/tokens.tools.d.ts.map +1 -0
  124. package/dist/tools/tokens.tools.js +154 -0
  125. package/dist/tools/tokens.tools.js.map +1 -0
  126. package/dist/tools/transfer.tools.d.ts +3 -0
  127. package/dist/tools/transfer.tools.d.ts.map +1 -0
  128. package/dist/tools/transfer.tools.js +62 -0
  129. package/dist/tools/transfer.tools.js.map +1 -0
  130. package/dist/tools/wallet-management.tools.d.ts +6 -0
  131. package/dist/tools/wallet-management.tools.d.ts.map +1 -0
  132. package/dist/tools/wallet-management.tools.js +390 -0
  133. package/dist/tools/wallet-management.tools.js.map +1 -0
  134. package/dist/tools/wallet.tools.d.ts +3 -0
  135. package/dist/tools/wallet.tools.d.ts.map +1 -0
  136. package/dist/tools/wallet.tools.js +105 -0
  137. package/dist/tools/wallet.tools.js.map +1 -0
  138. package/dist/transactions/builder.d.ts +56 -0
  139. package/dist/transactions/builder.d.ts.map +1 -0
  140. package/dist/transactions/builder.js +134 -0
  141. package/dist/transactions/builder.js.map +1 -0
  142. package/dist/transactions/clarity-values.d.ts +67 -0
  143. package/dist/transactions/clarity-values.d.ts.map +1 -0
  144. package/dist/transactions/clarity-values.js +169 -0
  145. package/dist/transactions/clarity-values.js.map +1 -0
  146. package/dist/transactions/post-conditions.d.ts +27 -0
  147. package/dist/transactions/post-conditions.d.ts.map +1 -0
  148. package/dist/transactions/post-conditions.js +101 -0
  149. package/dist/transactions/post-conditions.js.map +1 -0
  150. package/dist/utils/encryption.d.ts +33 -0
  151. package/dist/utils/encryption.d.ts.map +1 -0
  152. package/dist/utils/encryption.js +110 -0
  153. package/dist/utils/encryption.js.map +1 -0
  154. package/dist/utils/errors.d.ts +84 -0
  155. package/dist/utils/errors.d.ts.map +1 -0
  156. package/dist/utils/errors.js +132 -0
  157. package/dist/utils/errors.js.map +1 -0
  158. package/dist/utils/formatting.d.ts +51 -0
  159. package/dist/utils/formatting.d.ts.map +1 -0
  160. package/dist/utils/formatting.js +114 -0
  161. package/dist/utils/formatting.js.map +1 -0
  162. package/dist/utils/index.d.ts +6 -0
  163. package/dist/utils/index.d.ts.map +1 -0
  164. package/dist/utils/index.js +6 -0
  165. package/dist/utils/index.js.map +1 -0
  166. package/dist/utils/storage.d.ts +90 -0
  167. package/dist/utils/storage.d.ts.map +1 -0
  168. package/dist/utils/storage.js +196 -0
  169. package/dist/utils/storage.js.map +1 -0
  170. package/dist/utils/validation.d.ts +67 -0
  171. package/dist/utils/validation.d.ts.map +1 -0
  172. package/dist/utils/validation.js +74 -0
  173. package/dist/utils/validation.js.map +1 -0
  174. package/dist/wallet.d.ts +86 -0
  175. package/dist/wallet.d.ts.map +1 -0
  176. package/dist/wallet.js +279 -0
  177. package/dist/wallet.js.map +1 -0
  178. package/package.json +58 -0
@@ -0,0 +1,935 @@
1
+ /**
2
+ * Known x402 endpoints registry
3
+ * Endpoints from x402.biwas.xyz and stx402.com
4
+ */
5
+ // =============================================================================
6
+ // x402.biwas.xyz ENDPOINTS
7
+ // =============================================================================
8
+ const BIWAS_PAID_ENDPOINTS = [
9
+ // News & Research
10
+ {
11
+ path: "/api/news",
12
+ method: "GET",
13
+ description: "Get latest Stacks and Bitcoin news with AI analysis",
14
+ cost: "0.001 STX",
15
+ category: "News & Research",
16
+ source: "x402.biwas.xyz",
17
+ },
18
+ {
19
+ path: "/api/research/user",
20
+ method: "POST",
21
+ description: "Research user profile from X/Twitter and web sources",
22
+ cost: "0.005 STX",
23
+ category: "News & Research",
24
+ source: "x402.biwas.xyz",
25
+ body: { username: "Twitter/X username to research" },
26
+ },
27
+ {
28
+ path: "/api/sentiment",
29
+ method: "POST",
30
+ description: "Real-time sentiment analysis for crypto tokens on X/Twitter",
31
+ cost: "0.005 STX",
32
+ category: "News & Research",
33
+ source: "x402.biwas.xyz",
34
+ body: { token: "Token symbol to analyze (e.g., STX, BTC)" },
35
+ },
36
+ // Security & Auditing
37
+ {
38
+ path: "/api/audit",
39
+ method: "POST",
40
+ description: "Security audit for Clarity smart contracts",
41
+ cost: "0.02 STX",
42
+ category: "Security",
43
+ source: "x402.biwas.xyz",
44
+ body: { contract: "Clarity contract source code or contract ID" },
45
+ },
46
+ // Wallet Analysis
47
+ {
48
+ path: "/api/wallet/classify",
49
+ method: "POST",
50
+ description: "Classify wallet behavior (trader, whale, bot, dao, bridge)",
51
+ cost: "0.005 STX",
52
+ category: "Wallet Analysis",
53
+ source: "x402.biwas.xyz",
54
+ body: { address: "Stacks wallet address" },
55
+ },
56
+ {
57
+ path: "/api/wallet/trading",
58
+ method: "POST",
59
+ description: "AI-enhanced wallet trading behavior analysis",
60
+ cost: "0.005 STX",
61
+ category: "Wallet Analysis",
62
+ source: "x402.biwas.xyz",
63
+ body: { address: "Stacks wallet address" },
64
+ },
65
+ {
66
+ path: "/api/wallet/pnl",
67
+ method: "POST",
68
+ description: "AI-enhanced wallet profit/loss analysis",
69
+ cost: "0.005 STX",
70
+ category: "Wallet Analysis",
71
+ source: "x402.biwas.xyz",
72
+ body: { address: "Stacks wallet address" },
73
+ },
74
+ // ALEX DEX
75
+ {
76
+ path: "/api/alex/swap-optimizer",
77
+ method: "POST",
78
+ description: "AI swap route optimizer - finds optimal routes, calculates slippage",
79
+ cost: "0.005 STX",
80
+ category: "ALEX DEX",
81
+ source: "x402.biwas.xyz",
82
+ body: { tokenIn: "Input token", tokenOut: "Output token", amount: "Amount" },
83
+ },
84
+ {
85
+ path: "/api/alex/pool-risk",
86
+ method: "POST",
87
+ description: "LP position risk analyzer - impermanent loss scenarios",
88
+ cost: "0.008 STX",
89
+ category: "ALEX DEX",
90
+ source: "x402.biwas.xyz",
91
+ body: { pool: "Pool identifier", amount: "LP amount" },
92
+ },
93
+ {
94
+ path: "/api/alex/arbitrage-scan",
95
+ method: "GET",
96
+ description: "Cross-pool arbitrage scanner - finds price discrepancies",
97
+ cost: "0.01 STX",
98
+ category: "ALEX DEX",
99
+ source: "x402.biwas.xyz",
100
+ },
101
+ {
102
+ path: "/api/alex/market-regime",
103
+ method: "GET",
104
+ description: "Market regime detector - classifies current market conditions",
105
+ cost: "0.005 STX",
106
+ category: "ALEX DEX",
107
+ source: "x402.biwas.xyz",
108
+ },
109
+ // Zest Protocol (Lending)
110
+ {
111
+ path: "/api/zest/liquidation-risk",
112
+ method: "POST",
113
+ description: "Liquidation risk monitor - health factor analysis",
114
+ cost: "0.008 STX",
115
+ category: "Zest Protocol",
116
+ source: "x402.biwas.xyz",
117
+ body: { address: "Stacks wallet address" },
118
+ },
119
+ {
120
+ path: "/api/zest/yield-optimizer",
121
+ method: "POST",
122
+ description: "Lending yield optimizer - recommends optimal strategy",
123
+ cost: "0.008 STX",
124
+ category: "Zest Protocol",
125
+ source: "x402.biwas.xyz",
126
+ body: { address: "Stacks wallet address", amount: "Amount to optimize" },
127
+ },
128
+ {
129
+ path: "/api/zest/interest-forecast",
130
+ method: "GET",
131
+ description: "Interest rate forecaster - predicts rate movements",
132
+ cost: "0.005 STX",
133
+ category: "Zest Protocol",
134
+ source: "x402.biwas.xyz",
135
+ },
136
+ {
137
+ path: "/api/zest/position-health",
138
+ method: "POST",
139
+ description: "Position health analyzer - comprehensive check with rebalancing recommendations",
140
+ cost: "0.005 STX",
141
+ category: "Zest Protocol",
142
+ source: "x402.biwas.xyz",
143
+ body: { address: "Stacks wallet address" },
144
+ },
145
+ // DeFi Portfolio
146
+ {
147
+ path: "/api/defi/portfolio-analyzer",
148
+ method: "POST",
149
+ description: "DeFi portfolio intelligence - combined analysis across protocols",
150
+ cost: "0.015 STX",
151
+ category: "DeFi",
152
+ source: "x402.biwas.xyz",
153
+ body: { address: "Stacks wallet address" },
154
+ },
155
+ {
156
+ path: "/api/defi/strategy-builder",
157
+ method: "POST",
158
+ description: "AI strategy builder - generates complete DeFi strategy",
159
+ cost: "0.02 STX",
160
+ category: "DeFi",
161
+ source: "x402.biwas.xyz",
162
+ body: { address: "Address", riskTolerance: "low|medium|high", goals: "Goals" },
163
+ },
164
+ ];
165
+ const BIWAS_FREE_ENDPOINTS = [
166
+ // Market Data
167
+ {
168
+ path: "/api/market/stats",
169
+ method: "GET",
170
+ description: "Stacks DeFi market statistics",
171
+ cost: "FREE",
172
+ category: "Market Data",
173
+ source: "x402.biwas.xyz",
174
+ },
175
+ {
176
+ path: "/api/market/gainers",
177
+ method: "GET",
178
+ description: "Top gaining tokens by price change",
179
+ cost: "FREE",
180
+ category: "Market Data",
181
+ source: "x402.biwas.xyz",
182
+ },
183
+ {
184
+ path: "/api/market/losers",
185
+ method: "GET",
186
+ description: "Top losing tokens by price change",
187
+ cost: "FREE",
188
+ category: "Market Data",
189
+ source: "x402.biwas.xyz",
190
+ },
191
+ {
192
+ path: "/api/market/whales",
193
+ method: "GET",
194
+ description: "Recent whale trades",
195
+ cost: "FREE",
196
+ category: "Market Data",
197
+ source: "x402.biwas.xyz",
198
+ },
199
+ {
200
+ path: "/api/market/netflow",
201
+ method: "GET",
202
+ description: "Hourly net flow of funds",
203
+ cost: "FREE",
204
+ category: "Market Data",
205
+ source: "x402.biwas.xyz",
206
+ },
207
+ // Pools
208
+ {
209
+ path: "/api/pools/trending",
210
+ method: "GET",
211
+ description: "Trending liquidity pools",
212
+ cost: "FREE",
213
+ category: "Pools",
214
+ source: "x402.biwas.xyz",
215
+ },
216
+ {
217
+ path: "/api/pools/ohlc",
218
+ method: "POST",
219
+ description: "OHLCV candlestick data for pools",
220
+ cost: "FREE",
221
+ category: "Pools",
222
+ source: "x402.biwas.xyz",
223
+ body: { pool: "Pool identifier", interval: "1h | 4h | 1d" },
224
+ },
225
+ // Tokens
226
+ {
227
+ path: "/api/tokens/summary",
228
+ method: "POST",
229
+ description: "Token market summary",
230
+ cost: "FREE",
231
+ category: "Tokens",
232
+ source: "x402.biwas.xyz",
233
+ body: { token: "Token symbol or contract ID" },
234
+ },
235
+ {
236
+ path: "/api/tokens/details",
237
+ method: "POST",
238
+ description: "Full token details including metadata",
239
+ cost: "FREE",
240
+ category: "Tokens",
241
+ source: "x402.biwas.xyz",
242
+ body: { token: "Token symbol or contract ID" },
243
+ },
244
+ ];
245
+ // =============================================================================
246
+ // stx402.com ENDPOINTS
247
+ // =============================================================================
248
+ const STX402_FREE_ENDPOINTS = [
249
+ {
250
+ path: "/api/health",
251
+ method: "GET",
252
+ description: "Service health status",
253
+ cost: "FREE",
254
+ category: "System",
255
+ source: "stx402.com",
256
+ },
257
+ {
258
+ path: "/api/registry/list",
259
+ method: "GET",
260
+ description: "List all registered x402 endpoints",
261
+ cost: "FREE",
262
+ category: "Registry",
263
+ source: "stx402.com",
264
+ },
265
+ {
266
+ path: "/api/links/expand/{slug}",
267
+ method: "GET",
268
+ description: "Expand short link with click tracking",
269
+ cost: "FREE",
270
+ category: "Links",
271
+ source: "stx402.com",
272
+ params: { slug: "Short link slug" },
273
+ },
274
+ {
275
+ path: "/api/agent/registry",
276
+ method: "GET",
277
+ description: "Agent registry contract info (ERC-8004)",
278
+ cost: "FREE",
279
+ category: "Agent Registry",
280
+ source: "stx402.com",
281
+ },
282
+ ];
283
+ const STX402_PAID_ENDPOINTS = [
284
+ // Data Operations
285
+ {
286
+ path: "/api/data/json-minify",
287
+ method: "POST",
288
+ description: "Remove JSON whitespace and minify",
289
+ cost: "Paid",
290
+ category: "Data Operations",
291
+ source: "stx402.com",
292
+ body: { json: "JSON string to minify" },
293
+ },
294
+ {
295
+ path: "/api/data/json-validate",
296
+ method: "POST",
297
+ description: "Validate JSON syntax",
298
+ cost: "Paid",
299
+ category: "Data Operations",
300
+ source: "stx402.com",
301
+ body: { json: "JSON string to validate" },
302
+ },
303
+ // Stacks Blockchain
304
+ {
305
+ path: "/api/stacks/convert-address/{address}",
306
+ method: "GET",
307
+ description: "Convert Stacks address between networks",
308
+ cost: "Paid",
309
+ category: "Stacks Blockchain",
310
+ source: "stx402.com",
311
+ params: { address: "Stacks address" },
312
+ },
313
+ {
314
+ path: "/api/stacks/decode-clarity-hex",
315
+ method: "POST",
316
+ description: "Decode Clarity hex values",
317
+ cost: "Paid",
318
+ category: "Stacks Blockchain",
319
+ source: "stx402.com",
320
+ body: { hex: "Clarity hex value" },
321
+ },
322
+ {
323
+ path: "/api/stacks/to-consensus-buff",
324
+ method: "POST",
325
+ description: "Serialize Clarity value to consensus buffer",
326
+ cost: "Paid",
327
+ category: "Stacks Blockchain",
328
+ source: "stx402.com",
329
+ body: { value: "Clarity value" },
330
+ },
331
+ {
332
+ path: "/api/stacks/from-consensus-buff",
333
+ method: "POST",
334
+ description: "Deserialize from consensus buffer",
335
+ cost: "Paid",
336
+ category: "Stacks Blockchain",
337
+ source: "stx402.com",
338
+ body: { buffer: "Consensus buffer hex" },
339
+ },
340
+ {
341
+ path: "/api/stacks/decode-tx",
342
+ method: "POST",
343
+ description: "Decode raw Stacks transaction",
344
+ cost: "Paid",
345
+ category: "Stacks Blockchain",
346
+ source: "stx402.com",
347
+ body: { tx: "Raw transaction hex" },
348
+ },
349
+ {
350
+ path: "/api/stacks/profile/{address}",
351
+ method: "GET",
352
+ description: "Aggregated profile data (BNS, balances, NFT counts)",
353
+ cost: "Paid",
354
+ category: "Stacks Blockchain",
355
+ source: "stx402.com",
356
+ params: { address: "Stacks address" },
357
+ },
358
+ {
359
+ path: "/api/stacks/contract-info/{contract_id}",
360
+ method: "GET",
361
+ description: "Contract source code and ABI",
362
+ cost: "Paid",
363
+ category: "Stacks Blockchain",
364
+ source: "stx402.com",
365
+ params: { contract_id: "Contract ID (address.name)" },
366
+ },
367
+ // AI Services
368
+ {
369
+ path: "/api/ai/dad-joke",
370
+ method: "GET",
371
+ description: "Generate a dad joke",
372
+ cost: "Paid",
373
+ category: "AI Services",
374
+ source: "stx402.com",
375
+ },
376
+ {
377
+ path: "/api/ai/image-describe",
378
+ method: "POST",
379
+ description: "Vision analysis - describe an image",
380
+ cost: "Paid",
381
+ category: "AI Services",
382
+ source: "stx402.com",
383
+ body: { image: "Image URL or base64" },
384
+ },
385
+ {
386
+ path: "/api/ai/tts",
387
+ method: "POST",
388
+ description: "Text-to-speech (English/Spanish)",
389
+ cost: "Paid",
390
+ category: "AI Services",
391
+ source: "stx402.com",
392
+ body: { text: "Text to speak", language: "en | es" },
393
+ },
394
+ {
395
+ path: "/api/ai/summarize",
396
+ method: "POST",
397
+ description: "Summarize text content",
398
+ cost: "Paid",
399
+ category: "AI Services",
400
+ source: "stx402.com",
401
+ body: { text: "Text to summarize" },
402
+ },
403
+ {
404
+ path: "/api/ai/generate-image",
405
+ method: "POST",
406
+ description: "Generate image from text (Flux model)",
407
+ cost: "Paid",
408
+ category: "AI Services",
409
+ source: "stx402.com",
410
+ body: { prompt: "Image description" },
411
+ },
412
+ {
413
+ path: "/api/ai/explain-contract/{contract_id}",
414
+ method: "GET",
415
+ description: "AI explanation of smart contract",
416
+ cost: "Paid",
417
+ category: "AI Services",
418
+ source: "stx402.com",
419
+ params: { contract_id: "Contract ID (address.name)" },
420
+ },
421
+ {
422
+ path: "/api/ai/translate",
423
+ method: "POST",
424
+ description: "Multi-language translation",
425
+ cost: "Paid",
426
+ category: "AI Services",
427
+ source: "stx402.com",
428
+ body: { text: "Text to translate", target: "Target language" },
429
+ },
430
+ {
431
+ path: "/api/ai/sentiment",
432
+ method: "POST",
433
+ description: "Sentiment analysis of text",
434
+ cost: "Paid",
435
+ category: "AI Services",
436
+ source: "stx402.com",
437
+ body: { text: "Text to analyze" },
438
+ },
439
+ {
440
+ path: "/api/ai/keywords",
441
+ method: "POST",
442
+ description: "Extract keywords from text",
443
+ cost: "Paid",
444
+ category: "AI Services",
445
+ source: "stx402.com",
446
+ body: { text: "Text to extract keywords from" },
447
+ },
448
+ {
449
+ path: "/api/ai/language-detect",
450
+ method: "POST",
451
+ description: "Detect language of text",
452
+ cost: "Paid",
453
+ category: "AI Services",
454
+ source: "stx402.com",
455
+ body: { text: "Text to detect" },
456
+ },
457
+ {
458
+ path: "/api/ai/paraphrase",
459
+ method: "POST",
460
+ description: "Paraphrase text in different styles",
461
+ cost: "Paid",
462
+ category: "AI Services",
463
+ source: "stx402.com",
464
+ body: { text: "Text to paraphrase", style: "Style" },
465
+ },
466
+ {
467
+ path: "/api/ai/grammar-check",
468
+ method: "POST",
469
+ description: "Check and correct grammar",
470
+ cost: "Paid",
471
+ category: "AI Services",
472
+ source: "stx402.com",
473
+ body: { text: "Text to check" },
474
+ },
475
+ {
476
+ path: "/api/ai/question-answer",
477
+ method: "POST",
478
+ description: "Answer questions based on context",
479
+ cost: "Paid",
480
+ category: "AI Services",
481
+ source: "stx402.com",
482
+ body: { context: "Context text", question: "Question" },
483
+ },
484
+ // Cryptography
485
+ {
486
+ path: "/api/hash/sha256",
487
+ method: "POST",
488
+ description: "SHA-256 hash",
489
+ cost: "Paid",
490
+ category: "Cryptography",
491
+ source: "stx402.com",
492
+ body: { data: "Data to hash" },
493
+ },
494
+ {
495
+ path: "/api/hash/sha512",
496
+ method: "POST",
497
+ description: "SHA-512 hash",
498
+ cost: "Paid",
499
+ category: "Cryptography",
500
+ source: "stx402.com",
501
+ body: { data: "Data to hash" },
502
+ },
503
+ {
504
+ path: "/api/hash/keccak256",
505
+ method: "POST",
506
+ description: "Keccak-256 hash",
507
+ cost: "Paid",
508
+ category: "Cryptography",
509
+ source: "stx402.com",
510
+ body: { data: "Data to hash" },
511
+ },
512
+ {
513
+ path: "/api/hash/hash160",
514
+ method: "POST",
515
+ description: "RIPEMD160(SHA256) hash",
516
+ cost: "Paid",
517
+ category: "Cryptography",
518
+ source: "stx402.com",
519
+ body: { data: "Data to hash" },
520
+ },
521
+ {
522
+ path: "/api/hash/ripemd160",
523
+ method: "POST",
524
+ description: "RIPEMD-160 hash",
525
+ cost: "Paid",
526
+ category: "Cryptography",
527
+ source: "stx402.com",
528
+ body: { data: "Data to hash" },
529
+ },
530
+ {
531
+ path: "/api/hash/hmac",
532
+ method: "POST",
533
+ description: "HMAC signature generation",
534
+ cost: "Paid",
535
+ category: "Cryptography",
536
+ source: "stx402.com",
537
+ body: { data: "Data", key: "Secret key", algorithm: "sha256 | sha512" },
538
+ },
539
+ // Utilities
540
+ {
541
+ path: "/api/util/qr-generate",
542
+ method: "POST",
543
+ description: "Generate QR code",
544
+ cost: "Paid",
545
+ category: "Utilities",
546
+ source: "stx402.com",
547
+ body: { data: "Data to encode", size: "Size in pixels" },
548
+ },
549
+ {
550
+ path: "/api/util/verify-signature",
551
+ method: "POST",
552
+ description: "Verify SIP-018 signature",
553
+ cost: "Paid",
554
+ category: "Utilities",
555
+ source: "stx402.com",
556
+ body: { message: "Message", signature: "Signature", publicKey: "Public key" },
557
+ },
558
+ // Registry
559
+ {
560
+ path: "/api/registry/probe",
561
+ method: "POST",
562
+ description: "Discover x402 payment info for an endpoint",
563
+ cost: "Paid",
564
+ category: "Registry",
565
+ source: "stx402.com",
566
+ body: { url: "Endpoint URL to probe" },
567
+ },
568
+ {
569
+ path: "/api/registry/register",
570
+ method: "POST",
571
+ description: "Register a new x402 endpoint",
572
+ cost: "Paid",
573
+ category: "Registry",
574
+ source: "stx402.com",
575
+ body: { url: "Endpoint URL", description: "Description" },
576
+ },
577
+ {
578
+ path: "/api/registry/details",
579
+ method: "POST",
580
+ description: "Get full details of registered endpoint",
581
+ cost: "Paid",
582
+ category: "Registry",
583
+ source: "stx402.com",
584
+ body: { url: "Endpoint URL" },
585
+ },
586
+ // Key-Value Storage
587
+ {
588
+ path: "/api/kv/set",
589
+ method: "POST",
590
+ description: "Store key-value with optional TTL",
591
+ cost: "Paid",
592
+ category: "Storage",
593
+ source: "stx402.com",
594
+ body: { key: "Key name", value: "Value", ttl: "TTL in seconds (optional)" },
595
+ },
596
+ {
597
+ path: "/api/kv/get",
598
+ method: "POST",
599
+ description: "Retrieve value by key",
600
+ cost: "Paid",
601
+ category: "Storage",
602
+ source: "stx402.com",
603
+ body: { key: "Key name" },
604
+ },
605
+ {
606
+ path: "/api/kv/delete",
607
+ method: "POST",
608
+ description: "Delete key-value pair",
609
+ cost: "Paid",
610
+ category: "Storage",
611
+ source: "stx402.com",
612
+ body: { key: "Key name" },
613
+ },
614
+ {
615
+ path: "/api/kv/list",
616
+ method: "POST",
617
+ description: "List keys with pagination",
618
+ cost: "Paid",
619
+ category: "Storage",
620
+ source: "stx402.com",
621
+ body: { prefix: "Key prefix (optional)", limit: "Max results" },
622
+ },
623
+ // Paste Service
624
+ {
625
+ path: "/api/paste/create",
626
+ method: "POST",
627
+ description: "Create a paste/snippet",
628
+ cost: "Paid",
629
+ category: "Paste",
630
+ source: "stx402.com",
631
+ body: { content: "Content to paste", language: "Language (optional)" },
632
+ },
633
+ {
634
+ path: "/api/paste/{code}",
635
+ method: "GET",
636
+ description: "Retrieve paste by code",
637
+ cost: "Paid",
638
+ category: "Paste",
639
+ source: "stx402.com",
640
+ params: { code: "Paste code" },
641
+ },
642
+ // Counters
643
+ {
644
+ path: "/api/counter/increment",
645
+ method: "POST",
646
+ description: "Atomically increment counter",
647
+ cost: "Paid",
648
+ category: "Counters",
649
+ source: "stx402.com",
650
+ body: { name: "Counter name", amount: "Increment amount (default 1)" },
651
+ },
652
+ {
653
+ path: "/api/counter/decrement",
654
+ method: "POST",
655
+ description: "Atomically decrement counter",
656
+ cost: "Paid",
657
+ category: "Counters",
658
+ source: "stx402.com",
659
+ body: { name: "Counter name", amount: "Decrement amount (default 1)" },
660
+ },
661
+ {
662
+ path: "/api/counter/get",
663
+ method: "GET",
664
+ description: "Get counter value",
665
+ cost: "Paid",
666
+ category: "Counters",
667
+ source: "stx402.com",
668
+ params: { name: "Counter name" },
669
+ },
670
+ // SQL Database
671
+ {
672
+ path: "/api/sql/query",
673
+ method: "POST",
674
+ description: "Execute read-only SELECT query",
675
+ cost: "Paid",
676
+ category: "SQL Database",
677
+ source: "stx402.com",
678
+ body: { sql: "SELECT query" },
679
+ },
680
+ {
681
+ path: "/api/sql/execute",
682
+ method: "POST",
683
+ description: "Execute write operations (CREATE, INSERT, UPDATE, DELETE)",
684
+ cost: "Paid",
685
+ category: "SQL Database",
686
+ source: "stx402.com",
687
+ body: { sql: "SQL statement" },
688
+ },
689
+ {
690
+ path: "/api/sql/schema",
691
+ method: "GET",
692
+ description: "Get database schema",
693
+ cost: "Paid",
694
+ category: "SQL Database",
695
+ source: "stx402.com",
696
+ },
697
+ // Links
698
+ {
699
+ path: "/api/links/create",
700
+ method: "POST",
701
+ description: "Create a short link",
702
+ cost: "Paid",
703
+ category: "Links",
704
+ source: "stx402.com",
705
+ body: { url: "URL to shorten", slug: "Custom slug (optional)" },
706
+ },
707
+ {
708
+ path: "/api/links/stats",
709
+ method: "POST",
710
+ description: "Get link analytics",
711
+ cost: "Paid",
712
+ category: "Links",
713
+ source: "stx402.com",
714
+ body: { slug: "Link slug" },
715
+ },
716
+ {
717
+ path: "/api/links/list",
718
+ method: "GET",
719
+ description: "List all your links",
720
+ cost: "Paid",
721
+ category: "Links",
722
+ source: "stx402.com",
723
+ },
724
+ // Synchronization (Locks)
725
+ {
726
+ path: "/api/sync/lock",
727
+ method: "POST",
728
+ description: "Acquire a named lock",
729
+ cost: "Paid",
730
+ category: "Synchronization",
731
+ source: "stx402.com",
732
+ body: { name: "Lock name", ttl: "TTL in seconds" },
733
+ },
734
+ {
735
+ path: "/api/sync/unlock",
736
+ method: "POST",
737
+ description: "Release a lock",
738
+ cost: "Paid",
739
+ category: "Synchronization",
740
+ source: "stx402.com",
741
+ body: { name: "Lock name", token: "Lock token" },
742
+ },
743
+ {
744
+ path: "/api/sync/check",
745
+ method: "POST",
746
+ description: "Check lock status",
747
+ cost: "Paid",
748
+ category: "Synchronization",
749
+ source: "stx402.com",
750
+ body: { name: "Lock name" },
751
+ },
752
+ // Job Queue
753
+ {
754
+ path: "/api/queue/push",
755
+ method: "POST",
756
+ description: "Add job to queue",
757
+ cost: "Paid",
758
+ category: "Job Queue",
759
+ source: "stx402.com",
760
+ body: { queue: "Queue name", payload: "Job payload" },
761
+ },
762
+ {
763
+ path: "/api/queue/pop",
764
+ method: "POST",
765
+ description: "Claim next job from queue",
766
+ cost: "Paid",
767
+ category: "Job Queue",
768
+ source: "stx402.com",
769
+ body: { queue: "Queue name" },
770
+ },
771
+ {
772
+ path: "/api/queue/complete",
773
+ method: "POST",
774
+ description: "Mark job as complete",
775
+ cost: "Paid",
776
+ category: "Job Queue",
777
+ source: "stx402.com",
778
+ body: { jobId: "Job ID" },
779
+ },
780
+ {
781
+ path: "/api/queue/status",
782
+ method: "POST",
783
+ description: "Get queue statistics",
784
+ cost: "Paid",
785
+ category: "Job Queue",
786
+ source: "stx402.com",
787
+ body: { queue: "Queue name" },
788
+ },
789
+ // Memory & Embeddings
790
+ {
791
+ path: "/api/memory/store",
792
+ method: "POST",
793
+ description: "Store memory with optional embedding",
794
+ cost: "Paid",
795
+ category: "Memory",
796
+ source: "stx402.com",
797
+ body: { key: "Memory key", content: "Content", embed: "Generate embedding (bool)" },
798
+ },
799
+ {
800
+ path: "/api/memory/recall",
801
+ method: "POST",
802
+ description: "Retrieve memory by key",
803
+ cost: "Paid",
804
+ category: "Memory",
805
+ source: "stx402.com",
806
+ body: { key: "Memory key" },
807
+ },
808
+ {
809
+ path: "/api/memory/search",
810
+ method: "POST",
811
+ description: "Semantic search across memories",
812
+ cost: "Paid",
813
+ category: "Memory",
814
+ source: "stx402.com",
815
+ body: { query: "Search query", limit: "Max results" },
816
+ },
817
+ {
818
+ path: "/api/memory/list",
819
+ method: "POST",
820
+ description: "List memories with filters",
821
+ cost: "Paid",
822
+ category: "Memory",
823
+ source: "stx402.com",
824
+ body: { prefix: "Key prefix (optional)" },
825
+ },
826
+ {
827
+ path: "/api/memory/forget",
828
+ method: "POST",
829
+ description: "Delete a memory",
830
+ cost: "Paid",
831
+ category: "Memory",
832
+ source: "stx402.com",
833
+ body: { key: "Memory key" },
834
+ },
835
+ // Agent Registry (ERC-8004)
836
+ {
837
+ path: "/api/agent/info",
838
+ method: "POST",
839
+ description: "Get agent info by ID",
840
+ cost: "Paid",
841
+ category: "Agent Registry",
842
+ source: "stx402.com",
843
+ body: { agentId: "Agent ID" },
844
+ },
845
+ {
846
+ path: "/api/agent/lookup",
847
+ method: "POST",
848
+ description: "Lookup agent by owner address",
849
+ cost: "Paid",
850
+ category: "Agent Registry",
851
+ source: "stx402.com",
852
+ body: { owner: "Owner address" },
853
+ },
854
+ // Agent Reputation
855
+ {
856
+ path: "/api/agent/reputation/summary",
857
+ method: "POST",
858
+ description: "Get agent reputation summary",
859
+ cost: "Paid",
860
+ category: "Agent Reputation",
861
+ source: "stx402.com",
862
+ body: { agentId: "Agent ID" },
863
+ },
864
+ {
865
+ path: "/api/agent/reputation/list",
866
+ method: "POST",
867
+ description: "List all feedback for agent",
868
+ cost: "Paid",
869
+ category: "Agent Reputation",
870
+ source: "stx402.com",
871
+ body: { agentId: "Agent ID" },
872
+ },
873
+ ];
874
+ // =============================================================================
875
+ // EXPORTS
876
+ // =============================================================================
877
+ export const PAID_ENDPOINTS = [...BIWAS_PAID_ENDPOINTS, ...STX402_PAID_ENDPOINTS];
878
+ export const FREE_ENDPOINTS = [...BIWAS_FREE_ENDPOINTS, ...STX402_FREE_ENDPOINTS];
879
+ export const ALL_ENDPOINTS = [...PAID_ENDPOINTS, ...FREE_ENDPOINTS];
880
+ /**
881
+ * Search endpoints by keyword
882
+ */
883
+ export function searchEndpoints(query) {
884
+ const lowerQuery = query.toLowerCase();
885
+ return ALL_ENDPOINTS.filter((endpoint) => endpoint.path.toLowerCase().includes(lowerQuery) ||
886
+ endpoint.description.toLowerCase().includes(lowerQuery) ||
887
+ endpoint.category.toLowerCase().includes(lowerQuery));
888
+ }
889
+ /**
890
+ * Get endpoints by category
891
+ */
892
+ export function getEndpointsByCategory(category) {
893
+ return ALL_ENDPOINTS.filter((endpoint) => endpoint.category.toLowerCase() === category.toLowerCase());
894
+ }
895
+ /**
896
+ * Get endpoints by source
897
+ */
898
+ export function getEndpointsBySource(source) {
899
+ return ALL_ENDPOINTS.filter((endpoint) => endpoint.source === source);
900
+ }
901
+ /**
902
+ * Format endpoints for display
903
+ */
904
+ export function formatEndpointsTable(endpoints) {
905
+ const grouped = endpoints.reduce((acc, endpoint) => {
906
+ const key = `${endpoint.category} (${endpoint.source})`;
907
+ if (!acc[key]) {
908
+ acc[key] = [];
909
+ }
910
+ acc[key].push(endpoint);
911
+ return acc;
912
+ }, {});
913
+ let output = "";
914
+ for (const [category, eps] of Object.entries(grouped)) {
915
+ output += `\n## ${category}\n`;
916
+ for (const ep of eps) {
917
+ output += `- ${ep.method} ${ep.path} (${ep.cost})\n ${ep.description}\n`;
918
+ if (ep.params) {
919
+ output += ` Params: ${JSON.stringify(ep.params)}\n`;
920
+ }
921
+ if (ep.body) {
922
+ output += ` Body: ${JSON.stringify(ep.body)}\n`;
923
+ }
924
+ }
925
+ }
926
+ return output.trim();
927
+ }
928
+ /**
929
+ * Get all unique categories
930
+ */
931
+ export function getCategories() {
932
+ const categories = new Set(ALL_ENDPOINTS.map((ep) => ep.category));
933
+ return Array.from(categories).sort();
934
+ }
935
+ //# sourceMappingURL=registry.js.map