"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.useProtocolRewardsV2 = exports.useProtocolRewardsV1 = void 0;
var react_1 = require("react");
var common_1 = require("../common");
var typechain_1 = require("../../typechain");
var utils_1 = require("../../utils");
function useProtocolRewardsV1(chain) {
    var signerOrProvider = (0, common_1.useSignerOrProvider)(chain);
    return (0, react_1.useMemo)(function () {
        if (!signerOrProvider)
            return null;
        var address = (0, utils_1.getContractAddrById)(chain, 'ProtocolRewards');
        if (!address) {
            console.error('No address found for ProtocolRewards');
            return null;
        }
        return typechain_1.ProtocolRewards__factory.connect(address, signerOrProvider);
    }, [signerOrProvider, chain]);
}
exports.useProtocolRewardsV1 = useProtocolRewardsV1;
function useProtocolRewardsV2(chain) {
    var signerOrProvider = (0, common_1.useSignerOrProvider)(chain);
    return (0, react_1.useMemo)(function () {
        if (!signerOrProvider)
            return null;
        var address = (0, utils_1.getContractAddrById)(chain, 'ProtocolRewardsV2');
        if (!address) {
            console.error('No address found for ProtocolRewards');
            return null;
        }
        return typechain_1.ProtocolRewards__factory.connect(address, signerOrProvider);
    }, [signerOrProvider, chain]);
}
exports.useProtocolRewardsV2 = useProtocolRewardsV2;
//# sourceMappingURL=useProtocolRewards.js.map