Blog

  1. Blog
  2. Get Ethereum data by GRPC
šŸ—“ Dec 10, 2022 | šŸ•‘ 4 min

GRPC Contract for Interaction with Ethereum

Overview

This GRPC contract enables you to obtain cryptocurrency data from various blockchain networks (etherium, polygon, near, binance smart chain, tron) for use in your web3 applications.

Specifically, you can retrieve balance information and transaction history for ERC20 tokens on the Ethereum blockchain.

Table of contents

Latest Version

You can access the latest version of the contract here:

wget https://raw.githubusercontent.com/cryptomation/grpc-contract/main/universal-api.proto
copy

Usage

To use the contract, follow these steps:

  • First you need to create api keys for needed network here: šŸ‘‰ CryptoMation/Console
  • Download proto file from this repository: šŸ‘‰ CryptoMation/grpc-contract
  • Compile proto file with grpc compiler: šŸ‘‰ protoc --go_out=plugins=grpc:. universal-api.proto

Available Methods

  • getBalance - retrieves the balance of an account in the network.
  • getTransactions - retrieves the transaction history (include erc20) of an account in the network.

Example: Retrieving Transaction History on Etherium blockchain

āš  Possible values for network param: near, near-testnet, near-mainnet, etherium, polygon, tron

āš  Note that you must have grpcurl to run this example.

grpcurl -plaintext -d '{"api_key": "insert_you_api_key", "network":"ethereum", "address": "0xdec0de7e6ed3ee7bb3a2c0baae7827d101d1ec20"}' grpc.cryptomation.com com.cryptomation.universal.api.v1.grpc.UniversalCryptoApi/getTransactions
copy

Example: Retrieving Balance Information on Etherium blockchain

āš  Possible values for network param: near, near-testnet, near-mainnet, etherium, polygon, tron

āš  Note that you must have grpcurl to run this example.

grpcurl -plaintext -d '{"api_key": "insert_you_api_key", "network":"etherium", "address": "0xdec0de7e6ed3ee7bb3a2c0baae7827d101d1ec20"}' grpc.cryptomation.com com.cryptomation.universal.api.v1.grpc.UniversalCryptoApi/getBalance
copy

More info?

Much more info about our API method you could found on our docs!


Ready to get started?

Our api help your project gain easy access to a sea of crypto data.

If you want to try our Universal API, please enter your email or login from Google Gmail:

Continue with