@q-dev/q-js-sdk
Version:
Typescript Library to interact with Q System Contracts
81 lines • 3.61 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.BaseSlashingEscrowInstance = void 0;
const BaseContractInstance_1 = require("../BaseContractInstance");
/**
* Abstract Slashing Escrow instance to interact with Validator and RootNodes slashing escrow contract.
* See [onchain documentation](@system-contracts-repo/@network/ASlashingEscrow/) for more details.
*/
class BaseSlashingEscrowInstance extends BaseContractInstance_1.BaseContractInstance {
/**
* [External documentation](@system-contracts-repo/@network/ASlashingEscrow/#confirmdecision)
*/
async confirmDecision(id, hash, txOptions) {
return this.submitTransaction('confirmDecision', [id, hash], txOptions);
}
/**
* [External documentation](@system-contracts-repo/@network/ASlashingEscrow/#arbitrationinfos)
*/
async arbitrationInfos(id) {
const info = await this.instance.arbitrationInfos(id);
return {
remark: info.remark,
proposerRemark: info.proposerRemark,
params: {
slashedAmount: info.params.slashedAmount.toString(),
objectionEndTime: info.params.objectionEndTime.toString(),
appealEndTime: info.params.appealEndTime.toString(),
},
decision: {
notAppealed: info.decision.notAppealed,
proposer: info.decision.proposer,
confirmers: info.decision.confirmers,
externalReference: info.decision.externalReference,
percentage: info.decision.percentage.toString(),
confirmationCount: info.decision.confirmationCount.toString(),
endDate: info.decision.endDate.toString(),
hash: info.decision.hash,
},
executed: info.executed,
appealConfirmed: info.appealConfirmed,
};
}
/**
* [External documentation](@system-contracts-repo/@network/ASlashingEscrow/#castobjection)
*/
async castObjection(id, remark, txOptions) {
return this.submitTransaction('castObjection', [id, remark], txOptions);
}
/**
* [External documentation](@system-contracts-repo/@network/ASlashingEscrow/#setremark)
*/
async setRemark(id, remark, txOptions) {
return this.submitTransaction('setRemark', [id, remark], txOptions);
}
/**
* [External documentation](@system-contracts-repo/@network/ASlashingEscrow/#setproposerremark)
*/
async setProposerRemark(id, proposerRemark, appealConfirmed, txOptions) {
return this.submitTransaction('setProposerRemark', [id, proposerRemark, appealConfirmed], txOptions);
}
/**
* [External documentation](@system-contracts-repo/@network/ASlashingEscrow/#execute)
*/
async execute(id, txOptions) {
return this.submitTransaction('execute', [id], txOptions);
}
/**
* [External documentation](@system-contracts-repo/@network/ASlashingEscrow/#proposedecision)
*/
async proposeDecision(id, percentage, notAppealed, reference, txOptions) {
return this.submitTransaction('proposeDecision', [id, percentage, notAppealed, reference], txOptions);
}
/**
* [External documentation](@system-contracts-repo/@network/ASlashingEscrow/#recallproposeddecision)
*/
async recallProposedDecision(id, txOptions) {
return this.submitTransaction('recallProposedDecision', [id], txOptions);
}
}
exports.BaseSlashingEscrowInstance = BaseSlashingEscrowInstance;
//# sourceMappingURL=BaseSlashingEscrowInstance.js.map