Carbon APIs

There are a few ways to interact with the Carbon Core blockchain through your DeFi application. The simplest way would be to use the official TypeScript / Javascript SDK here:

Alternatively, there are APIs accessible for direct interaction with Carbon nodes, offering improved control and reliability.

Here are the APIs available:

  • Carbon WebSocket: This API streams formatted data on the state of all Carbon modules, rather than exposing the raw state of the blockchain. However, transactions cannot be sent through this API. This API is ideal for applications such as trading bots, decentralized exchanges, and explorers.

  • Carbon / Cosmos-SDK GRPC: This API enables the sending of transactions, and provides queries for i) Cosmos-SDK core module states, ii) Carbon module states, as well as iii) Additional off-chain data stored by Carbon nodes running the off-chain persistence module. For applications that do not support GRPC, a GRPC-gateway is available, allowing the same GRPC endpoints to be accessed via REST.

  • Tendermint RPC / WebSocket: This API is useful for querying lower-level information about the Carbon Core blockchain.

  • Command Line Interface: You may also use the CLI that comes with the Carbon node binary to query the blockchain or send transactions.

  • Carbon Insights: This is a separate API service that aggregates time-series data and statistical information.

For a reliable end-user experience, we recommend utilizing a combination of WebSockets (for monitoring state) and GRPC (for sending transactions).

If you are developing an extensive application or serving a large user base, it is advisable to run your own Testnet or Mainnet node to enhance reliability and scalability.

Last updated