@ardier16/q-js-sdk
Version:
Typescript Library to interact with Q System Contracts
40 lines • 1.67 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.CompoundRateKeeperInstance = void 0;
const SystemContractInstance_1 = require("../SystemContractInstance");
/**
* Compound rate keeper instance to interact with Compound rate keeper contract.
* See [onchain documentation](@system-contracts-repo/@network/CompoundRateKeeper/) for more details.
*/
class CompoundRateKeeperInstance extends SystemContractInstance_1.SystemContractInstance {
constructor(web3, address) {
super(web3, CompoundRateKeeperInstance.abi, address);
}
/**
* [External documentation](@system-contracts-repo/@network/CompoundRateKeeper/#getcurrentrate)
*/
async getCurrentRate() {
return this.instance.methods.getCurrentRate().call();
}
/**
* [External documentation](@system-contracts-repo/@network/CompoundRateKeeper/#getlastupdate)
*/
async getLastUpdate() {
return this.instance.methods.getLastUpdate().call();
}
/**
* [External documentation](@system-contracts-repo/@network/CompoundRateKeeper/#normalizeamount)
*/
async normalizeAmount(targetAmount) {
return this.instance.methods.normalizeAmount(targetAmount).call();
}
/**
* [External documentation](@system-contracts-repo/@network/CompoundRateKeeper/#denormalizeamount)
*/
async denormalizeAmount(normalizedAmount) {
return this.instance.methods.denormalizeAmount(normalizedAmount).call();
}
}
exports.CompoundRateKeeperInstance = CompoundRateKeeperInstance;
CompoundRateKeeperInstance.abi = 'CompoundRateKeeper.json';
//# sourceMappingURL=CompoundRateKeeperInstance.js.map