From e87cf0400b41de15494b3f965050a6639b95abbd Mon Sep 17 00:00:00 2001 From: Ramiro Vazquez Date: Mon, 23 May 2022 14:05:56 -0300 Subject: [PATCH 1/3] export errors --- src/api/cow/index.ts | 2 ++ src/index.ts | 1 + 2 files changed, 3 insertions(+) diff --git a/src/api/cow/index.ts b/src/api/cow/index.ts index a0b1564a..0dc251df 100644 --- a/src/api/cow/index.ts +++ b/src/api/cow/index.ts @@ -26,6 +26,8 @@ import { import { CowError, logPrefix, objectToQueryString } from '../../utils/common' import { Context } from '../../utils/context' +export { OperatorError, QuoteError } + function getGnosisProtocolUrl(isDev: boolean): Partial> { if (isDev) { return { diff --git a/src/index.ts b/src/index.ts index 2b7d1091..0c34830a 100644 --- a/src/index.ts +++ b/src/index.ts @@ -3,3 +3,4 @@ export { CowError } from './utils/common' export { ALL_SUPPORTED_CHAIN_IDS, SupportedChainId } from './constants/chains' export * from './types' export * as GraphQL from './api/cow-subgraph/graphql' +export { OperatorError, QuoteError } from './api/cow' From 4843f15180b5661c1bbe5f53a890b1082b4d422e Mon Sep 17 00:00:00 2001 From: Ramiro Vazquez Date: Mon, 23 May 2022 14:06:23 -0300 Subject: [PATCH 2/3] allow receiving a DocumentNode --- src/api/cow-subgraph/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/api/cow-subgraph/index.ts b/src/api/cow-subgraph/index.ts index e6cb14cc..6f0ad93d 100644 --- a/src/api/cow-subgraph/index.ts +++ b/src/api/cow-subgraph/index.ts @@ -1,6 +1,7 @@ import log from 'loglevel' import fetch from 'cross-fetch' import { GraphQLClient, Variables } from 'graphql-request' +import { DocumentNode } from 'graphql' import { CowError } from '../../utils/common' import { Context } from '../../utils/context' import { SupportedChainId as ChainId } from '../../constants/chains' @@ -56,7 +57,7 @@ export class CowSubgraphApi { return this.runQuery(LAST_HOURS_VOLUME_QUERY, { hours }) } - async runQuery(query: string, variables?: Variables): Promise { + async runQuery(query: string | DocumentNode, variables?: Variables): Promise { try { const chainId = await this.context.chainId const client = this.clients[chainId] From 5fbcda7f5c43f9b460b40297853474cb5871c32e Mon Sep 17 00:00:00 2001 From: Ramiro Vazquez Date: Thu, 26 May 2022 07:01:11 -0300 Subject: [PATCH 3/3] Revert "export errors" This reverts commit e87cf0400b41de15494b3f965050a6639b95abbd. --- src/api/cow/index.ts | 2 -- src/index.ts | 1 - 2 files changed, 3 deletions(-) diff --git a/src/api/cow/index.ts b/src/api/cow/index.ts index 0dc251df..a0b1564a 100644 --- a/src/api/cow/index.ts +++ b/src/api/cow/index.ts @@ -26,8 +26,6 @@ import { import { CowError, logPrefix, objectToQueryString } from '../../utils/common' import { Context } from '../../utils/context' -export { OperatorError, QuoteError } - function getGnosisProtocolUrl(isDev: boolean): Partial> { if (isDev) { return { diff --git a/src/index.ts b/src/index.ts index 0c34830a..2b7d1091 100644 --- a/src/index.ts +++ b/src/index.ts @@ -3,4 +3,3 @@ export { CowError } from './utils/common' export { ALL_SUPPORTED_CHAIN_IDS, SupportedChainId } from './constants/chains' export * from './types' export * as GraphQL from './api/cow-subgraph/graphql' -export { OperatorError, QuoteError } from './api/cow'