Blok3 - Cross-Chain Cryptocurrency API

This page contains examples of using the GraphQL API to fetch different kinds of data. Simply press 'Execute' to execute the query and show the output.

Last available block

Returns the last available block for Ethereum blockchain
{
  ethereum {
    status {
      blk
    }
  }
}

Last 5 transactions

Returns 5 most recent transactions that have affected vitalik's address
{
  ethereum {
    transactions(addr: "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045", first: 5) {
      cur
      obj {
        hash
        src
        dst
        amt
      }
    }
  }
}

ETH balance

Returns ETH balance for vitalik's address (ETH balances are always first). Note the paging cursor returned in cur field.
{
  ethereum {
    balances(addr: "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045", first: 1) {
      cur
      obj {
        amt
      }
    }
  }
}

ERC Balances

Returns ERC20 & NFT balances for vitalik's address. We use paging to skip over ETH balance.
{
  ethereum {
    balances(
      addr: "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
      first: 5
      after: "1"
    ) {
      cur
      obj {
        ctr
        tok
        amt
        ast {
          ... on FungibleAsset {
            ctr
            nme
            sym
            dec
          }
        }
      }
    }
  }
}

NFT metadata

Returns available metadata for bored ape NFTs. If the metadata is not available, it queues the requested NFTs for processing. They should be available for subsequent queries.
{
  ethereum {
    contractNfts(contract: "0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d", first: 3) {
      cur
      obj {
        ctr
        uri
        tok
        nme
        sym
        dsc
        img
        anm
        att
      }
    }
  }
}