Skip to content

API written in Go to query and interact with any EVM blockchain

Notifications You must be signed in to change notification settings

aglawson/Web3API-Go

Repository files navigation

Web3 API (GO)

A full Web3 API that allows users to query and interact with the blockchain, as well as generate new wallets.

API URL

You can test this API for yourself by using this base link. Add the desired endpoint and necessary parameters.

Endpoints

  • /get_block

    • Params:
      • network - string representing desired network (ex. mainnet, goerli, polygon-mainnet)
        • will default to ethereum mainnet if undefined
    • Returns the latest block on Ethereum mainnet
  • /get_balance

    • Params:
      • network - string representing desired network (ex. mainnet, goerli, polygon-mainnet)
        • will default to ethereum mainnet if undefined
      • wallet - string wallet address
    • Returns the balance of provided wallet address (wallet)
  • /create_wallet

    • Returns the private key and public address of a newly generated wallet
    • NOTE: do not use except on a secure local server.
  • /get_gas_price

    • Params:
      • network - string representing desired network (ex. mainnet, goerli, polygon-mainnet)
        • will default to ethereum mainnet if undefined
    • Returns the current gas price of a given network
  • /get_token_balance

    • Params:
      • network - string representing desired network (ex. mainnet, goerli, polygon-mainnet)
        • will default to ethereum mainnet if undefined
      • wallet - address of asset owner
      • contract - smart contract of asset
        • NOTE: can be either an NFT or an ERC20 token
    • Returns the current number of assets under contract that wallet owns on network
  • /get_token_supply

    • Params:
      • network - string representing desired network (ex. mainnet, goerli, polygon-mainnet)
        • will default to ethereum mainnet if undefined
      • contract - smart contract of asset
        • NOTE: can be either NFT or ERC20 token
  • /is_token_holder

    • Params:
      • wallet - address of wallet in question
      • network - string representing desired network (ex. mainnet, goerli, polygon-mainnet)
        • will default to ethereum mainnet if undefined
      • contract - smart contract of asset
        • NOTE: can be either NFT or ERC20 token
    • Returns boolean value. If wallet owns 1 or more tokens from contract -> true; otherwise -> false;
  • /get_coin_price

    • Params:
      • from: name of coin to inquire about (supported: 'ethereum')
      • to: name of currency to convert to (supported: 'usd', 'vnd')
    • Returns float representing the amount of 'to' that equates to 1 'from'
  • /write_coin_price

    • Params:
      • from: name of coin to inquire about (eg. 'ethereum')
      • to: name of currency to convert to (eg. 'usd', 'vnd')
    • Writes to connected Firestore DB the current amount of 'to' that equates to 1 'from'
  • /get_token_metadata

    • Params:
      • contract: address of token smart contract
      • network: network where contract is deployed
        • will default to ethereum mainnet if undefined
    • Returns a json object of token metadata {name, symbol, totalSupply, uri}

About

API written in Go to query and interact with any EVM blockchain

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages