Removing ./pages directory

This commit is contained in:
Jamie Hewitt 2022-08-22 15:43:28 +03:00
parent 043b524219
commit fe464e605c

View File

@ -1,35 +0,0 @@
import { ethers } from 'ethers'
import {
createClient,
dedupExchange,
TypedDocumentNode,
OperationContext,
fetchExchange
} from 'urql'
export async function getProvider(): Promise<any> {
const provider = new ethers.providers.InfuraProvider(
'homestead',
process.env.INFURA_PROJECT_ID
)
return provider
}
export async function fetchData(
query: TypedDocumentNode,
variables: any,
context: OperationContext
): Promise<any> {
try {
const client = createClient({
url: 'https://v4.subgraph.mainnet.oceanprotocol.com/subgraphs/name/oceanprotocol/ocean-subgraph',
exchanges: [dedupExchange, fetchExchange]
})
const response = await client.query(query, variables, context).toPromise()
return response
} catch (error) {
console.error('Error fetchData: ', error)
}
return null
}