Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

fix(etherscan): support stringified numbers in response #1524

Merged
merged 4 commits into from
Jul 28, 2022

Conversation

mattsse
Copy link
Collaborator

@mattsse mattsse commented Jul 28, 2022

Motivation

Closes #1507

the etherscan API returns numbers as strings

    {
      "blockNumber": "2228258",
      "timeStamp": "1473433992",
      "hash": "0x5f2cd76fd3656686e356bc02cc91d8d0726a16936fd08e67ed30467053225a86",
      "nonce": "10",
      "blockHash": "0x466dbced0a98e1b0490f787b51570850c8347960a4e92bd89acf85299e4cb9dc",
      "from": "0x4e83362442b8d1bec281594cea3050c8eb01311c",
      "contractAddress": "0xecf8f87f810ecf450940c9f60066b4a7a501d6a7",
      "to": "0xac75b73394c329376c214663d92156afa864a77f",
      "value": "101000000000000000000",
      "tokenName": "",
      "tokenSymbol": "",
      "tokenDecimal": "1",
      "transactionIndex": "10",
      "gas": "1000000",
      "gasPrice": "20000000000",
      "gasUsed": "93657",
      "cumulativeGasUsed": "684715",
      "input": "deprecated",
      "confirmations": "13002487"
    }

wich results in wrong values

Solution

PR Checklist

  • Added Tests
  • Added Documentation
  • Updated the changelog

@gakonst gakonst merged commit 81a2a5e into gakonst:master Jul 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Blocknumber is incorrectly decoded as hex value for etherscan client
2 participants