"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.AddressList = void 0;
const superstruct_1 = require("superstruct");
const abstract_1 = require("./abstract");
const DEFAULT_NAME = "bybit";
const DEFAULT_URL = "https://hackscan.hackbounty.io/public/hack-address.json";
const bybitResponse = (0, superstruct_1.type)({
    "0221": (0, superstruct_1.type)({
        eth: (0, superstruct_1.defaulted)((0, superstruct_1.array)((0, superstruct_1.string)()), []),
        bsc: (0, superstruct_1.defaulted)((0, superstruct_1.array)((0, superstruct_1.string)()), []),
        arbi: (0, superstruct_1.defaulted)((0, superstruct_1.array)((0, superstruct_1.string)()), []),
    }),
});
class AddressList extends abstract_1.AbstractAdapter {
    constructor(opts) {
        super(opts?.name ?? DEFAULT_NAME, opts?.path ?? DEFAULT_URL, opts);
    }
    async update() {
        const response = await this.fetch(this.name, this.path, this.timeout, this.retries);
        if (!bybitResponse.is(response)) {
            return this.error("Failed to validate response");
        }
        return [...response["0221"].eth, ...response["0221"].bsc, ...response["0221"].arbi];
    }
}
exports.AddressList = AddressList;
//# sourceMappingURL=bybit.js.map