@aibtc/mcp-server 1.36.0 → 1.37.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/services/defi.service.d.ts.map +1 -1
- package/dist/services/defi.service.js +4 -17
- package/dist/services/defi.service.js.map +1 -1
- package/dist/services/wallet-manager.d.ts.map +1 -1
- package/dist/services/wallet-manager.js +7 -0
- package/dist/services/wallet-manager.js.map +1 -1
- package/dist/tools/contract.tools.d.ts.map +1 -1
- package/dist/tools/contract.tools.js +3 -2
- package/dist/tools/contract.tools.js.map +1 -1
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +15 -0
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/jingswap.tools.d.ts +3 -0
- package/dist/tools/jingswap.tools.d.ts.map +1 -0
- package/dist/tools/jingswap.tools.js +471 -0
- package/dist/tools/jingswap.tools.js.map +1 -0
- package/dist/tools/nostr.tools.d.ts +3 -0
- package/dist/tools/nostr.tools.d.ts.map +1 -0
- package/dist/tools/nostr.tools.js +409 -0
- package/dist/tools/nostr.tools.js.map +1 -0
- package/dist/tools/ordinals-p2p.tools.d.ts +21 -0
- package/dist/tools/ordinals-p2p.tools.d.ts.map +1 -0
- package/dist/tools/ordinals-p2p.tools.js +621 -0
- package/dist/tools/ordinals-p2p.tools.js.map +1 -0
- package/dist/tools/relay-diagnostic.tools.d.ts.map +1 -1
- package/dist/tools/relay-diagnostic.tools.js +27 -4
- package/dist/tools/relay-diagnostic.tools.js.map +1 -1
- package/dist/tools/skill-mappings.d.ts.map +1 -1
- package/dist/tools/skill-mappings.js +13 -1
- package/dist/tools/skill-mappings.js.map +1 -1
- package/dist/tools/stacks-market.tools.d.ts +22 -0
- package/dist/tools/stacks-market.tools.d.ts.map +1 -0
- package/dist/tools/stacks-market.tools.js +630 -0
- package/dist/tools/stacks-market.tools.js.map +1 -0
- package/dist/tools/taproot-multisig.tools.d.ts +17 -0
- package/dist/tools/taproot-multisig.tools.d.ts.map +1 -0
- package/dist/tools/taproot-multisig.tools.js +236 -0
- package/dist/tools/taproot-multisig.tools.js.map +1 -0
- package/dist/tools/transfer.tools.js +1 -1
- package/dist/tools/transfer.tools.js.map +1 -1
- package/dist/transactions/builder.d.ts +35 -1
- package/dist/transactions/builder.d.ts.map +1 -1
- package/dist/transactions/builder.js +153 -4
- package/dist/transactions/builder.js.map +1 -1
- package/dist/utils/fee.d.ts +15 -0
- package/dist/utils/fee.d.ts.map +1 -1
- package/dist/utils/fee.js +36 -4
- package/dist/utils/fee.js.map +1 -1
- package/package.json +4 -1
- package/skill/SKILL.md +1 -1
package/dist/utils/fee.js
CHANGED
|
@@ -9,12 +9,18 @@ import { getHiroApi } from "../services/hiro-api.js";
|
|
|
9
9
|
/**
|
|
10
10
|
* Fee floor and ceiling clamps by transaction type (in micro-STX).
|
|
11
11
|
* Prevents absurd fees during mempool spikes while allowing reasonable variation.
|
|
12
|
+
*
|
|
13
|
+
* Ceilings are set conservatively:
|
|
14
|
+
* token_transfer: 3,000 uSTX (0.003 STX) — simple transfer
|
|
15
|
+
* contract_call: 50,000 uSTX (0.05 STX) — complex contract call
|
|
16
|
+
* smart_contract: 50,000 uSTX (0.05 STX) — deployment
|
|
17
|
+
* These match the x402-sponsor-relay reference implementation.
|
|
12
18
|
*/
|
|
13
19
|
const FEE_CLAMPS = {
|
|
14
20
|
token_transfer: { floor: 180n, ceiling: 3000n },
|
|
15
|
-
contract_call: { floor: 3000n, ceiling:
|
|
16
|
-
smart_contract: { floor: 10000n, ceiling:
|
|
17
|
-
all: { floor: 180n, ceiling:
|
|
21
|
+
contract_call: { floor: 3000n, ceiling: 50000n },
|
|
22
|
+
smart_contract: { floor: 10000n, ceiling: 50000n },
|
|
23
|
+
all: { floor: 180n, ceiling: 50000n }, // Widest range for aggregate fees
|
|
18
24
|
};
|
|
19
25
|
/**
|
|
20
26
|
* Check if a string is a valid fee preset.
|
|
@@ -90,6 +96,32 @@ export async function resolveFee(fee, network, txType = "all") {
|
|
|
90
96
|
if (!/^\d+$/.test(normalizedFee)) {
|
|
91
97
|
throw new Error(`Invalid fee value "${fee}" – expected a non-negative integer string in micro-STX or preset ("low", "medium", "high").`);
|
|
92
98
|
}
|
|
93
|
-
|
|
99
|
+
// Clamp numeric overrides to the txType ceiling so user-specified fees
|
|
100
|
+
// can't accidentally produce NotEnoughFunds on complex calls.
|
|
101
|
+
const numericFee = BigInt(normalizedFee);
|
|
102
|
+
const clamps = FEE_CLAMPS[txType];
|
|
103
|
+
return clampFee(numericFee, clamps.floor, clamps.ceiling);
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Resolve a default medium-priority fee for a given transaction type.
|
|
107
|
+
*
|
|
108
|
+
* Used by builder functions when the caller does not supply an explicit fee,
|
|
109
|
+
* so that ALL write paths receive a clamped fee rather than relying on the
|
|
110
|
+
* unclamped @stacks/transactions auto-estimation which can over-shoot.
|
|
111
|
+
*
|
|
112
|
+
* Falls back gracefully: if the Hiro mempool API is unreachable, returns the
|
|
113
|
+
* floor × 2 (medium multiplier) for the tx type.
|
|
114
|
+
*
|
|
115
|
+
* @param network - The Stacks network to fetch fee estimates from
|
|
116
|
+
* @param txType - The transaction type for ceiling/floor selection
|
|
117
|
+
* @returns Fee in micro-STX as bigint
|
|
118
|
+
*/
|
|
119
|
+
export async function resolveDefaultFee(network, txType = "contract_call") {
|
|
120
|
+
const resolved = await resolveFee("medium", network, txType);
|
|
121
|
+
// resolveFee("medium", ...) always returns a value (never undefined) because
|
|
122
|
+
// "medium" is a valid preset — the cast is safe.
|
|
123
|
+
// Fallback path (when Hiro is unreachable): returns floor × 2 for the txType.
|
|
124
|
+
// This risks slow inclusion during congestion but prevents hard failures.
|
|
125
|
+
return resolved;
|
|
94
126
|
}
|
|
95
127
|
//# sourceMappingURL=fee.js.map
|
package/dist/utils/fee.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fee.js","sourceRoot":"","sources":["../../src/utils/f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AAuB,WAAW,UAAU,GAAG,YAAY,MAAM,QAAQ,CAC1E,CAAC;YAEF,OAAO,WAAW,CAAC;QACrB,CAAC;IACH,CAAC;IAED,MAAM,aAAa,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC;IACjC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC,EAAE,CAAC;QACjC,MAAM,IAAI,KAAK,CACb,sBAAsB,GAAG,8FAA8F,CACxH,CAAC;IACJ,CAAC;IAED,uEAAuE;IACvE,8DAA8D;IAC9D,MAAM,UAAU,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC;IACzC,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;IAClC,OAAO,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;AAC5D,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,OAAgB,EAChB,SAAgE,eAAe;IAE/E,MAAM,QAAQ,GAAG,MAAM,UAAU,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IAC7D,6EAA6E;IAC7E,iDAAiD;IACjD,8EAA8E;IAC9E,0EAA0E;IAC1E,OAAO,QAAkB,CAAC;AAC5B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aibtc/mcp-server",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.37.0",
|
|
4
4
|
"description": "Bitcoin-native MCP server for AI agents: BTC/STX wallets, DeFi yield, sBTC peg, NFTs, and x402 payments.",
|
|
5
5
|
"mcpName": "io.github.aibtcdev/mcp-server",
|
|
6
6
|
"type": "module",
|
|
@@ -60,12 +60,15 @@
|
|
|
60
60
|
"axios": "^1.13.6",
|
|
61
61
|
"dotenv": "^17.3.1",
|
|
62
62
|
"micro-ordinals": "^0.3.0",
|
|
63
|
+
"nostr-tools": "^2.23.3",
|
|
63
64
|
"sbtc": "^0.3.2",
|
|
64
65
|
"tslib": "^2.8.1",
|
|
66
|
+
"ws": "^8.19.0",
|
|
65
67
|
"zod": "^4.3.6"
|
|
66
68
|
},
|
|
67
69
|
"devDependencies": {
|
|
68
70
|
"@types/node": "^22.19.13",
|
|
71
|
+
"@types/ws": "^8.18.1",
|
|
69
72
|
"tsx": "^4.21.0",
|
|
70
73
|
"typescript": "^5.9.3",
|
|
71
74
|
"vitest": "^4.0.18"
|
package/skill/SKILL.md
CHANGED
|
@@ -4,7 +4,7 @@ description: Bitcoin L1 wallet for agents - check balances, send BTC, manage UTX
|
|
|
4
4
|
license: MIT
|
|
5
5
|
metadata:
|
|
6
6
|
author: aibtcdev
|
|
7
|
-
version: 1.
|
|
7
|
+
version: 1.37.0 # x-release-please-version
|
|
8
8
|
npm: "@aibtc/mcp-server"
|
|
9
9
|
github: https://github.com/aibtcdev/aibtc-mcp-server
|
|
10
10
|
---
|