@covalenthq/client-sdk 0.1.1 → 0.1.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.
Files changed (66) hide show
  1. package/README.md +171 -1
  2. package/dist/services/BalanceService.d.ts +390 -0
  3. package/dist/services/BalanceService.js +618 -0
  4. package/dist/services/BalanceService.js.map +1 -0
  5. package/dist/services/BaseService.d.ts +303 -0
  6. package/dist/services/BaseService.js +691 -0
  7. package/dist/services/BaseService.js.map +1 -0
  8. package/dist/services/Client.d.ts +22 -0
  9. package/dist/services/Client.js +26 -0
  10. package/dist/services/Client.js.map +1 -0
  11. package/dist/services/NftService.d.ts +428 -0
  12. package/dist/services/NftService.js +981 -0
  13. package/dist/services/NftService.js.map +1 -0
  14. package/dist/services/PricingService.d.ts +75 -0
  15. package/dist/services/PricingService.js +126 -0
  16. package/dist/services/PricingService.js.map +1 -0
  17. package/dist/services/SecurityService.d.ts +96 -0
  18. package/dist/services/SecurityService.js +122 -0
  19. package/dist/services/SecurityService.js.map +1 -0
  20. package/dist/services/TransactionService.d.ts +222 -0
  21. package/dist/services/TransactionService.js +433 -0
  22. package/dist/services/TransactionService.js.map +1 -0
  23. package/dist/services/XykService.d.ts +529 -0
  24. package/dist/services/XykService.js +1000 -0
  25. package/dist/services/XykService.js.map +1 -0
  26. package/dist/services/index.js.map +1 -0
  27. package/dist/util/ApiHelpers.d.ts +1 -0
  28. package/dist/util/ApiHelpers.js +15 -0
  29. package/dist/util/ApiHelpers.js.map +1 -0
  30. package/dist/util/backoff.d.ts +9 -0
  31. package/dist/util/backoff.js +25 -0
  32. package/dist/util/backoff.js.map +1 -0
  33. package/package.json +9 -1
  34. package/dist/ApprovalService.d.ts +0 -59
  35. package/dist/ApprovalService.js +0 -52
  36. package/dist/ApprovalService.js.map +0 -1
  37. package/dist/BalancesService.d.ts +0 -189
  38. package/dist/BalancesService.js +0 -231
  39. package/dist/BalancesService.js.map +0 -1
  40. package/dist/BaseService.d.ts +0 -169
  41. package/dist/BaseService.js +0 -276
  42. package/dist/BaseService.js.map +0 -1
  43. package/dist/Client.d.ts +0 -24
  44. package/dist/Client.js +0 -30
  45. package/dist/Client.js.map +0 -1
  46. package/dist/LogEventService.d.ts +0 -62
  47. package/dist/LogEventService.js +0 -75
  48. package/dist/LogEventService.js.map +0 -1
  49. package/dist/NameResolverService.d.ts +0 -33
  50. package/dist/NameResolverService.js +0 -52
  51. package/dist/NameResolverService.js.map +0 -1
  52. package/dist/NftService.d.ts +0 -271
  53. package/dist/NftService.js +0 -528
  54. package/dist/NftService.js.map +0 -1
  55. package/dist/PricingService.d.ts +0 -52
  56. package/dist/PricingService.js +0 -65
  57. package/dist/PricingService.js.map +0 -1
  58. package/dist/TransactionsService.d.ts +0 -126
  59. package/dist/TransactionsService.js +0 -230
  60. package/dist/TransactionsService.js.map +0 -1
  61. package/dist/XykService.d.ts +0 -383
  62. package/dist/XykService.js +0 -467
  63. package/dist/XykService.js.map +0 -1
  64. package/dist/index.js.map +0 -1
  65. /package/dist/{index.d.ts → services/index.d.ts} +0 -0
  66. /package/dist/{index.js → services/index.js} +0 -0
