"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getSgId = exports.reverseChainId = exports.fixChainId = void 0;
var _a = process.env.PUBLIC_SUBGRAPH, PUBLIC_SUBGRAPH = _a === void 0 ? 'localhost' : _a;
function fixChainId(chain) {
    if (chain === 'arbitrum')
        return 'arbitrum-one';
    return chain;
}
exports.fixChainId = fixChainId;
function reverseChainId(chain) {
    if (chain === 'arbitrum-one')
        return 'arbitrum';
    return chain;
}
exports.reverseChainId = reverseChainId;
function getSgId(address, chain) {
    if (chain === 'localhost')
        chain = PUBLIC_SUBGRAPH.split('-')[0];
    return (address === null || address === void 0 ? void 0 : address.toLowerCase()) + fixChainId(chain);
}
exports.getSgId = getSgId;
//# sourceMappingURL=subgraph.js.map