From 8999b7e1430fa5973404e7b47a4fef69a3740411 Mon Sep 17 00:00:00 2001 From: bagheera Date: Tue, 4 Nov 2025 14:39:19 +0300 Subject: [PATCH] Update README.md --- README.md | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 7c6afa5..3c3eaa0 100644 --- a/README.md +++ b/README.md @@ -4,48 +4,38 @@ Example code for building your own Ethereum smart contract API in [Node.js](http ## Setup -``` git clone git@github.com:compound-developers/api-guide-example.git cd api-guide-example npm install -``` **config.json** -The listed contract addresses and ABIs might be out of date. They can be confirmed here https://compound.finance/docs#networks. +The listed contract addresses and ABIs might be out of date. They can be confirmed [here](https://compound.finance/docs#networks). **server.js** -1. Be sure to set an environment variable for the Ethereum wallet private -key. +1. Be sure to set an environment variable for the Ethereum wallet private key. 2. Replace the HTTP Provider URL with your own. [Infura provides free API keys](https://infura.io/). -```js const walletPrivateKey = process.env.walletPrivateKey; const web3 = new Web3('https://mainnet.infura.io/v3/_your_api_key_here_'); -``` ## Running -``` node server.js -``` ## API Endpoint Example Calls -These are the possible calls that can be made with [cURL](https://curl.haxx.se/download.html). +These are the possible calls that can be made with [cURL](https://curl.se/download.html). -```bash curl localhost:3000/wallet-balance/eth/ curl localhost:3000/wallet-balance/ceth/ curl localhost:3000/supply/eth/9000 curl localhost:3000/protocol-balance/eth/ curl localhost:3000/redeem/eth/123 -``` -Here is an example of outputs for a series of API calls. The wallet started out with 100 ETH. +Here is an example of outputs for a series of API calls. The wallet started with 100 ETH. -```bash curl localhost:3000/wallet-balance/eth/ > 100 @@ -75,5 +65,3 @@ curl localhost:3000/wallet-balance/ceth/ curl localhost:3000/wallet-balance/eth/ > 99.995909700269046879 - -```