@secondlayer/sdk 0.6.2 → 0.6.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.
Files changed (2) hide show
  1. package/README.md +7 -9
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -57,28 +57,26 @@ await sl.streams.update("stream-id", { name: "renamed" });
57
57
  await sl.streams.delete("stream-id");
58
58
  ```
59
59
 
60
- ## Views
60
+ ## Subgraphs
61
61
 
62
- Deploy and query materialized views.
62
+ Deploy and query subgraphs (custom indexers).
63
63
 
64
64
  ```typescript
65
65
  // List
66
- const { data } = await sl.views.list();
66
+ const { data } = await sl.subgraphs.list();
67
67
 
68
68
  // Get
69
- const view = await sl.views.get("my-view");
69
+ const subgraph = await sl.subgraphs.get("my-subgraph");
70
70
 
71
71
  // Query table
72
- const rows = await sl.views.queryTable("my-view", "transfers", {
72
+ const rows = await sl.subgraphs.queryTable("my-subgraph", "transfers", {
73
73
  sort: "block_height",
74
74
  order: "desc",
75
75
  limit: 50,
76
76
  });
77
77
 
78
- // Typed client (with defineView schema)
79
- import myView from "./views/my-view";
80
- const client = sl.views.typed(myView);
81
- const rows = await client.transfers.findMany({ where: { sender: "SP..." } });
78
+ // Deploy
79
+ const result = await sl.subgraphs.deploy({ name, sources, schema, handlerCode });
82
80
  ```
83
81
 
84
82
  ## Error Handling
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@secondlayer/sdk",
3
- "version": "0.6.2",
3
+ "version": "0.6.3",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -29,8 +29,8 @@
29
29
  "prepublishOnly": "bun run build"
30
30
  },
31
31
  "dependencies": {
32
- "@secondlayer/shared": "^0.5.0",
33
- "@secondlayer/subgraphs": "^0.5.3"
32
+ "@secondlayer/shared": "^0.6.0",
33
+ "@secondlayer/subgraphs": "^0.5.6"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@types/bun": "latest",