UNPKG

@ajna-finance/sdk

Version:

A typescript SDK that can be used to create Dapps in Ajna ecosystem.

36 lines 1.21 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Proposal = void 0; const tslib_1 = require("tslib"); const grant_fund_1 = require("../contracts/grant-fund"); const types_1 = require("../types"); /** * Models a grants fund proposal. */ class Proposal { constructor(provider, id) { this.provider = provider; this.id = id; } getInfo() { return tslib_1.__awaiter(this, void 0, void 0, function* () { const [proposalId, distributionId, votesReceived, tokensRequested, fundingVotesReceived, executed,] = yield (0, grant_fund_1.getProposalInfo)(this.provider, this.id); return { proposalId, distributionId, votesReceived, tokensRequested, fundingVotesReceived, executed, }; }); } getState() { return tslib_1.__awaiter(this, void 0, void 0, function* () { const index = yield (0, grant_fund_1.getProposalState)(this.provider, this.id); return types_1.proposalStates[index]; }); } } exports.Proposal = Proposal; //# sourceMappingURL=Proposal.js.map