@cowprotocol/cow-sdk
Advanced tools
Comparing version 4.0.6 to 4.0.7
{ | ||
"name": "@cowprotocol/cow-sdk", | ||
"version": "4.0.6", | ||
"version": "4.0.7", | ||
"license": "(MIT OR Apache-2.0)", | ||
@@ -5,0 +5,0 @@ "files": [ |
import { LastDaysVolumeQuery, LastHoursVolumeQuery, TotalsQuery } from './graphql'; | ||
import { DocumentNode } from 'graphql/index'; | ||
import { Variables } from 'graphql-request'; | ||
import { ApiContext, PartialApiContext } from '../common/configs'; | ||
import { ApiContext } from '../common/configs'; | ||
import { SupportedChainId } from '../common/chains'; | ||
type SubgraphApiBaseUrls = Record<SupportedChainId, string | null>; | ||
interface SubgraphApiContext extends Omit<ApiContext, 'baseUrls'> { | ||
baseUrls?: SubgraphApiBaseUrls; | ||
} | ||
type PartialSubgraphApiContext = Partial<SubgraphApiContext>; | ||
/** | ||
@@ -26,8 +30,8 @@ * CoW Protocol Production Subgraph API configuration. | ||
API_NAME: string; | ||
context: ApiContext; | ||
context: SubgraphApiContext; | ||
/** | ||
* Create a new CoW Protocol API instance. | ||
* @param context Any properties of the {@link ApiContext} may be overridden by passing a {@link PartialApiContext}. | ||
* @param context Any properties of the {@link SubgraphApiContext} may be overridden by passing a {@link PartialSubgraphApiContext}. | ||
*/ | ||
constructor(context?: PartialApiContext); | ||
constructor(context?: PartialSubgraphApiContext); | ||
/** | ||
@@ -38,17 +42,17 @@ * Query the totals from TheGraph for the CoW Protocol. | ||
*/ | ||
getTotals(contextOverride?: PartialApiContext): Promise<TotalsQuery['totals'][0]>; | ||
getTotals(contextOverride?: PartialSubgraphApiContext): Promise<TotalsQuery['totals'][0]>; | ||
/** | ||
* Query the volume over the last N days from TheGraph for the CoW Protocol. | ||
* @param {number} days The number of days to query. | ||
* @param {PartialApiContext} contextOverride Override the context for this call only. | ||
* @param {PartialSubgraphApiContext} contextOverride Override the context for this call only. | ||
* @returns The volume for the last N days. | ||
*/ | ||
getLastDaysVolume(days: number, contextOverride?: PartialApiContext): Promise<LastDaysVolumeQuery>; | ||
getLastDaysVolume(days: number, contextOverride?: PartialSubgraphApiContext): Promise<LastDaysVolumeQuery>; | ||
/** | ||
* Query the volume over the last N hours from TheGraph for the CoW Protocol. | ||
* @param {number} hours The number of hours to query. | ||
* @param {PartialApiContext} contextOverride Override the context for this call only. | ||
* @param {PartialSubgraphApiContext} contextOverride Override the context for this call only. | ||
* @returns The volume for the last N hours. | ||
*/ | ||
getLastHoursVolume(hours: number, contextOverride?: PartialApiContext): Promise<LastHoursVolumeQuery>; | ||
getLastHoursVolume(hours: number, contextOverride?: PartialSubgraphApiContext): Promise<LastHoursVolumeQuery>; | ||
/** | ||
@@ -58,11 +62,11 @@ * Run a query against the CoW Protocol Subgraph. | ||
* @param {Variables | undefined} variables To be passed to the query. | ||
* @param {PartialApiContext} contextOverride Override the context for this call only. | ||
* @param {PartialSubgraphApiContext} contextOverride Override the context for this call only. | ||
* @returns Results of the query. | ||
* @throws {@link CowError} if the query fails. | ||
*/ | ||
runQuery<T>(query: string | DocumentNode, variables?: Variables | undefined, contextOverride?: PartialApiContext): Promise<T>; | ||
runQuery<T>(query: string | DocumentNode, variables?: Variables | undefined, contextOverride?: PartialSubgraphApiContext): Promise<T>; | ||
/** | ||
* Override parts of the context for a specific call. | ||
* @param {PartialApiContext} contextOverride Override the context for this call only. | ||
* @returns {ApiContext} The context with the override applied. | ||
* @param {PartialSubgraphApiContext} contextOverride Override the context for this call only. | ||
* @returns {SubgraphApiContext} The context with the override applied. | ||
*/ | ||
@@ -69,0 +73,0 @@ private getContextWithOverride; |
{ | ||
"name": "@cowprotocol/cow-sdk", | ||
"version": "4.0.6", | ||
"version": "4.0.7", | ||
"license": "(MIT OR Apache-2.0)", | ||
@@ -5,0 +5,0 @@ "files": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1098267
8271