@@ -0,0 +1,303 @@
1
+ import { Chains } from "./Client";
2
+ declare class BlockResponse {
3
+ /** * The timestamp when the response was generated. Useful to show data staleness to users. */
4
+ updated_at: string;
5
+ /** * The requested chain ID eg: `1`. */
6
+ chain_id: number;
7
+ /** * The requested chain name eg: `eth-mainnet`. */
8
+ chain_name: string;
9
+ /** * List of response items. */
10
+ items: Block[];
11
+ constructor(data: BlockResponse);
12
+ }
13
+ declare class Block {
14
+ /** * The block signed timestamp in UTC. */
15
+ signed_at: string;
16
+ /** * The block height. */
17
+ height: number;
18
+ constructor(data: Block);
19
+ }
20
+ declare class ResolvedAddress {
21
+ /** * The requested address. */
22
+ address: string;
23
+ /** * The timestamp when the response was generated. Useful to show data staleness to users. */
24
+ updated_at: string;
25
+ /** * The requested chain ID eg: `1`. */
26
+ chain_id: number;
27
+ /** * The requested chain name eg: `eth-mainnet`. */
28
+ chain_name: string;
29
+ /** * List of response items. */
30
+ items: ResolvedAddressItem[];
31
+ constructor(data: ResolvedAddress);
32
+ }
33
+ declare class ResolvedAddressItem {
34
+ address: string;
35
+ name: string;
36
+ constructor(data: ResolvedAddressItem);
37
+ }
38
+ declare class BlockHeightsResponse {
39
+ /** * The timestamp when the response was generated. Useful to show data staleness to users. */
40
+ updated_at: string;
41
+ /** * The requested chain ID eg: `1`. */
42
+ chain_id: number;
43
+ /** * The requested chain name eg: `eth-mainnet`. */
44
+ chain_name: string;
45
+ /** * List of response items. */
46
+ items: Block[];
47
+ /** * Pagination metadata. */
48
+ pagination: Pagination;
49
+ constructor(data: BlockHeightsResponse);
50
+ }
51
+ declare class Pagination {
52
+ /** * True is there is another page. */
53
+ has_more: boolean;
54
+ /** * The requested page number. */
55
+ page_number: number;
56
+ /** * The requested number of items on the current page. */
57
+ page_size: number;
58
+ /** * The total number of items across all pages for this request. */
59
+ total_count: number;
60
+ constructor(data: Pagination);
61
+ }
62
+ declare class GetLogsResponse {
63
+ /** * The timestamp when the response was generated. Useful to show data staleness to users. */
64
+ updated_at: string;
65
+ /** * The requested chain ID eg: `1`. */
66
+ chain_id: number;
67
+ /** * The requested chain name eg: `eth-mainnet`. */
68
+ chain_name: string;
69
+ /** * List of response items. */
70
+ items: GetLogsEvent[];
71
+ constructor(data: GetLogsResponse);
72
+ }
73
+ declare class GetLogsEvent {
74
+ /** * The block signed timestamp in UTC. */
75
+ block_signed_at: string;
76
+ /** * The height of the block. */
77
+ block_height: number;
78
+ /** * The hash of the block. */
79
+ block_hash: string;
80
+ /** * The offset is the position of the tx in the block. */
81
+ tx_offset: number;
82
+ log_offset: number;
83
+ /** * The requested transaction hash. */
84
+ tx_hash: string;
85
+ raw_log_topics: string;
86
+ /** * Use contract decimals to format the token balance for display purposes - divide the balance by `10^{contract_decimals}`. */
87
+ sender_contract_decimals: number;
88
+ sender_name: string;
89
+ /** * The ticker symbol for the sender. This field is set by a developer and non-unique across a network. */
90
+ sender_contract_ticker_symbol: string;
91
+ sender_address: string;
92
+ sender_address_label: string;
93
+ /** * The contract logo URL. */
94
+ sender_logo_url: string;
95
+ raw_log_data: string;
96
+ decoded: DecodedItem;
97
+ constructor(data: GetLogsEvent);
98
+ }
99
+ declare class DecodedItem {
100
+ name: string;
101
+ signature: string;
102
+ params: Param[];
103
+ constructor(data: DecodedItem);
104
+ }
105
+ declare class Param {
106
+ name: string;
107
+ type: string;
108
+ indexed: boolean;
109
+ decoded: boolean;
110
+ value: string;
111
+ constructor(data: Param);
112
+ }
113
+ declare class LogEventsByAddressResponse {
114
+ /** * The timestamp when the response was generated. Useful to show data staleness to users. */
115
+ updated_at: string;
116
+ /** * The requested chain ID eg: `1`. */
117
+ chain_id: number;
118
+ /** * The requested chain name eg: `eth-mainnet`. */
119
+ chain_name: string;
120
+ /** * List of response items. */
121
+ items: LogEvent[];
122
+ /** * Pagination metadata. */
123
+ pagination: Pagination;
124
+ constructor(data: LogEventsByAddressResponse);
125
+ }
126
+ declare class LogEvent {
127
+ /** * The block signed timestamp in UTC. */
128
+ block_signed_at: string;
129
+ /** * The height of the block. */
130
+ block_height: number;
131
+ /** * The offset is the position of the tx in the block. */
132
+ tx_offset: number;
133
+ log_offset: number;
134
+ /** * The requested transaction hash. */
135
+ tx_hash: string;
136
+ raw_log_topics: string;
137
+ /** * Use contract decimals to format the token balance for display purposes - divide the balance by `10^{contract_decimals}`. */
138
+ sender_contract_decimals: number;
139
+ sender_name: string;
140
+ sender_contract_ticker_symbol: string;
141
+ sender_address: string;
142
+ sender_address_label: string;
143
+ /** * The contract logo URL. */
144
+ sender_logo_url: string;
145
+ raw_log_data: string;
146
+ decoded: DecodedItem;
147
+ constructor(data: LogEvent);
148
+ }
149
+ declare class LogEventsByTopicHashResponse {
150
+ /** * The timestamp when the response was generated. Useful to show data staleness to users. */
151
+ updated_at: string;
152
+ /** * The requested chain ID eg: `1`. */
153
+ chain_id: number;
154
+ /** * The requested chain name eg: `eth-mainnet`. */
155
+ chain_name: string;
156
+ /** * List of response items. */
157
+ items: LogEvent[];
158
+ /** * Pagination metadata. */
159
+ pagination: Pagination;
160
+ constructor(data: LogEventsByTopicHashResponse);
161
+ }
162
+ declare class AllChainsResponse {
163
+ /** * The timestamp when the response was generated. Useful to show data staleness to users. */
164
+ updated_at: string;
165
+ /** * List of response items. */
166
+ items: ChainItem[];
167
+ constructor(data: AllChainsResponse);
168
+ }
169
+ declare class ChainItem {
170
+ /** * The chain name eg: `eth-mainnet`. */
171
+ name: string;
172
+ /** * The requested chain ID eg: `1`. */
173
+ chain_id: string;
174
+ /** * True if the chain is a testnet. */
175
+ is_testnet: boolean;
176
+ /** * Schema name to use for direct SQL. */
177
+ db_schema_name: string;
178
+ /** * The chains label eg: `Ethereum Mainnet`. */
179
+ label: string;
180
+ /** * The category label eg: `Ethereum`. */
181
+ category_label: string;
182
+ /** * A svg logo url for the chain. */
183
+ logo_url: string;
184
+ /** * A black png logo url for the chain. */
185
+ black_logo_url: string;
186
+ /** * A white png logo url for the chain. */
187
+ white_logo_url: string;
188
+ /** * True if the chain is an AppChain. */
189
+ is_appchain: boolean;
190
+ /** * The ChainItem the appchain is a part of. */
191
+ appchain_of: ChainItem;
192
+ constructor(data: ChainItem);
193
+ }
194
+ declare class AllChainsStatusResponse {
195
+ /** * The timestamp when the response was generated. Useful to show data staleness to users. */
196
+ updated_at: string;
197
+ /** * List of response items. */
198
+ items: ChainStatusItem[];
199
+ constructor(data: AllChainsStatusResponse);
200
+ }
201
+ declare class ChainStatusItem {
202
+ /** * The chain name eg: `eth-mainnet`. */
203
+ name: string;
204
+ /** * The requested chain ID eg: `1`. */
205
+ chain_id: string;
206
+ /** * True if the chain is a testnet. */
207
+ is_testnet: boolean;
208
+ /** * A svg logo url for the chain. */
209
+ logo_url: boolean;
210
+ /** * A black png logo url for the chain. */
211
+ black_logo_url: string;
212
+ /** * A white png logo url for the chain. */
213
+ white_logo_url: string;
214
+ /** * True if the chain is an AppChain. */
215
+ is_appchain: boolean;
216
+ /** * The height of the lastest block available. */
217
+ synced_block_height: number;
218
+ /** * The signed timestamp of lastest block available. */
219
+ synced_blocked_signed_at: string;
220
+ /** * True if the chain has data and ready for querying. */
221
+ has_data: boolean;
222
+ constructor(data: ChainStatusItem);
223
+ }
224
+ /**
225
+ * Class A - Base
226
+ *
227
+ */
228
+ export declare class Response<T> {
229
+ data: T;
230
+ error: boolean;
231
+ error_code: number;
232
+ error_message: string;
233
+ }
234
+ export declare class BaseService {
235
+ private apiKey;
236
+ constructor(apiKey: string);
237
+ /**
238
+ *
239
+ * @param {string} chainName - The chain name eg: `eth-mainnet`.
240
+ * @param {string} blockHeight - The block height or `latest` for the latest block available.
241
+ *
242
+ */
243
+ getBlock(chainName: Chains, blockHeight: string): Promise<Response<BlockResponse>>;
244
+ /**
245
+ *
246
+ * @param {string} chainName - The chain name eg: `eth-mainnet`.
247
+ * @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
248
+ *
249
+ */
250
+ getResolvedAddress(chainName: Chains, walletAddress: string): Promise<Response<ResolvedAddress>>;
251
+ /**
252
+ *
253
+ * @param {string} chainName - The chain name eg: `eth-mainnet`.
254
+ * @param {string} startDate - The start date in YYYY-MM-DD format.
255
+ * @param {string} endDate - The end date in YYYY-MM-DD format.
256
+ *
257
+ */
258
+ getBlockHeights(chainName: Chains, startDate: string, endDate: string): Promise<Response<BlockHeightsResponse>>;
259
+ /**
260
+ *
261
+ * @param {string} chainName - The chain name eg: `eth-mainnet`.
262
+ * @param {number} startingBlock - The first block to retrieve log events with. Accepts decimals, hexadecimals, or the strings `earliest` and `latest`.
263
+ * @param {string} endingBlock - The last block to retrieve log events with. Accepts decimals, hexadecimals, or the strings `earliest` and `latest`.
264
+ * @param {string} address - The address of the log events sender contract.
265
+ * @param {string} topics - The topic hash(es) to retrieve logs with.
266
+ * @param {string} blockHash - The block hash to retrieve logs for.
267
+ * @param {boolean} skipDecode - Omit decoded log events.
268
+ *
269
+ */
270
+ getLogs(chainName: Chains, startingBlock?: number, endingBlock?: string, address?: string, topics?: string, blockHash?: string, skipDecode?: boolean): Promise<Response<GetLogsResponse>>;
271
+ /**
272
+ *
273
+ * @param {string} chainName - The chain name eg: `eth-mainnet`.
274
+ * @param {string} contractAddress - The endpoint will return event logs emitted from this contract address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
275
+ * @param {number} startingBlock - The first block to retrieve log events with. Accepts decimals, hexadecimals, or the strings `earliest` and `latest`.
276
+ * @param {string} endingBlock - The last block to retrieve log events with. Accepts decimals, hexadecimals, or the strings `earliest` and `latest`.
277
+ *
278
+ */
279
+ getLogEventsByAddress(chainName: Chains, contractAddress: string, startingBlock?: number, endingBlock?: string): Promise<Response<LogEventsByAddressResponse>>;
280
+ /**
281
+ *
282
+ * @param {string} chainName - The chain name eg: `eth-mainnet`.
283
+ * @param {string} topicHash - The endpoint will return event logs that contain this topic hash.
284
+ * @param {number} startingBlock - The first block to retrieve log events with. Accepts decimals, hexadecimals, or the strings `earliest` and `latest`.
285
+ * @param {string} endingBlock - The last block to retrieve log events with. Accepts decimals, hexadecimals, or the strings `earliest` and `latest`.
286
+ * @param {string} secondaryTopics - Additional topic hash(es) to filter on - padded & unpadded address fields are supported.
287
+ *
288
+ */
289
+ getLogEventsByTopicHash(chainName: Chains, topicHash: string, startingBlock?: number, endingBlock?: string, secondaryTopics?: string): Promise<Response<LogEventsByTopicHashResponse>>;
290
+ /**
291
+ *
292
+
293
+ *
294
+ */
295
+ getAllChains(): Promise<Response<AllChainsResponse>>;
296
+ /**
297
+ *
298
+
299
+ *
300
+ */
301
+ getAllChainStatus(): Promise<Response<AllChainsStatusResponse>>;
302
+ }
303
+ export {};