import { array, string } from "superstruct";
import { AbstractAdapter } from "./abstract";
const RESPONSE_TYPE = array(string());
const DEFAULT_NAME = "Risk Labs";
const DEFAULT_URL = "https://blacklist.risklabs.foundation/api/blacklist";
export class AddressList extends 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;
    }
}
//# sourceMappingURL=risklabs.js.map