@covalenthq/client-sdk 0.2.9 → 0.5.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.
Files changed (116) hide show
  1. package/README.md +117 -46
  2. package/dist/cjs/index.d.ts +9 -0
  3. package/dist/cjs/index.js +5226 -0
  4. package/dist/cjs/index.js.map +1 -0
  5. package/dist/cjs/services/BalanceService.d.ts +543 -0
  6. package/dist/cjs/services/BaseService.d.ts +357 -0
  7. package/dist/cjs/services/CovalentClient.d.ts +65 -0
  8. package/dist/cjs/services/NftService.d.ts +620 -0
  9. package/dist/cjs/services/PricingService.d.ts +88 -0
  10. package/dist/cjs/services/SecurityService.d.ts +158 -0
  11. package/dist/cjs/services/TransactionService.d.ts +457 -0
  12. package/dist/cjs/services/XykService.d.ts +686 -0
  13. package/dist/cjs/util/ApiHelpers.d.ts +5 -0
  14. package/dist/cjs/util/backoff.d.ts +11 -0
  15. package/dist/cjs/util/types/BalanceServiceTypes.d.ts +322 -0
  16. package/dist/cjs/util/types/BaseServiceTypes.d.ts +180 -0
  17. package/dist/cjs/util/types/GenericTypes.d.ts +96 -0
  18. package/dist/cjs/util/types/NftServiceTypes.d.ts +297 -0
  19. package/dist/cjs/util/types/PricingServiceTypes.d.ts +31 -0
  20. package/dist/cjs/util/types/SecurityServiceTypes.d.ts +121 -0
  21. package/dist/cjs/util/types/TransactionServiceTypes.d.ts +322 -0
  22. package/dist/cjs/util/types/XykServiceTypes.d.ts +479 -0
  23. package/dist/es/index.d.ts +9 -0
  24. package/dist/es/index.js +5223 -0
  25. package/dist/es/index.js.map +1 -0
  26. package/dist/es/services/BalanceService.d.ts +543 -0
  27. package/dist/es/services/BaseService.d.ts +357 -0
  28. package/dist/es/services/CovalentClient.d.ts +65 -0
  29. package/dist/es/services/NftService.d.ts +620 -0
  30. package/dist/es/services/PricingService.d.ts +88 -0
  31. package/dist/es/services/SecurityService.d.ts +158 -0
  32. package/dist/es/services/TransactionService.d.ts +457 -0
  33. package/dist/es/services/XykService.d.ts +686 -0
  34. package/dist/es/util/ApiHelpers.d.ts +5 -0
  35. package/dist/es/util/backoff.d.ts +11 -0
  36. package/dist/es/util/types/BalanceServiceTypes.d.ts +322 -0
  37. package/dist/es/util/types/BaseServiceTypes.d.ts +180 -0
  38. package/dist/es/util/types/GenericTypes.d.ts +96 -0
  39. package/dist/es/util/types/NftServiceTypes.d.ts +297 -0
  40. package/dist/es/util/types/PricingServiceTypes.d.ts +31 -0
  41. package/dist/es/util/types/SecurityServiceTypes.d.ts +121 -0
  42. package/dist/es/util/types/TransactionServiceTypes.d.ts +322 -0
  43. package/dist/es/util/types/XykServiceTypes.d.ts +479 -0
  44. package/dist/esm/index.d.ts +9 -0
  45. package/dist/esm/index.js +5223 -0
  46. package/dist/esm/index.js.map +1 -0
  47. package/dist/esm/services/BalanceService.d.ts +543 -0
  48. package/dist/esm/services/BaseService.d.ts +357 -0
  49. package/dist/esm/services/CovalentClient.d.ts +65 -0
  50. package/dist/esm/services/NftService.d.ts +620 -0
  51. package/dist/esm/services/PricingService.d.ts +88 -0
  52. package/dist/esm/services/SecurityService.d.ts +158 -0
  53. package/dist/esm/services/TransactionService.d.ts +457 -0
  54. package/dist/esm/services/XykService.d.ts +686 -0
  55. package/dist/esm/util/ApiHelpers.d.ts +5 -0
  56. package/dist/esm/util/backoff.d.ts +11 -0
  57. package/dist/esm/util/types/BalanceServiceTypes.d.ts +322 -0
  58. package/dist/esm/util/types/BaseServiceTypes.d.ts +180 -0
  59. package/dist/esm/util/types/GenericTypes.d.ts +96 -0
  60. package/dist/esm/util/types/NftServiceTypes.d.ts +297 -0
  61. package/dist/esm/util/types/PricingServiceTypes.d.ts +31 -0
  62. package/dist/esm/util/types/SecurityServiceTypes.d.ts +121 -0
  63. package/dist/esm/util/types/TransactionServiceTypes.d.ts +322 -0
  64. package/dist/esm/util/types/XykServiceTypes.d.ts +479 -0
  65. package/dist/index.d.ts +1 -1
  66. package/dist/index.js +9 -27
  67. package/dist/index.js.map +1 -1
  68. package/dist/services/BalanceService.d.ts +149 -11
  69. package/dist/services/BalanceService.js +300 -84
  70. package/dist/services/BalanceService.js.map +1 -1
  71. package/dist/services/BaseService.d.ts +46 -10
  72. package/dist/services/BaseService.js +199 -151
  73. package/dist/services/BaseService.js.map +1 -1
  74. package/dist/services/CovalentClient.d.ts +65 -0
  75. package/dist/services/CovalentClient.js +44 -0
  76. package/dist/services/CovalentClient.js.map +1 -0
  77. package/dist/services/NftService.d.ts +182 -16
  78. package/dist/services/NftService.js +490 -211
  79. package/dist/services/NftService.js.map +1 -1
  80. package/dist/services/PricingService.d.ts +8 -3
  81. package/dist/services/PricingService.js +44 -38
  82. package/dist/services/PricingService.js.map +1 -1
  83. package/dist/services/SecurityService.d.ts +71 -3
  84. package/dist/services/SecurityService.js +140 -32
  85. package/dist/services/SecurityService.js.map +1 -1
  86. package/dist/services/TransactionService.d.ts +58 -9
  87. package/dist/services/TransactionService.js +152 -103
  88. package/dist/services/TransactionService.js.map +1 -1
  89. package/dist/services/XykService.d.ts +85 -19
  90. package/dist/services/XykService.js +470 -291
  91. package/dist/services/XykService.js.map +1 -1
  92. package/dist/util/ApiHelpers.d.ts +2 -1
  93. package/dist/util/ApiHelpers.js +57 -36
  94. package/dist/util/ApiHelpers.js.map +1 -1
  95. package/dist/util/backoff.d.ts +5 -3
  96. package/dist/util/backoff.js +35 -13
  97. package/dist/util/backoff.js.map +1 -1
  98. package/dist/util/types/BalanceServiceTypes.d.ts +63 -0
  99. package/dist/util/types/BalanceServiceTypes.js +1 -2
  100. package/dist/util/types/BaseServiceTypes.d.ts +8 -0
  101. package/dist/util/types/BaseServiceTypes.js +1 -2
  102. package/dist/util/types/GenericTypes.d.ts +7 -0
  103. package/dist/util/types/GenericTypes.js +1 -2
  104. package/dist/util/types/NftServiceTypes.d.ts +86 -2
  105. package/dist/util/types/NftServiceTypes.js +1 -2
  106. package/dist/util/types/PricingServiceTypes.js +1 -2
  107. package/dist/util/types/SecurityServiceTypes.d.ts +51 -0
  108. package/dist/util/types/SecurityServiceTypes.js +1 -2
  109. package/dist/util/types/TransactionServiceTypes.d.ts +24 -2
  110. package/dist/util/types/TransactionServiceTypes.js +1 -2
  111. package/dist/util/types/XykServiceTypes.d.ts +20 -6
  112. package/dist/util/types/XykServiceTypes.js +1 -2
  113. package/package.json +19 -4
  114. package/dist/services/Client.d.ts +0 -29
  115. package/dist/services/Client.js +0 -30
  116. package/dist/services/Client.js.map +0 -1
