@covalenthq/client-sdk 2.3.1 → 2.3.2

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.
Files changed (66) hide show
  1. package/dist/{cjs/index.js → index.js} +12 -28
  2. package/dist/index.js.map +1 -0
  3. package/dist/{esm/src → src}/utils/types/Generic.types.d.ts +11 -27
  4. package/package.json +9 -13
  5. package/dist/cjs/index.js.map +0 -1
  6. package/dist/cjs/src/utils/types/Generic.types.d.ts +0 -391
  7. package/dist/esm/index.d.ts +0 -16
  8. package/dist/esm/index.js +0 -5696
  9. package/dist/esm/index.js.map +0 -1
  10. package/dist/esm/src/GoldRushClient.d.ts +0 -27
  11. package/dist/esm/src/services/AllChainsService.d.ts +0 -63
  12. package/dist/esm/src/services/BalanceService.d.ts +0 -125
  13. package/dist/esm/src/services/BaseService.d.ts +0 -163
  14. package/dist/esm/src/services/BitcoinService.d.ts +0 -40
  15. package/dist/esm/src/services/NftService.d.ts +0 -193
  16. package/dist/esm/src/services/PricingService.d.ts +0 -36
  17. package/dist/esm/src/services/SecurityService.d.ts +0 -28
  18. package/dist/esm/src/services/StreamingService.d.ts +0 -151
  19. package/dist/esm/src/services/TransactionService.d.ts +0 -134
  20. package/dist/esm/src/utils/functions/bigIntParser.d.ts +0 -1
  21. package/dist/esm/src/utils/functions/calculatePrettyBalance.d.ts +0 -1
  22. package/dist/esm/src/utils/functions/debugOutput.d.ts +0 -2
  23. package/dist/esm/src/utils/functions/endpointGenerator.d.ts +0 -4
  24. package/dist/esm/src/utils/functions/execution.d.ts +0 -11
  25. package/dist/esm/src/utils/functions/isValidApiKey.d.ts +0 -1
  26. package/dist/esm/src/utils/functions/paginateEndpoint.d.ts +0 -7
  27. package/dist/esm/src/utils/functions/prettifyCurrency.d.ts +0 -2
  28. package/dist/esm/src/utils/functions/timestamp-parser.d.ts +0 -1
  29. package/dist/esm/src/utils/types/AllChainService.types.d.ts +0 -123
  30. package/dist/esm/src/utils/types/BalanceService.types.d.ts +0 -442
  31. package/dist/esm/src/utils/types/BaseService.types.d.ts +0 -312
  32. package/dist/esm/src/utils/types/BitcoinService.types.d.ts +0 -88
  33. package/dist/esm/src/utils/types/NftService.types.d.ts +0 -355
  34. package/dist/esm/src/utils/types/PricingService.types.d.ts +0 -80
  35. package/dist/esm/src/utils/types/SecurityService.types.d.ts +0 -124
  36. package/dist/esm/src/utils/types/StreamingService.types.d.ts +0 -201
  37. package/dist/esm/src/utils/types/TransactionService.types.d.ts +0 -392
  38. /package/dist/{cjs/index.d.ts → index.d.ts} +0 -0
  39. /package/dist/{cjs/src → src}/GoldRushClient.d.ts +0 -0
  40. /package/dist/{cjs/src → src}/services/AllChainsService.d.ts +0 -0
  41. /package/dist/{cjs/src → src}/services/BalanceService.d.ts +0 -0
  42. /package/dist/{cjs/src → src}/services/BaseService.d.ts +0 -0
  43. /package/dist/{cjs/src → src}/services/BitcoinService.d.ts +0 -0
  44. /package/dist/{cjs/src → src}/services/NftService.d.ts +0 -0
  45. /package/dist/{cjs/src → src}/services/PricingService.d.ts +0 -0
  46. /package/dist/{cjs/src → src}/services/SecurityService.d.ts +0 -0
  47. /package/dist/{cjs/src → src}/services/StreamingService.d.ts +0 -0
  48. /package/dist/{cjs/src → src}/services/TransactionService.d.ts +0 -0
  49. /package/dist/{cjs/src → src}/utils/functions/bigIntParser.d.ts +0 -0
  50. /package/dist/{cjs/src → src}/utils/functions/calculatePrettyBalance.d.ts +0 -0
  51. /package/dist/{cjs/src → src}/utils/functions/debugOutput.d.ts +0 -0
  52. /package/dist/{cjs/src → src}/utils/functions/endpointGenerator.d.ts +0 -0
  53. /package/dist/{cjs/src → src}/utils/functions/execution.d.ts +0 -0
  54. /package/dist/{cjs/src → src}/utils/functions/isValidApiKey.d.ts +0 -0
  55. /package/dist/{cjs/src → src}/utils/functions/paginateEndpoint.d.ts +0 -0
  56. /package/dist/{cjs/src → src}/utils/functions/prettifyCurrency.d.ts +0 -0
  57. /package/dist/{cjs/src → src}/utils/functions/timestamp-parser.d.ts +0 -0
  58. /package/dist/{cjs/src → src}/utils/types/AllChainService.types.d.ts +0 -0
  59. /package/dist/{cjs/src → src}/utils/types/BalanceService.types.d.ts +0 -0
  60. /package/dist/{cjs/src → src}/utils/types/BaseService.types.d.ts +0 -0
  61. /package/dist/{cjs/src → src}/utils/types/BitcoinService.types.d.ts +0 -0
  62. /package/dist/{cjs/src → src}/utils/types/NftService.types.d.ts +0 -0
  63. /package/dist/{cjs/src → src}/utils/types/PricingService.types.d.ts +0 -0
  64. /package/dist/{cjs/src → src}/utils/types/SecurityService.types.d.ts +0 -0
  65. /package/dist/{cjs/src → src}/utils/types/StreamingService.types.d.ts +0 -0
  66. /package/dist/{cjs/src → src}/utils/types/TransactionService.types.d.ts +0 -0
