UNPKG

@verified-network/verified-sdk

Version:

An SDK to develop applications on the Verified Network

33 lines (32 loc) 1.42 kB
"use strict"; // SPDX-License-Identifier: BUSL-1.1 // @ts-nocheck Object.defineProperty(exports, "__esModule", { value: true }); const index_1 = require("../index"); const Comet_json_1 = require("../../abi/loans/compound/Comet.json"); var FUNCTIONS; (function (FUNCTIONS) { FUNCTIONS["ALLOW"] = "allow"; FUNCTIONS["HASPERMISSION"] = "hasPermission"; })(FUNCTIONS || (FUNCTIONS = {})); class Comet extends index_1.VerifiedContract { constructor(signer, contractNetworkAddress) { const address = contractNetworkAddress; super(address, JSON.stringify(Comet_json_1.abi), signer); this.contractAddress = address; } async _getMeeQuote(paymentTokenAddress, functionName, args, apiKey, rpcUrl, isReactNative) { return await this.getQuote(paymentTokenAddress, functionName, args, rpcUrl, apiKey, isReactNative); } async allow(manager, isAllowed, options) { await this.validateInput(index_1.DATATYPES.ADDRESS, manager); await this.validateInput(index_1.DATATYPES.BOOLEAN, isAllowed); return this.callContract(FUNCTIONS.ALLOW, manager, isAllowed, options); } async hasPermission(owner, manager) { await this.validateInput(index_1.DATATYPES.ADDRESS, owner); await this.validateInput(index_1.DATATYPES.ADDRESS, manager); return this.callContract(FUNCTIONS.HASPERMISSION, owner, manager); } } exports.default = Comet;