UNPKG

@widolabs/collateral-swap-sdk

Version:

TypeScript SDK for interacting with the Wido protocol to allow collateral swaps on Compound Comet.

31 lines (30 loc) 948 B
import { BigNumber } from 'ethers'; import { Provider } from '@ethersproject/providers'; export declare enum LoanProvider { Equalizer = 1, Aave = 2 } export declare abstract class LoanProviderBase { protected readonly widoContractAddress: string; protected readonly asset: string; protected readonly amount: BigNumber; protected readonly rpcProvider: Provider; private computedFee; constructor(widoContractAddress: string, asset: string, amount: BigNumber, rpcProvider: Provider); /** * Returns the provider type */ abstract id(): LoanProvider; /** * Computes the fee of this provider for the given asset/amount */ abstract computeFee(): Promise<BigNumber>; /** * Checks whether the provider is eligible for the given asset/amount */ abstract canBeUsed(): Promise<boolean>; /** * Returns the fee of the provider */ fee(): Promise<BigNumber>; }