@covalenthq/client-sdk 0.4.2 → 0.5.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.
- package/README.md +62 -40
- package/dist/cjs/index.js +956 -239
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/services/BalanceService.d.ts +100 -0
- package/dist/cjs/services/BaseService.d.ts +17 -0
- package/dist/cjs/services/CovalentClient.d.ts +3 -3
- package/dist/cjs/services/NftService.d.ts +137 -1
- package/dist/cjs/services/SecurityService.d.ts +62 -0
- package/dist/cjs/services/TransactionService.d.ts +65 -0
- package/dist/cjs/services/XykService.d.ts +4 -0
- package/dist/cjs/util/types/BalanceServiceTypes.d.ts +38 -0
- package/dist/cjs/util/types/BaseServiceTypes.d.ts +16 -0
- package/dist/cjs/util/types/NftServiceTypes.d.ts +76 -0
- package/dist/cjs/util/types/SecurityServiceTypes.d.ts +50 -0
- package/dist/cjs/util/types/TransactionServiceTypes.d.ts +27 -0
- package/dist/es/index.js +956 -239
- package/dist/es/index.js.map +1 -1
- package/dist/es/services/BalanceService.d.ts +100 -0
- package/dist/es/services/BaseService.d.ts +17 -0
- package/dist/es/services/CovalentClient.d.ts +3 -3
- package/dist/es/services/NftService.d.ts +137 -1
- package/dist/es/services/SecurityService.d.ts +62 -0
- package/dist/es/services/TransactionService.d.ts +65 -0
- package/dist/es/services/XykService.d.ts +4 -0
- package/dist/es/util/types/BalanceServiceTypes.d.ts +38 -0
- package/dist/es/util/types/BaseServiceTypes.d.ts +16 -0
- package/dist/es/util/types/NftServiceTypes.d.ts +76 -0
- package/dist/es/util/types/SecurityServiceTypes.d.ts +50 -0
- package/dist/es/util/types/TransactionServiceTypes.d.ts +27 -0
- package/dist/esm/index.js +956 -239
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/services/BalanceService.d.ts +100 -0
- package/dist/esm/services/BaseService.d.ts +17 -0
- package/dist/esm/services/CovalentClient.d.ts +3 -3
- package/dist/esm/services/NftService.d.ts +137 -1
- package/dist/esm/services/SecurityService.d.ts +62 -0
- package/dist/esm/services/TransactionService.d.ts +65 -0
- package/dist/esm/services/XykService.d.ts +4 -0
- package/dist/esm/util/types/BalanceServiceTypes.d.ts +38 -0
- package/dist/esm/util/types/BaseServiceTypes.d.ts +16 -0
- package/dist/esm/util/types/NftServiceTypes.d.ts +76 -0
- package/dist/esm/util/types/SecurityServiceTypes.d.ts +50 -0
- package/dist/esm/util/types/TransactionServiceTypes.d.ts +27 -0
- package/dist/services/BalanceService.d.ts +100 -0
- package/dist/services/BalanceService.js +193 -6
- package/dist/services/BalanceService.js.map +1 -1
- package/dist/services/BaseService.d.ts +17 -0
- package/dist/services/BaseService.js +23 -12
- package/dist/services/BaseService.js.map +1 -1
- package/dist/services/CovalentClient.d.ts +3 -3
- package/dist/services/CovalentClient.js +1 -1
- package/dist/services/NftService.d.ts +137 -1
- package/dist/services/NftService.js +294 -16
- package/dist/services/NftService.js.map +1 -1
- package/dist/services/PricingService.js +2 -2
- package/dist/services/PricingService.js.map +1 -1
- package/dist/services/SecurityService.d.ts +62 -0
- package/dist/services/SecurityService.js +103 -2
- package/dist/services/SecurityService.js.map +1 -1
- package/dist/services/TransactionService.d.ts +65 -0
- package/dist/services/TransactionService.js +116 -7
- package/dist/services/TransactionService.js.map +1 -1
- package/dist/services/XykService.d.ts +4 -0
- package/dist/services/XykService.js +34 -28
- package/dist/services/XykService.js.map +1 -1
- package/dist/util/ApiHelpers.js +1 -1
- package/dist/util/ApiHelpers.js.map +1 -1
- package/dist/util/types/BalanceServiceTypes.d.ts +38 -0
- package/dist/util/types/BaseServiceTypes.d.ts +16 -0
- package/dist/util/types/NftServiceTypes.d.ts +76 -0
- package/dist/util/types/SecurityServiceTypes.d.ts +50 -0
- package/dist/util/types/TransactionServiceTypes.d.ts +27 -0
- package/package.json +2 -1
|
@@ -282,3 +282,41 @@ export interface HistoricalBalanceItem {
|
|
|
282
282
|
/** * NFT-specific data. */
|
|
283
283
|
nft_data: NftData[];
|
|
284
284
|
}
|
|
285
|
+
export interface TokenBalanceNativeResponse {
|
|
286
|
+
/** * The requested address. */
|
|
287
|
+
address: string;
|
|
288
|
+
/** * The timestamp when the response was generated. Useful to show data staleness to users. */
|
|
289
|
+
updated_at: Date;
|
|
290
|
+
/** * The requested quote currency eg: `USD`. */
|
|
291
|
+
quote_currency: string;
|
|
292
|
+
/** * The requested chain ID eg: `1`. */
|
|
293
|
+
chain_id: number;
|
|
294
|
+
/** * The requested chain name eg: `eth-mainnet`. */
|
|
295
|
+
chain_name: string;
|
|
296
|
+
/** * List of response items. */
|
|
297
|
+
items: NativeBalanceItem[];
|
|
298
|
+
}
|
|
299
|
+
export interface NativeBalanceItem {
|
|
300
|
+
/** * Use contract decimals to format the token balance for display purposes - divide the balance by `10^{contract_decimals}`. */
|
|
301
|
+
contract_decimals: number;
|
|
302
|
+
/** * The string returned by the `name()` method. */
|
|
303
|
+
contract_name: string;
|
|
304
|
+
/** * The ticker symbol for this contract. This field is set by a developer and non-unique across a network. */
|
|
305
|
+
contract_ticker_symbol: string;
|
|
306
|
+
/** * Use the relevant `contract_address` to lookup prices, logos, token transfers, etc. */
|
|
307
|
+
contract_address: string;
|
|
308
|
+
/** * A list of supported standard ERC interfaces, eg: `ERC20` and `ERC721`. */
|
|
309
|
+
supports_erc: string;
|
|
310
|
+
/** * The contract logo URL. */
|
|
311
|
+
logo_url: string;
|
|
312
|
+
/** * The height of the block. */
|
|
313
|
+
block_height: number;
|
|
314
|
+
/** * The asset balance. Use `contract_decimals` to scale this balance for display purposes. */
|
|
315
|
+
balance: bigint | null;
|
|
316
|
+
/** * The exchange rate for the requested quote currency. */
|
|
317
|
+
quote_rate: number;
|
|
318
|
+
/** * The current balance converted to fiat in `quote-currency`. */
|
|
319
|
+
quote: number;
|
|
320
|
+
/** * A prettier version of the quote for rendering purposes. */
|
|
321
|
+
pretty_quote: string;
|
|
322
|
+
}
|
|
@@ -133,11 +133,27 @@ export interface ChainItem {
|
|
|
133
133
|
black_logo_url: string;
|
|
134
134
|
/** * A white png logo url for the chain. */
|
|
135
135
|
white_logo_url: string;
|
|
136
|
+
/** * The color theme for the chain. */
|
|
137
|
+
color_theme: ColorTheme;
|
|
136
138
|
/** * True if the chain is an AppChain. */
|
|
137
139
|
is_appchain: boolean;
|
|
138
140
|
/** * The ChainItem the appchain is a part of. */
|
|
139
141
|
appchain_of: ChainItem;
|
|
140
142
|
}
|
|
143
|
+
export interface ColorTheme {
|
|
144
|
+
/** * The red color code. */
|
|
145
|
+
red: number;
|
|
146
|
+
/** * The green color code. */
|
|
147
|
+
green: number;
|
|
148
|
+
/** * The blue color code. */
|
|
149
|
+
blue: number;
|
|
150
|
+
/** * The alpha color code. */
|
|
151
|
+
alpha: number;
|
|
152
|
+
/** * The hexadecimal color code. */
|
|
153
|
+
hex: string;
|
|
154
|
+
/** * The color represented in css rgb() functional notation. */
|
|
155
|
+
css_rgb: string;
|
|
156
|
+
}
|
|
141
157
|
export interface AllChainsStatusResponse {
|
|
142
158
|
/** * The timestamp when the response was generated. Useful to show data staleness to users. */
|
|
143
159
|
updated_at: Date;
|
|
@@ -219,3 +219,79 @@ export interface NftOwnershipForCollectionItem {
|
|
|
219
219
|
type: string;
|
|
220
220
|
nft_data: NftData;
|
|
221
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
|
+
}
|
|
@@ -69,3 +69,53 @@ export interface TokenSpenderItem {
|
|
|
69
69
|
pretty_value_at_risk_quote: string;
|
|
70
70
|
risk_factor: string;
|
|
71
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
|
+
}
|
|
@@ -61,6 +61,8 @@ export interface Transaction {
|
|
|
61
61
|
lending_details: LendingReport;
|
|
62
62
|
/** * The log events. */
|
|
63
63
|
log_events: LogEvent[];
|
|
64
|
+
/** * The details related to the safe transaction. */
|
|
65
|
+
safe_details: SafeDetails[];
|
|
64
66
|
}
|
|
65
67
|
export interface DexReport {
|
|
66
68
|
/** * The offset is the position of the log entry within an event log. */
|
|
@@ -249,6 +251,14 @@ export interface LendingReport {
|
|
|
249
251
|
/** * Stores the wallet address of the user initiating the event. */
|
|
250
252
|
user: string;
|
|
251
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
|
+
}
|
|
252
262
|
export interface RecentTransactionsResponse {
|
|
253
263
|
/** * The requested address. */
|
|
254
264
|
address: string;
|
|
@@ -310,3 +320,20 @@ export interface TransactionSummary {
|
|
|
310
320
|
/** * The link to the transaction details using the Covalent API. */
|
|
311
321
|
tx_detail_link: string;
|
|
312
322
|
}
|
|
323
|
+
export interface TransactionsResponse {
|
|
324
|
+
/** * The requested address. */
|
|
325
|
+
address: string;
|
|
326
|
+
/** * The timestamp when the response was generated. Useful to show data staleness to users. */
|
|
327
|
+
updated_at: Date;
|
|
328
|
+
/** * The requested quote currency eg: `USD`. */
|
|
329
|
+
quote_currency: string;
|
|
330
|
+
/** * The requested chain ID eg: `1`. */
|
|
331
|
+
chain_id: number;
|
|
332
|
+
/** * The requested chain name eg: `eth-mainnet`. */
|
|
333
|
+
chain_name: string;
|
|
334
|
+
/** * The current page of the response. */
|
|
335
|
+
current_page: number;
|
|
336
|
+
links: PaginationLinks;
|
|
337
|
+
/** * List of response items. */
|
|
338
|
+
items: Transaction[];
|
|
339
|
+
}
|