@angleprotocol/sdk
Version:
SDK for Angle DApps
148 lines • 9.67 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.merklSubgraphALMEndpoints = exports.merklSubgraphAMMEndpoints = exports.getMerklSubgraphPrefix = exports.merklFallbackTGEndpoint = exports.swapsSubgraphsEndpoint = void 0;
const constants_1 = require("../../types/constants");
const merkl_1 = require("../../types/merkl");
const sushiswapV3SubgraphPrefix = 'https://api.thegraph.com/subgraphs/name/sushi-v3/v3-';
exports.swapsSubgraphsEndpoint = {
[ ]: {
[ ]: sushiswapV3SubgraphPrefix + 'arbitrum',
[ ]: 'https://api.thegraph.com/subgraphs/name/ianlapham/arbitrum-minimal',
[ ]: 'https://api.thegraph.com/subgraphs/name/camelotlabs/camelot-amm-v3',
[ ]: 'https://subgraph-prod.goerli.horiza.io/subgraphs/name/retro-arbitrum-one-uniswap-v3',
},
[ ]: {
[ ]: sushiswapV3SubgraphPrefix + 'ethereum',
[ ]: 'https://api.thegraph.com/subgraphs/name/uniswap/uniswap-v3',
[ ]: 'https://api.thegraph.com/subgraphs/name/pancakeswap/exchange-v3-eth',
},
[ ]: {
[ ]: sushiswapV3SubgraphPrefix + 'optimism',
[ ]: 'https://api.thegraph.com/subgraphs/name/ianlapham/optimism-post-regenesis',
},
[ ]: {
[ ]: sushiswapV3SubgraphPrefix + 'polygon',
[ ]: 'https://api.thegraph.com/subgraphs/name/ianlapham/uniswap-v3-polygon',
[ ]: 'https://api.thegraph.com/subgraphs/name/ruvlol/univ3-test',
},
[ ]: {
[ ]: 'https://api.studio.thegraph.com/query/45376/exchange-v3-polygon-zkevm/version/latest',
},
[ ]: {
[ ]: 'https://api.studio.thegraph.com/query/32073/v3-base/version/latest',
[ ]: 'https://api.thegraph.com/subgraphs/name/baseswapfi/v3-base',
[ ]: 'https://subgraph.goerli.horiza.io/subgraphs/name/base-uniswap-v3',
},
};
const merklFallbackSubgraphPrefix = 'https://api.thegraph.com/subgraphs/name/angleprotocol/back-merkl-';
const merklFallbackSubgraphPrefixUniswapV3 = `${merklFallbackSubgraphPrefix}uniswapv3-`;
const merklFallbackSubgraphPrefixSushiswapV3 = `${merklFallbackSubgraphPrefix}sushiswapv3-`;
const merklFallbackSubgraphPrefixRetro = `${merklFallbackSubgraphPrefix}retro-`;
exports.merklFallbackTGEndpoint = {
[ ]: {
[ ]: merklFallbackSubgraphPrefixRetro + 'arb',
[ ]: merklFallbackSubgraphPrefixSushiswapV3 + 'arb',
[ ]: merklFallbackSubgraphPrefixUniswapV3 + 'arb',
},
[ ]: {
[ ]: merklFallbackSubgraphPrefixRetro + 'eth',
[ ]: merklFallbackSubgraphPrefixSushiswapV3 + 'eth',
[ ]: merklFallbackSubgraphPrefixUniswapV3 + 'eth',
[ ]: 'https://api.thegraph.com/subgraphs/name/pancakeswap/exchange-v3-eth',
},
[ ]: {
[ ]: merklFallbackSubgraphPrefixRetro + 'opt',
[ ]: merklFallbackSubgraphPrefixSushiswapV3 + 'opt',
[ ]: merklFallbackSubgraphPrefixUniswapV3 + 'opt',
},
[ ]: {
[ ]: merklFallbackSubgraphPrefixRetro + 'pol',
[ ]: merklFallbackSubgraphPrefixSushiswapV3 + 'pol',
[ ]: merklFallbackSubgraphPrefixUniswapV3 + 'pol',
},
[ ]: {
[ ]: 'https://api.studio.thegraph.com/query/45376/exchange-v3-polygon-zkevm/version/latest',
},
[ ]: { [merkl_1.AMMType.SushiSwapV3]: 'https://api.studio.thegraph.com/query/32073/v3-base/version/latest' },
};
const merklSubgraphPrefix = 'https://api.thegraph.com/subgraphs/name/angleprotocol/';
const merklSubgraphPrefixStudio = 'https://api.studio.thegraph.com/query/12694/';
const getMerklSubgraphPrefix = (env, isHostedService = true) => {
return isHostedService
? merklSubgraphPrefix + (env !== 'prod' ? 'test-merkl-' : 'merkl-')
: merklSubgraphPrefixStudio + (env !== 'prod' ? 'test-merkl-' : 'merkl-');
};
exports.getMerklSubgraphPrefix = getMerklSubgraphPrefix;
const merklSubgraphAMMEndpoints = (env) => {
return {
[ ]: {
[ ]: (0, exports.getMerklSubgraphPrefix)(env) + 'sushiswapv3-arb',
[ ]: (0, exports.getMerklSubgraphPrefix)(env) + 'uniswapv3-arb',
[ ]: (0, exports.getMerklSubgraphPrefix)(env) + 'camelot-arb',
[ ]: (0, exports.getMerklSubgraphPrefix)(env) + 'horiza-arb',
},
[ ]: {
[ ]: (0, exports.getMerklSubgraphPrefix)(env) + 'sushiswapv3-eth',
[ ]: (0, exports.getMerklSubgraphPrefix)(env) + 'uniswapv3-eth',
[ ]: (0, exports.getMerklSubgraphPrefix)(env) + 'pancakeswapv3-eth',
},
[ ]: {
[ ]: (0, exports.getMerklSubgraphPrefix)(env) + 'sushiswapv3-opt',
[ ]: (0, exports.getMerklSubgraphPrefix)(env) + 'uniswapv3-opt',
},
[ ]: {
[ ]: (0, exports.getMerklSubgraphPrefix)(env) + 'retro-pol',
[ ]: (0, exports.getMerklSubgraphPrefix)(env) + 'sushiswapv3-pol',
[ ]: (0, exports.getMerklSubgraphPrefix)(env) + 'uniswapv3-pol',
},
[ ]: {
[ ]: (0, exports.getMerklSubgraphPrefix)(env, false) + 'pancakeswapv3-zkevm/version/latest',
},
[ ]: {
[ ]: (0, exports.getMerklSubgraphPrefix)(env, false) + 'sushiswapv3-base/version/latest',
[ ]: (0, exports.getMerklSubgraphPrefix)(env, false) + 'basex-base/version/latest',
[ ]: (0, exports.getMerklSubgraphPrefix)(env, false) + 'horiza-base/version/latest',
},
};
};
exports.merklSubgraphAMMEndpoints = merklSubgraphAMMEndpoints;
const merklSubgraphALMEndpoints = (env) => {
return {
[ ]: {
[ ]: (0, exports.getMerklSubgraphPrefix)(env) + 'arrakis-arb',
[ ]: (0, exports.getMerklSubgraphPrefix)(env) + 'arrakisv2-arb',
[ ]: (0, exports.getMerklSubgraphPrefix)(env) + 'gamma-arb',
[ ]: (0, exports.getMerklSubgraphPrefix)(env) + 'defiedge-arb',
[ ]: (0, exports.getMerklSubgraphPrefix)(env) + 'range-arb',
[ ]: (0, exports.getMerklSubgraphPrefix)(env) + 'steer-arb',
[ ]: (0, exports.getMerklSubgraphPrefix)(env) + 'unipilot-arb',
},
[ ]: {
[ ]: (0, exports.getMerklSubgraphPrefix)(env) + 'arrakis-eth',
[ ]: (0, exports.getMerklSubgraphPrefix)(env) + 'gamma-eth',
[ ]: (0, exports.getMerklSubgraphPrefix)(env) + 'defiedge-eth',
[ ]: (0, exports.getMerklSubgraphPrefix)(env) + 'ichi-eth',
[ ]: (0, exports.getMerklSubgraphPrefix)(env) + 'range-eth',
},
[ ]: {
[ ]: (0, exports.getMerklSubgraphPrefix)(env) + 'arrakis-opt',
[ ]: (0, exports.getMerklSubgraphPrefix)(env) + 'gamma-opt',
[ ]: (0, exports.getMerklSubgraphPrefix)(env) + 'defiedge-opt',
[ ]: (0, exports.getMerklSubgraphPrefix)(env) + 'steer-opt',
},
[ ]: {
[ ]: (0, exports.getMerklSubgraphPrefix)(env) + 'arrakis-pol',
[ ]: (0, exports.getMerklSubgraphPrefix)(env) + 'gamma-pol',
[ ]: (0, exports.getMerklSubgraphPrefix)(env) + 'defiedge-pol',
[ ]: (0, exports.getMerklSubgraphPrefix)(env) + 'ichi-pol',
[ ]: (0, exports.getMerklSubgraphPrefix)(env) + 'steer-pol',
[ ]: (0, exports.getMerklSubgraphPrefix)(env) + 'range-pol',
},
[ ]: {},
[ ]: {
[ ]: (0, exports.getMerklSubgraphPrefix)(env) + 'gamma-base',
},
};
};
exports.merklSubgraphALMEndpoints = merklSubgraphALMEndpoints;
//# sourceMappingURL=endpoints.js.map