crypto-quant-signal-mcp 1.25.0 → 1.26.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 +13 -23
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +78 -19
- package/dist/index.js.map +1 -1
- package/dist/lib/account-handlers.js +7 -7
- package/dist/lib/account-handlers.js.map +1 -1
- package/dist/lib/adapters/binance.d.ts.map +1 -1
- package/dist/lib/adapters/binance.js +30 -20
- package/dist/lib/adapters/binance.js.map +1 -1
- package/dist/lib/adapters/bingx.d.ts.map +1 -1
- package/dist/lib/adapters/bingx.js +27 -15
- package/dist/lib/adapters/bingx.js.map +1 -1
- package/dist/lib/adapters/bitget.d.ts.map +1 -1
- package/dist/lib/adapters/bitget.js +27 -17
- package/dist/lib/adapters/bitget.js.map +1 -1
- package/dist/lib/adapters/bitmart.d.ts.map +1 -1
- package/dist/lib/adapters/bitmart.js +32 -17
- package/dist/lib/adapters/bitmart.js.map +1 -1
- package/dist/lib/adapters/bybit.d.ts.map +1 -1
- package/dist/lib/adapters/bybit.js +31 -19
- package/dist/lib/adapters/bybit.js.map +1 -1
- package/dist/lib/adapters/edgex.d.ts.map +1 -1
- package/dist/lib/adapters/edgex.js +4 -7
- package/dist/lib/adapters/edgex.js.map +1 -1
- package/dist/lib/adapters/gateio.d.ts.map +1 -1
- package/dist/lib/adapters/gateio.js +34 -20
- package/dist/lib/adapters/gateio.js.map +1 -1
- package/dist/lib/adapters/htx.d.ts.map +1 -1
- package/dist/lib/adapters/htx.js +13 -6
- package/dist/lib/adapters/htx.js.map +1 -1
- package/dist/lib/adapters/hyperliquid.d.ts.map +1 -1
- package/dist/lib/adapters/hyperliquid.js +32 -24
- package/dist/lib/adapters/hyperliquid.js.map +1 -1
- package/dist/lib/adapters/kucoin.js +1 -1
- package/dist/lib/adapters/kucoin.js.map +1 -1
- package/dist/lib/adapters/okx.d.ts.map +1 -1
- package/dist/lib/adapters/okx.js +27 -19
- package/dist/lib/adapters/okx.js.map +1 -1
- package/dist/lib/adapters/phemex.d.ts.map +1 -1
- package/dist/lib/adapters/phemex.js +27 -15
- package/dist/lib/adapters/phemex.js.map +1 -1
- package/dist/lib/adapters/weex.d.ts.map +1 -1
- package/dist/lib/adapters/weex.js +26 -14
- package/dist/lib/adapters/weex.js.map +1 -1
- package/dist/lib/adapters/whitebit.d.ts.map +1 -1
- package/dist/lib/adapters/whitebit.js +31 -17
- package/dist/lib/adapters/whitebit.js.map +1 -1
- package/dist/lib/adapters/xt.d.ts.map +1 -1
- package/dist/lib/adapters/xt.js +26 -13
- package/dist/lib/adapters/xt.js.map +1 -1
- package/dist/lib/contact-leads-store.d.ts +28 -0
- package/dist/lib/contact-leads-store.d.ts.map +1 -0
- package/dist/lib/contact-leads-store.js +64 -0
- package/dist/lib/contact-leads-store.js.map +1 -0
- package/dist/lib/contact-page.d.ts +31 -0
- package/dist/lib/contact-page.d.ts.map +1 -0
- package/dist/lib/contact-page.js +103 -0
- package/dist/lib/contact-page.js.map +1 -0
- package/dist/lib/contact-submit.d.ts +87 -0
- package/dist/lib/contact-submit.d.ts.map +1 -0
- package/dist/lib/contact-submit.js +97 -0
- package/dist/lib/contact-submit.js.map +1 -0
- package/dist/lib/email.d.ts +40 -0
- package/dist/lib/email.d.ts.map +1 -1
- package/dist/lib/email.js +112 -23
- package/dist/lib/email.js.map +1 -1
- package/dist/lib/errors.d.ts +11 -0
- package/dist/lib/errors.d.ts.map +1 -1
- package/dist/lib/errors.js +15 -0
- package/dist/lib/errors.js.map +1 -1
- package/dist/lib/funnel-scoreboard.d.ts.map +1 -1
- package/dist/lib/funnel-scoreboard.js +18 -11
- package/dist/lib/funnel-scoreboard.js.map +1 -1
- package/dist/lib/funnel-snapshot.d.ts +46 -0
- package/dist/lib/funnel-snapshot.d.ts.map +1 -1
- package/dist/lib/funnel-snapshot.js +136 -5
- package/dist/lib/funnel-snapshot.js.map +1 -1
- package/dist/lib/indeterminate-counter.d.ts +52 -0
- package/dist/lib/indeterminate-counter.d.ts.map +1 -0
- package/dist/lib/indeterminate-counter.js +72 -0
- package/dist/lib/indeterminate-counter.js.map +1 -0
- package/dist/lib/integrations-data/ai-agents.js +1 -1
- package/dist/lib/integrations-data/mcp-clients.d.ts +20 -8
- package/dist/lib/integrations-data/mcp-clients.d.ts.map +1 -1
- package/dist/lib/integrations-data/mcp-clients.js +180 -10
- package/dist/lib/integrations-data/mcp-clients.js.map +1 -1
- package/dist/lib/integrations-data/types.d.ts +47 -3
- package/dist/lib/integrations-data/types.d.ts.map +1 -1
- package/dist/lib/integrations-data/types.js +11 -2
- package/dist/lib/integrations-data/types.js.map +1 -1
- package/dist/lib/license.d.ts +9 -2
- package/dist/lib/license.d.ts.map +1 -1
- package/dist/lib/license.js +52 -7
- package/dist/lib/license.js.map +1 -1
- package/dist/lib/nudge-copy.d.ts.map +1 -1
- package/dist/lib/nudge-copy.js +13 -2
- package/dist/lib/nudge-copy.js.map +1 -1
- package/dist/lib/performance-db.d.ts.map +1 -1
- package/dist/lib/performance-db.js +52 -0
- package/dist/lib/performance-db.js.map +1 -1
- package/dist/lib/plans.d.ts +55 -1
- package/dist/lib/plans.d.ts.map +1 -1
- package/dist/lib/plans.js +102 -4
- package/dist/lib/plans.js.map +1 -1
- package/dist/lib/referral-pages.js +1 -1
- package/dist/lib/signin-component.js +1 -1
- package/dist/lib/signup-flow.d.ts +13 -15
- package/dist/lib/signup-flow.d.ts.map +1 -1
- package/dist/lib/signup-flow.js +70 -32
- package/dist/lib/signup-flow.js.map +1 -1
- package/dist/lib/stripe.d.ts +82 -1
- package/dist/lib/stripe.d.ts.map +1 -1
- package/dist/lib/stripe.js +165 -62
- package/dist/lib/stripe.js.map +1 -1
- package/dist/lib/subscriber-attribution.d.ts +59 -1
- package/dist/lib/subscriber-attribution.d.ts.map +1 -1
- package/dist/lib/subscriber-attribution.js +108 -2
- package/dist/lib/subscriber-attribution.js.map +1 -1
- package/dist/lib/telegram.d.ts +26 -0
- package/dist/lib/telegram.d.ts.map +1 -1
- package/dist/lib/telegram.js +53 -11
- package/dist/lib/telegram.js.map +1 -1
- package/dist/lib/venue-store.d.ts +43 -0
- package/dist/lib/venue-store.d.ts.map +1 -1
- package/dist/lib/venue-store.js +95 -0
- package/dist/lib/venue-store.js.map +1 -1
- package/dist/lib/welcome-page.js +1 -1
- package/dist/lib/x402-http-routes.d.ts.map +1 -1
- package/dist/lib/x402-http-routes.js +36 -6
- package/dist/lib/x402-http-routes.js.map +1 -1
- package/dist/lib/x402-idempotency-store.d.ts +39 -9
- package/dist/lib/x402-idempotency-store.d.ts.map +1 -1
- package/dist/lib/x402-idempotency-store.js +89 -39
- package/dist/lib/x402-idempotency-store.js.map +1 -1
- package/dist/lib/x402-operator-wallets.d.ts +40 -2
- package/dist/lib/x402-operator-wallets.d.ts.map +1 -1
- package/dist/lib/x402-operator-wallets.js +42 -3
- package/dist/lib/x402-operator-wallets.js.map +1 -1
- package/dist/lib/x402.d.ts +1 -1
- package/dist/lib/x402.d.ts.map +1 -1
- package/dist/lib/x402.js +7 -5
- package/dist/lib/x402.js.map +1 -1
- package/dist/scripts/backfill-x402-payer-wallet.d.ts +22 -0
- package/dist/scripts/backfill-x402-payer-wallet.d.ts.map +1 -1
- package/dist/scripts/backfill-x402-payer-wallet.js +113 -20
- package/dist/scripts/backfill-x402-payer-wallet.js.map +1 -1
- package/dist/scripts/evaluate-venues.d.ts +44 -6
- package/dist/scripts/evaluate-venues.d.ts.map +1 -1
- package/dist/scripts/evaluate-venues.js +120 -10
- package/dist/scripts/evaluate-venues.js.map +1 -1
- package/dist/scripts/extend-venue.d.ts +22 -0
- package/dist/scripts/extend-venue.d.ts.map +1 -0
- package/dist/scripts/extend-venue.js +207 -0
- package/dist/scripts/extend-venue.js.map +1 -0
- package/dist/tool-descriptions.d.ts +1 -1
- package/dist/tool-descriptions.d.ts.map +1 -1
- package/dist/tool-descriptions.js +1 -1
- package/dist/tool-descriptions.js.map +1 -1
- package/dist/types.d.ts +9 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -2
- package/server.json +2 -2
package/README.md
CHANGED
|
@@ -11,11 +11,11 @@
|
|
|
11
11
|
</p>
|
|
12
12
|
|
|
13
13
|
<p align="center">
|
|
14
|
-
<span data-tr-field="pfe_wr">91.
|
|
14
|
+
<span data-tr-field="pfe_wr">91.8%</span> PFE win rate across <span data-tr-field="total_calls">447,056</span>+ verified calls. Merkle-verified on Base L2. Don't trust — verify. <!-- SNAPSHOT-LINE -->
|
|
15
15
|
</p>
|
|
16
16
|
|
|
17
17
|
<p align="center">
|
|
18
|
-
<strong>100 free calls/month.
|
|
18
|
+
<strong>100 free calls/month. Start in 30 seconds.</strong>
|
|
19
19
|
</p>
|
|
20
20
|
|
|
21
21
|
<p align="center">
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
|
|
44
44
|
No code. No API key. No install. The server speaks Streamable HTTP at `https://api.algovault.com/mcp` — any [Model Context Protocol](https://github.com/modelcontextprotocol) client connects directly.
|
|
45
45
|
|
|
46
|
-
**1. Add the connector.** In Claude → Settings →
|
|
46
|
+
**1. Add the connector.** In Claude → Settings → Connectors → Add custom connector:
|
|
47
47
|
|
|
48
48
|
| Field | Value |
|
|
49
49
|
|---|---|
|
|
@@ -94,7 +94,7 @@ Under the hood, a self-tuning model fuses momentum, trend structure, derivatives
|
|
|
94
94
|
{ "coin": "SOL", "timeframe": "15m", "confidence": 73 }
|
|
95
95
|
],
|
|
96
96
|
"_algovault": {
|
|
97
|
-
"version": "1.
|
|
97
|
+
"version": "1.26.0",
|
|
98
98
|
"tool": "get_trade_call",
|
|
99
99
|
"compatible_with": ["crypto-quant-risk-mcp", "crypto-quant-backtest-mcp"]
|
|
100
100
|
}
|
|
@@ -112,7 +112,7 @@ The `_algovault` block makes outputs composable: downstream risk and backtest to
|
|
|
112
112
|
scripts/snapshot-landing-data.mjs at npm-publish + Hetzner-deploy. Do NOT hand-edit the
|
|
113
113
|
numbers; edit "What's new" by hand. Wired by OPS-NPM-README-SINGLE-SOT-W1 (2026-05-31). -->
|
|
114
114
|
<p align="center">
|
|
115
|
-
<strong><span data-tr-field="pfe_wr">91.
|
|
115
|
+
<strong><span data-tr-field="pfe_wr">91.8%</span> PFE Win Rate</strong> · <strong><span data-tr-field="total_calls">447,056</span> trade calls</strong> · <strong><span data-tr-field="merkle_batches">118</span> on-chain batches</strong> · <strong><span data-tr-field="hold_rate">99.2%</span> HOLD rate</strong> <!-- SNAPSHOT-LINE -->
|
|
116
116
|
</p>
|
|
117
117
|
|
|
118
118
|
<p align="center">
|
|
@@ -138,7 +138,7 @@ AlgoVault is drop-in for every MCP-spec client, every major agent framework, and
|
|
|
138
138
|
|
|
139
139
|
| Client | Config |
|
|
140
140
|
|---|---|
|
|
141
|
-
| **Claude Desktop** | Settings →
|
|
141
|
+
| **Claude Desktop** | Settings → Connectors → Add custom connector → `https://api.algovault.com/mcp` |
|
|
142
142
|
| **Claude Code** (CLI) | `claude mcp add crypto-quant-signal https://api.algovault.com/mcp` |
|
|
143
143
|
| **Cursor** | `~/.cursor/config.json` → `mcpServers` block → `url: "https://api.algovault.com/mcp"` |
|
|
144
144
|
| **Cline** | VS Code Cline extension → MCP server settings → add Streamable HTTP server |
|
|
@@ -229,12 +229,12 @@ Single-prompt wrappers over 1–3 tool calls — regime gating, multi-timeframe
|
|
|
229
229
|
|
|
230
230
|
## Pricing
|
|
231
231
|
|
|
232
|
-
Quota-only tiers. Every tier gets all venues, all assets, all timeframes — you pay for call volume, nothing else.
|
|
232
|
+
Quota-only tiers. Every tier gets all venues, all assets, all timeframes — you pay for call volume, nothing else.
|
|
233
233
|
|
|
234
234
|
| Feature | Free | Starter ($9.99/mo) | Pro ($49/mo) | Enterprise ($299/mo) | x402 (per call) |
|
|
235
235
|
|---------|------|-------------------|-------------|---------------------|-----------------|
|
|
236
236
|
| Exchanges | All 15 | All 15 | All 15 | All 15 | All 15 | <!-- SNAPSHOT-LINE-TABLE -->
|
|
237
|
-
| Assets | All
|
|
237
|
+
| Assets | All 1530+ | All 1530+ | All 1530+ | All 1530+ | All 1530+ | <!-- SNAPSHOT-LINE-TABLE -->
|
|
238
238
|
| Asset classes | Crypto + TradFi | Crypto + TradFi | Crypto + TradFi | Crypto + TradFi | Crypto + TradFi |
|
|
239
239
|
| Timeframes | All 11 | All 11 | All 11 | All 11 | All 11 |
|
|
240
240
|
| Funding arb results | Top 5 | Unlimited | Unlimited | Unlimited | Unlimited |
|
|
@@ -242,9 +242,7 @@ Quota-only tiers. Every tier gets all venues, all assets, all timeframes — you
|
|
|
242
242
|
| Monthly calls | 100/mo | 3,000/mo | 15,000/mo | 100,000/mo | Unlimited |
|
|
243
243
|
| Support | Community | Email | Priority | Dedicated | — |
|
|
244
244
|
| Price | $0 | $9.99/mo | $49/mo | $299/mo | $0.01–0.05/call |
|
|
245
|
-
| HOLD calls | Free | Free | Free | Free | Free |
|
|
246
245
|
|
|
247
|
-
\* HOLD verdicts (engine says "don't trade") are always free across all tiers — no x402 charge, no quota deduction. We only get paid when we see a tradeable opportunity.
|
|
248
246
|
|
|
249
247
|
**Subscriptions:** Sign up at [api.algovault.com/signup](https://api.algovault.com/signup). Starter ($9.99/mo) unlocks 3,000 calls/mo. API key delivered instantly after checkout.
|
|
250
248
|
|
|
@@ -252,7 +250,11 @@ Quota-only tiers. Every tier gets all venues, all assets, all timeframes — you
|
|
|
252
250
|
|
|
253
251
|
---
|
|
254
252
|
|
|
255
|
-
## What's new in v1.
|
|
253
|
+
## What's new in v1.26.0
|
|
254
|
+
|
|
255
|
+
- **💳 Annual plans — prepay a year, save up to 49%.** Starter is **$79/yr** (~$6.58/mo) and Pro is **$299/yr** (~$24.92/mo). Monthly pricing is unchanged — pick annual at [signup](https://api.algovault.com/signup) via `?interval=year`. Enterprise remains contact-us.
|
|
256
|
+
|
|
257
|
+
### v1.25.0 highlights (recap)
|
|
256
258
|
|
|
257
259
|
- **🎯 Screen the scan universe by liquidity.** `scan_trade_calls` now takes an optional `minLiquidityUsd` floor — filter to names with real depth, by notional open interest or 24h volume. Omit it for no floor.
|
|
258
260
|
- **💳 Charge-correctness on the paid path.** A paid request whose body was dropped could return a defaults-only result. Every payable route now rejects a dropped body, and a rejected request explains why.
|
|
@@ -266,18 +268,6 @@ Quota-only tiers. Every tier gets all venues, all assets, all timeframes — you
|
|
|
266
268
|
- **🌐 Three new exchanges: WhiteBIT, BitMart, XT.** AlgoVault's signal engine spans more perpetual-futures venues. Point any tool at the new venues via the `exchange` parameter.
|
|
267
269
|
- **🔌 New venue integration pages.** Per-venue connect guides at [algovault.com/integrations](https://algovault.com/integrations).
|
|
268
270
|
|
|
269
|
-
### v1.23.1 highlights (recap)
|
|
270
|
-
|
|
271
|
-
- **🔗 A dedicated page for every way to connect.** New hub pages walk through each access channel end-to-end, with copy-paste code and a quick FAQ: [MCP](https://algovault.com/mcp), [REST API](https://algovault.com/rest-api), and [webhooks](https://algovault.com/webhooks).
|
|
272
|
-
- **🧭 Tools index + unified navigation.** Browse all public tools at [algovault.com/tools](https://algovault.com/tools); a new Platform menu makes the whole site easier to navigate.
|
|
273
|
-
|
|
274
|
-
### v1.23.0 highlights (recap)
|
|
275
|
-
|
|
276
|
-
- **📡 Cross-venue funding arbitrage now spans 7 venues.** `scan_funding_arb` expanded from 3 to 7 — Hyperliquid, Binance, Bybit, Gate, KuCoin, Aster, and OKX — with interval-correct annualization per venue and a per-leg liquidity filter, so only tradeable spreads surface.
|
|
277
|
-
|
|
278
|
-
> MCP clients cache `tools/list` at session start — toggle the connector off/on (or restart the MCP connection) to pick up the updated `scan_funding_arb`.
|
|
279
|
-
|
|
280
|
-
|
|
281
271
|
> **Refresh your MCP client to pick up this release.** MCP clients cache `tools/list` at session start — Claude.ai/Desktop: toggle the connector off+on; Cursor/Cline: restart the MCP server connection.
|
|
282
272
|
|
|
283
273
|
---
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAWA,OAAO,EAAE,SAAS,EAAuC,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAWA,OAAO,EAAE,SAAS,EAAuC,MAAM,yCAAyC,CAAC;AAgTzG;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,MAAM,EAAE,MAAM,GACb,MAAM,CAOR;AAED;;;;;;;GAOG;AACH,wBAAsB,kBAAkB,CACtC,GAAG,EAAE,OAAO,SAAS,EAAE,OAAO,EAC9B,GAAG,EAAE,OAAO,SAAS,EAAE,QAAQ,EAC/B,UAAU,EAAE,MAAM,SAAS,GAC1B,OAAO,CAAC,IAAI,CAAC,CAYf;AA2yID,wBAAgB,mBAAmB,cAElC"}
|
package/dist/index.js
CHANGED
|
@@ -206,6 +206,7 @@ function toolErrorContent(err) {
|
|
|
206
206
|
return { content: [{ type: 'text', text: JSON.stringify({ error: message }) }], isError: true };
|
|
207
207
|
}
|
|
208
208
|
const signup_flow_js_1 = require("./lib/signup-flow.js");
|
|
209
|
+
const contact_page_js_1 = require("./lib/contact-page.js");
|
|
209
210
|
const account_handlers_js_1 = require("./lib/account-handlers.js");
|
|
210
211
|
const site_nav_js_1 = require("./lib/site-nav.js");
|
|
211
212
|
const oi_ranking_js_1 = require("./lib/oi-ranking.js");
|
|
@@ -1134,7 +1135,11 @@ async function startHttp() {
|
|
|
1134
1135
|
const INTEGRATION_FRAMEWORKS = ['langchain', 'llamaindex', 'maf', 'crewai'];
|
|
1135
1136
|
// INTEGRATIONS-FULL-STACK-W1 C4 (2026-05-19): 5 MCP-client landing pages
|
|
1136
1137
|
// (Plain HTTP/curl stays inline-only per Q-PLAIN-HTTP=NO; not in allow-list).
|
|
1137
|
-
|
|
1138
|
+
// LANDING-MCP-CLIENT-REGISTRY-W1 (2026-08-05): +3 MCP-client pages. The other
|
|
1139
|
+
// 3 registry rows (plain-http, zai-api, deepseek) are hasDedicatedPage:false —
|
|
1140
|
+
// a transport, a server-side API and a model, none of which have a page.
|
|
1141
|
+
const INTEGRATION_MCP_CLIENTS = ['claude-desktop', 'claude-code', 'cursor', 'cline', 'smithery',
|
|
1142
|
+
'codex', 'kimi', 'glm-zcode'];
|
|
1138
1143
|
const ALL_INTEGRATION_SLUGS = [...INTEGRATION_EXCHANGES, ...INTEGRATION_FRAMEWORKS, ...INTEGRATION_MCP_CLIENTS];
|
|
1139
1144
|
const INTEGRATION_HTML = new Map();
|
|
1140
1145
|
{
|
|
@@ -1341,6 +1346,62 @@ async function startHttp() {
|
|
|
1341
1346
|
res.status(400).json({ error: 'Webhook verification failed' });
|
|
1342
1347
|
}
|
|
1343
1348
|
});
|
|
1349
|
+
// ── Contact form (CONTACT-FORM-AND-SUPPORT-CLAIM-SWEEP-W1) ──
|
|
1350
|
+
//
|
|
1351
|
+
// Replaces a `mailto:` Enterprise CTA that was dead in two independent ways: Cloudflare
|
|
1352
|
+
// rewrites every `mailto:` into `/cdn-cgi/l/email-protection#…` (measured — ZERO plain mailto
|
|
1353
|
+
// survives to a browser on any page), and even fully decoded it needs an OS mail handler the
|
|
1354
|
+
// visitor may not have. This is the first lead-capture surface the product has.
|
|
1355
|
+
const contactLimiter = rateLimit({
|
|
1356
|
+
windowMs: 60 * 60 * 1000,
|
|
1357
|
+
max: 10,
|
|
1358
|
+
standardHeaders: true,
|
|
1359
|
+
legacyHeaders: false,
|
|
1360
|
+
message: 'Too many messages. Try again in an hour, or email admin@algovault.com.',
|
|
1361
|
+
});
|
|
1362
|
+
app.get('/contact', (req, res) => {
|
|
1363
|
+
const src = typeof req.query.src === 'string' ? req.query.src : null;
|
|
1364
|
+
const error = typeof req.query.error === 'string' ? req.query.error : null;
|
|
1365
|
+
res.type('html').send((0, contact_page_js_1.renderContactPage)({ error, src }));
|
|
1366
|
+
});
|
|
1367
|
+
// ORDER IS THE CONTRACT: validate → PERSIST → notify → record the notify outcome. A lead is
|
|
1368
|
+
// the scarcest thing this product captures and an email send is a network call that fails, so
|
|
1369
|
+
// a Resend outage must degrade to "stored, not yet notified" — never to a lost lead behind a
|
|
1370
|
+
// success page.
|
|
1371
|
+
// Thin shell: wires real dependencies into `handleContactSubmission`, which owns the ordering
|
|
1372
|
+
// contract and is unit-testable (CLAUDE.md — a handler closure in index.ts is not).
|
|
1373
|
+
app.post('/contact', contactLimiter, express.urlencoded({ extended: false, limit: '8kb' }), async (req, res) => {
|
|
1374
|
+
const body = (req.body ?? {});
|
|
1375
|
+
const [{ handleContactSubmission }, store, emailMod, tg] = await Promise.all([
|
|
1376
|
+
import('./lib/contact-submit.js'),
|
|
1377
|
+
import('./lib/contact-leads-store.js'),
|
|
1378
|
+
import('./lib/email.js'),
|
|
1379
|
+
import('./lib/telegram.js'),
|
|
1380
|
+
]);
|
|
1381
|
+
// Channel re-derived server-side; the form's hidden field is a hint, never trusted as sent.
|
|
1382
|
+
const classified = (0, attribution_sources_js_1.classifySource)({
|
|
1383
|
+
srcParam: typeof body.src === 'string' ? body.src : undefined,
|
|
1384
|
+
userAgent: req.headers['user-agent'],
|
|
1385
|
+
referer: req.headers.referer,
|
|
1386
|
+
origin: req.headers.origin,
|
|
1387
|
+
});
|
|
1388
|
+
const result = await handleContactSubmission(body, { src: classified.source ?? null, ipHash: (0, analytics_js_1.hashIp)((0, client_ip_js_1.clientIp)(req) || 'unknown') }, {
|
|
1389
|
+
validateEmail: email_validation_js_1.validateSignupEmail,
|
|
1390
|
+
insertLead: store.insertContactLead,
|
|
1391
|
+
markNotified: store.markContactLeadNotified,
|
|
1392
|
+
sendEmail: emailMod.sendContactLeadEmail,
|
|
1393
|
+
sendAlert: tg.sendAlert,
|
|
1394
|
+
});
|
|
1395
|
+
switch (result.kind) {
|
|
1396
|
+
case 'ok':
|
|
1397
|
+
case 'honeypot':
|
|
1398
|
+
return res.type('html').send((0, contact_page_js_1.renderContactConfirmation)());
|
|
1399
|
+
case 'invalid':
|
|
1400
|
+
return res.status(400).type('html').send((0, contact_page_js_1.renderContactPage)({ error: result.error }));
|
|
1401
|
+
default:
|
|
1402
|
+
return res.status(500).type('html').send((0, contact_page_js_1.renderContactPage)({ error: 'server_error' }));
|
|
1403
|
+
}
|
|
1404
|
+
});
|
|
1344
1405
|
// ── Signup (redirects to Stripe Checkout) ──
|
|
1345
1406
|
// ACTIVATION-PAYWALL-W1: forwards UTM query params (utm_source, utm_campaign)
|
|
1346
1407
|
// through to Stripe metadata so `checkout.session.completed` attribution
|
|
@@ -1411,12 +1472,20 @@ async function startHttp() {
|
|
|
1411
1472
|
}
|
|
1412
1473
|
try {
|
|
1413
1474
|
const baseUrl = `${req.protocol}://${req.get('host')}`;
|
|
1475
|
+
// PRICING-ANNUAL-AND-HOLD-PROMISE-W1: `?interval=year` selects annual prepay. Anything
|
|
1476
|
+
// else — absent, misspelt, hostile — resolves to 'month', so a malformed query can only
|
|
1477
|
+
// ever bill the SMALLER amount. Never infer annual from a partial match.
|
|
1478
|
+
const interval = req.query.interval === 'year' ? 'year' : 'month';
|
|
1414
1479
|
const url = await (0, stripe_js_1.createCheckoutSession)(plan, baseUrl, {
|
|
1415
1480
|
utmSource,
|
|
1416
1481
|
utmCampaign,
|
|
1417
1482
|
clientReferenceId,
|
|
1418
1483
|
refCode,
|
|
1484
|
+
interval,
|
|
1419
1485
|
});
|
|
1486
|
+
// A configured plan with an unconfigured interval lands here too (e.g. annual requested
|
|
1487
|
+
// before the Price exists in Stripe) — same operator-actionable failure, not a silent
|
|
1488
|
+
// downgrade to a price the caller did not choose.
|
|
1420
1489
|
if (!url)
|
|
1421
1490
|
return res.status(500).send('Stripe not configured or missing price IDs');
|
|
1422
1491
|
// SUBSCRIBER-ATTRIBUTION-SPINE-W1 (C1): persist the click attribution so
|
|
@@ -1484,7 +1553,7 @@ async function startHttp() {
|
|
|
1484
1553
|
}
|
|
1485
1554
|
catch (err) {
|
|
1486
1555
|
console.error('Welcome page error:', err instanceof Error ? err.message : err);
|
|
1487
|
-
res.status(500).send('Failed to retrieve your API key. Please contact
|
|
1556
|
+
res.status(500).send('Failed to retrieve your API key. Please contact admin@algovault.com');
|
|
1488
1557
|
}
|
|
1489
1558
|
});
|
|
1490
1559
|
// ── /account self-service portal ──
|
|
@@ -1676,7 +1745,7 @@ async function startHttp() {
|
|
|
1676
1745
|
res.setHeader('Content-Type', 'text/html; charset=utf-8');
|
|
1677
1746
|
res.setHeader('Cache-Control', 'no-store');
|
|
1678
1747
|
if (!isValidCodeFormat(code) || sig !== notifyUnsubSig(code) || !(await resolveCode(code))) {
|
|
1679
|
-
return res.status(400).send('<!DOCTYPE html><meta charset="utf-8"><body style="font-family:-apple-system,sans-serif;max-width:480px;margin:60px auto;text-align:center;color:#1f2328"><h2>Invalid link</h2><p>This unsubscribe link is invalid or expired. Manage notifications from the Telegram bot (/notifications) or contact
|
|
1748
|
+
return res.status(400).send('<!DOCTYPE html><meta charset="utf-8"><body style="font-family:-apple-system,sans-serif;max-width:480px;margin:60px auto;text-align:center;color:#1f2328"><h2>Invalid link</h2><p>This unsubscribe link is invalid or expired. Manage notifications from the Telegram bot (/notifications) or contact admin@algovault.com.</p></body>');
|
|
1680
1749
|
}
|
|
1681
1750
|
await setNotifyOptOut(code, true);
|
|
1682
1751
|
return res.send('<!DOCTYPE html><meta charset="utf-8"><body style="font-family:-apple-system,sans-serif;max-width:480px;margin:60px auto;text-align:center;color:#1f2328"><h2>Notifications off</h2><p>You won't receive referral join/earnings notifications anymore. Changed your mind? Re-enable from the Telegram bot (<code>/notifications</code>).</p></body>');
|
|
@@ -4487,21 +4556,11 @@ function getSignupPageHtml() {
|
|
|
4487
4556
|
.container { max-width: 960px; width: 100%; }
|
|
4488
4557
|
h1 { font-size: 28px; margin-bottom: 8px; }
|
|
4489
4558
|
.subtitle { color: #8b949e; margin-bottom: 32px; font-size: 14px; }
|
|
4490
|
-
|
|
4491
|
-
|
|
4492
|
-
|
|
4493
|
-
|
|
4494
|
-
.
|
|
4495
|
-
.plan .price { font-size: 36px; font-weight: 700; color: #58a6ff; margin: 12px 0; }
|
|
4496
|
-
.plan .price span { font-size: 16px; font-weight: 400; color: #8b949e; }
|
|
4497
|
-
.plan ul { list-style: none; margin: 16px 0 24px; }
|
|
4498
|
-
.plan ul li { padding: 4px 0; color: #c9d1d9; font-size: 14px; }
|
|
4499
|
-
.plan ul li::before { content: '\\2713'; color: #3fb950; margin-right: 8px; }
|
|
4500
|
-
.btn { display: inline-block; background: #238636; color: #fff; text-decoration: none; padding: 12px 28px; border-radius: 8px; font-size: 16px; font-weight: 600; transition: background 0.15s; }
|
|
4501
|
-
.btn:hover { background: #2ea043; }
|
|
4502
|
-
.btn.ent { background: #8957e5; }
|
|
4503
|
-
.btn.ent:hover { background: #a371f7; }
|
|
4504
|
-
.pop-badge { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); background: #34D199; color: #0f1117; font-size: 11px; font-weight: 700; padding: 3px 12px; border-radius: 20px; letter-spacing: 0.5px; }
|
|
4559
|
+
/* PRICING-ANNUAL-AND-HOLD-PROMISE-W1: this block used to RESTATE the plan-card rules that
|
|
4560
|
+
signup-flow.ts also exports, with a comment on each side telling the next author to keep the
|
|
4561
|
+
two in sync by hand. Interpolating the constant is the generator-level fix — the annual price
|
|
4562
|
+
block and the Enterprise contact line could not otherwise render correctly on /signup. */
|
|
4563
|
+
${signup_flow_js_1.PLAN_CARDS_CSS}
|
|
4505
4564
|
</style>
|
|
4506
4565
|
</head>
|
|
4507
4566
|
<body>
|
|
@@ -4516,7 +4575,7 @@ function getSignupPageHtml() {
|
|
|
4516
4575
|
<div style="background:#161b22;border:1px solid #30363d;border-radius:12px;padding:24px 28px;margin-top:20px;display:flex;flex-wrap:wrap;align-items:center;gap:16px;justify-content:space-between">
|
|
4517
4576
|
<div style="flex:1;min-width:260px">
|
|
4518
4577
|
<h2 style="font-size:18px;margin-bottom:6px;color:#e1e4e8">No subscription? Pay-per-call with x402</h2>
|
|
4519
|
-
<div style="color:#8b949e;font-size:14px;line-height:1.5">Agents can skip signup entirely — pay per call in USDC on Base. From $0.01/call · $0.02 standard. No Stripe, no API key
|
|
4578
|
+
<div style="color:#8b949e;font-size:14px;line-height:1.5">Agents can skip signup entirely — pay per call in USDC on Base. From $0.01/call · $0.02 standard. No Stripe, no API key.</div>
|
|
4520
4579
|
</div>
|
|
4521
4580
|
<a class="btn" href="https://algovault.com/docs.html#x402" style="background:#1f6feb;white-space:nowrap">Pay per call with x402 →</a>
|
|
4522
4581
|
</div>
|