@guiie/buda-mcp 1.5.2 → 1.5.4
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/.github/workflows/publish.yml +17 -7
- package/CHANGELOG.md +52 -0
- package/PUBLISH_CHECKLIST.md +55 -42
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +6 -1
- package/dist/http.js +32 -17
- package/dist/tools/arbitrage.d.ts.map +1 -1
- package/dist/tools/arbitrage.js +11 -0
- package/dist/tools/batch_orders.d.ts +1 -1
- package/dist/tools/batch_orders.d.ts.map +1 -1
- package/dist/tools/batch_orders.js +2 -2
- package/dist/tools/cancel_all_orders.d.ts +1 -1
- package/dist/tools/cancel_all_orders.d.ts.map +1 -1
- package/dist/tools/cancel_all_orders.js +2 -2
- package/dist/tools/cancel_order.d.ts +1 -1
- package/dist/tools/cancel_order.d.ts.map +1 -1
- package/dist/tools/cancel_order.js +2 -2
- package/dist/tools/cancel_order_by_client_id.d.ts +1 -1
- package/dist/tools/cancel_order_by_client_id.d.ts.map +1 -1
- package/dist/tools/cancel_order_by_client_id.js +2 -2
- package/dist/tools/lightning.d.ts +1 -1
- package/dist/tools/lightning.d.ts.map +1 -1
- package/dist/tools/lightning.js +9 -3
- package/dist/tools/place_order.d.ts +1 -1
- package/dist/tools/place_order.d.ts.map +1 -1
- package/dist/tools/place_order.js +2 -2
- package/dist/tools/receive_addresses.d.ts +1 -1
- package/dist/tools/receive_addresses.d.ts.map +1 -1
- package/dist/tools/receive_addresses.js +2 -2
- package/dist/tools/remittances.d.ts +1 -1
- package/dist/tools/remittances.d.ts.map +1 -1
- package/dist/tools/remittances.js +3 -3
- package/dist/tools/withdrawals.d.ts +1 -1
- package/dist/tools/withdrawals.d.ts.map +1 -1
- package/dist/tools/withdrawals.js +7 -3
- package/dist/utils.d.ts +2 -0
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +10 -5
- package/package.json +2 -1
- package/server.json +2 -2
- package/src/client.ts +9 -1
- package/src/http.ts +33 -17
- package/src/tools/arbitrage.ts +12 -0
- package/src/tools/batch_orders.ts +6 -2
- package/src/tools/cancel_all_orders.ts +6 -2
- package/src/tools/cancel_order.ts +6 -2
- package/src/tools/cancel_order_by_client_id.ts +6 -2
- package/src/tools/lightning.ts +14 -4
- package/src/tools/place_order.ts +6 -2
- package/src/tools/receive_addresses.ts +6 -2
- package/src/tools/remittances.ts +7 -3
- package/src/tools/withdrawals.ts +11 -3
- package/src/utils.ts +10 -4
package/src/utils.ts
CHANGED
|
@@ -3,12 +3,18 @@ import type { Amount, OhlcvCandle } from "./types.js";
|
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Constant-time string comparison to prevent timing attacks on bearer tokens.
|
|
6
|
+
* Both strings are written into equal-length buffers before comparing so that
|
|
7
|
+
* neither token length nor content can be inferred from execution time.
|
|
6
8
|
*/
|
|
7
9
|
export function safeTokenEqual(a: string, b: string): boolean {
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
const aByteLen = Buffer.byteLength(a);
|
|
11
|
+
const bByteLen = Buffer.byteLength(b);
|
|
12
|
+
const maxLen = Math.max(aByteLen, bByteLen);
|
|
13
|
+
const aBuf = Buffer.alloc(maxLen);
|
|
14
|
+
const bBuf = Buffer.alloc(maxLen);
|
|
15
|
+
aBuf.write(a);
|
|
16
|
+
bBuf.write(b);
|
|
17
|
+
return timingSafeEqual(aBuf, bBuf) && aByteLen === bByteLen;
|
|
12
18
|
}
|
|
13
19
|
|
|
14
20
|
/**
|