How to use the @liquality/ethereum-utils.ensureBlockFormat function in @liquality/ethereum-utils

To help you get started, we’ve selected a few @liquality/ethereum-utils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github liquality / chainabstractionlayer / packages / ethereum-erc20-loan-provider / lib / EthereumERC20LoanProvider.js View on Github external
async getBiddingExpiration (contractAddress, block) {
    const biddingExpiration = await this.getMethod('jsonrpc')('eth_call', { data: '0x9f2fe458', to: ensure0x(contractAddress) }, ensureBlockFormat(block))
    return parseInt(biddingExpiration, 16)
  }
github liquality / chainabstractionlayer / packages / ethereum-erc20-loan-provider / lib / EthereumERC20LoanProvider.js View on Github external
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
  }
github liquality / chainabstractionlayer / packages / ethereum-erc20-loan-provider / lib / EthereumERC20LoanProvider.js View on Github external
async getLoanExpiration (contractAddress, block) {
    const loanExpiration = await this.getMethod('jsonrpc')('eth_call', { data: '0xbd2f2882', to: ensure0x(contractAddress) }, ensureBlockFormat(block))
    return parseInt(loanExpiration, 16)
  }
github liquality / chainabstractionlayer / packages / ethereum-erc20-loan-provider / lib / EthereumERC20LoanProvider.js View on Github external
async getInterestAmount (contractAddress, block) {
    const interest = await this.getMethod('jsonrpc')('eth_call', { data: '0xc392f766', to: ensure0x(contractAddress) }, ensureBlockFormat(block))
    return parseInt(interest, 16)
  }
github liquality / chainabstractionlayer / packages / ethereum-erc20-loan-provider / lib / EthereumERC20LoanProvider.js View on Github external
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
  }
github liquality / chainabstractionlayer / packages / ethereum-erc20-loan-provider / lib / EthereumERC20LoanProvider.js View on Github external
async getApproveExpiration (contractAddress, block) {
    const approveExpiration = await this.getMethod('jsonrpc')('eth_call', { data: '0x110bba8d', to: ensure0x(contractAddress) }, ensureBlockFormat(block))
    return parseInt(approveExpiration, 16)
  }
github liquality / chainabstractionlayer / packages / ethereum-erc20-loan-provider / lib / EthereumERC20LoanProvider.js View on Github external
async getSecretHashB2 (contractAddress, block) {
    return this.getMethod('jsonrpc')('eth_call', { data: '0xa4e10668', to: ensure0x(contractAddress) }, ensureBlockFormat(block))
  }
}
github liquality / chainabstractionlayer / packages / ethereum-erc20-loan-provider / lib / EthereumERC20LoanProvider.js View on Github external
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
  }
github liquality / chainabstractionlayer / packages / ethereum-erc20-loan-provider / lib / EthereumERC20LoanProvider.js View on Github external
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
  }
github liquality / chainabstractionlayer / packages / ethereum-erc20-loan-provider / lib / EthereumERC20LoanProvider.js View on Github external
async getLiquidationFeeAmount (contractAddress, block) {
    const liquidationFee = await this.getMethod('jsonrpc')('eth_call', { data: '0xa36a3630', to: ensure0x(contractAddress) }, ensureBlockFormat(block))
    return parseInt(liquidationFee, 16)
  }

@liquality/ethereum-utils

[![Build Status](https://travis-ci.com/liquality/chainabstractionlayer.svg?branch=master)](https://travis-ci.com/liquality/chainabstractionlayer) [![Coverage Status](https://coveralls.io/repos/github/liquality/chainabstractionlayer/badge.svg?branch=master

MIT
Latest version published 3 years ago

Package Health Score

52 / 100
Full package analysis

Similar packages