@covalenthq/client-sdk 2.3.2 → 2.3.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.
@@ -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
  *
@@ -4,6 +4,8 @@ import type { ContractMetadata } from "./Generic.types";
4
4
  */
5
5
  export declare enum StreamingChain {
6
6
  BASE_MAINNET = "BASE_MAINNET",
7
+ SOLANA_MAINNET = "SOLANA_MAINNET",
8
+ SONIC_MAINNET = "SONIC_MAINNET",
7
9
  ETH_MAINNET = "ETH_MAINNET",
8
10
  BSC_MAINNET = "BSC_MAINNET"
9
11
  }
@@ -31,7 +33,23 @@ export declare enum StreamingTimeframe {
31
33
  }
32
34
  export declare enum StreamingProtocol {
33
35
  UNISWAP_V2 = "UNISWAP_V2",
34
- UNISWAP_V3 = "UNISWAP_V3"
36
+ UNISWAP_V3 = "UNISWAP_V3",
37
+ UNISWAP_V4 = "UNISWAP_V4",
38
+ VIRTUALS_V2 = "VIRTUALS_V2",
39
+ CLANKER = "CLANKER",
40
+ RAYDIUM_AMM = "RAYDIUM_AMM",
41
+ RAYDIUM_CPMM = "RAYDIUM_CPMM",
42
+ PUMP_DOT_FUN = "PUMP_DOT_FUN",
43
+ PUMP_FUN_AMM = "PUMP_FUN_AMM",
44
+ MOONSHOT = "MOONSHOT",
45
+ RAYDIUM_LAUNCH_LAB = "RAYDIUM_LAUNCH_LAB",
46
+ METEORA_DAMM = "METEORA_DAMM",
47
+ METEORA_DLMM = "METEORA_DLMM",
48
+ METEORA_DBC = "METEORA_DBC",
49
+ PANCAKESWAP_V2 = "PANCAKESWAP_V2",
50
+ PANCAKESWAP_V3 = "PANCAKESWAP_V3",
51
+ SHADOW_V2 = "SHADOW_V2",
52
+ SHADOW_V3 = "SHADOW_V3"
35
53
  }
36
54
  /**
37
55
  * OHLCV Pairs Stream Types
@@ -146,6 +164,26 @@ export interface TokenBalancesStreamResponse {
146
164
  last_block: number;
147
165
  items: TokenBalanceItem[];
148
166
  }
167
+ /**
168
+ * Update Pairs Stream Types
169
+ */
170
+ export interface UpdatePairsStreamParams {
171
+ chain_name: StreamingChain;
172
+ pair_addresses: string[];
173
+ }
174
+ export interface UpdatePairsStreamResponse {
175
+ chain_name: string;
176
+ pair_address: string;
177
+ timestamp: string;
178
+ price: number;
179
+ price_usd: number;
180
+ volume: number;
181
+ volume_usd: number;
182
+ market_cap: number;
183
+ liquidity: number;
184
+ base_token: ContractMetadata;
185
+ quote_token: ContractMetadata;
186
+ }
149
187
  /**
150
188
  * Wallet Activity Stream Types
151
189
  */
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.4",
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
+ }