@@ -1,312 +0,0 @@
1
- import { type ChainID, type ChainLabel, type ChainName, type DecodedItem, type LogEvent, type Nullable, type Pagination, type Quote } from "./Generic.types";
2
- export type BlockResponse = Nullable<{
3
- /** * The timestamp when the response was generated. Useful to show data staleness to users. */
4
- updated_at: Date;
5
- /** * The requested chain ID eg: `1`. */
6
- chain_id: ChainID;
7
- /** * The requested chain name eg: `eth-mainnet`. */
8
- chain_name: ChainName;
9
- /** * List of response items. */
10
- items: Block[];
11
- }>;
12
- export type Block = Nullable<{
13
- /** * The hash of the block. */
14
- block_hash: string;
15
- /** * The block signed timestamp in UTC. */
16
- signed_at: Date;
17
- /** * The block height. */
18
- height: number;
19
- /** * The parent block hash. */
20
- block_parent_hash: string;
21
- /** * Extra data written to the block. */
22
- extra_data: string;
23
- /** * The address of the miner. */
24
- miner_address: string;
25
- /** * The associated mining cost. */
26
- mining_cost: number;
27
- /** * The associated gas used. */
28
- gas_used: number;
29
- /** * The associated gas limit. */
30
- gas_limit: number;
31
- /** * The link to the related tx by block endpoint. */
32
- transactions_link: string;
33
- }>;
34
- export type ResolvedAddress = Nullable<{
35
- /** * The timestamp when the response was generated. Useful to show data staleness to users. */
36
- updated_at: Date;
37
- /** * The requested chain ID eg: `1`. */
38
- chain_id: ChainID;
39
- /** * The requested chain name eg: `eth-mainnet`. */
40
- chain_name: ChainName;
41
- /** * List of response items. */
42
- items: ResolvedAddressItem[];
43
- }>;
44
- export type ResolvedAddressItem = Nullable<{
45
- /** * The requested address. */
46
- address: string;
47
- name: string;
48
- }>;
49
- export type BlockHeightsResponse = Nullable<{
50
- /** * The timestamp when the response was generated. Useful to show data staleness to users. */
51
- updated_at: Date;
52
- /** * The requested chain ID eg: `1`. */
53
- chain_id: ChainID;
54
- /** * The requested chain name eg: `eth-mainnet`. */
55
- chain_name: ChainName;
56
- /** * List of response items. */
57
- items: BlockHeights[];
58
- /** * Pagination metadata. */
59
- pagination: Pagination;
60
- }>;
61
- export type BlockHeights = Nullable<{
62
- /** * The hash of the block. */
63
- block_hash: string;
64
- /** * The block signed timestamp in UTC. */
65
- signed_at: Date;
66
- /** * The block height. */
67
- height: number;
68
- /** * The parent block hash. */
69
- block_parent_hash: string;
70
- /** * Extra data written to the block. */
71
- extra_data: string;
72
- /** * The address of the miner. */
73
- miner_address: string;
74
- /** * The associated mining cost. */
75
- mining_cost: number;
76
- /** * The associated gas used. */
77
- gas_used: number;
78
- /** * The associated gas limit. */
79
- gas_limit: number;
80
- /** * The link to the related tx by block endpoint. */
81
- transactions_link: string;
82
- }>;
83
- export type GetLogsResponse = Nullable<{
84
- /** * The timestamp when the response was generated. Useful to show data staleness to users. */
85
- updated_at: Date;
86
- /** * The requested chain ID eg: `1`. */
87
- chain_id: ChainID;
88
- /** * The requested chain name eg: `eth-mainnet`. */
89
- chain_name: ChainName;
90
- /** * List of response items. */
91
- items: GetLogsEvent[];
92
- }>;
93
- export type GetLogsEvent = Nullable<{
94
- /** * The block signed timestamp in UTC. */
95
- block_signed_at: Date;
96
- /** * The height of the block. */
97
- block_height: number;
98
- /** * The hash of the block. */
99
- block_hash: string;
100
- /** * The offset is the position of the tx in the block. */
101
- tx_offset: number;
102
- /** * The offset is the position of the log entry within an event log. */
103
- log_offset: number;
104
- /** * The requested transaction hash. */
105
- tx_hash: string;
106
- /** * The log topics in raw data. */
107
- raw_log_topics: string[];
108
- /** * Use contract decimals to format the token balance for display purposes - divide the balance by `10^{contract_decimals}`. */
109
- sender_contract_decimals: number;
110
- /** * The name of the sender. */
111
- sender_name: string;
112
- /** * The ticker symbol for the sender. This field is set by a developer and non-unique across a network. */
113
- sender_contract_ticker_symbol: string;
114
- /** * The address of the sender. */
115
- sender_address: string;
116
- /** * The label of the sender address. */
117
- sender_address_label: string;
118
- /** * A list of supported standard ERC interfaces, eg: `ERC20` and `ERC721`. */
119
- supports_erc: string[];
120
- /** * The contract logo URL. */
121
- sender_logo_url: string;
122
- /** * The address of the deployed UniswapV2 like factory contract for this DEX. */
123
- sender_factory_address: string;
124
- /** * The log events in raw. */
125
- raw_log_data: string;
126
- /** * The decoded item. */
127
- decoded: DecodedItem;
128
- }>;
129
- export type LogEventsByAddressResponse = Nullable<{
130
- /** * The timestamp when the response was generated. Useful to show data staleness to users. */
131
- updated_at: Date;
132
- /** * The requested chain ID eg: `1`. */
133
- chain_id: ChainID;
134
- /** * The requested chain name eg: `eth-mainnet`. */
135
- chain_name: ChainName;
136
- /** * List of response items. */
137
- items: LogEvent[];
138
- /** * Pagination metadata. */
139
- pagination: Pagination;
140
- }>;
141
- export type LogEventsByTopicHashResponse = Nullable<{
142
- /** * The timestamp when the response was generated. Useful to show data staleness to users. */
143
- updated_at: Date;
144
- /** * The requested chain ID eg: `1`. */
145
- chain_id: ChainID;
146
- /** * The requested chain name eg: `eth-mainnet`. */
147
- chain_name: ChainName;
148
- /** * List of response items. */
149
- items: LogEvent[];
150
- /** * Pagination metadata. */
151
- pagination: Pagination;
152
- }>;
153
- export type AllChainsResponse = Nullable<{
154
- /** * The timestamp when the response was generated. Useful to show data staleness to users. */
155
- updated_at: Date;
156
- /** * List of response items. */
157
- items: ChainItem[];
158
- }>;
159
- export type ChainItem = Nullable<{
160
- /** * The chain name eg: `eth-mainnet`. */
161
- name: string;
162
- /** * The requested chain ID eg: `1`. */
163
- chain_id: ChainID;
164
- /** * True if the chain is a testnet. */
165
- is_testnet: boolean;
166
- /** * Schema name to use for direct SQL. */
167
- db_schema_name: string;
168
- /** * The chains label eg: `Ethereum Mainnet`. */
169
- label: string;
170
- /** * The category label eg: `Ethereum`. */
171
- category_label: string;
172
- /** * A svg logo url for the chain. */
173
- logo_url: string;
174
- /** * A black png logo url for the chain. */
175
- black_logo_url: string;
176
- /** * A white png logo url for the chain. */
177
- white_logo_url: string;
178
- /** * The color theme for the chain. */
179
- color_theme: ColorTheme;
180
- /** * True if the chain is an AppChain. */
181
- is_appchain: boolean;
182
- /** * The ChainItem the appchain is a part of. */
183
- appchain_of: ChainItem;
184
- /** * A classification of the chain */
185
- priority_label: ChainLabel;
186
- }>;
187
- export type ColorTheme = Nullable<{
188
- /** * The red color code. */
189
- red: number;
190
- /** * The green color code. */
191
- green: number;
192
- /** * The blue color code. */
193
- blue: number;
194
- /** * The alpha color code. */
195
- alpha: number;
196
- /** * The hexadecimal color code. */
197
- hex: string;
198
- /** * The color represented in css rgb() functional notation. */
199
- css_rgb: string;
200
- }>;
201
- export type AllChainsStatusResponse = Nullable<{
202
- /** * The timestamp when the response was generated. Useful to show data staleness to users. */
203
- updated_at: Date;
204
- /** * List of response items. */
205
- items: ChainStatusItem[];
206
- }>;
207
- export type ChainStatusItem = Nullable<{
208
- /** * The chain name eg: `eth-mainnet`. */
209
- name: string;
210
- /** * The requested chain ID eg: `1`. */
211
- chain_id: ChainID;
212
- /** * True if the chain is a testnet. */
213
- is_testnet: boolean;
214
- /** * A svg logo url for the chain. */
215
- logo_url: string;
216
- /** * A black png logo url for the chain. */
217
- black_logo_url: string;
218
- /** * A white png logo url for the chain. */
219
- white_logo_url: string;
220
- /** * True if the chain is an AppChain. */
221
- is_appchain: boolean;
222
- /** * The height of the latest block available. */
223
- synced_block_height: number;
224
- /** * The signed timestamp of latest block available. */
225
- synced_blocked_signed_at: Date;
226
- /** * True if the chain has data and ready for querying. */
227
- has_data: boolean;
228
- }>;
229
- export type GasPricesResponse = Nullable<{
230
- /** * The requested chain ID eg: `1`. */
231
- chain_id: ChainID;
232
- /** * The requested chain name eg: `eth-mainnet`. */
233
- chain_name: ChainName;
234
- /** * The requested quote currency eg: `USD`. */
235
- quote_currency: Quote;
236
- /** * The timestamp when the response was generated. Useful to show data staleness to users. */
237
- updated_at: Date;
238
- /** * The requested event type. */
239
- event_type: string;
240
- /** * The exchange rate for the requested quote currency. */
241
- gas_quote_rate: number;
242
- /** * The lowest gas fee for the latest block height. */
243
- base_fee: bigint;
244
- /** * List of response items. */
245
- items: PriceItem[];
246
- }>;
247
- export type PriceItem = Nullable<{
248
- /** * The average gas price, in WEI, for the time interval. */
249
- gas_price: string;
250
- /** * The average gas spent for the time interval. */
251
- gas_spent: string;
252
- /** * The average gas spent in `quote-currency` denomination for the time interval. */
253
- gas_quote: number;
254
- /** * Other fees, when applicable. For example: OP chain L1 fees. */
255
- other_fees: OtherFees;
256
- /** * The sum of the L1 and L2 gas spent, in quote-currency, for the specified time interval. */
257
- total_gas_quote: number;
258
- /** * A prettier version of the total average gas spent, in quote-currency, for the specified time interval, for rendering purposes. */
259
- pretty_total_gas_quote: string;
260
- /** * The specified time interval. */
261
- interval: string;
262
- }>;
263
- export type OtherFees = Nullable<{
264
- /** * The calculated L1 gas spent, when applicable, in quote-currency, for the specified time interval. */
265
- l1_gas_quote: number;
266
- }>;
267
- export type GetBlockHeightsQueryParamOpts = Nullable<{
268
- /** * Number of items per page. Omitting this parameter defaults to 100. */
269
- pageSize?: number;
270
- /** * 0-indexed page number to begin pagination. */
271
- pageNumber?: number;
272
- }>;
273
- export type GetLogsQueryParamOpts = Nullable<{
274
- /** * The first block to retrieve log events with. Accepts decimals, hexadecimals, or the strings `earliest` and `latest`. */
275
- startingBlock?: number;
276
- /** * The last block to retrieve log events with. Accepts decimals, hexadecimals, or the strings `earliest` and `latest`. */
277
- endingBlock?: string;
278
- /** * The address of the log events sender contract. */
279
- address?: string;
280
- /** * The topic hash(es) to retrieve logs with. */
281
- topics?: string;
282
- /** * The block hash to retrieve logs for. */
283
- blockHash?: string;
284
- /** * Omit decoded log events. */
285
- skipDecode?: boolean;
286
- }>;
287
- export type GetLogEventsByAddressQueryParamOpts = Nullable<{
288
- /** * The first block to retrieve log events with. Accepts decimals, hexadecimals, or the strings `earliest` and `latest`. */
289
- startingBlock?: string | number;
290
- /** * The last block to retrieve log events with. Accepts decimals, hexadecimals, or the strings `earliest` and `latest`. */
291
- endingBlock?: string | number;
292
- /** * Number of items per page. Omitting this parameter defaults to 100. */
293
- pageSize?: number;
294
- /** * 0-indexed page number to begin pagination. */
295
- pageNumber?: number;
296
- }>;
297
- export type GetLogEventsByTopicHashQueryParamOpts = Nullable<{
298
- /** * The first block to retrieve log events with. Accepts decimals, hexadecimals, or the strings `earliest` and `latest`. */
299
- startingBlock?: string | number;
300
- /** * The last block to retrieve log events with. Accepts decimals, hexadecimals, or the strings `earliest` and `latest`. */
301
- endingBlock?: string | number;
302
- /** * Additional topic hash(es) to filter on - padded & unpadded address fields are supported. Separate multiple topics with a comma. */
303
- secondaryTopics?: string;
304
- /** * Number of items per page. Omitting this parameter defaults to 100. */
305
- pageSize?: number;
306
- /** * 0-indexed page number to begin pagination. */
307
- pageNumber?: number;
308
- }>;
309
- export type GetGasPricesQueryParamOpts = Nullable<{
310
- /** * The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`. */
311
- quoteCurrency?: Quote;
312
- }>;
@@ -1,88 +0,0 @@
1
- import { type BalanceItem } from "./BalanceService.types";
2
- import { type ChainID, type ChainName, type Nullable, type Pagination, type Quote } from "./Generic.types";
3
- export type GetBitcoinHdWalletBalancesQueryParamOpts = Nullable<{
4
- /** * The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`. */
5
- quoteCurrency?: Quote;
6
- }>;
7
- export type BitcoinHdWalletBalancesResponse = Nullable<{
8
- /** * The requested address. */
9
- address: string;
10
- /** * The timestamp when the response was generated. Useful to show data staleness to users. */
11
- updated_at: Date;
12
- /** * The requested quote currency eg: `USD`. */
13
- quote_currency: Quote;
14
- /** * Bitcoin chain ID. */
15
- chain_id: ChainID;
16
- /** * Bitcoin Chain Name. */
17
- chain_name: ChainName;
18
- /** * List of response items. */
19
- items: BitcoinHdWalletBalanceItem[];
20
- }>;
21
- export type BitcoinHdWalletBalanceItem = BalanceItem & Nullable<{
22
- /** * The specific Bitcoin address derived from the HD wallet. */
23
- child_address: string;
24
- /** * Derivation path used to derive the specific Bitcoin address, e.g., M/0H/0/0. */
25
- address_path: string;
26
- /** * The HD wallet path. */
27
- hd_wallet_path: string;
28
- }>;
29
- export type GetTransactionsForBitcoinAddressParamOpts = Nullable<{
30
- /** * The bitcoin address to query. */
31
- address?: string;
32
- /** * Omit log events. */
33
- pageSize?: number;
34
- /** * Include safe details. */
35
- pageNumber?: number;
36
- }>;
37
- export type GetBitcoinNonHdWalletBalancesQueryParamOpts = Nullable<{
38
- /** * The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`. */
39
- quoteCurrency?: Quote;
40
- }>;
41
- export type BitcoinTransactionResponse = Nullable<{
42
- /** * The timestamp when the response was generated. Useful to show data staleness to users. */
43
- updated_at: Date;
44
- /** * List of response items. */
45
- items: BitcoinTransaction[];
46
- /** * Pagination metadata. */
47
- pagination: Pagination;
48
- }>;
49
- export type BitcoinTransaction = Nullable<{
50
- /** The requested chain ID eg: 20090103. */
51
- chain_id: number;
52
- /** The requested chain name eg: btc-mainnet. */
53
- chain_name: string;
54
- /** Use contract decimals to format the token balance for display purposes - divide the balance by 10^{contract_decimals}. */
55
- contract_decimals: number;
56
- /** The block signed timestamp in UTC. */
57
- block_signed_at: Date;
58
- /** The height of the block. */
59
- block_height: number;
60
- /** The hash of the block. */
61
- block_hash: string;
62
- /** The requested transaction hash. */
63
- tx_hash: string;
64
- /** The position index of the tx in the block. */
65
- tx_idx: number;
66
- /** Either 'input' as the sender or 'output' as the receiver of btc. */
67
- type: string;
68
- /** The wallet address. */
69
- address: string;
70
- /** The value attached to this tx in satoshi. */
71
- value: bigint;
72
- /** The value attached to this tx in USD. */
73
- quote: number;
74
- /** The value token exchange rate in USD. */
75
- quote_rate: number;
76
- /** The total transaction fees denoted in satoshi. */
77
- fees_paid: bigint;
78
- /** The gas spent in USD. */
79
- gas_quote: number;
80
- /** The native gas token exchange rate in USD. */
81
- gas_quote_rate: number;
82
- /** Indicates if this is a coinbase tx where btc is rewarded to a miner for validating the block. */
83
- coinbase: boolean;
84
- /** The earliest Unix timestamp or block height at which the tx is valid and can be included. Is 0 if no restriction. */
85
- locktime: number;
86
- /** A measure that reflects impact on the block size limit. Used to determine fees. */
87
- weight: number;
88
- }>;