yearn-api-archived icon indicating copy to clipboard operation
yearn-api-archived copied to clipboard

User statistics endpoint returns lower case vault addresses, should return checksummed addresses.

Open graham-u opened this issue 4 years ago • 0 comments

The /user/[address]/vaults/statistics endpoint returns results containing lower case vault addresses. This is in contrast to other endpoints that returned checksummed addresses.

This may require API users to have to process the results if their apps are expecting checksummed versions.

For consistency we should return checksummed addresses. This can be achieved simply with:

const checkSummedAddress = Web3.utils.toChecksumAddress(upperOrLowerCaseAddress);

Edit: A thought just occurred.. as small a change as this is, it could be a breaking change if anyone has come to rely on the addresses being lowercase. Unlikely but worth mentioning.

graham-u avatar Dec 01 '20 14:12 graham-u