Skip to content

Commit 47ff9c5

Browse files
committed
chore(repo): update README
1 parent 3a29dab commit 47ff9c5

File tree

2 files changed

+17
-103
lines changed

2 files changed

+17
-103
lines changed

README.md

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,46 @@
1-
**English** | [中文](https://github.com/nanmu42/etherscan-api/blob/master/README_ZH.md)
2-
31
# etherscan-api
42

5-
[![GoDoc](https://godoc.org/github.com/nanmu42/etherscan-api?status.svg)](https://godoc.org/github.com/nanmu42/etherscan-api)
6-
[![CI status](https://github.com/nanmu42/etherscan-api/actions/workflows/ci.yaml/badge.svg)](https://github.com/nanmu42/etherscan-api/actions)
7-
[![codecov](https://codecov.io/gh/nanmu42/etherscan-api/branch/master/graph/badge.svg)](https://codecov.io/gh/nanmu42/etherscan-api)
8-
[![Go Report Card](https://goreportcard.com/badge/github.com/nanmu42/etherscan-api)](https://goreportcard.com/report/github.com/nanmu42/etherscan-api)
3+
[![GoDoc](https://godoc.org/github.com/timcki/etherscan-api/v2?status.svg)](https://godoc.org/github.com/timcki/etherscan-api)
94

10-
Golang client for the Etherscan.io API(and its families like BscScan), with nearly full implementation(accounts, transactions, tokens, contracts, blocks, stats), full network support(Mainnet, Ropsten, Kovan, Rinkby, Goerli, Tobalaba), and only depending on standard library. :wink:
5+
Golang client for the Etherscan.io v2 API with nearly full implementation(accounts, transactions, tokens, contracts, blocks, stats) and minimal dependencies.
116

127
# Usage
138

149
```bash
15-
go get github.com/nanmu42/etherscan-api
10+
go get github.com/timcki/etherscan-api/v2
1611
```
1712

1813
Create an API instance and off you go. :rocket:
1914

2015
```go
2116
import (
22-
"github.com/nanmu42/etherscan-api"
17+
"github.com/nanmu42/etherscan-api/v2/pkg/client"
18+
"github.com/nanmu42/etherscan-api/v2/pkg/chain"
2319
"fmt"
2420
)
2521

2622
func main() {
2723
// create a API client for specified ethereum net
2824
// there are many pre-defined network in package
29-
client := etherscan.New(etherscan.Mainnet, "[your API key]")
30-
31-
// or, if you are working with etherscan-family API like BscScan
25+
client := client.NewClient(chain.EthereumMainnet, "[your API key]")
26+
27+
// or, if you are working with antoher chain
28+
// client := client.NewClient(chain.OpMainnet, "[your API key]")
3229
//
30+
// or more customized
3331
// client := etherscan.NewCustomized(etherscan.Customization{
3432
// Timeout: 15 * time.Second,
3533
// Key: "You key here",
36-
// BaseURL: "https://api.bscscan.com/api?",
34+
// Chain: chain.NewChain(<chain number>),
35+
// BaseURL: "<whatever thid-party api provider>",
3736
// Verbose: false,
3837
// })
3938

4039
// (optional) add hooks, e.g. for rate limit
41-
client.BeforeRequest = func(module, action string, param map[string]interface{}) error {
40+
client.BeforeRequest = func(module, action string, values url.Values) error {
4241
// ...
4342
}
44-
client.AfterRequest = func(module, action string, param map[string]interface{}, outcome interface{}, requestErr error) {
43+
client.AfterRequest = func(module, action string, values url.Values, outcome interface{}, requestErr error) error {
4544
// ...
4645
}
4746

@@ -61,20 +60,18 @@ func main() {
6160
}
6261
```
6362

64-
You may find full method list at [GoDoc](https://godoc.org/github.com/nanmu42/etherscan-api).
63+
You may find full method list at [GoDoc](https://godoc.org/github.com/timcki/etherscan-api/v2).
6564

6665
# Etherscan API Key
6766

6867
You may apply for an API key on [etherscan](https://etherscan.io/apis).
6968

70-
> The Etherscan Ethereum Developer APIs are provided as a community service and without warranty, so please just use what you need and no more. They support both GET/POST requests and a rate limit of 5 requests/sec (exceed and you will be blocked).
69+
> The Etherscan Ethereum Developer APIs are provided as a community service and without warranty, so please just use what you need and no more. They support both GET/POST requests and a rate limit of 5 requests/sec (exceed and you will be blocked).
7170
7271
# Paperwork Things
7372

74-
I am not from Etherscan and I just find their service really useful, so I implement this. :smile:
73+
This library is not affiliated with Etherscan.io, it's developed for internal use in TokenTax.
7574

7675
# License
7776

7877
Use of this work is governed by an MIT License.
79-
80-
You may find a license copy in project root.

README_ZH.md

Lines changed: 0 additions & 83 deletions
This file was deleted.

0 commit comments

Comments
 (0)