"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
Object.defineProperty(exports, "__esModule", { value: true });
const base_1 = require("./base");
class Uia {
    constructor(connection) {
        this.base = new base_1.Base(connection);
    }
    getIssuers(limit, offset) {
        return __awaiter(this, void 0, void 0, function* () {
            const params = {
                limit: limit,
                offset: offset,
            };
            const res = yield this.base.get('/api/uia/issuers', params);
            const result = res.data;
            return result;
        });
    }
    isIssuer(address) {
        return __awaiter(this, void 0, void 0, function* () {
            const res = yield this.base.get(`/api/uia/isIssuer/${address}`);
            const result = res.data;
            return result;
        });
    }
    getIssuer(name) {
        return __awaiter(this, void 0, void 0, function* () {
            const res = yield this.base.get(`/api/uia/issuers/${name}`);
            const result = res.data;
            return result;
        });
    }
    getIssuerAssets(name, limit, offset) {
        return __awaiter(this, void 0, void 0, function* () {
            const params = {
                limit: limit,
                offset: offset,
            };
            const res = yield this.base.get(`/api/uia/issuers/${name}/assets`, params);
            const result = res.data;
            return result;
        });
    }
    getAssets(limit, offset) {
        return __awaiter(this, void 0, void 0, function* () {
            const params = {
                limit: limit,
                offset: offset,
            };
            const res = yield this.base.get('/api/uia/assets', params);
            const result = res.data;
            return result;
        });
    }
    getAsset(name) {
        return __awaiter(this, void 0, void 0, function* () {
            const res = yield this.base.get(`/api/uia/assets/${name}`);
            const result = res.data;
            return result;
        });
    }
    getBalances(address, limit, offset) {
        return __awaiter(this, void 0, void 0, function* () {
            const params = {
                limit: limit,
                offset: offset,
            };
            const res = yield this.base.get(`/api/uia/balances/${address}`, params);
            const result = res.data;
            return result;
        });
    }
    getBalance(address, currency) {
        return __awaiter(this, void 0, void 0, function* () {
            const res = yield this.base.get(`/api/uia/balances/${address}/${currency}`);
            const result = res.data;
            return result;
        });
    }
    getHolders(asset, limit = 100, offset = 0) {
        return __awaiter(this, void 0, void 0, function* () {
            const res = yield this.base.get(`/api/uia/holders/${asset}?limit=${limit}&offset=${offset}`);
            const result = res.data;
            return result;
        });
    }
}
exports.Uia = Uia;
//# sourceMappingURL=uia.js.map