You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: sdk/src/accounts/README_WebSocketAccountSubscriberV2.md
+2-102Lines changed: 2 additions & 102 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,22 +4,7 @@ This is a new implementation of the WebSocket account subscriber that utilizes t
4
4
5
5
## Overview
6
6
7
-
The `WebSocketAccountSubscriberV2` class provides the same interface as the original `WebSocketAccountSubscriber` but uses gill's modern JavaScript/TypeScript client library for Solana blockchain interactions.
8
-
9
-
## Key Benefits
10
-
11
-
1.**Modern Library**: Uses gill, which is built on top of Anza's `@solana/kit` (formerly web3.js v2)
12
-
2.**Better Performance**: Optimized RPC calls and WebSocket subscriptions
13
-
3.**Type Safety**: Full TypeScript support with better type definitions
14
-
4.**Compatibility**: Drop-in replacement for existing `WebSocketAccountSubscriber`
15
-
16
-
## Installation
17
-
18
-
First, install the gill dependency:
19
-
20
-
```bash
21
-
npm install gill
22
-
```
7
+
The `WebSocketAccountSubscriberV2` class provides the same interface as the original `WebSocketAccountSubscriber` but uses gill's modern TypeScript client library for Solana blockchain interactions.
2.**WebSocket Subscriptions**: Uses gill's `rpcSubscriptions` for real-time updates
70
52
3.**Address Handling**: Converts `PublicKey` to gill's `Address` type for compatibility
71
53
4.**Response Formatting**: Converts gill responses to match the expected `AccountInfo<Buffer>` format
72
-
73
-
### Fallback Implementation
74
-
75
-
The current implementation includes fallback code that uses the original web3.js methods when gill is not available. This ensures backward compatibility while the gill integration is being set up.
76
-
77
-
## Migration Guide
78
-
79
-
To migrate from `WebSocketAccountSubscriber` to `WebSocketAccountSubscriberV2`:
80
-
81
-
1.**Install gill**: `npm install gill`
82
-
2.**Update imports**: Replace the import statement
83
-
3.**Uncomment gill code**: Remove the TODO comments and uncomment the gill-specific code
84
-
4.**Test thoroughly**: Ensure all functionality works as expected
85
-
86
-
## Example with Gill Integration
87
-
88
-
Here's how the implementation looks when fully integrated with gill:
0 commit comments