All Projects β†’ hunterlong β†’ Tokenbalance

hunterlong / Tokenbalance

Licence: apache-2.0
Simple Ethereum API to get your ERC20 Token Balance along with useful information

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Tokenbalance

Uniswap V2 Periphery
🎚 Peripheral smart contracts for interacting with Uniswap V2
Stars: ✭ 267 (+63.8%)
Mutual labels:  ethereum, cryptocurrency, erc20
Ethlist
The Comprehensive Ethereum Reading List
Stars: ✭ 3,576 (+2093.87%)
Mutual labels:  ethereum, cryptocurrency, ethereum-contract
Trust Ray
☁️ API for the Trust Wallet. Project no longer supported and current version used as source of transactions and address tokens in Blockatlas https://github.com/trustwallet/blockatlas/blob/master/config.yml#L64
Stars: ✭ 172 (+5.52%)
Mutual labels:  ethereum, cryptocurrency, erc20
Ico Contracts
Ethereum smart contracts that have been used during successful ICOs
Stars: ✭ 160 (-1.84%)
Mutual labels:  ethereum, erc20, ethereum-contract
Cryptocurrency Icons
A set of icons for all the main cryptocurrencies and altcoins, in a range of styles and sizes.
Stars: ✭ 2,116 (+1198.16%)
Mutual labels:  ethereum, cryptocurrency, erc20
Basic Attention Token Crowdsale
Basic Attention Token
Stars: ✭ 160 (-1.84%)
Mutual labels:  ethereum, erc20, ethereum-contract
Uniswap V1
🐍Uniswap V1 smart contracts
Stars: ✭ 313 (+92.02%)
Mutual labels:  ethereum, cryptocurrency, erc20
Uniswap V2 Core
πŸŽ› Core smart contracts of Uniswap V2
Stars: ✭ 889 (+445.4%)
Mutual labels:  ethereum, cryptocurrency, erc20
Eltwallet
Non-custodial decentralized mobile wallet
Stars: ✭ 88 (-46.01%)
Mutual labels:  ethereum, cryptocurrency, erc20
Etherscan Ml
Python Data Science and Machine Learning Library for the Ethereum and ERC-20 Blockchain
Stars: ✭ 55 (-66.26%)
Mutual labels:  ethereum, cryptocurrency, erc20
Multicurrencywallet
Bitcoin, Ethereum, ERC20 crypto wallets with Atomic Swap exchange. Release announce: https://twitter.com/SwapOnlineTeam/status/1321844352369500160
Stars: ✭ 136 (-16.56%)
Mutual labels:  ethereum, cryptocurrency, erc20
Eden Smart Contracts
EDEN - EDN Smart Token & Smart Contracts
Stars: ✭ 109 (-33.13%)
Mutual labels:  ethereum, erc20, ethereum-contract
Web3 By Example
Node.js with Web3 javascript examples for getting basic information (transactions, balances, network stats, and tokens) from the Ethereum blockchain.
Stars: ✭ 156 (-4.29%)
Mutual labels:  ethereum, erc20, geth
Alpha Wallet Ios
An advanced Ethereum mobile wallet
Stars: ✭ 140 (-14.11%)
Mutual labels:  ethereum, erc20
Blockchainbooks.github.io
Blockchain Books
Stars: ✭ 139 (-14.72%)
Mutual labels:  ethereum, cryptocurrency
Status Network Token
Smart Contracts for the Status Contribution Period, along with Genesis and Network Tokens
Stars: ✭ 138 (-15.34%)
Mutual labels:  ethereum, cryptocurrency
Peatiocryptoexchange
An open-source Crypto-Currency exchange. Peatio v3.0 Coming Soon !
Stars: ✭ 141 (-13.5%)
Mutual labels:  ethereum, cryptocurrency
My Token
πŸ“ˆTrack token prices of your favorite exchanges in terminal!
Stars: ✭ 141 (-13.5%)
Mutual labels:  ethereum, cryptocurrency
Nsfminer
No Fee Ethash miner for AMD and Nvidia
Stars: ✭ 141 (-13.5%)
Mutual labels:  ethereum, cryptocurrency
Ebtc
eBitcoin (eBTC) is an ERC20 token. Its primary utility is to provide an easy & fast payment solution. Its edge over other tokens is that it is capable of sending up to 255 payments in a single transaction.
Stars: ✭ 149 (-8.59%)
Mutual labels:  ethereum, cryptocurrency

TokenBalance

TokenBalance API Build Status Docker Build Status Coverage Status GoDoc

TokenBalance is an easy to use public API and application that will output your ERC20 Token balance without any troubles. You can run TokenBalance on your local computer or you can use api.tokenbalance.com to easily parse your erc20 token balances. Connects to your local geth IPC and prints out a simple JSON response for ethereum token balances. Runs on port 8080 by default if you wish to run locally.

Server Status and Uptime

You can view the current status of Token Balance along with API latency information on our status page. This status page logs the Ethereum Mainnet, Ropsten testnet, and Rinkeby testnet.

