@covalenthq/client-sdk 2.3.7 → 3.0.0

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.
@@ -70,55 +70,3 @@ export type TokenSpenderItem = Nullable<{
70
70
  pretty_value_at_risk_quote: string;
71
71
  risk_factor: string;
72
72
  }>;
73
- export type NftApprovalsResponse = Nullable<{
74
- /** * The timestamp when the response was generated. Useful to show data staleness to users. */
75
- updated_at: Date;
76
- /** * The requested chain ID eg: `1`. */
77
- chain_id: ChainID;
78
- /** * The requested chain name eg: `eth-mainnet`. */
79
- chain_name: ChainName;
80
- /** * The requested address. */
81
- address: string;
82
- /** * List of response items. */
83
- items: NftApprovalsItem[];
84
- }>;
85
- export type NftApprovalsItem = Nullable<{
86
- /** * Use the relevant `contract_address` to lookup prices, logos, token transfers, etc. */
87
- contract_address: string;
88
- /** * The label of the contract address. */
89
- contract_address_label: string;
90
- /** * The ticker symbol for this contract. This field is set by a developer and non-unique across a network. */
91
- contract_ticker_symbol: string;
92
- /** * A list of supported standard ERC interfaces, eg: `ERC20` and `ERC721`. */
93
- supports_erc: string[];
94
- /** * List of asset balances held by the user. */
95
- token_balances: NftApprovalBalance[];
96
- /** * Contracts with non-zero approvals for this token. */
97
- spenders: NftApprovalSpender[];
98
- }>;
99
- export type NftApprovalBalance = Nullable<{
100
- /** * The token's id. */
101
- token_id: bigint;
102
- /** * The NFT's token balance. */
103
- token_balance: bigint;
104
- }>;
105
- export type NftApprovalSpender = Nullable<{
106
- /** * The height of the block. */
107
- block_height: number;
108
- /** * The offset is the position of the tx in the block. */
109
- tx_offset: number;
110
- /** * The offset is the position of the log entry within an event log." */
111
- log_offset: number;
112
- /** * The block signed timestamp in UTC. */
113
- block_signed_at: Date;
114
- /** * Most recent transaction that updated approval amounts for the token. */
115
- tx_hash: string;
116
- /** * Address of the contract with approval for the token. */
117
- spender_address: string;
118
- /** * Name of the contract with approval for the token. */
119
- spender_address_label: string;
120
- /** * The token ids approved. */
121
- token_ids_approved: string;
122
- /** * Remaining number of tokens granted to the spender by the approval. */
123
- allowance: string;
124
- }>;
@@ -9,7 +9,10 @@ export declare enum StreamingChain {
9
9
  ETH_MAINNET = "ETH_MAINNET",
10
10
  BSC_MAINNET = "BSC_MAINNET",
11
11
  HYPERCORE_MAINNET = "HYPERCORE_MAINNET",
12
- MONAD_MAINNET = "MONAD_MAINNET"
12
+ HYPEREVM_MAINNET = "HYPEREVM_MAINNET",
13
+ MONAD_MAINNET = "MONAD_MAINNET",
14
+ POLYGON_MAINNET = "POLYGON_MAINNET",
15
+ MEGAETH_MAINNET = "MEGAETH_MAINNET"
13
16
  }
