@descent-protocol/sdk
Version:
A Typescript library for interacting with the Descent Protocol
148 lines (147 loc) • 4.66 kB
JavaScript
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var Rate_factory_exports = {};
__export(Rate_factory_exports, {
Rate__factory: () => Rate__factory
});
module.exports = __toCommonJS(Rate_factory_exports);
var import_ethers = require("ethers");
const _abi = [
{
inputs: [
{
components: [
{
internalType: "uint256",
name: "rate",
type: "uint256"
},
{
internalType: "uint256",
name: "accumulatedRate",
type: "uint256"
},
{
internalType: "uint256",
name: "lastUpdateTime",
type: "uint256"
}
],
internalType: "struct IVault.RateInfo",
name: "_rateInfo",
type: "tuple"
}
],
name: "calculateCurrentAccumulatedRate",
outputs: [
{
internalType: "uint256",
name: "",
type: "uint256"
}
],
stateMutability: "view",
type: "function"
},
{
inputs: [
{
components: [
{
internalType: "uint256",
name: "rate",
type: "uint256"
},
{
internalType: "uint256",
name: "accumulatedRate",
type: "uint256"
},
{
internalType: "uint256",
name: "lastUpdateTime",
type: "uint256"
}
],
internalType: "struct IVault.RateInfo",
name: "_baseRateInfo",
type: "tuple"
},
{
components: [
{
internalType: "uint256",
name: "rate",
type: "uint256"
},
{
internalType: "uint256",
name: "accumulatedRate",
type: "uint256"
},
{
internalType: "uint256",
name: "lastUpdateTime",
type: "uint256"
}
],
internalType: "struct IVault.RateInfo",
name: "_collateralRateInfo",
type: "tuple"
}
],
name: "calculateCurrentTotalAccumulatedRate",
outputs: [
{
internalType: "uint256",
name: "",
type: "uint256"
}
],
stateMutability: "view",
type: "function"
}
];
const _bytecode = "0x608060405234801561001057600080fd5b506101a0806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c8063cf5696cb1461003b578063d14a27fd14610060575b600080fd5b61004e6100493660046100e3565b610073565b60405190815260200160405180910390f35b61004e61006e366004610118565b61009a565b600061007e8361009a565b6100878361009a565b6100919190610163565b90505b92915050565b6000806100ab604084013542610176565b6100b6908435610189565b6100c4906020850135610163565b9392505050565b6000606082840312156100dd57600080fd5b50919050565b60008060c083850312156100f657600080fd5b61010084846100cb565b915061010f84606085016100cb565b90509250929050565b60006060828403121561012a57600080fd5b61009183836100cb565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8082018082111561009457610094610134565b8181038181111561009457610094610134565b80820281158282048414176100945761009461013456";
const isSuperArgs = (xs) => xs.length > 1;
class Rate__factory extends import_ethers.ContractFactory {
constructor(...args) {
if (isSuperArgs(args)) {
super(...args);
} else {
super(_abi, _bytecode, args[0]);
}
}
getDeployTransaction(overrides) {
return super.getDeployTransaction(overrides || {});
}
deploy(overrides) {
return super.deploy(overrides || {});
}
connect(runner) {
return super.connect(runner);
}
static bytecode = _bytecode;
static abi = _abi;
static createInterface() {
return new import_ethers.Interface(_abi);
}
static connect(address, runner) {
return new import_ethers.Contract(address, _abi, runner);
}
}