@@ -26,6 +26,7 @@ export interface ResolvedAddress {
26
26
  items: ResolvedAddressItem[];
27
27
  }
28
28
  export interface ResolvedAddressItem {
29
+ /** * The requested address. */
29
30
  address: string;
30
31
  name: string;
31
32
  }
@@ -60,20 +61,27 @@ export interface GetLogsEvent {
60
61
  block_hash: string;
61
62
  /** * The offset is the position of the tx in the block. */
62
63
  tx_offset: number;
64
+ /** * The offset is the position of the log entry within an event log. */
63
65
  log_offset: number;
64
66
  /** * The requested transaction hash. */
65
67
  tx_hash: string;
68
+ /** * The log topics in raw data. */
66
69
  raw_log_topics: string;
67
70
  /** * Use contract decimals to format the token balance for display purposes - divide the balance by `10^{contract_decimals}`. */
68
71
  sender_contract_decimals: number;
72
+ /** * The name of the sender. */
69
73
  sender_name: string;
70
74
  /** * The ticker symbol for the sender. This field is set by a developer and non-unique across a network. */
71
75
  sender_contract_ticker_symbol: string;
76
+ /** * The address of the sender. */
72
77
  sender_address: string;
78
+ /** * The label of the sender address. */
73
79
  sender_address_label: string;
74
80
  /** * The contract logo URL. */
75
81
  sender_logo_url: string;
82
+ /** * The log events in raw. */
76
83
  raw_log_data: string;
84
+ /** * The decoded item. */
77
85
  decoded: DecodedItem;
78
86
  }