14
17
  export declare enum StreamingInterval {
15
18
  ONE_SECOND = "ONE_SECOND",
@@ -35,7 +38,7 @@ export declare enum StreamingProtocol {
35
38
  UNISWAP_V2 = "UNISWAP_V2",
36
39
  UNISWAP_V3 = "UNISWAP_V3",
37
40
  VIRTUALS_V2 = "VIRTUALS_V2",
38
- CLANKER_V3 = "CLANKER_V3",
41
+ CLANKER_V3 = "CLANKER",
39
42
  RAYDIUM_AMM = "RAYDIUM_AMM",
40
43
  RAYDIUM_CLMM = "RAYDIUM_CLMM",
41
44
  RAYDIUM_CPMM = "RAYDIUM_CPMM",
@@ -51,7 +54,13 @@ export declare enum StreamingProtocol {
51
54
  SHADOW_V2 = "SHADOW_V2",
52
55
  SHADOW_V3 = "SHADOW_V3",
53
56
  OCTOSWAP_V2 = "OCTOSWAP_V2",
54
- OCTOSWAP_V3 = "OCTOSWAP_V3"
57
+ OCTOSWAP_V3 = "OCTOSWAP_V3",
58
+ QUICKSWAP_V2 = "QUICKSWAP_V2",
59
+ QUICKSWAP_V3 = "QUICKSWAP_V3",
60
+ SUSHISWAP_V2 = "SUSHISWAP_V2",
61
+ PROJECT_X = "PROJECT_X",
62
+ KUMBAYA_V1 = "KUMBAYA_V1",
63
+ JOE_V2 = "JOE_V2"
55
64
  }
56
65
  /**
57
66
  * OHLCV Pairs Stream Types
@@ -140,9 +149,9 @@ export interface NewPairsStreamResponse {
140
149
  event_name: string;
141
150
  quote_rate: number;
142
151
  quote_rate_usd: number;
143
- base_token_metadata: ContractMetadata;
144
- quote_token_metadata: ContractMetadata;
145
- pair_metadata: ContractMetadata;
152
+ base_token: ContractMetadata;
153
+ quote_token: ContractMetadata;
154
+ pair: ContractMetadata;
146
155
  }
147
156
  /**
148
157
  * Update Pairs Stream Types
@@ -250,6 +259,58 @@ export interface WalletActivityStreamResponse {
250
259
  decoded_details?: DecodedTransactionDetails;
251
260
  logs: WalletActivityLogItem[];
252
261
  }
262
+ /**
263
+ * Token Search Query Types
264
+ */
265
+ export interface TokenSearchParams {
266
+ query: string;
267
+ }
268
+ export interface TokenSearchResponse {
269
+ pair_address: string;
270
+ chain_name: string;
271
+ quote_rate: number;
272
+ quote_rate_usd: number;
273
+ volume: number;
274
+ volume_usd: number;
275
+ market_cap: number;
276
+ base_token: ContractMetadata;
277
+ quote_token: ContractMetadata;
278
+ }
279
+ /**
280
+ * Unrealized PnL for Token Query Types
281
+ */
282
+ export interface UPnLForTokenParams {
283
+ chain_name: StreamingChain;
284
+ token_address: string;
285
+ }
286
+ export interface UPnLForTokenResponse {
287
+ token_address: string;
288
+ wallet_address: string;
289
+ volume: string;
290
+ transactions_count: number;
291
+ pnl_realized_usd: number;
292
+ balance: string;
293
+ balance_pretty: string;
294
+ pnl_unrealized_usd: number;
295
+ contract_metadata: ContractMetadata;
296
+ }
297
+ /**
298
+ * Unrealized PnL for Wallet Query Types
299
+ */
300
+ export interface UPnLForWalletParams {
301
+ chain_name: StreamingChain;
302
+ wallet_address: string;
303
+ }
304
+ export interface UPnLForWalletResponse {
305
+ token_address: string;
306
+ cost_basis: number;
307
+ current_price: number;
308
+ pnl_realized_usd: number | null;
309
+ pnl_unrealized_usd: number;
310
+ net_balance_change: string;
311
+ marketcap_usd: string;
312
+ contract_metadata: ContractMetadata;
313
+ }
253
314
  /**
254
315
  * Streaming service configuration
255
316
  */
@@ -314,6 +314,8 @@ export type GetTransactionSummaryQueryParamOpts = Nullable<{
314
314
  quoteCurrency?: Quote;
315
315
  /** * Include gas summary details. Additional charge of 1 credit when true. Response times may be impacted for wallets with millions of transactions. */
316
316
  withGas?: boolean;
317
+ /** * Represents the total count of ERC-20 token movement events, including `Transfer`, `Deposit` and `Withdraw`. Response times may be impacted for wallets with large number of transactions. Additional charge of 3 credits. */
318
+ withTransferCount?: boolean;
317
319
  }>;
318
320
  export type InternalTransfer = Nullable<{
319
321
  /** * The contract address sending the native token. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@covalenthq/client-sdk",
3
- "version": "2.3.7",
3
+ "version": "3.0.0",
4
4
  "license": "Apache-2.0",
5
5
  "repository": {
6
6
  "type": "git",
@@ -16,26 +16,20 @@
16
16
  "homepage": "https://github.com/covalenthq/covalent-api-sdk-ts#readme",
17
17
  "dependencies": {
18
18
  "big.js": "^6.2.1",
19
- "graphql-ws": "^6.0.5"
19
+ "graphql-ws": "^6.0.5",
20
+ "graphqurl": "^1.0.3"
20
21
  },
21
22
  "devDependencies": {
22
23
  "@rollup/plugin-commonjs": "^25.0.4",
23
24
  "@rollup/plugin-json": "^6.1.0",
24
25
  "@rollup/plugin-node-resolve": "^15.2.1",
25
- "@trivago/prettier-plugin-sort-imports": "^4.3.0",
26
26
  "@types/big.js": "^6.2.2",
27
27
  "@types/jest": "^29.5.5",
28
28
  "@types/node": "^20",
29
29
  "@types/ws": "^8.18.1",
30
- "@typescript-eslint/eslint-plugin": "^7.7.1",
31
- "@typescript-eslint/parser": "^7.7.1",
32
30
  "dotenv": "^16.4.5",
33
- "eslint": "^8",
34
- "eslint-config-prettier": "^9.1.0",
35
- "eslint-plugin-prettier": "^5.1.3",
36
31
  "jest": "^29.6.1",
37
32
  "p-limit": "^3.1.0",
38
- "prettier": "^3.3.2",
39
33
  "rimraf": "^6.0.1",
40
34
  "rollup": "^3.29.1",
41
35
  "rollup-plugin-typescript2": "^0.35.0",
@@ -67,6 +61,9 @@
67
61
  "clean": "rimraf dist",
68
62
  "start": "rollup -c",
69
63
  "lint": "eslint .",
70
- "pretty": "prettier . --write"
64
+ "format": "prettier --ignore-path ../../.prettierignore --write .",
65
+ "format:check": "prettier --ignore-path ../../.prettierignore --check .",
66
+ "sync-docs": "ts-node --project ../../s/tsconfig.json ../../s/sync-docs/index.ts",
67
+ "sync-docs:check": "ts-node --project ../../s/tsconfig.json ../../s/sync-docs/index.ts --check"
71
68
  }
72
69
  }