aave-protocol-v2/types/LendingPoolDataProviderFactory.ts

506 lines
40 KiB
TypeScript
Raw Normal View History

2020-06-03 10:23:21 +00:00
/* Generated by ts-generator ver. 0.0.8 */
/* tslint:disable */
import { Contract, ContractFactory, Signer } from "ethers";
import { Provider } from "ethers/providers";
import { UnsignedTransaction } from "ethers/utils/transaction";
import { TransactionOverrides } from ".";
import { LendingPoolDataProvider } from "./LendingPoolDataProvider";
export class LendingPoolDataProviderFactory extends ContractFactory {
constructor(signer?: Signer) {
super(_abi, _bytecode, signer);
}
deploy(overrides?: TransactionOverrides): Promise<LendingPoolDataProvider> {
return super.deploy(overrides) as Promise<LendingPoolDataProvider>;
}
getDeployTransaction(overrides?: TransactionOverrides): UnsignedTransaction {
return super.getDeployTransaction(overrides);
}
attach(address: string): LendingPoolDataProvider {
return super.attach(address) as LendingPoolDataProvider;
}
connect(signer: Signer): LendingPoolDataProviderFactory {
return super.connect(signer) as LendingPoolDataProviderFactory;
}
static connect(
address: string,
signerOrProvider: Signer | Provider
): LendingPoolDataProvider {
return new Contract(
address,
_abi,
signerOrProvider
) as LendingPoolDataProvider;
}
}
const _abi = [
{
inputs: [],
name: "DATA_PROVIDER_REVISION",
outputs: [
{
internalType: "uint256",
name: "",
type: "uint256"
}
],
stateMutability: "view",
type: "function"
},
{
inputs: [],
name: "HEALTH_FACTOR_LIQUIDATION_THRESHOLD",
outputs: [
{
internalType: "uint256",
name: "",
type: "uint256"
}
],
stateMutability: "view",
type: "function"
},
{
inputs: [],
name: "addressesProvider",
outputs: [
{
internalType: "contract LendingPoolAddressesProvider",
name: "",
type: "address"
}
],
stateMutability: "view",
type: "function"
},
{
inputs: [
{
internalType: "address",
name: "_reserve",
type: "address"
},
{
internalType: "address",
name: "_user",
type: "address"
},
{
internalType: "uint256",
name: "_amount",
type: "uint256"
}
],
name: "balanceDecreaseAllowed",
outputs: [
{
internalType: "bool",
name: "",
type: "bool"
}
],
stateMutability: "view",
type: "function"
},
{
inputs: [
{
internalType: "address",
name: "_reserve",
type: "address"
},
{
internalType: "uint256",
name: "_amount",
type: "uint256"
},
{
internalType: "uint256",
name: "_fee",
type: "uint256"
},
{
internalType: "uint256",
name: "_userCurrentBorrowBalanceTH",
type: "uint256"
},
{
internalType: "uint256",
name: "_userCurrentFeesETH",
type: "uint256"
},
{
internalType: "uint256",
name: "_userCurrentLtv",
type: "uint256"
}
],
name: "calculateCollateralNeededInETH",
outputs: [
{
internalType: "uint256",
name: "",
type: "uint256"
}
],
stateMutability: "view",
type: "function"
},
{
inputs: [
{
internalType: "address",
name: "_user",
type: "address"
}
],
name: "calculateUserGlobalData",
outputs: [
{
internalType: "uint256",
name: "totalLiquidityBalanceETH",
type: "uint256"
},
{
internalType: "uint256",
name: "totalCollateralBalanceETH",
type: "uint256"
},
{
internalType: "uint256",
name: "totalBorrowBalanceETH",
type: "uint256"
},
{
internalType: "uint256",
name: "totalFeesETH",
type: "uint256"
},
{
internalType: "uint256",
name: "currentLtv",
type: "uint256"
},
{
internalType: "uint256",
name: "currentLiquidationThreshold",
type: "uint256"
},
{
internalType: "uint256",
name: "healthFactor",
type: "uint256"
},
{
internalType: "bool",
name: "healthFactorBelowThreshold",
type: "bool"
}
],
stateMutability: "view",
type: "function"
},
{
inputs: [],
name: "core",
outputs: [
{
internalType: "contract LendingPoolCore",
name: "",
type: "address"
}
],
stateMutability: "view",
type: "function"
},
{
inputs: [],
name: "getHealthFactorLiquidationThreshold",
outputs: [
{
internalType: "uint256",
name: "",
type: "uint256"
}
],
stateMutability: "pure",
type: "function"
},
{
inputs: [
{
internalType: "address",
name: "_reserve",
type: "address"
}
],
name: "getReserveConfigurationData",
outputs: [
{
internalType: "uint256",
name: "ltv",
type: "uint256"
},
{
internalType: "uint256",
name: "liquidationThreshold",
type: "uint256"
},
{
internalType: "uint256",
name: "liquidationBonus",
type: "uint256"
},
{
internalType: "address",
name: "rateStrategyAddress",
type: "address"
},
{
internalType: "bool",
name: "usageAsCollateralEnabled",
type: "bool"
},
{
internalType: "bool",
name: "borrowingEnabled",
type: "bool"
},
{
internalType: "bool",
name: "stableBorrowRateEnabled",
type: "bool"
},
{
internalType: "bool",
name: "isActive",
type: "bool"
}
],
stateMutability: "view",
type: "function"
},
{
inputs: [
{
internalType: "address",
name: "_reserve",
type: "address"
}
],
name: "getReserveData",
outputs: [
{
internalType: "uint256",
name: "totalLiquidity",
type: "uint256"
},
{
internalType: "uint256",
name: "availableLiquidity",
type: "uint256"
},
{
internalType: "uint256",
name: "totalBorrowsStable",
type: "uint256"
},
{
internalType: "uint256",
name: "totalBorrowsVariable",
type: "uint256"
},
{
internalType: "uint256",
name: "liquidityRate",
type: "uint256"
},
{
internalType: "uint256",
name: "variableBorrowRate",
type: "uint256"
},
{
internalType: "uint256",
name: "stableBorrowRate",
type: "uint256"
},
{
internalType: "uint256",
name: "averageStableBorrowRate",
type: "uint256"
},
{
internalType: "uint256",
name: "utilizationRate",
type: "uint256"
},
{
internalType: "uint256",
name: "liquidityIndex",
type: "uint256"
},
{
internalType: "uint256",
name: "variableBorrowIndex",
type: "uint256"
},
{
internalType: "address",
name: "aTokenAddress",
type: "address"
},
{
internalType: "uint40",
name: "lastUpdateTimestamp",
type: "uint40"
}
],
stateMutability: "view",
type: "function"
},
{
inputs: [
{
internalType: "address",
name: "_user",
type: "address"
}
],
name: "getUserAccountData",
outputs: [
{
internalType: "uint256",
name: "totalLiquidityETH",
type: "uint256"
},
{
internalType: "uint256",
name: "totalCollateralETH",
type: "uint256"
},
{
internalType: "uint256",
name: "totalBorrowsETH",
type: "uint256"
},
{
internalType: "uint256",
name: "totalFeesETH",
type: "uint256"
},
{
internalType: "uint256",
name: "availableBorrowsETH",
type: "uint256"
},
{
internalType: "uint256",
name: "currentLiquidationThreshold",
type: "uint256"
},
{
internalType: "uint256",
name: "ltv",
type: "uint256"
},
{
internalType: "uint256",
name: "healthFactor",
type: "uint256"
}
],
stateMutability: "view",
type: "function"
},
{
inputs: [
{
internalType: "address",
name: "_reserve",
type: "address"
},
{
internalType: "address",
name: "_user",
type: "address"
}
],
name: "getUserReserveData",
outputs: [
{
internalType: "uint256",
name: "currentATokenBalance",
type: "uint256"
},
{
internalType: "uint256",
name: "currentBorrowBalance",
type: "uint256"
},
{
internalType: "uint256",
name: "principalBorrowBalance",
type: "uint256"
},
{
internalType: "uint256",
name: "borrowRateMode",
type: "uint256"
},
{
internalType: "uint256",
name: "borrowRate",
type: "uint256"
},
{
internalType: "uint256",
name: "liquidityRate",
type: "uint256"
},
{
internalType: "uint256",
name: "originationFee",
type: "uint256"
},
{
internalType: "uint256",
name: "variableBorrowIndex",
type: "uint256"
},
{
internalType: "uint256",
name: "lastUpdateTimestamp",
type: "uint256"
},
{
internalType: "bool",
name: "usageAsCollateralEnabled",
type: "bool"
}
],
stateMutability: "view",
type: "function"
},
{
inputs: [
{
internalType: "contract LendingPoolAddressesProvider",
name: "_addressesProvider",
type: "address"
}
],
name: "initialize",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}
];
const _bytecode =
"0x60806040526000805534801561001457600080fd5b50613c56806100246000396000f3fe608060405234801561001057600080fd5b50600436106100cf5760003560e01c806376e9d6151161008c578063c3525c2811610066578063c3525c281461059c578063c4d66de8146105ba578063c72c4d10146105fe578063f2f4eb2614610648576100cf565b806376e9d6151461046f5780638daf609f146104f5578063bf92857c14610513576100cf565b806312737c33146100d457806328dd2d011461015e5780632c6d0e9b1461021957806335ea6a75146102a65780633e1501411461038c5780633e44bee814610451575b600080fd5b610148600480360360c08110156100ea57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190505050610692565b6040518082815260200191505060405180910390f35b6101c06004803603604081101561017457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061096c565b604051808b81526020018a8152602001898152602001888152602001878152602001868152602001858152602001848152602001838152602001821515151581526020019a505050505050505050505060405180910390f35b61025b6004803603602081101561022f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506114b5565b60405180898152602001888152602001878152602001868152602001858152602001848152602001838152602001821515151581526020019850505050505050505060405180910390f35b6102e8600480360360208110156102bc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611c7d565b604051808e81526020018d81526020018c81526020018b81526020018a81526020018981526020018881526020018781526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018264ffffffffff1664ffffffffff1681526020019d505050505050505050505050505060405180910390f35b6103ce600480360360208110156103a257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506127ce565b604051808981526020018881526020018781526020018673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001851515151581526020018415151515815260200183151515158152602001821515151581526020019850505050505050505060405180910390f35b610459612d39565b6040518082815260200191505060405180910390f35b6104db6004803603606081101561048557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612d49565b604051808215151515815260200191505060405180910390f35b6104fd61325c565b6040518082815260200191505060405180910390f35b6105556004803603602081101561052957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613261565b604051808981526020018881526020018781526020018681526020018581526020018481526020018381526020018281526020019850505050505050505060405180910390f35b6105a46132ac565b6040518082815260200191505060405180910390f35b6105fc600480360360208110156105d057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506132b8565b005b6106066134aa565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6106506134d0565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b600080603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a2353fdc896040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561073457600080fd5b505afa158015610748573d6000803e3d6000fd5b505050506040513d602081101561075e57600080fd5b810190808051906020019092919050505090506000603560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663fca513a86040518163ffffffff1660e01b815260040160206040518083038186803b1580156107db576000