UNPKG

@ardier16/q-js-sdk

Version:

Typescript Library to interact with Q System Contracts

81 lines 3.58 kB
"use strict"; 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(this.instance.methods.confirmDecision(id, hash), txOptions); } /** * [External documentation](@system-contracts-repo/@network/ASlashingEscrow/#arbitrationinfos) */ async arbitrationInfos(id) { const info = await this.instance.methods.arbitrationInfos(id).call(); return { remark: info.remark, proposerRemark: info.proposerRemark, params: { slashedAmount: info.params[0], objectionEndTime: info.params[1], appealEndTime: info.params[2], }, decision: { notAppealed: info.decision[0], proposer: info.decision[1], confirmers: info.decision[2], externalReference: info.decision[3], percentage: info.decision[4], confirmationCount: info.decision[5], endDate: info.decision[6], hash: info.decision[7], }, executed: info.executed, appealConfirmed: info.appealConfirmed, }; } /** * [External documentation](@system-contracts-repo/@network/ASlashingEscrow/#castobjection) */ async castObjection(id, remark, txOptions) { return this.submitTransaction(this.instance.methods.castObjection(id, remark), txOptions); } /** * [External documentation](@system-contracts-repo/@network/ASlashingEscrow/#setremark) */ async setRemark(id, remark, txOptions) { return this.submitTransaction(this.instance.methods.setRemark(id, remark), txOptions); } /** * [External documentation](@system-contracts-repo/@network/ASlashingEscrow/#setproposerremark) */ async setProposerRemark(id, proposerRemark, appealConfirmed, txOptions) { return this.submitTransaction(this.instance.methods.setProposerRemark(id, proposerRemark, appealConfirmed), txOptions); } /** * [External documentation](@system-contracts-repo/@network/ASlashingEscrow/#execute) */ async execute(id, txOptions) { return this.submitTransaction(this.instance.methods.execute(id), txOptions); } /** * [External documentation](@system-contracts-repo/@network/ASlashingEscrow/#proposedecision) */ async proposeDecision(id, percentage, notAppealed, reference, txOptions) { return this.submitTransaction(this.instance.methods.proposeDecision(id, percentage, notAppealed, reference), txOptions); } /** * [External documentation](@system-contracts-repo/@network/ASlashingEscrow/#recallproposeddecision) */ async recallProposedDecision(id, txOptions) { return this.submitTransaction(this.instance.methods.recallProposedDecision(id), txOptions); } } exports.BaseSlashingEscrowInstance = BaseSlashingEscrowInstance; //# sourceMappingURL=BaseSlashingEscrowInstance.js.map