@covalenthq/client-sdk 0.7.5 → 0.8.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.
- package/README.md +25 -0
- package/dist/cjs/index.js +1183 -451
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/services/BalanceService.d.ts +15 -13
- package/dist/cjs/services/BaseService.d.ts +13 -11
- package/dist/cjs/services/CovalentClient.d.ts +8 -4
- package/dist/cjs/services/NftService.d.ts +19 -17
- package/dist/cjs/services/PricingService.d.ts +5 -3
- package/dist/cjs/services/SecurityService.d.ts +6 -4
- package/dist/cjs/services/TransactionService.d.ts +83 -12
- package/dist/cjs/services/XykService.d.ts +287 -22
- package/dist/cjs/util/ApiHelpers.d.ts +2 -1
- package/dist/cjs/util/backoff.d.ts +2 -1
- package/dist/cjs/util/types/TransactionServiceTypes.d.ts +11 -0
- package/dist/cjs/util/types/XykServiceTypes.d.ts +160 -8
- package/dist/es/index.js +1183 -451
- package/dist/es/index.js.map +1 -1
- package/dist/es/services/BalanceService.d.ts +15 -13
- package/dist/es/services/BaseService.d.ts +13 -11
- package/dist/es/services/CovalentClient.d.ts +8 -4
- package/dist/es/services/NftService.d.ts +19 -17
- package/dist/es/services/PricingService.d.ts +5 -3
- package/dist/es/services/SecurityService.d.ts +6 -4
- package/dist/es/services/TransactionService.d.ts +83 -12
- package/dist/es/services/XykService.d.ts +287 -22
- package/dist/es/util/ApiHelpers.d.ts +2 -1
- package/dist/es/util/backoff.d.ts +2 -1
- package/dist/es/util/types/TransactionServiceTypes.d.ts +11 -0
- package/dist/es/util/types/XykServiceTypes.d.ts +160 -8
- package/dist/esm/index.js +1183 -451
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/services/BalanceService.d.ts +15 -13
- package/dist/esm/services/BaseService.d.ts +13 -11
- package/dist/esm/services/CovalentClient.d.ts +8 -4
- package/dist/esm/services/NftService.d.ts +19 -17
- package/dist/esm/services/PricingService.d.ts +5 -3
- package/dist/esm/services/SecurityService.d.ts +6 -4
- package/dist/esm/services/TransactionService.d.ts +83 -12
- package/dist/esm/services/XykService.d.ts +287 -22
- package/dist/esm/util/ApiHelpers.d.ts +2 -1
- package/dist/esm/util/backoff.d.ts +2 -1
- package/dist/esm/util/types/TransactionServiceTypes.d.ts +11 -0
- package/dist/esm/util/types/XykServiceTypes.d.ts +160 -8
- package/dist/services/BalanceService.d.ts +15 -13
- package/dist/services/BalanceService.js +47 -39
- package/dist/services/BalanceService.js.map +1 -1
- package/dist/services/BaseService.d.ts +13 -11
- package/dist/services/BaseService.js +77 -65
- package/dist/services/BaseService.js.map +1 -1
- package/dist/services/CovalentClient.d.ts +8 -4
- package/dist/services/CovalentClient.js +19 -19
- package/dist/services/CovalentClient.js.map +1 -1
- package/dist/services/NftService.d.ts +19 -17
- package/dist/services/NftService.js +96 -81
- package/dist/services/NftService.js.map +1 -1
- package/dist/services/PricingService.d.ts +5 -3
- package/dist/services/PricingService.js +10 -7
- package/dist/services/PricingService.js.map +1 -1
- package/dist/services/SecurityService.d.ts +6 -4
- package/dist/services/SecurityService.js +17 -13
- package/dist/services/SecurityService.js.map +1 -1
- package/dist/services/TransactionService.d.ts +83 -12
- package/dist/services/TransactionService.js +434 -90
- package/dist/services/TransactionService.js.map +1 -1
- package/dist/services/XykService.d.ts +287 -22
- package/dist/services/XykService.js +438 -93
- package/dist/services/XykService.js.map +1 -1
- package/dist/util/ApiHelpers.d.ts +2 -1
- package/dist/util/ApiHelpers.js +7 -6
- package/dist/util/ApiHelpers.js.map +1 -1
- package/dist/util/backoff.d.ts +2 -1
- package/dist/util/backoff.js +3 -3
- package/dist/util/backoff.js.map +1 -1
- package/dist/util/types/TransactionServiceTypes.d.ts +11 -0
- package/dist/util/types/XykServiceTypes.d.ts +160 -8
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Pagination } from "./GenericTypes";
|
|
1
|
+
import { Pagination, ContractMetadata } from "./GenericTypes";
|
|
2
2
|
export interface PoolResponse {
|
|
3
3
|
/** * The timestamp when the response was generated. Useful to show data staleness to users. */
|
|
4
4
|
updated_at: Date;
|
|
@@ -232,6 +232,8 @@ export interface PoolsDexDataItem {
|
|
|
232
232
|
volume_7d_quote: number;
|
|
233
233
|
/** * The fee 24h converted to fiat in `quote-currency`. */
|
|
234
234
|
fee_24h_quote: number;
|
|
235
|
+
/** * The annual fee percentage. */
|
|
236
|
+
annualized_fee: number;
|
|
235
237
|
/** * A prettier version of the volume 24h quote for rendering purposes. */
|
|
236
238
|
pretty_volume_24h_quote: string;
|
|
237
239
|
/** * A prettier version of the volume 7d quote for rendering purposes. */
|
|
@@ -288,6 +290,8 @@ export interface UniswapLikeToken {
|
|
|
288
290
|
/** * The asset balance. Use `contract_decimals` to scale this balance for display purposes. */
|
|
289
291
|
balance: bigint | null;
|
|
290
292
|
quote: number;
|
|
293
|
+
/** * A prettier version of the quote for rendering purposes. */
|
|
294
|
+
pretty_quote: string;
|
|
291
295
|
/** * The exchange rate for the requested quote currency. */
|
|
292
296
|
quote_rate: number;
|
|
293
297
|
}
|
|
@@ -303,6 +307,8 @@ export interface UniswapLikeTokenWithSupply {
|
|
|
303
307
|
/** * The asset balance. Use `contract_decimals` to scale this balance for display purposes. */
|
|
304
308
|
balance: bigint | null;
|
|
305
309
|
quote: number;
|
|
310
|
+
/** * A prettier version of the quote for rendering purposes. */
|
|
311
|
+
pretty_quote: string;
|
|
306
312
|
/** * The exchange rate for the requested quote currency. */
|
|
307
313
|
quote_rate: number;
|
|
308
314
|
/** * Total supply of this pool token. */
|
|
@@ -357,6 +363,108 @@ export interface TokenV2Volume {
|
|
|
357
363
|
/** * The total volume 24h converted to fiat in `quote-currency`. */
|
|
358
364
|
total_volume_24h_quote: number;
|
|
359
365
|
}
|
|
366
|
+
export interface NetworkExchangeTokenViewResponse {
|
|
367
|
+
/** * The timestamp when the response was generated. Useful to show data staleness to users. */
|
|
368
|
+
updated_at: Date;
|
|
369
|
+
/** * The requested chain ID eg: `1`. */
|
|
370
|
+
chain_id: number;
|
|
371
|
+
/** * The requested chain name eg: `eth-mainnet`. */
|
|
372
|
+
chain_name: string;
|
|
373
|
+
/** * List of response items. */
|
|
374
|
+
items: TokenV2VolumeWithChartData[];
|
|
375
|
+
/** * Pagination metadata. */
|
|
376
|
+
pagination: Pagination;
|
|
377
|
+
}
|
|
378
|
+
export interface TokenV2VolumeWithChartData {
|
|
379
|
+
/** * The requested chain name eg: `eth-mainnet`. */
|
|
380
|
+
chain_name: string;
|
|
381
|
+
/** * The requested chain ID eg: `1`. */
|
|
382
|
+
chain_id: string;
|
|
383
|
+
/** * The name of the DEX, eg: `uniswap_v2`. */
|
|
384
|
+
dex_name: string;
|
|
385
|
+
/** * Use the relevant `contract_address` to lookup prices, logos, token transfers, etc. */
|
|
386
|
+
contract_address: string;
|
|
387
|
+
/** * The string returned by the `name()` method. */
|
|
388
|
+
contract_name: string;
|
|
389
|
+
/** * The total liquidity unscaled value. */
|
|
390
|
+
total_liquidity: number;
|
|
391
|
+
/** * The total volume 24h unscaled value. */
|
|
392
|
+
total_volume_24h: number;
|
|
393
|
+
/** * The contract logo URL. */
|
|
394
|
+
logo_url: string;
|
|
395
|
+
/** * The ticker symbol for this contract. This field is set by a developer and non-unique across a network. */
|
|
396
|
+
contract_ticker_symbol: string;
|
|
397
|
+
/** * Use contract decimals to format the token balance for display purposes - divide the balance by `10^{contract_decimals}`. */
|
|
398
|
+
contract_decimals: number;
|
|
399
|
+
/** * The total amount of swaps in the last 24h. */
|
|
400
|
+
swap_count_24h: number;
|
|
401
|
+
/** * The exchange rate for the requested quote currency. */
|
|
402
|
+
quote_rate: number;
|
|
403
|
+
/** * The 24h exchange rate for the requested quote currency. */
|
|
404
|
+
quote_rate_24h: number;
|
|
405
|
+
/** * A prettier version of the exchange rate for rendering purposes. */
|
|
406
|
+
pretty_quote_rate: string;
|
|
407
|
+
/** * A prettier version of the 24h exchange rate for rendering purposes. */
|
|
408
|
+
pretty_quote_rate_24h: string;
|
|
409
|
+
/** * A prettier version of the total liquidity quote for rendering purposes. */
|
|
410
|
+
pretty_total_liquidity_quote: string;
|
|
411
|
+
/** * A prettier version of the 24h volume quote for rendering purposes. */
|
|
412
|
+
pretty_total_volume_24h_quote: string;
|
|
413
|
+
/** * The total liquidity converted to fiat in `quote-currency`. */
|
|
414
|
+
total_liquidity_quote: number;
|
|
415
|
+
/** * The total volume 24h converted to fiat in `quote-currency`. */
|
|
416
|
+
total_volume_24h_quote: number;
|
|
417
|
+
/** * The number of transactions in the last 24h. */
|
|
418
|
+
transactions_24h: number;
|
|
419
|
+
volume_timeseries_7d: VolumeTokenTimeseries[];
|
|
420
|
+
volume_timeseries_30d: VolumeTokenTimeseries[];
|
|
421
|
+
liquidity_timeseries_7d: LiquidityTokenTimeseries[];
|
|
422
|
+
liquidity_timeseries_30d: LiquidityTokenTimeseries[];
|
|
423
|
+
price_timeseries_7d: PriceTokenTimeseries[];
|
|
424
|
+
price_timeseries_30d: PriceTokenTimeseries[];
|
|
425
|
+
}
|
|
426
|
+
export interface VolumeTokenTimeseries {
|
|
427
|
+
/** * The name of the DEX, eg: `uniswap_v2`. */
|
|
428
|
+
dex_name: string;
|
|
429
|
+
/** * The requested chain ID eg: `1`. */
|
|
430
|
+
chain_id: string;
|
|
431
|
+
/** * The current date. */
|
|
432
|
+
dt: string;
|
|
433
|
+
/** * The total volume unscaled for this day. */
|
|
434
|
+
total_volume: string;
|
|
435
|
+
/** * The volume in `quote-currency` denomination. */
|
|
436
|
+
volume_quote: number;
|
|
437
|
+
/** * A prettier version of the volume quote for rendering purposes. */
|
|
438
|
+
pretty_volume_quote: string;
|
|
439
|
+
}
|
|
440
|
+
export interface LiquidityTokenTimeseries {
|
|
441
|
+
/** * The name of the DEX, eg: `uniswap_v2`. */
|
|
442
|
+
dex_name: string;
|
|
443
|
+
/** * The requested chain ID eg: `1`. */
|
|
444
|
+
chain_id: string;
|
|
445
|
+
/** * The current date. */
|
|
446
|
+
dt: string;
|
|
447
|
+
/** * The total liquidity unscaled up to this day. */
|
|
448
|
+
total_liquidity: string;
|
|
449
|
+
/** * The liquidity in `quote-currency` denomination. */
|
|
450
|
+
liquidity_quote: number;
|
|
451
|
+
/** * A prettier version of the liquidity quote for rendering purposes. */
|
|
452
|
+
pretty_liquidity_quote: string;
|
|
453
|
+
}
|
|
454
|
+
export interface PriceTokenTimeseries {
|
|
455
|
+
/** * The name of the DEX, eg: `uniswap_v2`. */
|
|
456
|
+
dex_name: string;
|
|
457
|
+
/** * The requested chain ID eg: `1`. */
|
|
458
|
+
chain_id: string;
|
|
459
|
+
/** * The current date. */
|
|
460
|
+
dt: string;
|
|
461
|
+
/** * The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`. */
|
|
462
|
+
quote_currency: string;
|
|
463
|
+
/** * The exchange rate for the requested quote currency. */
|
|
464
|
+
quote_rate: number;
|
|
465
|
+
/** * A prettier version of the exchange rate for rendering purposes. */
|
|
466
|
+
pretty_quote_rate: string;
|
|
467
|
+
}
|
|
360
468
|
export interface SupportedDexesResponse {
|
|
361
469
|
/** * The timestamp when the response was generated. Useful to show data staleness to users. */
|
|
362
470
|
updated_at: Date;
|
|
@@ -409,6 +517,30 @@ export interface ExchangeTransaction {
|
|
|
409
517
|
total_quote: number;
|
|
410
518
|
/** * A prettier version of the total quote for rendering purposes. */
|
|
411
519
|
pretty_total_quote: string;
|
|
520
|
+
/** * The value attached to this tx. */
|
|
521
|
+
value: bigint | null;
|
|
522
|
+
/** * The value attached in `quote-currency` to this tx. */
|
|
523
|
+
value_quote: number;
|
|
524
|
+
/** * A prettier version of the quote for rendering purposes. */
|
|
525
|
+
pretty_value_quote: string;
|
|
526
|
+
/** * The requested chain native gas token metadata. */
|
|
527
|
+
gas_metadata: ContractMetadata;
|
|
528
|
+
/** * The amount of gas supplied for this tx. */
|
|
529
|
+
gas_offered: string;
|
|
530
|
+
/** * The gas spent for this tx. */
|
|
531
|
+
gas_spent: string;
|
|
532
|
+
/** * The gas price at the time of this tx. */
|
|
533
|
+
gas_price: string;
|
|
534
|
+
/** * The total transaction fees (`gas_price` * `gas_spent`) paid for this tx, denoted in wei. */
|
|
535
|
+
fees_paid: bigint | null;
|
|
536
|
+
/** * The gas spent in `quote-currency` denomination. */
|
|
537
|
+
gas_quote: number;
|
|
538
|
+
/** * A prettier version of the quote for rendering purposes. */
|
|
539
|
+
pretty_gas_quote: string;
|
|
540
|
+
/** * The native gas exchange rate for the requested `quote-currency`. */
|
|
541
|
+
gas_quote_rate: number;
|
|
542
|
+
/** * The requested quote currency eg: `USD`. */
|
|
543
|
+
quote_currency: string;
|
|
412
544
|
token_0: PoolToken;
|
|
413
545
|
token_1: PoolToken;
|
|
414
546
|
token_0_quote_rate: number;
|
|
@@ -452,6 +584,18 @@ export interface TransactionsForExchangeResponse {
|
|
|
452
584
|
/** * Pagination metadata. */
|
|
453
585
|
pagination: Pagination;
|
|
454
586
|
}
|
|
587
|
+
export interface NetworkTransactionsResponse {
|
|
588
|
+
/** * The timestamp when the response was generated. Useful to show data staleness to users. */
|
|
589
|
+
updated_at: Date;
|
|
590
|
+
/** * The requested chain ID eg: `1`. */
|
|
591
|
+
chain_id: number;
|
|
592
|
+
/** * The requested chain name eg: `eth-mainnet`. */
|
|
593
|
+
chain_name: string;
|
|
594
|
+
/** * List of response items. */
|
|
595
|
+
items: ExchangeTransaction[];
|
|
596
|
+
/** * Pagination metadata. */
|
|
597
|
+
pagination: Pagination;
|
|
598
|
+
}
|
|
455
599
|
export interface EcosystemChartDataResponse {
|
|
456
600
|
/** * The timestamp when the response was generated. Useful to show data staleness to users. */
|
|
457
601
|
updated_at: Date;
|
|
@@ -472,13 +616,17 @@ export interface UniswapLikeEcosystemCharts {
|
|
|
472
616
|
/** * The requested quote currency eg: `USD`. */
|
|
473
617
|
quote_currency: string;
|
|
474
618
|
gas_token_price_quote: number;
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
619
|
+
total_swaps_24h: number;
|
|
620
|
+
total_active_pairs_7d: number;
|
|
621
|
+
total_fees_24h: number;
|
|
622
|
+
/** * A prettier version of the gas quote for rendering purposes. */
|
|
623
|
+
pretty_gas_token_price_quote: string;
|
|
624
|
+
/** * A prettier version of the 24h total fees for rendering purposes. */
|
|
625
|
+
pretty_total_fees_24h: string;
|
|
626
|
+
volume_chart_7d: VolumeEcosystemChart[];
|
|
627
|
+
volume_chart_30d: VolumeEcosystemChart[];
|
|
628
|
+
liquidity_chart_7d: LiquidityEcosystemChart[];
|
|
629
|
+
liquidity_chart_30d: LiquidityEcosystemChart[];
|
|
482
630
|
}
|
|
483
631
|
export interface VolumeEcosystemChart {
|
|
484
632
|
/** * The name of the DEX, eg: `uniswap_v2`. */
|
|
@@ -489,6 +637,8 @@ export interface VolumeEcosystemChart {
|
|
|
489
637
|
/** * The requested quote currency eg: `USD`. */
|
|
490
638
|
quote_currency: string;
|
|
491
639
|
volume_quote: number;
|
|
640
|
+
/** * A prettier version of the volume quote for rendering purposes. */
|
|
641
|
+
pretty_volume_quote: string;
|
|
492
642
|
swap_count_24: number;
|
|
493
643
|
}
|
|
494
644
|
export interface LiquidityEcosystemChart {
|
|
@@ -500,6 +650,8 @@ export interface LiquidityEcosystemChart {
|
|
|
500
650
|
/** * The requested quote currency eg: `USD`. */
|
|
501
651
|
quote_currency: string;
|
|
502
652
|
liquidity_quote: number;
|
|
653
|
+
/** * A prettier version of the liquidity quote for rendering purposes. */
|
|
654
|
+
pretty_liquidity_quote: string;
|
|
503
655
|
}
|
|
504
656
|
export interface HealthDataResponse {
|
|
505
657
|
/** * The timestamp when the response was generated. Useful to show data staleness to users. */
|