@aut-labs/sdk
Version:
The TS/JS SDK package aims to make it easy for frontends/backends to integrate with Aut Smart Contracts
55 lines • 2.58 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Hub = void 0;
const hub_contract_1 = require("../contracts/hub.contract");
const task_factory_contract_1 = require("../contracts/task-factory.contract");
const task_manager_contract_1 = require("../contracts/task-manager.contract");
const task_registry_contract_1 = require("../contracts/task-registry.contract");
const participation_score_contract_1 = require("../contracts/participation-score.contract");
class Hub {
constructor(_hubAddress, _multiSigner, _biconomyWrapper, _client) {
this._hubAddress = _hubAddress;
this._multiSigner = _multiSigner;
this._biconomyWrapper = _biconomyWrapper;
this._client = _client;
this.contract = new hub_contract_1.HubContract(this._hubAddress, this._multiSigner, this._biconomyWrapper);
}
async addAdmins(addresses) {
return this.contract.admins.addAdmins(addresses);
}
async removeAdmins(addresses) {
return this.contract.admins.removeAdmins(addresses);
}
async isAdmin(address) {
return this.contract.admins.isAdmin(address);
}
async isMember(address) {
return this.contract.members.isMember(address);
}
async getParticipationScoreFactory() {
if (!this._participationScoreContract) {
this._participationScoreContract = new participation_score_contract_1.ParticipationScoreContract(await this.contract.functions.participation(), this._multiSigner, this._biconomyWrapper);
}
return this._participationScoreContract;
}
async getTaskFactory() {
if (!this._taskFactoryContract) {
this._taskFactoryContract = new task_factory_contract_1.TaskFactoryContract(await this.contract.functions.taskFactory(), this._multiSigner, this._biconomyWrapper);
}
return this._taskFactoryContract;
}
async getTaskRegistry() {
if (!this._taskRegistryContract) {
this._taskRegistryContract = new task_registry_contract_1.TaskRegistryContract(await this.contract.functions.taskRegistry(), this._multiSigner, this._biconomyWrapper);
}
return this._taskRegistryContract;
}
async getTaskManager() {
if (!this._taskManagerContract) {
this._taskManagerContract = new task_manager_contract_1.TaskManagerContract(await this.contract.functions.taskManager(), this._multiSigner, this._biconomyWrapper);
}
return this._taskManagerContract;
}
}
exports.Hub = Hub;
//# sourceMappingURL=hub.service.js.map