79
87
  export interface LogEventsByAddressResponse {
@@ -1,3 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
3
2
  //# sourceMappingURL=BaseServiceTypes.js.map
@@ -58,19 +58,26 @@ export interface LogEvent {
58
58
  block_height: number;
59
59
  /** * The offset is the position of the tx in the block. */
60
60
  tx_offset: number;
61
+ /** * The offset is the position of the log entry within an event log. */
61
62
  log_offset: number;
62
63
  /** * The requested transaction hash. */
63
64
  tx_hash: string;
65
+ /** * The log topics in raw data. */
64
66
  raw_log_topics: string;
65
67
  /** * Use contract decimals to format the token balance for display purposes - divide the balance by `10^{contract_decimals}`. */
66
68
  sender_contract_decimals: number;
69
+ /** * The name of the sender. */
67
70
  sender_name: string;
68
71
  sender_contract_ticker_symbol: string;
72
+ /** * The address of the sender. */
69
73
  sender_address: string;
74
+ /** * The label of the sender address. */
70
75
  sender_address_label: string;
71
76
  /** * The contract logo URL. */
72
77
  sender_logo_url: string;
78
+ /** * The log events in raw. */
73
79
  raw_log_data: string;
80
+ /** * The decoded item. */
74
81
  decoded: DecodedItem;
75
82
  }
76
83
  export interface ContractMetadata {
@@ -1,3 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
3
2
  //# sourceMappingURL=GenericTypes.js.map
@@ -45,7 +45,7 @@ export interface NftTokenContractBalanceItem {
45
45
  last_transfered_at: Date;
46
46
  /** * The asset balance. Use `contract_decimals` to scale this balance for display purposes. */
47
47
  balance: bigint | null;
48
- balance24h: number;
48
+ balance_24h: number;
49
49
  type: string;
50
50
  nft_data: NftData[];
51
51
  }
@@ -105,10 +105,15 @@ export interface NftTransactionItem {
105
105
  tx_hash: string;
106
106
  /** * The offset is the position of the tx in the block. */
107
107
  tx_offset: number;
108
+ /** * Whether or not transaction is successful. */
108
109
  successful: boolean;
110
+ /** * The sender's wallet address. */
109
111
  from_address: string;
112
+ /** * The label of `from` address. */
110
113
  from_address_label: string;
114
+ /** * The receiver's wallet address. */
111
115
  to_address: string;
116
+ /** * The label of `to` address. */
112
117
  to_address_label: string;
113
118
  /** * The value attached to this tx. */
114
119
  value: bigint | null;
@@ -117,7 +122,9 @@ export interface NftTransactionItem {
117
122
  /** * A prettier version of the quote for rendering purposes. */
118
123
  pretty_value_quote: string;
119
124
  gas_offered: string;
125
+ /** * The gas spent for this tx. */
120
126
  gas_spent: string;
127
+ /** * The gas price at the time of this tx. */
121
128
  gas_price: string;
122
129
  /** * The total transaction fees (gas_price * gas_spent) paid for this tx, denoted in wei. */
123
130
  fees_paid: bigint | null;
@@ -126,6 +133,7 @@ export interface NftTransactionItem {
126
133
  /** * A prettier version of the quote for rendering purposes. */
127
134
  pretty_gas_quote: string;
128
135
  gas_quote_rate: number;
136
+ /** * The log events. */
129
137
  log_events: LogEvent[];
130
138
  }
131
139
  export interface NftCollectionTraitsResponse {
@@ -207,7 +215,83 @@ export interface NftOwnershipForCollectionItem {
207
215
  last_transfered_at: Date;
208
216
  /** * Nft balance. */
209
217
  balance: bigint | null;
210
- balance24h: number;
218
+ balance_24h: number;
211
219
  type: string;
212
220
  nft_data: NftData;
213
221
  }
222
+ export interface NftMarketSaleCountResponse {
223
+ /** * The timestamp when the response was generated. Useful to show data staleness to users. */
224
+ updated_at: Date;
225
+ /** * The requested address. */
226
+ address: string;
227
+ /** * The requested quote currency eg: `USD`. */
228
+ quote_currency: string;
229
+ /** * The requested chain name eg: `eth-mainnet`. */
230
+ chain_name: string;
231
+ /** * The requested chain ID eg: `1`. */
232
+ chain_id: number;
233
+ /** * List of response items. */
234
+ items: MarketSaleCountItem[];
235
+ }
236
+ export interface MarketSaleCountItem {
237
+ /** * The timestamp of the date of sale. */
238
+ date: Date;
239
+ /** * The total amount of sales for the current day. */
240
+ sale_count: number;
241
+ }
242
+ export interface NftMarketVolumeResponse {
243
+ /** * The timestamp when the response was generated. Useful to show data staleness to users. */
244
+ updated_at: Date;
245
+ /** * The requested address. */
246
+ address: string;
247
+ /** * The requested quote currency eg: `USD`. */
248
+ quote_currency: string;
249
+ /** * The requested chain name eg: `eth-mainnet`. */
250
+ chain_name: string;
251
+ /** * The requested chain ID eg: `1`. */
252
+ chain_id: number;
253
+ /** * List of response items. */
254
+ items: MarketVolumeItem[];
255
+ }
256
+ export interface MarketVolumeItem {
257
+ /** * The timestamp of the date of sale. */
258
+ date: Date;
259
+ /** * The ticker symbol for the native currency. */
260
+ native_ticker_symbol: string;
261
+ /** * The contract name of the native currency. */
262
+ native_name: string;
263
+ /** * The current volume converted to fiat in `quote-currency`. */
264
+ volume_quote: number;
265
+ /** * The current volume in native currency. */
266
+ volume_native_quote: number;
267
+ /** * A prettier version of the volume quote for rendering purposes. */
268
+ pretty_volume_quote: string;
269
+ }
270
+ export interface NftMarketFloorPriceResponse {
271
+ /** * The timestamp when the response was generated. Useful to show data staleness to users. */
272
+ updated_at: Date;
273
+ /** * The requested address. */
274
+ address: string;
275
+ /** * The requested quote currency eg: `USD`. */
276
+ quote_currency: string;
277
+ /** * The requested chain name eg: `eth-mainnet`. */
278
+ chain_name: string;
279
+ /** * The requested chain ID eg: `1`. */
280
+ chain_id: number;
281
+ /** * List of response items. */
282
+ items: MarketFloorPriceItem[];
283
+ }
284
+ export interface MarketFloorPriceItem {
285
+ /** * The timestamp of the date of sale. */
286
+ date: Date;
287
+ /** * The ticker symbol for the native currency. */
288
+ native_ticker_symbol: string;
289
+ /** * The contract name of the native currency. */
290
+ native_name: string;
291
+ /** * The current floor price in native currency. */
292
+ floor_price_native_quote: number;
293
+ /** * The current floor price converted to fiat in `quote-currency`. */
294
+ floor_price_quote: number;
295
+ /** * A prettier version of the floor price quote for rendering purposes. */
296
+ pretty_floor_price_quote: string;
297
+ }
@@ -1,3 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
3
2
  //# sourceMappingURL=NftServiceTypes.js.map
@@ -1,3 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
3
2
  //# sourceMappingURL=PricingServiceTypes.js.map
@@ -45,6 +45,7 @@ export interface TokenSpenderItem {
45
45
  block_height: number;
46
46
  /** * The offset is the position of the tx in the block. */
47
47
  tx_offset: number;
48
+ /** * The offset is the position of the log entry within an event log." */
48
49
  log_offset: number;
49
50
  /** * The block signed timestamp in UTC. */
50
51
  block_signed_at: Date;
@@ -68,3 +69,53 @@ export interface TokenSpenderItem {
68
69
  pretty_value_at_risk_quote: string;
69
70
  risk_factor: string;
70
71
  }
72
+ export interface NftApprovalsResponse {
73
+ /** * The timestamp when the response was generated. Useful to show data staleness to users. */
74
+ updated_at: Date;
75
+ /** * The requested chain ID eg: `1`. */
76
+ chain_id: number;
77
+ /** * The requested chain name eg: `eth-mainnet`. */
78
+ chain_name: string;
79
+ /** * The requested address. */
80
+ address: string;
81
+ /** * List of response items. */
82
+ items: NftApprovalsItem[];
83
+ }
84
+ export interface NftApprovalsItem {
85
+ /** * Use the relevant `contract_address` to lookup prices, logos, token transfers, etc. */
86
+ contract_address: string;
87
+ /** * The label of the contract address. */
88
+ contract_address_label: string;
89
+ /** * The ticker symbol for this contract. This field is set by a developer and non-unique across a network. */
90
+ contract_ticker_symbol: string;
91
+ /** * List of asset balances held by the user. */
92
+ token_balances: NftApprovalBalance[];
93
+ /** * Contracts with non-zero approvals for this token. */
94
+ spenders: NftApprovalSpender[];
95
+ }
96
+ export interface NftApprovalBalance {
97
+ /** * The token's id. */
98
+ token_id: bigint | null;
99
+ /** * The NFT's token balance. */
100
+ token_balance: bigint | null;
101
+ }
102
+ export interface NftApprovalSpender {
103
+ /** * The height of the block. */
104
+ block_height: number;
105
+ /** * The offset is the position of the tx in the block. */
106
+ tx_offset: number;
107
+ /** * The offset is the position of the log entry within an event log." */
108
+ log_offset: number;
109
+ /** * The block signed timestamp in UTC. */
110
+ block_signed_at: Date;
111
+ /** * Most recent transaction that updated approval amounts for the token. */
112
+ tx_hash: string;
113
+ /** * Address of the contract with approval for the token. */
114
+ spender_address: string;
115
+ /** * Name of the contract with approval for the token. */
116
+ spender_address_label: string;
117
+ /** * The token ids approved. */
118
+ token_ids_approved: string;
119
+ /** * Remaining number of tokens granted to the spender by the approval. */
120
+ allowance: string;
121
+ }
@@ -1,3 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
3
2
  //# sourceMappingURL=SecurityServiceTypes.js.map
@@ -14,15 +14,23 @@ export interface Transaction {
14
14
  block_signed_at: Date;
15
15
  /** * The height of the block. */
16
16
  block_height: number;
17
+ /** * The hash of the block. Use it to remove transactions from re-org-ed blocks. */
18
+ block_hash: string;
17
19
  /** * The requested transaction hash. */
18
20
  tx_hash: string;
19
21
  /** * The offset is the position of the tx in the block. */
20
22
  tx_offset: number;
21
23
  /** * Indicates whether a transaction failed or succeeded. */
22
24
  successful: boolean;
25
+ /** * The sender's wallet address. */
23
26
  from_address: string;
27
+ /** * The address of the miner. */
28
+ miner_address: string;
29
+ /** * The label of `from` address. */
24
30
  from_address_label: string;
31
+ /** * The receiver's wallet address. */
25
32
  to_address: string;
33
+ /** * The label of `to` address. */
26
34
  to_address_label: string;
27
35
  /** * The value attached to this tx. */
28
36
  value: bigint | null;
@@ -33,7 +41,9 @@ export interface Transaction {
33
41
  /** * The requested chain native gas token metadata. */
34
42
  gas_metadata: ContractMetadata;
35
43
  gas_offered: string;
44
+ /** * The gas spent for this tx. */
36
45
  gas_spent: string;
46
+ /** * The gas price at the time of this tx. */
37
47
  gas_price: string;
38
48
  /** * The total transaction fees (`gas_price` * `gas_spent`) paid for this tx, denoted in wei. */
39
49
  fees_paid: bigint | null;
@@ -49,9 +59,13 @@ export interface Transaction {
49
59
  nft_sale_details: NftSalesReport;
50
60
  /** * The details for the lending protocol transaction. */
51
61
  lending_details: LendingReport;
62
+ /** * The log events. */
52
63
  log_events: LogEvent[];
64
+ /** * The details related to the safe transaction. */
65
+ safe_details: SafeDetails[];
53
66
  }
54
67
  export interface DexReport {
68
+ /** * The offset is the position of the log entry within an event log. */
55
69
  log_offset: number;
56
70
  /** * Stores the name of the protocol that facilitated the event. */
57
71
  protocol_name: string;
@@ -114,6 +128,7 @@ export interface DexReport {
114
128
  recipient: string;
115
129
  }
116
130
  export interface NftSalesReport {
131
+ /** * The offset is the position of the log entry within an event log. */
117
132
  log_offset: number;
118
133
  /** * Stores the topic event hash. All events have a unique topic event hash. */
119
134
  topic0: string;
@@ -164,6 +179,7 @@ export interface NftSalesReport {
164
179
  trade_group_type: string;
165
180
  }
166
181
  export interface LendingReport {
182
+ /** * The offset is the position of the log entry within an event log. */
167
183
  log_offset: number;
168
184
  /** * Stores the name of the lending protocol that facilitated the event. */
169
185
  protocol_name: string;
@@ -235,13 +251,19 @@ export interface LendingReport {
235
251
  /** * Stores the wallet address of the user initiating the event. */
236
252
  user: string;
237
253
  }
254
+ export interface SafeDetails {
255
+ /** * The address that signed the safe transaction. */
256
+ owner_address: string;
257
+ /** * The signature of the owner for the safe transaction. */
258
+ signature: string;
259
+ /** * The type of safe signature used. */
260
+ signature_type: string;
261
+ }
238
262
  export interface RecentTransactionsResponse {
239
263
  /** * The requested address. */
240
264
  address: string;
241
265
  /** * The timestamp when the response was generated. Useful to show data staleness to users. */
242
266
  updated_at: Date;
243
- /** * DEPRECATED */
244
- next_update_at: Date;
245
267
  /** * The requested quote currency eg: `USD`. */
246
268
  quote_currency: string;
247
269
  /** * The requested chain ID eg: `1`. */
@@ -1,3 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
3
2
  //# sourceMappingURL=TransactionServiceTypes.js.map
@@ -65,6 +65,10 @@ export interface PoolToDexResponse {
65
65
  /** * List of response items. */
66
66
  items: PoolToDexItem[];
67
67
  }
68
+ export interface PoolToDexItem extends SupportedDex {
69
+ /** * The dex logo URL. */
70
+ logo_url: string;
71
+ }
68
72
  export interface SupportedDex {
69
73
  /** * The requested chain ID eg: `1`. */
70
74
  chain_id: string;
@@ -76,10 +80,6 @@ export interface SupportedDex {
76
80
  router_contract_addresses: string;
77
81
  swap_fee: number;
78
82
  }
79
- export interface PoolToDexItem extends SupportedDex {
80
- /** * The dex logo URL */
81
- logo_url: string;
82
- }
83
83
  export interface PoolByAddressResponse {
84
84
  /** * The timestamp when the response was generated. Useful to show data staleness to users. */
85
85
  updated_at: Date;
@@ -198,12 +198,28 @@ export interface PoolsDexDataItem {
198
198
  total_liquidity_quote: number;
199
199
  /** * A prettier version of the total liquidity quote for rendering purposes. */
200
200
  pretty_total_liquidity_quote: string;
201
+ /** * The volume 24h converted to fiat in `quote-currency`. */
202
+ volume_24h_quote: number;
203
+ /** * The volume 7d converted to fiat in `quote-currency`. */
204
+ volume_7d_quote: number;
205
+ /** * The fee 24h converted to fiat in `quote-currency`. */
206
+ fee_24h_quote: number;
207
+ /** * A prettier version of the volume 24h quote for rendering purposes. */
208
+ pretty_volume_24h_quote: string;
209
+ /** * A prettier version of the volume 7d quote for rendering purposes. */
210
+ pretty_volume_7d_quote: string;
211
+ /** * A prettier version of the fee 24h quote for rendering purposes. */
212
+ pretty_fee_24h_quote: string;
201
213
  /** * Token0's contract metadata and reserve data. */
202
214
  token_0: PoolsDexToken;
203
215
  /** * Token1's contract metadata and reserve data. */
204
216
  token_1: PoolsDexToken;
205
217
  }
206
218
  export interface PoolsDexToken {
219
+ /** * The reserves for the token. */
220
+ reserve: string;
221
+ /** * The string returned by the `name()` method. */
222
+ contract_name: string;
207
223
  /** * Use contract decimals to format the token balance for display purposes - divide the balance by `10^{contract_decimals}`. */
208
224
  contract_decimals: number;
209
225
  /** * The ticker symbol for this contract. This field is set by a developer and non-unique across a network. */
@@ -212,8 +228,6 @@ export interface PoolsDexToken {
212
228
  contract_address: string;
213
229
  /** * The contract logo URL. */
214
230
  logo_url: string;
215
- /** * The reserves for the token. */
216
- reserve: string;
217
231
  /** * The exchange rate for the requested quote currency. */
218
232
  quote_rate: number;
219
233
  }
@@ -1,3 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
3
2
  //# sourceMappingURL=XykServiceTypes.js.map
package/package.json CHANGED
@@ -1,7 +1,6 @@
1
1
  {
2
2
  "name": "@covalenthq/client-sdk",
3
- "version": "0.2.9",
4
- "main": "dist/index.js",
3
+ "version": "0.5.0",
5
4
  "types": "dist/index.d.ts",
6
5
  "files": [
7
6
  "/dist"
@@ -10,15 +9,31 @@
10
9
  "author": "Covalenthq",
11
10
  "license": "MIT",
12
11
  "dependencies": {
12
+ "@rollup/plugin-commonjs": "^25.0.4",
13
+ "@rollup/plugin-node-resolve": "^15.2.1",
14
+ "chalk": "^4.1.2",
13
15
  "date-fns": "^2.30.0",
16
+ "rollup": "^3.29.1",
17
+ "rollup-plugin-typescript2": "^0.35.0",
14
18
  "typescript": "^5.1.6"
15
19
  },
16
20
  "devDependencies": {
17
- "@types/jest": "^29.5.3",
21
+ "@types/chalk": "^2.2.0",
22
+ "@types/jest": "^29.5.5",
18
23
  "jest": "^29.6.1",
24
+ "p-limit": "^3.1.0",
19
25
  "ts-jest": "^29.1.1"
20
26
  },
21
27
  "scripts": {
22
- "test": "jest"
28
+ "test": "jest",
29
+ "build": "rollup -c rollup.config.js",
30
+ "clean": "rm -rf dist",
31
+ "start": "rollup -c"
32
+ },
33
+ "exports": {
34
+ ".": {
35
+ "require": "./dist/cjs/index.js",
36
+ "import": "./dist/es/index.js"
37
+ }
23
38
  }
24
39
  }
@@ -1,29 +0,0 @@
1
- import { SecurityService } from "./SecurityService";
2
- import { BalanceService } from "./BalanceService";
3
- import { BaseService } from "./BaseService";
4
- import { NftService } from "./NftService";
5
- import { PricingService } from "./PricingService";
6
- import { TransactionService } from "./TransactionService";
7
- import { XykService } from "./XykService";
8
- export type Chains = "btc-mainnet" | "eth-mainnet" | "matic-mainnet" | "bsc-mainnet" | "avalanche-mainnet" | "optimism-mainnet" | "fantom-mainnet" | "moonbeam-mainnet" | "moonbeam-moonriver" | "rsk-mainnet" | "arbitrum-mainnet" | "palm-mainnet" | "klaytn-mainnet" | "heco-mainnet" | "nervos-godwoken-mainnet" | "axie-mainnet" | "evmos-mainnet" | "astar-mainnet" | "iotex-mainnet" | "harmony-mainnet" | "cronos-mainnet" | "aurora-mainnet" | "emerald-paratime-mainnet" | "boba-mainnet" | "eth-goerli" | "matic-mumbai" | "avalanche-testnet" | "bsc-testnet" | "moonbeam-moonbase-alpha" | "rsk-testnet" | "arbitrum-goerli" | "fantom-testnet" | "palm-testnet" | "heco-testnet" | "nervos-godwoken-testnet" | "evmos-testnet" | "astar-shiden" | "iotex-testnet" | "harmony-testnet" | "aurora-testnet" | "scroll-sepolia-testnet" | "covalent-internal-network-v1" | "defi-kingdoms-mainnet" | "swimmer-mainnet" | "boba-avalanche-mainnet" | "boba-bobabeam-mainnet" | "boba-bnb-mainnet" | "boba-rinkeby-testnet" | "boba-bobabase-testnet" | "boba-bnb-testnet" | "boba-avalanche-testnet" | "klaytn-testnet" | "gather-mainnet" | "gather-testnet" | "skale-calypso" | "skale-mainnet" | "skale-razor" | "avalanche-dexalot-mainnet" | "skale-omnus" | "avalanche-dexalot-testnet" | "astar-shibuya" | "cronos-testnet" | "defi-kingdoms-testnet" | "metis-mainnet" | "metis-stardust" | "milkomeda-a1-mainnet" | "milkomeda-a1-devnet" | "milkomeda-c1-mainnet" | "milkomeda-c1-devnet" | "swimmer-testnet" | "solana-mainnet" | "skale-europa" | "meter-mainnet" | "meter-testnet" | "skale-exorde" | "boba-goerli" | "neon-testnet" | "skale-staging-uum" | "skale-staging-lcc" | "arbitrum-nova-mainnet" | "canto-mainnet" | "bittorrent-mainnet" | "bittorrent-testnet" | "flarenetworks-flare-mainnet" | "flarenetworks-flare-testnet" | "flarenetworks-canary-mainnet" | "flarenetworks-canary-testnet" | "kcc-mainnet" | "kcc-testnet" | "polygon-zkevm-testnet" | "linea-testnet" | "base-testnet" | "mantle-testnet" | "scroll-alpha-testnet" | "oasys-mainnet" | "oasys-testnet" | "findora-mainnet" | "findora-forge-testnet" | "sx-mainnet" | "oasis-sapphire-mainnet" | "oasis-sapphire-testnet" | "optimism-goerli" | "polygon-zkevm-mainnet" | "horizen-yuma-testnet" | "clv-parachain" | "energi-mainnet" | "energi-testnet" | "horizen-gobi-testnet" | "eth-sepolia" | "skale-nebula" | "skale-battleground" | "avalanche-meld-testnet" | "gunzilla-testnet" | "ultron-mainnet" | "ultron-testnet" | "zora-mainnet" | "zora-testnet" | "neon-mainnet" | "avalanche-shrapnel-mainnet" | "base-mainnet" | "mantle-mainnet" | "avalanche-loco-legends-mainnet" | "linea-mainnet" | "horizen-eon-mainnet" | "avalanche-numbers" | "avalanche-dos" | "avalanche-step-network" | "avalanche-xplus" | "avalanche-xanachain" | "avalanche-meld-mainnet" | "opside-public-zkevm" | "opside-law-chain" | "avalanche-shrapnel-testnet" | "avalanche-loco-legends-testnet" | "opside-cb-zkevm" | "opside-pre-alpha-testnet" | "opside-era7" | "opside-xthrill" | "zksync-mainnet" | "metis-testnet" | "zksync-testnet" | "avalanche-blitz-testnet" | "avalanche-d-chain-testnet" | "avalanche-green-dot-testnet" | "avalanche-mintara-testnet" | "avalanche-beam-testnet" | "bnb-meta-apes-mainnet" | "bnb-antimatter-mainnet" | "bnb-antimatter-testnet" | "bnb-opbnb-testnet" | "opside-debox" | "opside-jackbot" | "opside-odx-zkevm-testnet" | "opside-readon-content-testnet" | "opside-relation" | "opside-soquest-zkevm" | "opside-vip3" | "opside-zkmeta" | "avalanche-pulsar-testnet" | "avalanche-uptn" | "bnb-fncy-mainnet" | "zetachain-testnet" | "kinto-testnet" | "mode-testnet" | "loot-mainnet";
9
- export type Quotes = "USD" | "CAD" | "EUR" | "SGD" | "INR" | "JPY" | "VND" | "CNY" | "KRW" | "RUB" | "TRY" | "NGN" | "ARS" | "AUD" | "CHF" | "GBP";
10
- export declare const userAgent = "com.covalenthq.sdk.typescript/0.2.9";
11
- export declare class Response<T> {
12
- data: T;
13
- error: boolean;
14
- error_code: number;
15
- error_message: string;
16
- }
17
- /**
18
- * Client Class
19
- */
20
- export declare class Client {
21
- SecurityService: SecurityService;
22
- BalanceService: BalanceService;
23
- BaseService: BaseService;
24
- NftService: NftService;
25
- PricingService: PricingService;
26
- TransactionService: TransactionService;
27
- XykService: XykService;
28
- constructor(apiKey: string);
29
- }
@@ -1,30 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Client = exports.Response = exports.userAgent = void 0;
4
- const SecurityService_1 = require("./SecurityService");
5
- const BalanceService_1 = require("./BalanceService");
6
- const BaseService_1 = require("./BaseService");
7
- const NftService_1 = require("./NftService");
8
- const PricingService_1 = require("./PricingService");
9
- const TransactionService_1 = require("./TransactionService");
10
- const XykService_1 = require("./XykService");
11
- exports.userAgent = "com.covalenthq.sdk.typescript/0.2.9";
12
- class Response {
13
- }
14
- exports.Response = Response;
15
- /**
16
- * Client Class
17
- */
18
- class Client {
19
- constructor(apiKey) {
20
- this.SecurityService = new SecurityService_1.SecurityService(apiKey);
21
- this.BalanceService = new BalanceService_1.BalanceService(apiKey);
22
- this.BaseService = new BaseService_1.BaseService(apiKey);
23
- this.NftService = new NftService_1.NftService(apiKey);
24
- this.PricingService = new PricingService_1.PricingService(apiKey);
25
- this.TransactionService = new TransactionService_1.TransactionService(apiKey);
26
- this.XykService = new XykService_1.XykService(apiKey);
27
- }
28
- }
29
- exports.Client = Client;
30
- //# sourceMappingURL=Client.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Client.js","sourceRoot":"","sources":["../../src/services/Client.ts"],"names":[],"mappings":";;;AAAA,uDAAoD;AACpD,qDAAkD;AAClD,+CAA4C;AAC5C,6CAA0C;AAC1C,qDAAkD;AAClD,6DAA0D;AAC1D,6CAA0C;AAI7B,QAAA,SAAS,GAAG,qCAAqC,CAAC;AAE/D,MAAa,QAAQ;CAKpB;AALD,4BAKC;AAED;;GAEG;AACH,MAAa,MAAM;IAgBf,YAAY,MAAc;QAEtB,IAAI,CAAC,eAAe,GAAG,IAAI,iCAAe,CAAC,MAAM,CAAC,CAAC;QACnD,IAAI,CAAC,cAAc,GAAG,IAAI,+BAAc,CAAC,MAAM,CAAC,CAAC;QACjD,IAAI,CAAC,WAAW,GAAG,IAAI,yBAAW,CAAC,MAAM,CAAC,CAAC;QAC3C,IAAI,CAAC,UAAU,GAAG,IAAI,uBAAU,CAAC,MAAM,CAAC,CAAC;QACzC,IAAI,CAAC,cAAc,GAAG,IAAI,+BAAc,CAAC,MAAM,CAAC,CAAC;QACjD,IAAI,CAAC,kBAAkB,GAAG,IAAI,uCAAkB,CAAC,MAAM,CAAC,CAAC;QACzD,IAAI,CAAC,UAAU,GAAG,IAAI,uBAAU,CAAC,MAAM,CAAC,CAAC;IAC7C,CAAC;CAEJ;AA3BD,wBA2BC"}