@secondlayer/sdk 0.6.3 → 0.6.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/README.md +1 -18
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -19,23 +19,6 @@ const sl = new SecondLayer({
|
|
|
19
19
|
});
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
-
## Contracts
|
|
23
|
-
|
|
24
|
-
Search, inspect, and fetch ABIs for on-chain contracts.
|
|
25
|
-
|
|
26
|
-
```typescript
|
|
27
|
-
// Search by name
|
|
28
|
-
const { contracts, total } = await sl.contracts.search("bns", { limit: 10, offset: 0 });
|
|
29
|
-
|
|
30
|
-
// Get contract detail
|
|
31
|
-
const contract = await sl.contracts.get("SP000000000000000000002Q6VF78.bns");
|
|
32
|
-
// { contractId, name, deployer, deployBlock, deployTxId, callCount, lastCalledAt, abi, ... }
|
|
33
|
-
|
|
34
|
-
// Fetch ABI (lazy-cached from Stacks node)
|
|
35
|
-
const abi = await sl.contracts.getAbi("SP000000000000000000002Q6VF78.bns");
|
|
36
|
-
// { functions: [...], maps: [...], variables: [...], ... }
|
|
37
|
-
```
|
|
38
|
-
|
|
39
22
|
## Streams
|
|
40
23
|
|
|
41
24
|
Manage real-time event streams with endpoint delivery.
|
|
@@ -85,7 +68,7 @@ const result = await sl.subgraphs.deploy({ name, sources, schema, handlerCode })
|
|
|
85
68
|
import { ApiError } from "@secondlayer/sdk";
|
|
86
69
|
|
|
87
70
|
try {
|
|
88
|
-
await sl.
|
|
71
|
+
await sl.streams.get("nonexistent");
|
|
89
72
|
} catch (err) {
|
|
90
73
|
if (err instanceof ApiError) {
|
|
91
74
|
console.log(err.status); // 404
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@secondlayer/sdk",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.4",
|
|
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.
|
|
33
|
-
"@secondlayer/subgraphs": "^0.5.
|
|
32
|
+
"@secondlayer/shared": "^0.7.0",
|
|
33
|
+
"@secondlayer/subgraphs": "^0.5.7"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@types/bun": "latest",
|