@celo/contractkit
Version:
Celo's ContractKit to interact with Celo network
49 lines • 2.72 kB
JavaScript
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 });
exports.FeeHandlerWrapper = exports.ExchangeProposalState = void 0;
const BaseWrapper_1 = require("./BaseWrapper");
var ExchangeProposalState;
(function (ExchangeProposalState) {
ExchangeProposalState[ExchangeProposalState["None"] = 0] = "None";
ExchangeProposalState[ExchangeProposalState["Proposed"] = 1] = "Proposed";
ExchangeProposalState[ExchangeProposalState["Approved"] = 2] = "Approved";
ExchangeProposalState[ExchangeProposalState["Executed"] = 3] = "Executed";
ExchangeProposalState[ExchangeProposalState["Cancelled"] = 4] = "Cancelled";
})(ExchangeProposalState || (exports.ExchangeProposalState = ExchangeProposalState = {}));
class FeeHandlerWrapper extends BaseWrapper_1.BaseWrapper {
constructor() {
super(...arguments);
this.owner = (0, BaseWrapper_1.proxyCall)(this.contract.methods.owner);
this.handleAll = (0, BaseWrapper_1.proxySend)(this.connection, this.contract.methods.handleAll);
this.burnCelo = (0, BaseWrapper_1.proxySend)(this.connection, this.contract.methods.burnCelo);
}
handle(tokenAddress) {
return __awaiter(this, void 0, void 0, function* () {
const createExchangeProposalInner = (0, BaseWrapper_1.proxySend)(this.connection, this.contract.methods.handle);
return createExchangeProposalInner(tokenAddress);
});
}
sell(tokenAddress) {
return __awaiter(this, void 0, void 0, function* () {
const innerCall = (0, BaseWrapper_1.proxySend)(this.connection, this.contract.methods.sell);
return innerCall(tokenAddress);
});
}
distribute(tokenAddress) {
return __awaiter(this, void 0, void 0, function* () {
const innerCall = (0, BaseWrapper_1.proxySend)(this.connection, this.contract.methods.distribute);
return innerCall(tokenAddress);
});
}
}
exports.FeeHandlerWrapper = FeeHandlerWrapper;
//# sourceMappingURL=FeeHandler.js.map
;