diff --git a/content/api-reference/cronos/cronos-api-faq.mdx b/content/api-reference/cronos/cronos-api-faq.mdx new file mode 100644 index 000000000..503667c15 --- /dev/null +++ b/content/api-reference/cronos/cronos-api-faq.mdx @@ -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). diff --git a/content/api-reference/cronos/cronos-api-quickstart.mdx b/content/api-reference/cronos/cronos-api-quickstart.mdx new file mode 100644 index 000000000..e721302f6 --- /dev/null +++ b/content/api-reference/cronos/cronos-api-quickstart.mdx @@ -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 +--- + + + Build faster with production-ready APIs, smart wallets and rollup infrastructure across 70+ chains. Create your free Alchemy API key and{" "} + get started today. + + +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. + + + ```text npm + npm install --save viem + ``` + + ```text yarn + yarn add viem + ``` + + +## Create a client connected to Alchemy + + +```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"), +}); +``` + + +Now that you've created a client connected to Alchemy, you can continue with some basics: + +## Get the latest block number + + +```js +const blockNumber = await client.getBlockNumber(); +console.log("Current block number:", blockNumber); +``` + + +## Get an address balance + + +```js +const balance = await client.getBalance({ address: "0xab5801a7d398351b8be11c439e05c5b3259aec9b" }); +console.log("Balance (CRO):", Number(balance) / 1e18); +``` + + +## Read block data + + +```js +const block = await client.getBlock({ + blockNumber: blockNumber, // from previous example +}); +console.log(block); +``` + + +## Fetch a transaction by hash + + +```js +const tx = await client.getTransaction({ hash: "0xYOUR_TX_HASH" }); +console.log(tx); +``` + + +## Fetch a transaction receipt + + +```js +const receipt = await client.getTransactionReceipt({ + hash: "0xYOUR_TX_HASH" +}); +console.log(receipt); +``` + + +# Cronos APIs + +For the full list of Cronos APIs, see the [Cronos API Endpoints](/docs/chains#cronos-apis). diff --git a/content/docs.yml b/content/docs.yml index 672125b51..7ffbbc5e3 100644 --- a/content/docs.yml +++ b/content/docs.yml @@ -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: