"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.AddressList = void 0;
const superstruct_1 = require("superstruct");
const abstract_1 = require("./abstract");
const RESPONSE_TYPE = (0, superstruct_1.array)((0, superstruct_1.string)());
const DEFAULT_NAME = "Risk Labs";
const DEFAULT_URL = "https://blacklist.risklabs.foundation/api/blacklist";
class AddressList extends abstract_1.AbstractAdapter {
    constructor(opts) {
        super(opts?.name ?? DEFAULT_NAME, opts?.path ?? DEFAULT_URL, opts);
    }
    async update() {
        let response;
        try {
            response = await this.fetch(this.name, this.path, this.timeout, this.retries);
        }
        catch (err) {
            return this.error(err);
        }
        if (!RESPONSE_TYPE.is(response)) {
            return this.error("Failed to validate response");
        }
        return response;
    }
}
exports.AddressList = AddressList;
//# sourceMappingURL=risklabs.js.map