https://status.tokenbalance.com

Installing Token Balance

You don't need to compile Token Balance from source anymore! All you need to do is go to Releases in this repo and download the binary that is built for your OS. Once you've downloaded, rename the file to tokenbalance for ease if use. On Mac or Linux move this file with the command mv tokenbalance /usr/local/bin/tokenbalance, you should be able to run the application from anywhere now.

Token Balance and Token Info (/token)

To fetch information about your balance, token details, and ETH balance use the follow API call in a simple HTTP GET or CURL. The response is in JSON so you can easily parse what you need. Replace TOKEN_ADDRESS with the contract address of the ERC20 token, and replace ETH_ADDRESS with your address.

Ethereum Mainnet
https://api.tokenbalance.com/token/TOKEN_ADDRESS/ETH_ADDRESS
Ethereum Ropsten Testnet
https://test.tokenbalance.com/token/TOKEN_ADDRESS/ETH_ADDRESS
Ethereum Rinkeby Testnet
https://rinkeby.tokenbalance.com/token/TOKEN_ADDRESS/ETH_ADDRESS
  • Response (JSON)
{
    "name": "Kin",
    "wallet": "0x393c82c7Ae55B48775f4eCcd2523450d291f2418",
    "symbol": "KIN",
    "decimals": 18,
    "balance": "15788648",
    "eth_balance": "0.217960852347180212",
    "block": 4274167
}

Only Token Balance (/balance)

This API response will only show you the ERC20 token balance in plain text. Perfect for ultra simple parsing.

https://api.tokenbalance.com/balance/TOKEN_ADDRESS/ETH_ADDRESS
  • Response (PLAIN TEXT)
1022.503000

Examples

Run with Docker

You can easily start Token Balance with Docker. Register for a free Infura.io API Key to use Token Balance without downloading the ethereum blockchain.

docker run -p 8080:8080 -e GETH_SERVER=https://mainnet.infura.io/APIKEY -d hunterlong/tokenbalance

Use as Golang Package

You can use Token Balance as a typical Go Language package if you you like to implement ERC20 functionality into your own application.

go get github.com/hunterlong/tokenbalance
First you'll want to connect to your Geth server or IPC
import (
    "github.com/hunterlong/tokenbalance"
)

func main() {
	// connect to your Geth Server
    configs = &tokenbalance.Config{
         GethLocation: "https://eth.coinapp.io",
         Logs:         true,
    }
    configs.Connect()

    // insert a Token Contract address and Wallet address
    contract := "0x86fa049857e0209aa7d9e616f7eb3b3b78ecfdb0"
    wallet := "0xbfaa1a1ea534d35199e84859975648b59880f639"

    // query the blockchain and wallet details
    token, err := tokenbalance.New(contract, wallet)

    // Token Balance will respond back useful things
    token.BalanceString()  // "600000.0"
    token.ETHString()      // "1.020095885777777767"
    token.Name             // "OmiseGO"
    token.Symbol           // "OMG"
    token.Decimals         // 18
    token.Balance          // big.Int() (token balance)
    token.ETH              // big.Int() (ether balance)
}

Implement in Google Sheets

If your familiar with Google Sheets, you can easily fetch all of your cryptocurrency balances within 1 spreadsheet. All you need to do is make a cell with the value below.

=ImportData("https://api.tokenbalance.com/balance/0xd26114cd6EE289AccF82350c8d8487fedB8A0C07/0xf9578adc61d07671f536d50afc5800232fc9fd86")

Simple as that! Get creative an use Coin Market Cap's API to fetch the price and multiply with your balance to make a portfolio of your cryptocurrencies!

Implement in your App

Feel free to use the TokenBalance API server to fetch ERC20 token balances and details. We do have a header set that will allow you to call the API via AJAX. Access-Control-Allow-Origin "*" The server may limit your requests if you do more than 60 hits per minute.

Run Your Own Server

TokenBalance isn't just an API, it's an opensource HTTP server that you can run on your own computer or server.

Installation

Ubuntu 16.04
git clone https://github.com/hunterlong/tokenbalance
cd tokenbalance
go get && go build ./cmd

Start TokenBalance Server

tokenbalance start --geth="/ethereum/geth.ipc"

This will create a light weight HTTP server will respond balance information about a ethereum contract token.

Optional Config

tokenbalance start --geth="/ethereum/geth.ipc" --port 8080 --ip 127.0.0.1

CURL Request

CONTRACT=0xa74476443119A942dE498590Fe1f2454d7D4aC0d
ETH_ADDRESS=0xda0aed568d9a2dbdcbafc1576fedc633d28eee9a

curl https://api.tokenbalance.com/token/$CONTRACT/$ETH_ADDRESS

Response

{
    "name": "Kin",
    "wallet": "0x393c82c7Ae55B48775f4eCcd2523450d291f2418",
    "symbol": "KIN",
    "decimals": 18,
    "balance": "15788648",
    "eth_balance": "0.217960852347180212",
    "block": 4274167
}
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].