How to use ethereum-input-data-decoder - 3 common examples

To help you get started, we’ve selected a few ethereum-input-data-decoder 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 swaponline / swap.core / src / swap.swaps / EthSwap.js View on Github external
_initSwap(app) {
    super._initSwap(app)

    this.app = app

    this.decoder  = new InputDataDecoder(this.abi)
    this.contract = new this.app.env.web3.eth.Contract(this.abi, this.address)
  }
github ProofSuite / amp-client / src / store / services / provider / index.js View on Github external
export async function queryTransactionHistory(address: string) {
  try {
    const decoder = new abiDecoder([...ERC20, ...WETH])
    const provider = getEtherscanProvider()

    let txs = await provider.getHistory(address)
    let parsedTxs = []

    txs = txs.slice(Math.max(txs.length - 50, 0))

    txs.forEach(tx => {
      if (tx.data === '0x') {
          parsedTxs.push({ type: 'Ether Transferred', status: 'CONFIRMED', hash: tx.hash, time: tx.timestamp * 1000 })
        } else {
          let decoded = decoder.decodeData(tx.data)

          switch(decoded.name) {
            case 'approve':
              let value = decoded.inputs[1].toString()
github swaponline / swap.core / src / swap.swaps / EthTokenSwap.js View on Github external
_initSwap(app) {
    super._initSwap(app)

    this.app = app

    this.decoder        = new InputDataDecoder(this.abi)
    this.contract       = new this.app.env.web3.eth.Contract(this.abi, this.address)
    this.ERC20          = new this.app.env.web3.eth.Contract(this.tokenAbi, this.tokenAddress)
  }

ethereum-input-data-decoder

Ethereum smart contract transaction input data decoder

MIT
Latest version published 2 years ago

Package Health Score

42 / 100
Full package analysis

Popular ethereum-input-data-decoder functions