@chainstream-io/sdk 0.2.1 → 0.2.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.
- package/README.md +78 -0
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# ChainStream TypeScript SDK
|
|
2
|
+
|
|
3
|
+
Official TypeScript/JavaScript client library for ChainStream API.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @chainstream-io/sdk
|
|
9
|
+
# or
|
|
10
|
+
pnpm add @chainstream-io/sdk
|
|
11
|
+
# or
|
|
12
|
+
yarn add @chainstream-io/sdk
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Quick Start
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
import { ChainStreamClient } from '@chainstream-io/sdk';
|
|
19
|
+
|
|
20
|
+
// Create client
|
|
21
|
+
const client = new ChainStreamClient('your-access-token', {
|
|
22
|
+
autoConnectWebSocket: false
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
// Subscribe to token stats via WebSocket
|
|
26
|
+
const unsubscribe = client.stream.subscribeTokenStats({
|
|
27
|
+
chain: 'solana',
|
|
28
|
+
tokenAddress: 'So11111111111111111111111111111111111111112',
|
|
29
|
+
callback: (data) => {
|
|
30
|
+
console.log('Token stats:', data);
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
// Unsubscribe when done
|
|
35
|
+
unsubscribe.unsubscribe();
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Features
|
|
39
|
+
|
|
40
|
+
- REST API client generated from OpenAPI
|
|
41
|
+
- WebSocket streaming for real-time data
|
|
42
|
+
- Full TypeScript type definitions
|
|
43
|
+
- Support for multiple subscription types:
|
|
44
|
+
- Token stats, candles, holders
|
|
45
|
+
- Wallet balances and PnL
|
|
46
|
+
- Trade activities
|
|
47
|
+
- Ranking lists
|
|
48
|
+
- And more...
|
|
49
|
+
|
|
50
|
+
## Documentation
|
|
51
|
+
|
|
52
|
+
For detailed documentation, visit [https://docs.chainstream.io](https://docs.chainstream.io)
|
|
53
|
+
|
|
54
|
+
## Development
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
# Install dependencies
|
|
58
|
+
pnpm install
|
|
59
|
+
|
|
60
|
+
# Build
|
|
61
|
+
pnpm build
|
|
62
|
+
|
|
63
|
+
# Run tests
|
|
64
|
+
pnpm test
|
|
65
|
+
|
|
66
|
+
# Generate OpenAPI client
|
|
67
|
+
pnpm orval
|
|
68
|
+
|
|
69
|
+
# Lint
|
|
70
|
+
pnpm lint
|
|
71
|
+
|
|
72
|
+
# Format
|
|
73
|
+
pnpm format
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## License
|
|
77
|
+
|
|
78
|
+
MIT
|