create-surf-app 1.0.2 → 1.0.3

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.
@@ -15,13 +15,14 @@ Use `@surf-ai/sdk/server` in backend routes to talk to Surf data APIs.
15
15
 
16
16
  ```js
17
17
  const { dataApi } = require("@surf-ai/sdk/server");
18
- const data = await dataApi.market.price({ symbol: "BTC" });
19
- const holders = await dataApi.token.holders({
20
- address: "0x...",
21
- chain: "ethereum",
22
- });
23
- // Escape hatch for new endpoints:
24
- const raw = await dataApi.get("newcategory/endpoint", { foo: "bar" });
18
+
19
+ // Typed methods per domain — check `@surf-ai/sdk/server` typings for the
20
+ // available method on each domain and its exact parameter shape. Don't
21
+ // copy parameters from one method to another; shapes differ per endpoint.
22
+ const data = await dataApi.<domain>.<method>({ /* params */ });
23
+
24
+ // Escape hatch for endpoints not yet in the typed API:
25
+ const raw = await dataApi.get("<domain>/<endpoint>", { /* params */ });
25
26
  ```
26
27
 
27
28
  ## Structure
@@ -48,11 +49,7 @@ backend/db/schema.js - define database tables
48
49
  | `/api/cron/:id` | DELETE | Delete a cron task |
49
50
  | `/api/cron/:id/run` | POST | Manually trigger a cron task |
50
51
 
51
- Auto-registered from `backend/routes/*.js`:
52
- | File | Endpoint |
53
- |------|----------|
54
- | `routes/btc.js` | `/api/btc` |
55
- | `routes/portfolio.js` | `/api/portfolio` |
52
+ Auto-registered: any file at `backend/routes/<name>.js` is mounted at `/api/<name>`.
56
53
 
57
54
  ## Database
58
55
 
@@ -5,7 +5,7 @@
5
5
  "dev": "node scripts/check-env.js node --watch server.js"
6
6
  },
7
7
  "dependencies": {
8
- "@surf-ai/sdk": "1.0.2",
8
+ "@surf-ai/sdk": "1.0.3",
9
9
  "express": "4.22.1"
10
10
  }
11
11
  }
@@ -8,7 +8,7 @@
8
8
  "type-check": "tsc --noEmit --incremental"
9
9
  },
10
10
  "dependencies": {
11
- "@surf-ai/sdk": "1.0.2",
11
+ "@surf-ai/sdk": "1.0.3",
12
12
  "@surf-ai/theme": "latest",
13
13
  "next": "15.5.14",
14
14
  "react": "19.2.4",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-surf-app",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Scaffold a Surf app — Vite + React + Express + @surf-ai/sdk",
5
5
  "type": "module",
6
6
  "bin": {