@covalenthq/client-sdk 0.4.2 → 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 (65) hide show
  1. package/README.md +60 -39
  2. package/dist/cjs/index.js +687 -80
  3. package/dist/cjs/index.js.map +1 -1
  4. package/dist/cjs/services/BalanceService.d.ts +100 -0
  5. package/dist/cjs/services/CovalentClient.d.ts +1 -1
  6. package/dist/cjs/services/NftService.d.ts +137 -1
  7. package/dist/cjs/services/SecurityService.d.ts +62 -0
  8. package/dist/cjs/services/TransactionService.d.ts +17 -0
  9. package/dist/cjs/services/XykService.d.ts +4 -0
  10. package/dist/cjs/util/types/BalanceServiceTypes.d.ts +38 -0
  11. package/dist/cjs/util/types/NftServiceTypes.d.ts +76 -0
  12. package/dist/cjs/util/types/SecurityServiceTypes.d.ts +50 -0
  13. package/dist/cjs/util/types/TransactionServiceTypes.d.ts +10 -0
  14. package/dist/es/index.js +687 -80
  15. package/dist/es/index.js.map +1 -1
  16. package/dist/es/services/BalanceService.d.ts +100 -0
  17. package/dist/es/services/CovalentClient.d.ts +1 -1
  18. package/dist/es/services/NftService.d.ts +137 -1
  19. package/dist/es/services/SecurityService.d.ts +62 -0
  20. package/dist/es/services/TransactionService.d.ts +17 -0
  21. package/dist/es/services/XykService.d.ts +4 -0
  22. package/dist/es/util/types/BalanceServiceTypes.d.ts +38 -0
  23. package/dist/es/util/types/NftServiceTypes.d.ts +76 -0
  24. package/dist/es/util/types/SecurityServiceTypes.d.ts +50 -0
  25. package/dist/es/util/types/TransactionServiceTypes.d.ts +10 -0
  26. package/dist/esm/index.js +687 -80
  27. package/dist/esm/index.js.map +1 -1
  28. package/dist/esm/services/BalanceService.d.ts +100 -0
  29. package/dist/esm/services/CovalentClient.d.ts +1 -1
  30. package/dist/esm/services/NftService.d.ts +137 -1
  31. package/dist/esm/services/SecurityService.d.ts +62 -0
  32. package/dist/esm/services/TransactionService.d.ts +17 -0
  33. package/dist/esm/services/XykService.d.ts +4 -0
  34. package/dist/esm/util/types/BalanceServiceTypes.d.ts +38 -0
  35. package/dist/esm/util/types/NftServiceTypes.d.ts +76 -0
  36. package/dist/esm/util/types/SecurityServiceTypes.d.ts +50 -0
  37. package/dist/esm/util/types/TransactionServiceTypes.d.ts +10 -0
  38. package/dist/services/BalanceService.d.ts +100 -0
  39. package/dist/services/BalanceService.js +193 -6
  40. package/dist/services/BalanceService.js.map +1 -1
  41. package/dist/services/BaseService.js +12 -12
  42. package/dist/services/BaseService.js.map +1 -1
  43. package/dist/services/CovalentClient.d.ts +1 -1
  44. package/dist/services/CovalentClient.js +1 -1
  45. package/dist/services/NftService.d.ts +137 -1
  46. package/dist/services/NftService.js +294 -16
  47. package/dist/services/NftService.js.map +1 -1
  48. package/dist/services/PricingService.js +2 -2
  49. package/dist/services/PricingService.js.map +1 -1
  50. package/dist/services/SecurityService.d.ts +62 -0
  51. package/dist/services/SecurityService.js +103 -2
  52. package/dist/services/SecurityService.js.map +1 -1
  53. package/dist/services/TransactionService.d.ts +17 -0
  54. package/dist/services/TransactionService.js +23 -7
  55. package/dist/services/TransactionService.js.map +1 -1
  56. package/dist/services/XykService.d.ts +4 -0
  57. package/dist/services/XykService.js +34 -28
  58. package/dist/services/XykService.js.map +1 -1
  59. package/dist/util/ApiHelpers.js +1 -1
  60. package/dist/util/ApiHelpers.js.map +1 -1
  61. package/dist/util/types/BalanceServiceTypes.d.ts +38 -0
  62. package/dist/util/types/NftServiceTypes.d.ts +76 -0
  63. package/dist/util/types/SecurityServiceTypes.d.ts +50 -0
  64. package/dist/util/types/TransactionServiceTypes.d.ts +10 -0
  65. package/package.json +1 -1
