@anton-seriesfi/doppler-v3-sdk
Version:
SDK for interacting with Doppler v3 protocol
53 lines • 1.72 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ReadFactory = exports.ModuleState = void 0;
const drift_1 = require("@delvtech/drift");
const abis_1 = require("../../abis");
var ModuleState;
(function (ModuleState) {
ModuleState[ModuleState["NotWhitelisted"] = 0] = "NotWhitelisted";
ModuleState[ModuleState["TokenFactory"] = 1] = "TokenFactory";
ModuleState[ModuleState["GovernanceFactory"] = 2] = "GovernanceFactory";
ModuleState[ModuleState["HookFactory"] = 3] = "HookFactory";
ModuleState[ModuleState["Migrator"] = 4] = "Migrator";
})(ModuleState || (exports.ModuleState = ModuleState = {}));
class ReadFactory {
constructor(address, drift = (0, drift_1.createDrift)()) {
this.airlock = drift.contract({
abi: abis_1.airlockAbi,
address,
});
}
async getModuleState(address, options) {
return this.airlock.read("getModuleState", {
module: address,
...options,
});
}
async getAssetData(asset, options) {
return this.airlock.read("getAssetData", {
asset,
...options,
});
}
async owner() {
return this.airlock.read("owner");
}
async getCreateEvents(options) {
return this.airlock.getEvents("Create", {
...options,
});
}
async getMigrateEvents(options) {
return this.airlock.getEvents("Migrate", {
...options,
});
}
async getSetModuleStateEvents(options) {
return this.airlock.getEvents("SetModuleState", {
...options,
});
}
}
exports.ReadFactory = ReadFactory;
//# sourceMappingURL=ReadFactory.js.map