Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async getBiddingExpiration (contractAddress, block) {
const biddingExpiration = await this.getMethod('jsonrpc')('eth_call', { data: '0x9f2fe458', to: ensure0x(contractAddress) }, ensureBlockFormat(block))
return parseInt(biddingExpiration, 16)
}
async getApprovedLoan (contractAddress, block) {
const approved = await this.getMethod('jsonrpc')('eth_call', { data: '0x19d40b08', to: ensure0x(contractAddress) }, ensureBlockFormat(block))
return parseInt(approved, 16) === 1 ? true : false
}
async getLoanExpiration (contractAddress, block) {
const loanExpiration = await this.getMethod('jsonrpc')('eth_call', { data: '0xbd2f2882', to: ensure0x(contractAddress) }, ensureBlockFormat(block))
return parseInt(loanExpiration, 16)
}
async getInterestAmount (contractAddress, block) {
const interest = await this.getMethod('jsonrpc')('eth_call', { data: '0xc392f766', to: ensure0x(contractAddress) }, ensureBlockFormat(block))
return parseInt(interest, 16)
}
async getBiddingLoan (contractAddress, block) {
const bidding = await this.getMethod('jsonrpc')('eth_call', { data: '0xdb774c79', to: ensure0x(contractAddress) }, ensureBlockFormat(block))
return parseInt(bidding, 16) === 1 ? true : false
}
async getApproveExpiration (contractAddress, block) {
const approveExpiration = await this.getMethod('jsonrpc')('eth_call', { data: '0x110bba8d', to: ensure0x(contractAddress) }, ensureBlockFormat(block))
return parseInt(approveExpiration, 16)
}
async getSecretHashB2 (contractAddress, block) {
return this.getMethod('jsonrpc')('eth_call', { data: '0xa4e10668', to: ensure0x(contractAddress) }, ensureBlockFormat(block))
}
}
async getWithdrawnLoan (contractAddress, block) {
const withdrawn = await this.getMethod('jsonrpc')('eth_call', { data: '0xc80ec522', to: ensure0x(contractAddress) }, ensureBlockFormat(block))
return parseInt(withdrawn, 16) === 1 ? true : false
}
async getBorrowerPubKey (contractAddress, block) {
const prefixFunctionSignature = '0xac6bd7e4'
const suffixFunctionSignature = '0x527a438f'
const prefixBorrowerPubKey = await this.getMethod('jsonrpc')('eth_call', { data: prefixFunctionSignature, to: ensure0x(contractAddress) }, ensureBlockFormat(block))
const suffixBorrowerPubKey = await this.getMethod('jsonrpc')('eth_call', { data: suffixFunctionSignature, to: ensure0x(contractAddress) }, ensureBlockFormat(block))
return padHexStart(parseInt(prefixBorrowerPubKey, 16).toString(16)) + suffixBorrowerPubKey
}
async getLiquidationFeeAmount (contractAddress, block) {
const liquidationFee = await this.getMethod('jsonrpc')('eth_call', { data: '0xa36a3630', to: ensure0x(contractAddress) }, ensureBlockFormat(block))
return parseInt(liquidationFee, 16)
}