UNPKG

toucan-sdk

Version:

A JavaScript SDK for Toucan Protocol. Works in the web browser and Node.js.

24 lines (23 loc) 996 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getDexGraphClient = exports.getToucanGraphClient = void 0; const core_1 = require("@urql/core"); const graphAPIs_1 = require("./graphAPIs"); const getToucanGraphClient = (network) => (0, core_1.createClient)({ url: network === "polygon" ? graphAPIs_1.POLYGON_TOUCAN_GRAPH_API_URL : network === "celo" ? graphAPIs_1.CELO_TOUCAN_GRAPH_API_URL : graphAPIs_1.ALFAJORES_TOUCAN_GRAPH_API_URL, requestPolicy: "network-only", fetch: fetch, exchanges: [core_1.cacheExchange, core_1.fetchExchange], }); exports.getToucanGraphClient = getToucanGraphClient; const getDexGraphClient = (network) => (0, core_1.createClient)({ url: network === "polygon" ? graphAPIs_1.POLYGON_SUSHI_GRAPH_API_URL : graphAPIs_1.CELO_UBESWAP_GRAPH_API_URL, exchanges: [core_1.cacheExchange, core_1.fetchExchange], }); exports.getDexGraphClient = getDexGraphClient;