"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const trickle = require('timetrickle');
class Indexer {
    constructor(config) {
        this.limit = () => Promise.resolve({});
        Object.assign(this, config);
        const limit = trickle(this.rateLimits.calls, this.rateLimits.frame);
        this.limit = () => new Promise((resolve) => {
            limit(() => resolve());
        });
    }
    ensureLoggedIn() {
        if (!this.signedIn)
            return Promise.reject('Not logged in to use indexer');
        return Promise.resolve();
    }
}
exports.Indexer = Indexer;
//# sourceMappingURL=Indexer.js.map