All Projects → nanmu42 → etherscan-api

nanmu42 / etherscan-api

Licence: MIT License
🎸 Golang client for Ethereum Etherscan API (and its families like BscScan) / Golang 以太坊 Etherscan API库(也支持同一家族的BscScan)

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to etherscan-api

etherscan-python
A minimal, yet complete, python API for Etherscan.io.
Stars: ✭ 335 (+165.87%)
Mutual labels:  eth, etherscan
sol-verifier
Verify Solidity smart contracts on Etherscan
Stars: ✭ 22 (-82.54%)
Mutual labels:  etherscan, etherscan-api
laravel-web3
Laravel SDK wrapper for the Web3 PHP API client that interacts with the Ethereum blockchain.
Stars: ✭ 85 (-32.54%)
Mutual labels:  eth
blog
My Tech Blog: about Rust / Golang / Python / Flutter / Blockchain etc.
Stars: ✭ 150 (+19.05%)
Mutual labels:  eth
HTML-Crypto-Currency-Chart-Snippets
💹 Simple HTML Snippets to create Tickers / Charts of Cryptocurrencies with the TradingView API 💹
Stars: ✭ 89 (-29.37%)
Mutual labels:  eth
howtrader
Howtrader is a crypto currency quant framework, you can easily develop, backtest and run your own strategy in real market. It also supports tradingview or other 3rd party signals, just simply send a post request and it will help trade automatically. Now it only support binance spot, futures and inverse futures exchange. It will support okex, ftx…
Stars: ✭ 294 (+133.33%)
Mutual labels:  eth
ethereum-dex
Decentralized exchange implementation for the 0xcert protocol on the Ethereum blockchain.
Stars: ✭ 18 (-85.71%)
Mutual labels:  eth
kunkka-match
高性能撮合引擎
Stars: ✭ 50 (-60.32%)
Mutual labels:  eth
vickitrix
Trigger crypto trades on GDAX with the Twitter stream
Stars: ✭ 30 (-76.19%)
Mutual labels:  eth
Open Crypto Tracker
Bitcoin / Alts private portfolio tracker, with email / text / alexa / telegram price alerts, charts, leverage support and much more.
Stars: ✭ 59 (-53.17%)
Mutual labels:  eth
gdax bot
gdax_bot - Micro dollar cost averaging for crypto
Stars: ✭ 57 (-54.76%)
Mutual labels:  eth
minerProxy
以太坊矿池代理,可以自定义抽水地址和比例 ,go语言编写,性能极高。挂几个盗版狗minerproxyeth/minerproxy和MinerPr0xy/MinerProxy和nicococococ/MinerProxyLite和CharIesOrz/minerProxy和ryu-shen/minerProxy都是盗版加料的,大家注意分辨,可以查看git commits记录查看谁先发布的
Stars: ✭ 335 (+165.87%)
Mutual labels:  eth
trinity-eth
No description or website provided.
Stars: ✭ 14 (-88.89%)
Mutual labels:  eth
web3
⚡️ Web3 PHP is a supercharged PHP API client that allows you to interact with a generic Ethereum RPC.
Stars: ✭ 609 (+383.33%)
Mutual labels:  eth
minerProxy
以太坊矿池代理,可以自定义抽水地址和比例 ,支持热修改抽水比例。go语言编写,性能极高,唯一正版,明码标价开发费,拒绝暗抽!!!!!!
Stars: ✭ 183 (+45.24%)
Mutual labels:  eth
Wallet3
A secure mobile wallet for web3
Stars: ✭ 13 (-89.68%)
Mutual labels:  eth
go-dc-wallet
交易所收提币功能
Stars: ✭ 76 (-39.68%)
Mutual labels:  eth
bybit-api
Node.js connector for the Bybit APIs and WebSockets, with TypeScript & browser support.
Stars: ✭ 69 (-45.24%)
Mutual labels:  eth
reference-client
*client* reference implementation of subscriptions on Ethereum
Stars: ✭ 15 (-88.1%)
Mutual labels:  eth
uniswap-python
🦄 The unofficial Python client for the Uniswap exchange.
Stars: ✭ 533 (+323.02%)
Mutual labels:  eth

English | 中文

etherscan-api

GoDoc CI status codecov Go Report Card

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. 😉

Usage

go get github.com/nanmu42/etherscan-api

Create an API instance and off you go. 🚀

import (
	"github.com/nanmu42/etherscan-api"
	"fmt"
)

func main() {
	// create a API client for specified ethereum net
	// there are many pre-defined network in package
	client := etherscan.New(etherscan.Mainnet, "[your API key]")
	
	// or, if you are working with etherscan-family API like BscScan
	//
	// client := etherscan.NewCustomized(etherscan.Customization{
	// Timeout:       15 * time.Second,
	// Key:           "You key here",
	// BaseURL:       "https://api.bscscan.com/api?",
	// Verbose:       false,
	// })

	// (optional) add hooks, e.g. for rate limit
	client.BeforeRequest = func(module, action string, param map[string]interface{}) error {
		// ...
	}
	client.AfterRequest = func(module, action string, param map[string]interface{}, outcome interface{}, requestErr error) {
		// ...
	}

	// check account balance
	balance, err := client.AccountBalance("0x281055afc982d96fab65b3a49cac8b878184cb16")
	if err != nil {
		panic(err)
	}
	// balance in wei, in *big.Int type
	fmt.Println(balance.Int())

	// check token balance
	tokenBalance, err := client.TokenBalance("contractAddress", "holderAddress")

	// check ERC20 transactions from/to a specified address
	transfers, err := client.ERC20Transfers("contractAddress", "address", startBlock, endBlock, page, offset)
}

You may find full method list at GoDoc.

Etherscan API Key

You may apply for an API key on etherscan.

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).

Paperwork Things

I am not from Etherscan and I just find their service really useful, so I implement this. 😄

License

Use of this work is governed by an MIT License.

You may find a license copy in project root.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].