@q-dev/q-js-sdk
Version:
Typescript Library to interact with Q System Contracts
40 lines • 1.71 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(signerOrProvider, address) {
super(signerOrProvider, CompoundRateKeeperInstance.abi, address);
}
/**
* [External documentation](@system-contracts-repo/@network/CompoundRateKeeper/#getcurrentrate)
*/
async getCurrentRate() {
return (await this.instance.getCurrentRate()).toString();
}
/**
* [External documentation](@system-contracts-repo/@network/CompoundRateKeeper/#getlastupdate)
*/
async getLastUpdate() {
return (await this.instance.getLastUpdate()).toString();
}
/**
* [External documentation](@system-contracts-repo/@network/CompoundRateKeeper/#normalizeamount)
*/
async normalizeAmount(targetAmount) {
return (await this.instance.normalizeAmount(targetAmount)).toString();
}
/**
* [External documentation](@system-contracts-repo/@network/CompoundRateKeeper/#denormalizeamount)
*/
async denormalizeAmount(normalizedAmount) {
return (await this.instance.denormalizeAmount(normalizedAmount)).toString();
}
}
exports.CompoundRateKeeperInstance = CompoundRateKeeperInstance;
CompoundRateKeeperInstance.abi = 'CompoundRateKeeper.json';
//# sourceMappingURL=CompoundRateKeeperInstance.js.map