@covalenthq/client-sdk 2.3.2 → 2.3.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.
@@ -1,4 +1,4 @@
1
- import { type NewPairsStreamParams, type NewPairsStreamResponse, type OHLCVPairsStreamParams, type OHLCVPairsStreamResponse, type OHLCVTokensStreamParams, type OHLCVTokensStreamResponse, type StreamingServiceConfig, type StreamSubscriptionOptions, type TokenBalancesStreamParams, type TokenBalancesStreamResponse, type UnsubscribeFunction, type WalletActivityStreamParams, type WalletActivityStreamResponse } from "../utils/types/StreamingService.types";
1
+ import { type NewPairsStreamParams, type NewPairsStreamResponse, type OHLCVPairsStreamParams, type OHLCVPairsStreamResponse, type OHLCVTokensStreamParams, type OHLCVTokensStreamResponse, type StreamingServiceConfig, type StreamSubscriptionOptions, type TokenBalancesStreamParams, type TokenBalancesStreamResponse, type UnsubscribeFunction, type UpdatePairsStreamParams, type UpdatePairsStreamResponse, type WalletActivityStreamParams, type WalletActivityStreamResponse } from "../utils/types/StreamingService.types";
2
2
  import { type Client } from "graphql-ws";
3
3
  /**
4
4
  * Streaming API Service
@@ -102,6 +102,31 @@ export declare class StreamingService {
102
102
  * ```
103
103
  */
104
104
  subscribeToNewPairs(params: NewPairsStreamParams, callbacks: StreamSubscriptionOptions<NewPairsStreamResponse[]>): UnsubscribeFunction;
105
+ /**
106
+ * Subscribe to real-time updates for specific trading pairs including price, volume, and liquidity data
107
+ *
108
+ * @param params - Parameters for the update pairs stream
109
+ * @param callbacks - Subscription callbacks
110
+ * @returns Unsubscribe function
111
+ *
112
+ * @example
113
+ * ```typescript
114
+ * const unsubscribe = streamingService.subscribeToUpdatePairs(
115
+ * {
116
+ * chain_name: StreamingChain.BASE_MAINNET,
117
+ * pair_addresses: [
118
+ * "0x3f0296BF652e19bca772EC3dF08b32732F93014A"
119
+ * ]
120
+ * },
121
+ * {
122
+ * next: (data) => console.log("Pair Updates:", data),
123
+ * error: (err) => console.error("Error:", err),
124
+ * complete: () => console.log("Stream completed")
125
+ * }
126
+ * );
127
+ * ```
128
+ */
129
+ subscribeToUpdatePairs(params: UpdatePairsStreamParams, callbacks: StreamSubscriptionOptions<UpdatePairsStreamResponse>): UnsubscribeFunction;
105
130
  /**
106
131
  * Subscribe to real-time token balance updates for a specific wallet address
107
132
  *
@@ -31,7 +31,8 @@ export declare enum StreamingTimeframe {
31
31
  }
32
32
  export declare enum StreamingProtocol {
33
33
  UNISWAP_V2 = "UNISWAP_V2",
34
- UNISWAP_V3 = "UNISWAP_V3"
34
+ UNISWAP_V3 = "UNISWAP_V3",
35
+ UNISWAP_V4 = "UNISWAP_V4"
35
36
  }
36
37
  /**
37
38
  * OHLCV Pairs Stream Types
@@ -146,6 +147,26 @@ export interface TokenBalancesStreamResponse {
146
147
  last_block: number;
147
148
  items: TokenBalanceItem[];
148
149
  }
150
+ /**
151
+ * Update Pairs Stream Types
152
+ */
153
+ export interface UpdatePairsStreamParams {
154
+ chain_name: StreamingChain;
155
+ pair_addresses: string[];
156
+ }
157
+ export interface UpdatePairsStreamResponse {
158
+ chain_name: string;
159
+ pair_address: string;
160
+ timestamp: string;
161
+ price: number;
162
+ price_usd: number;
163
+ volume: number;
164
+ volume_usd: number;
165
+ market_cap: number;
166
+ liquidity: number;
167
+ base_token: ContractMetadata;
168
+ quote_token: ContractMetadata;
169
+ }
149
170
  /**
150
171
  * Wallet Activity Stream Types
151
172
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@covalenthq/client-sdk",
3
- "version": "2.3.2",
3
+ "version": "2.3.3",
4
4
  "license": "Apache-2.0",
5
5
  "repository": {
6
6
  "type": "git",
@@ -44,15 +44,6 @@
44
44
  "typescript": "^5",
45
45
  "ws": "^8.18.2"
46
46
  },
47
- "scripts": {
48
- "test": "jest",
49
- "build": "rollup -c rollup.config.js",
50
- "clean": "rimraf dist",
51
- "start": "rollup -c",
52
- "lint": "eslint .",
53
- "pretty": "prettier . --write",
54
- "prepublishOnly": "npm run clean && npm run build"
55
- },
56
47
  "publishConfig": {
57
48
  "access": "public"
58
49
  },
@@ -69,5 +60,13 @@
69
60
  }
70
61
  },
71
62
  "types": "./dist/index.d.ts",
72
- "sideEffects": false
73
- }
63
+ "sideEffects": false,
64
+ "scripts": {
65
+ "test": "jest",
66
+ "build": "rollup -c rollup.config.js",
67
+ "clean": "rimraf dist",
68
+ "start": "rollup -c",
69
+ "lint": "eslint .",
70
+ "pretty": "prettier . --write"
71
+ }
72
+ }