@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
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@ Bitcoin-native MCP server for AI agents: BTC/STX wallets, DeFi yield, sBTC peg,
|
|
|
15
15
|
- **Token Operations** - SIP-010 fungible token transfers and queries
|
|
16
16
|
- **NFT Support** - SIP-009 NFT holdings, transfers, and metadata
|
|
17
17
|
- **DeFi Trading** - ALEX DEX swaps and Zest Protocol lending/borrowing
|
|
18
|
-
- **Stacking/PoX** -
|
|
18
|
+
- **Stacking/PoX-5** - Stake STX with a signer manager, extend, unstake, claim sBTC rewards
|
|
19
19
|
- **BNS Domains** - .btc domain lookups and management (V1 + V2)
|
|
20
20
|
- **x402 Payments** - Automatic payment handling for paid APIs
|
|
21
21
|
|
|
@@ -27,7 +27,9 @@ Bitcoin-native MCP server for AI agents: BTC/STX wallets, DeFi yield, sBTC peg,
|
|
|
27
27
|
npx @aibtc/mcp-server@latest --install
|
|
28
28
|
```
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
This configures Claude Code and creates the agent's wallet: it prints the Stacks and Bitcoin addresses, a generated password and the 24-word mnemonic **once**. Write both down. The mnemonic is stored only encrypted (AES-256-GCM) in `~/.aibtc/` on this machine, and the password is not saved anywhere; the agent asks for it to unlock, and you can change it with `wallet_rotate_password`. If a wallet for the network already exists it is kept. The wallet is only created when the install runs in an interactive terminal (never into a pipe or CI log). Pass `--no-wallet` to skip it and create or import one from the agent instead.
|
|
31
|
+
|
|
32
|
+
Restart your terminal, send a little STX to the printed address, and ask the agent to unlock the wallet and make a paid inference call.
|
|
31
33
|
|
|
32
34
|
### Claude Desktop (App)
|
|
33
35
|
|
|
@@ -114,6 +116,37 @@ npx @aibtc/mcp-server@latest --install --cursor --testnet # Cursor, testnet
|
|
|
114
116
|
|
|
115
117
|
> **Why npx?** Using `npx @aibtc/mcp-server@latest` ensures you always get the newest version automatically. Global installs (`npm install -g`) won't auto-update.
|
|
116
118
|
|
|
119
|
+
### Tool Profiles
|
|
120
|
+
|
|
121
|
+
Every tool definition is loaded into the model's context, so `--install` writes `AIBTC_TOOLS=core`: a lean core of 25 tools: wallet (including `wallet_rotate_password`), balances, STX/BTC/sBTC transfers, x402 (`list_x402_endpoints`, `probe_x402_endpoint`, `execute_x402_endpoint`) and earning (`earning_opportunities`, `bounty_list/get/submit`, `identity_register`).
|
|
122
|
+
|
|
123
|
+
Add groups with `AIBTC_TOOLS=core,defi,ordinals` in the server's `env` (the core is always included), or load everything with `AIBTC_TOOLS=all` / `--profile full`. If `AIBTC_TOOLS` is not set at all, every tool is loaded, so configs written by earlier versions keep all their tools:
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
npx @aibtc/mcp-server@latest --install --profile full # writes AIBTC_TOOLS=all
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
| Group | Tools |
|
|
130
|
+
|-------|-------|
|
|
131
|
+
| `wallet` | Wallet management extras, encrypted credential store |
|
|
132
|
+
| `stacks` | Stacks transactions, contracts, tokens, NFTs, chain queries, nonce tools |
|
|
133
|
+
| `sbtc` | sBTC deposit/withdraw, Styx BTC→sBTC |
|
|
134
|
+
| `bitcoin` | Bitcoin L1 UTXOs, mempool watch |
|
|
135
|
+
| `lightning` | Lightning (Spark) wallet and L402 payments |
|
|
136
|
+
| `stacking` | PoX stacking, dual stacking, StackSpot |
|
|
137
|
+
| `defi` | ALEX, Zest, Bitflow, Jingswap, yield hunter/dashboard, Tenero analytics |
|
|
138
|
+
| `pillar` | Pillar smart wallet |
|
|
139
|
+
| `ordinals` | Inscriptions, runes, PSBT, ordinals marketplace/P2P, taproot multisig |
|
|
140
|
+
| `bns` | BNS names |
|
|
141
|
+
| `identity` | ERC-8004 identity and reputation, message signing |
|
|
142
|
+
| `social` | Nostr, AIBTC inbox |
|
|
143
|
+
| `earn` | Bounty board (create, accept, pay, my views) |
|
|
144
|
+
| `legion` | AIBTC News Legion |
|
|
145
|
+
| `markets` | Stacks prediction market, At Stake |
|
|
146
|
+
| `dev` | Scaffolding, OpenRouter, settings, inference marketplace, arXiv |
|
|
147
|
+
|
|
148
|
+
The server's instructions list the groups that are off, so the agent can tell you which one to enable. The OpenRouter `bridge` starts from the full set and narrows it with its own `--read-only`/`--allow`/`--block` flags.
|
|
149
|
+
|
|
117
150
|
### Manual Configuration
|
|
118
151
|
|
|
119
152
|
If you prefer to configure manually, add the following to your client's config file. The `-y` flag stops npx from prompting for confirmation.
|
|
@@ -181,7 +214,7 @@ NETWORK = "mainnet"
|
|
|
181
214
|
|
|
182
215
|
## Giving Claude a Wallet
|
|
183
216
|
|
|
184
|
-
|
|
217
|
+
`--install` creates a wallet for you (see [Quick Start](#quick-start)). If you installed with `--no-wallet`, configured the client by hand, or want another wallet, the agent can create or import one:
|
|
185
218
|
|
|
186
219
|
### Example Conversation
|
|
187
220
|
|
|
@@ -386,10 +419,14 @@ Both addresses are derived from the same recovery phrase, making it easy to mana
|
|
|
386
419
|
### Stacking / PoX
|
|
387
420
|
| Tool | Description |
|
|
388
421
|
|------|-------------|
|
|
389
|
-
| `get_pox_info` |
|
|
390
|
-
| `get_stacking_status` |
|
|
391
|
-
| `
|
|
392
|
-
| `
|
|
422
|
+
| `get_pox_info` | Current PoX-5 cycle, burn height, prepare phase |
|
|
423
|
+
| `get_stacking_status` | Locked amount, signer manager, unlock height |
|
|
424
|
+
| `list_stacking_signers` | Signer managers in the next cycle's signer set |
|
|
425
|
+
| `stack_stx` | Lock STX with a signer manager |
|
|
426
|
+
| `extend_stacking` | Extend, increase, switch signer or payout (stake-update) |
|
|
427
|
+
| `unstake_stx` | Stop early; unlocks next cycle |
|
|
428
|
+
| `get_stacking_rewards` | Unclaimed sBTC rewards for a cycle |
|
|
429
|
+
| `claim_stacking_rewards` | Claim a cycle's rewards through the signer manager |
|
|
393
430
|
|
|
394
431
|
### BNS Domains (V1 + V2)
|
|
395
432
|
| Tool | Description |
|
|
@@ -543,7 +580,7 @@ Or use any SIP-010 token by contract ID: `SP2X...::token-name`
|
|
|
543
580
|
| Environment Variable | Description | Default |
|
|
544
581
|
|---------------------|-------------|---------|
|
|
545
582
|
| `NETWORK` | `mainnet` or `testnet` | `mainnet` |
|
|
546
|
-
| `
|
|
583
|
+
| `AIBTC_TOOLS` | `core`, `core,<group,...>`, or `all` (see [Tool Profiles](#tool-profiles)). `--install` writes `core` | all tools when unset |
|
|
547
584
|
| `CLIENT_MNEMONIC` | (Optional) Pre-configured mnemonic | - |
|
|
548
585
|
| `HIRO_API_KEY` | (Optional) Hiro API key for higher rate limits | - |
|
|
549
586
|
| `SPEND_LIMIT_ENABLED` | Set `false` to disable the wallet spending limit | `true` |
|
package/dist/bridge/index.js
CHANGED
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
* --network <net> mainnet|testnet for the spawned server (default mainnet)
|
|
28
28
|
* --max-turns <n> tool-call loop cap (default 10)
|
|
29
29
|
*/
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
30
|
+
import { StdioClientTransport } from "@modelcontextprotocol/client/stdio";
|
|
31
|
+
import { Client } from "@modelcontextprotocol/client";
|
|
32
|
+
import { STATIC_ENDPOINTS } from "../endpoints/registry.js";
|
|
33
33
|
const OPENROUTER_URL = "https://openrouter.ai/api/v1/chat/completions";
|
|
34
34
|
const DEFAULT_MODEL = "anthropic/claude-3.5-haiku";
|
|
35
35
|
/**
|
|
@@ -154,7 +154,7 @@ function printSafetyReceipt(opts, exposed, totalTools) {
|
|
|
154
154
|
` write_tool_count=${writeToolCount}`,
|
|
155
155
|
` blocked_tool_count=${opts.block.size}`,
|
|
156
156
|
` session_spend_cap=${opts.maxSpendUstx ?? "default"} uSTX / ${opts.maxSpendSats ?? "default"} sats`,
|
|
157
|
-
`
|
|
157
|
+
` x402_static_endpoints=${STATIC_ENDPOINTS.length}`,
|
|
158
158
|
" (reports configured execution boundaries only; no value has moved)",
|
|
159
159
|
];
|
|
160
160
|
console.error(lines.join("\n"));
|
|
@@ -9,7 +9,7 @@ export declare const MAINNET_CONTRACTS: {
|
|
|
9
9
|
readonly SBTC_WITHDRAWAL: "SM3VDXK3WZZSA84XXFKAFAF15NNZX32CTSG82JFQ4.sbtc-withdrawal";
|
|
10
10
|
readonly USDCX: "SP120SBRBQJ00MCWS7TM5R8WJNTTKD5K0HFRC2CNE.usdcx";
|
|
11
11
|
readonly BNS: "SP000000000000000000002Q6VF78.bns";
|
|
12
|
-
readonly
|
|
12
|
+
readonly POX_5: "SP000000000000000000002Q6VF78.pox-5";
|
|
13
13
|
readonly ALEX_AMM_POOL: "SP3K8BC0PPEVCV7NZ6QSRWPQ2JE9E5B6N3PA0KBR9.amm-swap-pool-v1-1";
|
|
14
14
|
readonly ALEX_TOKEN: "SP102V8P0F7JX67ARQ77WEA3D3CFB5XW39REDT0AM.token-alex";
|
|
15
15
|
readonly ALEX_WSTX: "SP102V8P0F7JX67ARQ77WEA3D3CFB5XW39REDT0AM.token-wstx-v2";
|
|
@@ -57,7 +57,7 @@ export declare const TESTNET_CONTRACTS: {
|
|
|
57
57
|
readonly SBTC_WITHDRAWAL: "ST1F7QA2MDF17S807EPA36TSS8AMEFY4KA9TVGWXT.sbtc-withdrawal";
|
|
58
58
|
readonly USDCX: "ST1F7QA2MDF17S807EPA36TSS8AMEFY4KA9TVGWXT.usdcx";
|
|
59
59
|
readonly BNS: "ST000000000000000000002AMW42H.bns";
|
|
60
|
-
readonly
|
|
60
|
+
readonly POX_5: "ST000000000000000000002AMW42H.pox-5";
|
|
61
61
|
readonly IDENTITY_REGISTRY: "ST3YT0XW92E6T2FE59B2G5N2WNNFSBZ6MZKQS5D18.identity-registry-v2";
|
|
62
62
|
readonly REPUTATION_REGISTRY: "ST3YT0XW92E6T2FE59B2G5N2WNNFSBZ6MZKQS5D18.reputation-registry-v2";
|
|
63
63
|
readonly VALIDATION_REGISTRY: "ST3YT0XW92E6T2FE59B2G5N2WNNFSBZ6MZKQS5D18.validation-registry-v2";
|
|
@@ -72,7 +72,7 @@ export declare function getContracts(network: Network): {
|
|
|
72
72
|
readonly SBTC_WITHDRAWAL: "SM3VDXK3WZZSA84XXFKAFAF15NNZX32CTSG82JFQ4.sbtc-withdrawal";
|
|
73
73
|
readonly USDCX: "SP120SBRBQJ00MCWS7TM5R8WJNTTKD5K0HFRC2CNE.usdcx";
|
|
74
74
|
readonly BNS: "SP000000000000000000002Q6VF78.bns";
|
|
75
|
-
readonly
|
|
75
|
+
readonly POX_5: "SP000000000000000000002Q6VF78.pox-5";
|
|
76
76
|
readonly ALEX_AMM_POOL: "SP3K8BC0PPEVCV7NZ6QSRWPQ2JE9E5B6N3PA0KBR9.amm-swap-pool-v1-1";
|
|
77
77
|
readonly ALEX_TOKEN: "SP102V8P0F7JX67ARQ77WEA3D3CFB5XW39REDT0AM.token-alex";
|
|
78
78
|
readonly ALEX_WSTX: "SP102V8P0F7JX67ARQ77WEA3D3CFB5XW39REDT0AM.token-wstx-v2";
|
|
@@ -96,7 +96,7 @@ export declare function getContracts(network: Network): {
|
|
|
96
96
|
readonly SBTC_WITHDRAWAL: "ST1F7QA2MDF17S807EPA36TSS8AMEFY4KA9TVGWXT.sbtc-withdrawal";
|
|
97
97
|
readonly USDCX: "ST1F7QA2MDF17S807EPA36TSS8AMEFY4KA9TVGWXT.usdcx";
|
|
98
98
|
readonly BNS: "ST000000000000000000002AMW42H.bns";
|
|
99
|
-
readonly
|
|
99
|
+
readonly POX_5: "ST000000000000000000002AMW42H.pox-5";
|
|
100
100
|
readonly IDENTITY_REGISTRY: "ST3YT0XW92E6T2FE59B2G5N2WNNFSBZ6MZKQS5D18.identity-registry-v2";
|
|
101
101
|
readonly REPUTATION_REGISTRY: "ST3YT0XW92E6T2FE59B2G5N2WNNFSBZ6MZKQS5D18.reputation-registry-v2";
|
|
102
102
|
readonly VALIDATION_REGISTRY: "ST3YT0XW92E6T2FE59B2G5N2WNNFSBZ6MZKQS5D18.validation-registry-v2";
|
package/dist/config/contracts.js
CHANGED
|
@@ -12,7 +12,7 @@ export const MAINNET_CONTRACTS = {
|
|
|
12
12
|
// BNS
|
|
13
13
|
BNS: "SP000000000000000000002Q6VF78.bns",
|
|
14
14
|
// Stacking
|
|
15
|
-
|
|
15
|
+
POX_5: "SP000000000000000000002Q6VF78.pox-5",
|
|
16
16
|
// ALEX DEX (SDK handles most operations, but we need pool contract for queries)
|
|
17
17
|
ALEX_AMM_POOL: "SP3K8BC0PPEVCV7NZ6QSRWPQ2JE9E5B6N3PA0KBR9.amm-swap-pool-v1-1",
|
|
18
18
|
ALEX_TOKEN: "SP102V8P0F7JX67ARQ77WEA3D3CFB5XW39REDT0AM.token-alex",
|
|
@@ -112,7 +112,7 @@ export const TESTNET_CONTRACTS = {
|
|
|
112
112
|
// BNS
|
|
113
113
|
BNS: "ST000000000000000000002AMW42H.bns",
|
|
114
114
|
// Stacking
|
|
115
|
-
|
|
115
|
+
POX_5: "ST000000000000000000002AMW42H.pox-5",
|
|
116
116
|
// ERC-8004 Identity & Reputation
|
|
117
117
|
IDENTITY_REGISTRY: "ST3YT0XW92E6T2FE59B2G5N2WNNFSBZ6MZKQS5D18.identity-registry-v2",
|
|
118
118
|
REPUTATION_REGISTRY: "ST3YT0XW92E6T2FE59B2G5N2WNNFSBZ6MZKQS5D18.reputation-registry-v2",
|
package/dist/config/networks.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
export const NETWORK = process.env.NETWORK === "testnet" ? "testnet" : "mainnet";
|
|
2
|
-
|
|
2
|
+
// Base URL for bare-path x402 calls. Fixed per network, not read from the
|
|
3
|
+
// environment: the server loads the .env of whatever directory the client
|
|
4
|
+
// starts it in, and a project's generic API_URL must not redirect payments.
|
|
5
|
+
export const API_URL = NETWORK === "mainnet" ? "https://x402.aibtc.com" : "https://x402.aibtc.dev";
|
|
3
6
|
export function getStacksNetwork(network) {
|
|
4
7
|
return network === "mainnet" ? "mainnet" : "testnet";
|
|
5
8
|
}
|
|
@@ -1,41 +1,23 @@
|
|
|
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
|
-
export type
|
|
7
|
+
export type StaticX402Source = "x402.biwas.xyz" | "aibtc.com";
|
|
6
8
|
export interface X402Endpoint {
|
|
7
9
|
path: string;
|
|
8
10
|
method: "GET" | "POST" | "PUT" | "DELETE";
|
|
9
11
|
description: string;
|
|
10
12
|
cost: string;
|
|
11
13
|
category: string;
|
|
12
|
-
source:
|
|
14
|
+
source: string;
|
|
13
15
|
params?: Record<string, string>;
|
|
14
16
|
body?: Record<string, string>;
|
|
15
17
|
}
|
|
16
|
-
export declare const
|
|
17
|
-
/**
|
|
18
|
-
* Search endpoints by keyword
|
|
19
|
-
*/
|
|
20
|
-
export declare function searchEndpoints(query: string): X402Endpoint[];
|
|
21
|
-
/**
|
|
22
|
-
* Get endpoints by source
|
|
23
|
-
*/
|
|
24
|
-
export declare function getEndpointsBySource(source: X402Source): X402Endpoint[];
|
|
18
|
+
export declare const STATIC_ENDPOINTS: X402Endpoint[];
|
|
25
19
|
/**
|
|
26
|
-
* Format endpoints for display
|
|
20
|
+
* Format endpoints for display, grouped by category and source.
|
|
27
21
|
*/
|
|
28
22
|
export declare function formatEndpointsTable(endpoints: X402Endpoint[]): string;
|
|
29
|
-
/**
|
|
30
|
-
* Get all unique categories
|
|
31
|
-
*/
|
|
32
|
-
export declare function getCategories(): string[];
|
|
33
|
-
/**
|
|
34
|
-
* Lookup an endpoint in the registry by method, path, and source URL.
|
|
35
|
-
* Used to determine if an endpoint is known-FREE or known-PAID before
|
|
36
|
-
* deciding whether to use a payment-capable client.
|
|
37
|
-
*
|
|
38
|
-
* Supports path patterns with placeholders like {address}, {messageId}, etc.
|
|
39
|
-
*/
|
|
40
|
-
export declare function lookupEndpoint(method: string, path: string, sourceUrl: string): X402Endpoint | undefined;
|
|
41
23
|
//# sourceMappingURL=registry.d.ts.map
|