@aut-labs/sdk
Version:
The TS/JS SDK package aims to make it easy for frontends/backends to integrate with Aut Smart Contracts
29 lines • 1.17 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.AllowlistContract = void 0;
const abi_types_1 = require("@aut-labs/abi-types");
const response_1 = require("../models/response");
const base_contract_1 = __importDefault(require("./base.contract"));
const find_event_1 = require("../utils/find-event");
class AllowlistContract extends base_contract_1.default {
async addToAllowlist(address) {
try {
const tx = await (await this.functions.addToAllowlist(address)).wait();
const event = (0, find_event_1.findLogEvent)(tx, abi_types_1.AllowlistContractEventType.AddedToAllowList);
return new response_1.SDKContractGenericResponse({
isSuccess: !!event,
event,
});
}
catch (error) {
return new response_1.SDKContractGenericResponse({
error
});
}
}
}
exports.AllowlistContract = AllowlistContract;
//# sourceMappingURL=allowlist.contract.js.map