@@ -137,6 +137,23 @@ declare class OhlcItem {
137
137
  pretty_quote: string;
138
138
  constructor(data: OhlcItem);
139
139
  }
140
+ declare class Erc20TransfersResponse {
141
+ /** * The requested address. */
142
+ address: string;
143
+ /** * The timestamp when the response was generated. Useful to show data staleness to users. */
144
+ updated_at: Date;
145
+ /** * The requested quote currency eg: `USD`. */
146
+ quote_currency: string;
147
+ /** * The requested chain ID eg: `1`. */
148
+ chain_id: number;
149
+ /** * The requested chain name eg: `eth-mainnet`. */
150
+ chain_name: string;
151
+ /** * List of response items. */
152
+ items: BlockTransactionWithContractTransfers[];
153
+ /** * Pagination metadata. */
154
+ pagination: Pagination;
155
+ constructor(data: Erc20TransfersResponse);
156
+ }
140
157
  declare class BlockTransactionWithContractTransfers {
141
158
  /** * The block signed timestamp in UTC. */
142
159
  block_signed_at: Date;
@@ -178,6 +195,17 @@ declare class BlockTransactionWithContractTransfers {
178
195
  transfers: TokenTransferItem[];
179
196
  constructor(data: BlockTransactionWithContractTransfers);
180
197
  }
198
+ declare class Pagination {
199
+ /** * True is there is another page. */
200
+ has_more: boolean;
201
+ /** * The requested page number. */
202
+ page_number: number;
203
+ /** * The requested number of items on the current page. */
204
+ page_size: number;
205
+ /** * The total number of items across all pages for this request. */
206
+ total_count: number;
207
+ constructor(data: Pagination);
208
+ }
181
209
  declare class TokenTransferItem {
182
210
  /** * The block signed timestamp in UTC. */
183
211
  block_signed_at: Date;
@@ -300,6 +328,46 @@ declare class HistoricalBalanceItem {
300
328
  nft_data: NftData[];
301
329
  constructor(data: HistoricalBalanceItem);
302
330
  }
331
+ declare class TokenBalanceNativeResponse {
332
+ /** * The requested address. */
333
+ address: string;
334
+ /** * The timestamp when the response was generated. Useful to show data staleness to users. */
335
+ updated_at: Date;
336
+ /** * The requested quote currency eg: `USD`. */
337
+ quote_currency: string;
338
+ /** * The requested chain ID eg: `1`. */
339
+ chain_id: number;
340
+ /** * The requested chain name eg: `eth-mainnet`. */
341
+ chain_name: string;
342
+ /** * List of response items. */
343
+ items: NativeBalanceItem[];
344
+ constructor(data: TokenBalanceNativeResponse);
345
+ }
346
+ declare class NativeBalanceItem {
347
+ /** * Use contract decimals to format the token balance for display purposes - divide the balance by `10^{contract_decimals}`. */
348
+ contract_decimals: number;
349
+ /** * The string returned by the `name()` method. */
350
+ contract_name: string;
351
+ /** * The ticker symbol for this contract. This field is set by a developer and non-unique across a network. */
352
+ contract_ticker_symbol: string;
353
+ /** * Use the relevant `contract_address` to lookup prices, logos, token transfers, etc. */
354
+ contract_address: string;
355
+ /** * A list of supported standard ERC interfaces, eg: `ERC20` and `ERC721`. */
356
+ supports_erc: string;
357
+ /** * The contract logo URL. */
358
+ logo_url: string;
359
+ /** * The height of the block. */
360
+ block_height: number;
361
+ /** * The asset balance. Use `contract_decimals` to scale this balance for display purposes. */
362
+ balance: bigint | null;
363
+ /** * The exchange rate for the requested quote currency. */
364
+ quote_rate: number;
365
+ /** * The current balance converted to fiat in `quote-currency`. */
366
+ quote: number;
367
+ /** * A prettier version of the quote for rendering purposes. */
368
+ pretty_quote: string;
369
+ constructor(data: NativeBalanceItem);
370
+ }
303
371
  export interface GetTokenBalancesForWalletAddressQueryParamOpts {
304
372
  /** * The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`. */
305
373
  quoteCurrency?: Quote;
@@ -356,6 +424,12 @@ export interface GetHistoricalTokenBalancesForWalletAddressQueryParamOpts {
356
424
  /** * Ending date to define a block range (YYYY-MM-DD). Omitting this parameter defaults to the current date. */
357
425
  date?: number;
358
426
  }
427
+ export interface GetNativeTokenBalanceQueryParamOpts {
428
+ /** * The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`. */
429
+ quoteCurrency?: Quote;
430
+ /** * Ending block to define a block range. Omitting this parameter defaults to the latest block height. */
431
+ blockHeight?: number;
432
+ }
359
433
  /**
360
434
  * Balances APIs
361
435
  *
@@ -409,6 +483,22 @@ export declare class BalanceService {
409
483
  *
410
484
  */
411
485
  getErc20TransfersForWalletAddress(chainName: Chain, walletAddress: string, queryParamOpts?: GetErc20TransfersForWalletAddressQueryParamOpts): AsyncIterable<BlockTransactionWithContractTransfers>;
486
+ /**
487
+ *
488
+ * Commonly used to render the transfer-in and transfer-out of a token along with historical prices from an address.
489
+ *
490
+ * @param {string} chainName - The chain name eg: `eth-mainnet`.
491
+ * @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
492
+ * @param {GetErc20TransfersForWalletAddressQueryParamOpts} queryParamOpts
493
+ * - `quoteCurrency`: The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`.
494
+ * - `contractAddress`: The requested contract address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
495
+ * - `startingBlock`: The block height to start from, defaults to `0`.
496
+ * - `endingBlock`: The block height to end at, defaults to current block height.
497
+ * - `pageSize`: Number of items per page. Omitting this parameter defaults to 100.
498
+ * - `pageNumber`: 0-indexed page number to begin pagination.
499
+ *
500
+ */
501
+ getErc20TransfersForWalletAddressByPage(chainName: Chain, walletAddress: string, queryParamOpts?: GetErc20TransfersForWalletAddressQueryParamOpts): Promise<Response<Erc20TransfersResponse>>;
412
502
  /**
413
503
  *
414
504
  * Commonly used to get a list of all the token holders for a specified ERC20 or ERC721 token. Returns historic token holders when block-height is set (defaults to `latest`). Useful for building pie charts of token holders.
@@ -439,5 +529,15 @@ export declare class BalanceService {
439
529
  *
440
530
  */
441
531
  getHistoricalTokenBalancesForWalletAddress(chainName: Chain, walletAddress: string, queryParamOpts?: GetHistoricalTokenBalancesForWalletAddressQueryParamOpts): Promise<Response<HistoricalBalancesResponse>>;
532
+ /**
533
+ *
534
+ * @param {string} chainName - The chain name eg: `eth-mainnet`.
535
+ * @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
536
+ * @param {GetNativeTokenBalanceQueryParamOpts} queryParamOpts
537
+ * - `quoteCurrency`: The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`.
538
+ * - `blockHeight`: Ending block to define a block range. Omitting this parameter defaults to the latest block height.
539
+ *
540
+ */
541
+ getNativeTokenBalance(chainName: Chain, walletAddress: string, queryParamOpts?: GetNativeTokenBalanceQueryParamOpts): Promise<Response<TokenBalanceNativeResponse>>;
442
542
  }
443
543
  export {};
@@ -21,7 +21,7 @@ export type Chains = "btc-mainnet" | "eth-mainnet" | "matic-mainnet" | "bsc-main
21
21
  * CovalentClient Class
22
22
  */
23
23
  export type Quotes = "USD" | "CAD" | "EUR" | "SGD" | "INR" | "JPY" | "VND" | "CNY" | "KRW" | "RUB" | "TRY" | "NGN" | "ARS" | "AUD" | "CHF" | "GBP";
24
- export declare const userAgent = "com.covalenthq.sdk.typescript/0.4.2";
24
+ export declare const userAgent = "com.covalenthq.sdk.typescript/0.5.0";
25
25
  export declare class Response<T> {
26
26
  data: T;
27
27
  error: boolean;
@@ -1,4 +1,4 @@
1
- import { Chain, Response } from "./CovalentClient";
1
+ import { Chain, Quote, Response } from "./CovalentClient";
2
2
  declare class ChainCollectionItem {
3
3
  /** * Use the relevant `contract_address` to lookup prices, logos, token transfers, etc. */
4
4
  contract_address: string;
@@ -315,6 +315,88 @@ declare class NftOwnershipForCollectionItem {
315
315
  nft_data: NftData;
316
316
  constructor(data: NftOwnershipForCollectionItem);
317
317
  }
318
+ declare class NftMarketSaleCountResponse {
319
+ /** * The timestamp when the response was generated. Useful to show data staleness to users. */
320
+ updated_at: Date;
321
+ /** * The requested address. */
322
+ address: string;
323
+ /** * The requested quote currency eg: `USD`. */
324
+ quote_currency: string;
325
+ /** * The requested chain name eg: `eth-mainnet`. */
326
+ chain_name: string;
327
+ /** * The requested chain ID eg: `1`. */
328
+ chain_id: number;
329
+ /** * List of response items. */
330
+ items: MarketSaleCountItem[];
331
+ constructor(data: NftMarketSaleCountResponse);
332
+ }
333
+ declare class MarketSaleCountItem {
334
+ /** * The timestamp of the date of sale. */
335
+ date: Date;
336
+ /** * The total amount of sales for the current day. */
337
+ sale_count: number;
338
+ constructor(data: MarketSaleCountItem);
339
+ }
340
+ declare class NftMarketVolumeResponse {
341
+ /** * The timestamp when the response was generated. Useful to show data staleness to users. */
342
+ updated_at: Date;
343
+ /** * The requested address. */
344
+ address: string;
345
+ /** * The requested quote currency eg: `USD`. */
346
+ quote_currency: string;
347
+ /** * The requested chain name eg: `eth-mainnet`. */
348
+ chain_name: string;
349
+ /** * The requested chain ID eg: `1`. */
350
+ chain_id: number;
351
+ /** * List of response items. */
352
+ items: MarketVolumeItem[];
353
+ constructor(data: NftMarketVolumeResponse);
354
+ }
355
+ declare class MarketVolumeItem {
356
+ /** * The timestamp of the date of sale. */
357
+ date: Date;
358
+ /** * The ticker symbol for the native currency. */
359
+ native_ticker_symbol: string;
360
+ /** * The contract name of the native currency. */
361
+ native_name: string;
362
+ /** * The current volume converted to fiat in `quote-currency`. */
363
+ volume_quote: number;
364
+ /** * The current volume in native currency. */
365
+ volume_native_quote: number;
366
+ /** * A prettier version of the volume quote for rendering purposes. */
367
+ pretty_volume_quote: string;
368
+ constructor(data: MarketVolumeItem);
369
+ }
370
+ declare class NftMarketFloorPriceResponse {
371
+ /** * The timestamp when the response was generated. Useful to show data staleness to users. */
372
+ updated_at: Date;
373
+ /** * The requested address. */
374
+ address: string;
375
+ /** * The requested quote currency eg: `USD`. */
376
+ quote_currency: string;
377
+ /** * The requested chain name eg: `eth-mainnet`. */
378
+ chain_name: string;
379
+ /** * The requested chain ID eg: `1`. */
380
+ chain_id: number;
381
+ /** * List of response items. */
382
+ items: MarketFloorPriceItem[];
383
+ constructor(data: NftMarketFloorPriceResponse);
384
+ }
385
+ declare class MarketFloorPriceItem {
386
+ /** * The timestamp of the date of sale. */
387
+ date: Date;
388
+ /** * The ticker symbol for the native currency. */
389
+ native_ticker_symbol: string;
390
+ /** * The contract name of the native currency. */
391
+ native_name: string;
392
+ /** * The current floor price in native currency. */
393
+ floor_price_native_quote: number;
394
+ /** * The current floor price converted to fiat in `quote-currency`. */
395
+ floor_price_quote: number;
396
+ /** * A prettier version of the floor price quote for rendering purposes. */
397
+ pretty_floor_price_quote: string;
398
+ constructor(data: MarketFloorPriceItem);
399
+ }
318
400
  export interface GetChainCollectionsQueryParamOpts {
319
401
  /** * Number of items per page. Omitting this parameter defaults to 100. */
320
402
  pageSize?: number;
@@ -355,6 +437,24 @@ export interface GetNftTransactionsForContractTokenIdQueryParamOpts {
355
437
  /** * If `true`, the suspected spam tokens are removed. Supports `eth-mainnet` and `matic-mainnet`. */
356
438
  noSpam?: boolean;
357
439
  }
440
+ export interface GetNftMarketSaleCountQueryParamOpts {
441
+ /** * The number of days to return data for. Request up 365 days. Defaults to 30 days. */
442
+ days?: number;
443
+ /** * The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`. */
444
+ quoteCurrency?: Quote;
445
+ }
446
+ export interface GetNftMarketVolumeQueryParamOpts {
447
+ /** * The number of days to return data for. Request up 365 days. Defaults to 30 days. */
448
+ days?: number;
449
+ /** * The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`. */
450
+ quoteCurrency?: Quote;
451
+ }
452
+ export interface GetNftMarketFloorPriceQueryParamOpts {
453
+ /** * The number of days to return data for. Request up 365 days. Defaults to 30 days. */
454
+ days?: number;
455
+ /** * The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`. */
456
+ quoteCurrency?: Quote;
457
+ }
358
458
  /**
359
459
  * NFT APIs
360
460
  *
@@ -480,5 +580,41 @@ export declare class NftService {
480
580
  *
481
581
  */
482
582
  checkOwnershipInNftForSpecificTokenId(chainName: Chain, walletAddress: string, collectionContract: string, tokenId: string): Promise<Response<NftOwnershipForCollectionResponse>>;
583
+ /**
584
+ *
585
+ * Commonly used to build a time-series chart of the sales count of an NFT collection.
586
+ *
587
+ * @param {string} chainName - The chain name eg: `eth-mainnet`.
588
+ * @param {string} contractAddress - The requested contract address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
589
+ * @param {GetNftMarketSaleCountQueryParamOpts} queryParamOpts
590
+ * - `days`: The number of days to return data for. Request up 365 days. Defaults to 30 days.
591
+ * - `quoteCurrency`: The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`.
592
+ *
593
+ */
594
+ getNftMarketSaleCount(chainName: Chain, contractAddress: string, queryParamOpts?: GetNftMarketSaleCountQueryParamOpts): Promise<Response<NftMarketSaleCountResponse>>;
595
+ /**
596
+ *
597
+ * Commonly used to build a time-series chart of the transaction volume of an NFT collection.
598
+ *
599
+ * @param {string} chainName - The chain name eg: `eth-mainnet`.
600
+ * @param {string} contractAddress - The requested contract address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
601
+ * @param {GetNftMarketVolumeQueryParamOpts} queryParamOpts
602
+ * - `days`: The number of days to return data for. Request up 365 days. Defaults to 30 days.
603
+ * - `quoteCurrency`: The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`.
604
+ *
605
+ */
606
+ getNftMarketVolume(chainName: Chain, contractAddress: string, queryParamOpts?: GetNftMarketVolumeQueryParamOpts): Promise<Response<NftMarketVolumeResponse>>;
607
+ /**
608
+ *
609
+ * Commonly used to render a price floor chart for an NFT collection.
610
+ *
611
+ * @param {string} chainName - The chain name eg: `eth-mainnet`.
612
+ * @param {string} contractAddress - The requested contract address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
613
+ * @param {GetNftMarketFloorPriceQueryParamOpts} queryParamOpts
614
+ * - `days`: The number of days to return data for. Request up 365 days. Defaults to 30 days.
615
+ * - `quoteCurrency`: The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`.
616
+ *
617
+ */
618
+ getNftMarketFloorPrice(chainName: Chain, contractAddress: string, queryParamOpts?: GetNftMarketFloorPriceQueryParamOpts): Promise<Response<NftMarketFloorPriceResponse>>;
483
619
  }
484
620
  export {};
@@ -73,6 +73,60 @@ declare class TokenSpenderItem {
73
73
  risk_factor: string;
74
74
  constructor(data: TokenSpenderItem);
75
75
  }
76
+ declare class NftApprovalsResponse {
77
+ /** * The timestamp when the response was generated. Useful to show data staleness to users. */
78
+ updated_at: Date;
79
+ /** * The requested chain ID eg: `1`. */
80
+ chain_id: number;
81
+ /** * The requested chain name eg: `eth-mainnet`. */
82
+ chain_name: string;
83
+ /** * The requested address. */
84
+ address: string;
85
+ /** * List of response items. */
86
+ items: NftApprovalsItem[];
87
+ constructor(data: NftApprovalsResponse);
88
+ }
89
+ declare class NftApprovalsItem {
90
+ /** * Use the relevant `contract_address` to lookup prices, logos, token transfers, etc. */
91
+ contract_address: string;
92
+ /** * The label of the contract address. */
93
+ contract_address_label: string;
94
+ /** * The ticker symbol for this contract. This field is set by a developer and non-unique across a network. */
95
+ contract_ticker_symbol: string;
96
+ /** * List of asset balances held by the user. */
97
+ token_balances: NftApprovalBalance[];
98
+ /** * Contracts with non-zero approvals for this token. */
99
+ spenders: NftApprovalSpender[];
100
+ constructor(data: NftApprovalsItem);
101
+ }
102
+ declare class NftApprovalBalance {
103
+ /** * The token's id. */
104
+ token_id: bigint | null;
105
+ /** * The NFT's token balance. */
106
+ token_balance: bigint | null;
107
+ constructor(data: NftApprovalBalance);
108
+ }
109
+ declare class NftApprovalSpender {
110
+ /** * The height of the block. */
111
+ block_height: number;
112
+ /** * The offset is the position of the tx in the block. */
113
+ tx_offset: number;
114
+ /** * The offset is the position of the log entry within an event log." */
115
+ log_offset: number;
116
+ /** * The block signed timestamp in UTC. */
117
+ block_signed_at: Date;
118
+ /** * Most recent transaction that updated approval amounts for the token. */
119
+ tx_hash: string;
120
+ /** * Address of the contract with approval for the token. */
121
+ spender_address: string;
122
+ /** * Name of the contract with approval for the token. */
123
+ spender_address_label: string;
124
+ /** * The token ids approved. */
125
+ token_ids_approved: string;
126
+ /** * Remaining number of tokens granted to the spender by the approval. */
127
+ allowance: string;
128
+ constructor(data: NftApprovalSpender);
129
+ }
76
130
  /**
77
131
  * Approvals API
78
132
  *
@@ -92,5 +146,13 @@ export declare class SecurityService {
92
146
  *
93
147
  */
94
148
  getApprovals(chainName: Chain, walletAddress: string): Promise<Response<ApprovalsResponse>>;
149
+ /**
150
+ *
151
+ * @param {string} chainName - The chain name eg: `eth-mainnet`.
152
+ * @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
153
+
154
+ *
155
+ */
156
+ getNftApprovals(chainName: Chain, walletAddress: string): Promise<Response<NftApprovalsResponse>>;
95
157
  }
96
158
  export {};
@@ -62,6 +62,8 @@ declare class Transaction {
62
62
  lending_details: LendingReport;
63
63
  /** * The log events. */
64
64
  log_events: LogEvent[];
65
+ /** * The details related to the safe transaction. */
66
+ safe_details: SafeDetails[];
65
67
  constructor(data: Transaction);
66
68
  }
67
69
  declare class ContractMetadata {
@@ -299,6 +301,15 @@ declare class LogEvent {
299
301
  decoded: DecodedItem;
300
302
  constructor(data: LogEvent);
301
303
  }
304
+ declare class SafeDetails {
305
+ /** * The address that signed the safe transaction. */
306
+ owner_address: string;
307
+ /** * The signature of the owner for the safe transaction. */
308
+ signature: string;
309
+ /** * The type of safe signature used. */
310
+ signature_type: string;
311
+ constructor(data: SafeDetails);
312
+ }
302
313
  declare class DecodedItem {
303
314
  name: string;
304
315
  signature: string;
@@ -366,6 +377,8 @@ export interface GetTransactionQueryParamOpts {
366
377
  withNftSales?: boolean;
367
378
  /** * Decoded lending details including protocol (e.g. Aave), event (e.g. 'deposit') and tokens involved with prices. Additional 0.05 credits charged if data available. */
368
379
  withLending?: boolean;
380
+ /** * Include safe details. */
381
+ withSafe?: boolean;
369
382
  }
370
383
  export interface GetAllTransactionsForAddressQueryParamOpts {
371
384
  /** * The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`. */
@@ -374,6 +387,8 @@ export interface GetAllTransactionsForAddressQueryParamOpts {
374
387
  noLogs?: boolean;
375
388
  /** * Sort the transactions in ascending chronological order. By default, it's set to `false` and returns transactions in descending chronological order. */
376
389
  blockSignedAtAsc?: boolean;
390
+ /** * Include safe details. */
391
+ withSafe?: boolean;
377
392
  }
378
393
  export interface GetTransactionsForBlockQueryParamOpts {
379
394
  /** * The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`. */
@@ -399,6 +414,7 @@ export declare class TransactionService {
399
414
  * - `withDex`: Decoded DEX details including protocol (e.g. Uniswap), event (e.g 'add_liquidity') and tokens involved with historical prices. Additional 0.05 credits charged if data available.
400
415
  * - `withNftSales`: Decoded NFT sales details including marketplace (e.g. Opensea) and cached media links. Additional 0.05 credits charged if data available.
401
416
  * - `withLending`: Decoded lending details including protocol (e.g. Aave), event (e.g. 'deposit') and tokens involved with prices. Additional 0.05 credits charged if data available.
417
+ * - `withSafe`: Include safe details.
402
418
  *
403
419
  */
404
420
  getTransaction(chainName: Chain, txHash: string, queryParamOpts?: GetTransactionQueryParamOpts): Promise<Response<TransactionResponse>>;
@@ -412,6 +428,7 @@ export declare class TransactionService {
412
428
  * - `quoteCurrency`: The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`.
413
429
  * - `noLogs`: Omit log events.
414
430
  * - `blockSignedAtAsc`: Sort the transactions in ascending chronological order. By default, it's set to `false` and returns transactions in descending chronological order.
431
+ * - `withSafe`: Include safe details.
415
432
  *
416
433
  */
417
434
  getAllTransactionsForAddress(chainName: Chain, walletAddress: string, queryParamOpts?: GetAllTransactionsForAddressQueryParamOpts): AsyncIterable<Transaction>;
@@ -524,12 +524,16 @@ declare class HealthData {
524
524
  export interface GetPoolsForTokenAddressQueryParamOpts {
525
525
  /** * The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`. */
526
526
  quoteCurrency?: Quote;
527
+ /** * The DEX name eg: `uniswap_v2`. */
528
+ dexName?: string;
527
529
  }
528
530
  export interface GetPoolsForWalletAddressQueryParamOpts {
529
531
  /** * The token contract address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically. */
530
532
  tokenAddress?: string;
531
533
  /** * The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`. */
532
534
  quoteCurrency?: Quote;
535
+ /** * The DEX name eg: `uniswap_v2`. */
536
+ dexName?: string;
533
537
  }
534
538
  /**
535
539
  * XYK APIs
@@ -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
+ }
@@ -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;