Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions content/api-reference/cronos/cronos-api-faq.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
title: Cronos API FAQ
description: Frequently asked questions about the Cronos API
subtitle: Frequently asked questions about the Cronos API
slug: reference/cronos-api-faq
---

## What is Cronos?

Cronos is a public, open-source, EVM-compatible blockchain launched by Crypto.com in 2021. Built with the Cosmos SDK and Ethermint, Cronos runs in parallel to the Crypto.org Chain and lets developers deploy Ethereum-based smart contracts and dApps with low fees and fast finality, using `$CRO` as its native gas token.

## What is the Cronos API?

The Cronos API lets you interact with the Cronos network through a set of JSON-RPC methods. It supports operations such as smart contract deployment, transaction processing, and data retrieval, so you can integrate Cronos functionality into your applications.

## How can I get started using the Cronos API?

For a step-by-step guide, check out the [Cronos API Quickstart](/docs/reference/cronos-api-quickstart).

## Is Cronos EVM compatible?

Yes, Cronos is EVM-compatible. You can deploy Ethereum-based smart contracts and applications on the Cronos network and reuse existing Ethereum development tools and workflows.

## What API does Cronos use?

Cronos uses the JSON-RPC API standard, the same standard used across the Ethereum ecosystem. This provides a familiar and efficient interface for blockchain interactions.

## What is a Cronos API key?

When you access the Cronos network through a node provider like Alchemy, you use an API key to send transactions and retrieve data. An API key ensures secure and authenticated access to the network.

For the best development experience, we recommend that you [sign up for a free API key](https://dashboard.alchemy.com/signup).

## Which libraries support Cronos?

As an EVM-compatible chain, Cronos supports popular Ethereum libraries such as [viem](https://viem.sh/), [ethers.js](https://docs.ethers.org/), and [web3.js](https://web3js.readthedocs.io/). You can reuse existing tooling and knowledge when building on Cronos.

## What programming languages work with Cronos?

Cronos supports Solidity for smart contract development due to its EVM compatibility. For offchain interactions, you can use JavaScript, TypeScript, or other common web development languages.

## What does Cronos use for gas?

Cronos uses `$CRO` as its native gas token. You need `$CRO` to pay for transaction fees on the network.

## What methods does Alchemy support for the Cronos API?

You can find the full list of methods supported by Alchemy for the Cronos API on the [Cronos API Endpoints](/docs/chains#cronos-apis) page.

## My question isn't here, where can I get help?

If you have any questions or feedback, contact us at support@alchemy.com or open a ticket in the [Alchemy Dashboard](https://dashboard.alchemy.com).
98 changes: 98 additions & 0 deletions content/api-reference/cronos/cronos-api-quickstart.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
---
title: Cronos API Quickstart
description: How to get started building on Cronos using Alchemy
subtitle: How to get started building on Cronos using Alchemy
slug: reference/cronos-api-quickstart
---

<Tip title="Don't have an API key?" icon="star">
Build faster with production-ready APIs, smart wallets and rollup infrastructure across 70+ chains. Create your free Alchemy API key and{" "}
<a href="https://dashboard.alchemy.com/signup">get started today</a>.
</Tip>

Cronos is a public, open-source, EVM-compatible blockchain launched by Crypto.com in 2021. Built with the Cosmos SDK and Ethermint, Cronos aims to deliver low fees, fast finality, and full compatibility with Ethereum tooling, using `$CRO` as its native gas token.

The Cronos API lets you interact with the Cronos network through a set of JSON-RPC methods. If you have worked with Ethereum's JSON-RPC APIs, the interface will feel familiar.

## Send your first request on Alchemy

Let's use the [`viem`](https://www.npmjs.com/package/viem) package to create a Cronos client connected to Alchemy and fetch the latest block number.

<CodeGroup>
```text npm
npm install --save viem
```

```text yarn
yarn add viem
```
</CodeGroup>

## Create a client connected to Alchemy

<CodeGroup>
```js
import { createPublicClient, http } from "viem";
import { cronos } from "viem/chains";

const client = createPublicClient({
chain: cronos,
transport: http("https://cronos-mainnet.g.alchemy.com/v2/YOUR_ALCHEMY_API_KEY"),
});
```
</CodeGroup>

Now that you've created a client connected to Alchemy, you can continue with some basics:

## Get the latest block number

<CodeGroup>
```js
const blockNumber = await client.getBlockNumber();
console.log("Current block number:", blockNumber);
```
</CodeGroup>

## Get an address balance

<CodeGroup>
```js
const balance = await client.getBalance({ address: "0xab5801a7d398351b8be11c439e05c5b3259aec9b" });
console.log("Balance (CRO):", Number(balance) / 1e18);
```
</CodeGroup>

## Read block data

<CodeGroup>
```js
const block = await client.getBlock({
blockNumber: blockNumber, // from previous example
});
console.log(block);
```
</CodeGroup>

## Fetch a transaction by hash

<CodeGroup>
```js
const tx = await client.getTransaction({ hash: "0xYOUR_TX_HASH" });
console.log(tx);
```
</CodeGroup>

## Fetch a transaction receipt

<CodeGroup>
```js
const receipt = await client.getTransactionReceipt({
hash: "0xYOUR_TX_HASH"
});
console.log(receipt);
```
</CodeGroup>

# Cronos APIs

For the full list of Cronos APIs, see the [Cronos API Endpoints](/docs/chains#cronos-apis).
4 changes: 4 additions & 0 deletions content/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1260,11 +1260,15 @@ navigation:

- section: Cronos
contents:
- page: Quickstart
path: api-reference/cronos/cronos-api-quickstart.mdx
- page: Cronos API Overview
path: api-reference/cronos/cronos-api-overview.mdx
- api: Cronos API Endpoints
api-name: cronos
slug: cronos-api-endpoints
- page: FAQ
path: api-reference/cronos/cronos-api-faq.mdx
slug: cronos
- tab: data
layout:
Expand Down
Loading