Skip to content

Commit 61f837b

Browse files
authored
Chain docs revamp: update quickstarts and formatting (#891)
* update quickstarts * revert slug changes * further edits
1 parent 5427875 commit 61f837b

File tree

122 files changed

+3908
-5983
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

122 files changed

+3908
-5983
lines changed
Lines changed: 63 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,101 +1,98 @@
11
---
22
title: Abstract API Quickstart
3-
description: Get started building on Abstract and using the JSON-RPC API
4-
subtitle: Get started building on Abstract and using the JSON-RPC API
3+
description: How to get started building on Abstract using Alchemy
4+
subtitle: How to get started building on Abstract using Alchemy
55
slug: reference/abstract-api-quickstart
66
---
77

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

1013
Abstract is a Layer 2 (L2) network built on top of Ethereum, designed to securely power consumer-facing blockchain applications at scale with low fees and fast transaction speeds.
1114

12-
## What is the Abstract API?
13-
1415
The Abstract API allows interaction with the Abstract network through a set of JSON-RPC methods. Its design is familiar to developers who have worked with Ethereum's JSON-RPC APIs, making it intuitive and straightforward to use.
1516

16-
## Getting Started Instructions
17-
18-
### 1. Choose a Package Manager (npm or yarn)
19-
20-
Select a package manager to manage your project's dependencies. Choose between `npm` and `yarn` based on your preference or project requirements.
17+
## Send Your First Request on Alchemy
2118

22-
| npm | yarn |
23-
| ------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
24-
| Begin with `npm` by following the [npm documentation](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm). | For `yarn`, refer to [yarn's installation guide](https://classic.yarnpkg.com/lang/en/docs/install). |
19+
Let's use the [`viem`](https://www.npmjs.com/package/viem) package to create an Abstract client connected to Alchemy and fetch the latest block number!
2520

26-
### 2. Set Up Your Project
21+
<CodeGroup>
22+
```text npm
23+
npm install --save viem
24+
```
2725

28-
Open your terminal and execute the following commands to create and initialize your project:
26+
```text yarn
27+
yarn add viem
28+
```
29+
</CodeGroup>
2930

30-
```shell
31-
mkdir abstract-api-quickstart
32-
cd abstract-api-quickstart
33-
npm init --yes
34-
```
31+
## Create Client Connected to Alchemy
3532

36-
```shell
37-
mkdir abstract-api-quickstart
38-
cd abstract-api-quickstart
39-
yarn init --yes
33+
<CodeGroup>
34+
```js
35+
import { createPublicClient, http } from "viem";
36+
import { abstract } from "viem/chains";
37+
38+
const client = createPublicClient({
39+
chain: abstract,
40+
transport: http("https://abstract-mainnet.g.alchemy.com/v2/YOUR_ALCHEMY_API_KEY"),
41+
});
4042
```
43+
</CodeGroup>
4144

42-
This creates a new directory named `abstract-api-quickstart` and initializes a Node.js project within it.
43-
44-
### 3. Make Your First Request
45+
Now that you've created a client connected to Alchemy, you can continue with some basics:
4546

46-
Install Axios, a popular HTTP client, to make API requests:
47+
## Get Latest Block Number
4748

4849
<CodeGroup>
49-
```bash bash
50-
npm install axios
51-
# Or with yarn
52-
# yarn add axios
53-
```
50+
```js
51+
const blockNumber = await client.getBlockNumber();
52+
console.log("Current block number:", blockNumber);
53+
```
5454
</CodeGroup>
5555

56-
Create an `index.js` file in your project directory and paste the following code:
56+
## Get an Address Balance
5757

5858
<CodeGroup>
59-
```javascript javascript
60-
const axios = require('axios');
61-
62-
const url = `https://abstract-mainnet.g.alchemy.com/v2/${your-api-key}`;
63-
64-
const payload = {
65-
jsonrpc: '2.0',
66-
id: 1,
67-
method: 'eth_blockNumber',
68-
params: []
69-
};
70-
71-
axios.post(url, payload)
72-
.then(response => {
73-
console.log('Latest Block:', response.data.result);
74-
})
75-
.catch(error => {
76-
console.error(error);
77-
});
78-
```
59+
```js
60+
const balance = await client.getBalance({ address: "0xab5801a7d398351b8be11c439e05c5b3259aec9b" });
61+
console.log("Balance (ETH):", Number(balance) / 1e18);
62+
```
7963
</CodeGroup>
8064

81-
Remember to replace `your-api-key` with your actual Alchemy API key that you can get from your [Alchemy dashboard](https://dashboard.alchemy.com/signup).
65+
## Read Block Data
8266

83-
### 4. Run Your Script
67+
<CodeGroup>
68+
```js
69+
const block = await client.getBlock({
70+
blockNumber: blockNumber, // from previous example
71+
});
72+
console.log(block);
73+
```
74+
</CodeGroup>
8475

85-
Execute your script to make a request to the Abstract mainnet:
76+
## Fetch a Transaction by Hash
8677

87-
<CodeGroup>
88-
```bash bash
89-
node index.js
90-
```
78+
<CodeGroup>
79+
```js
80+
const tx = await client.getTransaction({ hash: "0xYOUR_TX_HASH" });
81+
console.log(tx);
82+
```
9183
</CodeGroup>
9284

93-
You should see the latest block information from Abstract's mainnet outputted to your console:
85+
## Fetch Transaction Receipt
9486

95-
```shell
96-
Latest Block: 0x...
87+
<CodeGroup>
88+
```js
89+
const receipt = await client.getTransactionReceipt({
90+
hash: "0xYOUR_TX_HASH"
91+
});
92+
console.log(receipt);
9793
```
94+
</CodeGroup>
9895

99-
## Next Steps
96+
# Abstract APIs
10097

101-
Congratulations! You've made your first request to the Abstract network. You can now explore the various [JSON-RPC methods available on Abstract](/reference/abstract-api-endpoints) and start building your dApps on this innovative platform.
98+
For the full list of Abstract APIs, see the [Abstract API Endpoints](/docs/chains#abstract-apis).

fern/api-reference/adi/adi-api-faq.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Yes, ADI is EVM compatible.
2121
ADI uses the JSON-RPC API standard. This API is crucial for any blockchain interaction on the ADI network, allowing users to read block/transaction data, query chain information, execute smart contracts, and store data on-chain.
2222

2323
## What methods are supported on ADI?
24-
ADI supports standard Ethereum JSON-RPC methods. Some chain-specific methods may vary. Please check the ADI API endpoints documentation for a complete list.
24+
ADI supports standard Ethereum JSON-RPC methods. Some chain-specific methods may vary. Please check the [ADI API Endpoints](/docs/chains#adi-apis) for a complete list.
2525

2626
## What is an ADI API key?
2727
When accessing the ADI network via a node provider like Alchemy, ADI developers use an API key to send transactions and retrieve data from the network. For the best development experience, we recommend that you [sign up for a free API key](https://dashboard.alchemy.com/signup)!
Lines changed: 65 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,117 +1,106 @@
11
---
22
title: ADI API Quickstart
3-
description: How to get started building on ADI and using the JSON-RPC API
4-
subtitle: How to get started building on ADI and using the JSON-RPC API
3+
description: How to get started building on ADI using Alchemy
4+
subtitle: How to get started building on ADI using Alchemy
55
slug: reference/adi-api-quickstart
66
---
77

8-
*To use the ADI API you'll need to [create a free Alchemy account](https://dashboard.alchemy.com/signup) first!*
9-
10-
## Introduction
8+
<Tip title="Don't have an API key?" icon="star">
9+
Build faster with production-ready APIs, smart wallets and rollup infrastructure across 70+ chains. Create your free Alchemy API key and{" "}
10+
<a href="https://dashboard.alchemy.com/signup">get started today</a>.
11+
</Tip>
1112

1213
ADI Network is an EVM-compatible Layer 2 that leverages cryptographic Zero-Knowledge validity proofs (ZKPs) to ensure both security and efficiency in transaction processing. ADI is enabling seamless integration between traditional finance, crypto ecosystems, and regulated markets.
1314

14-
## What is the ADI API?
15-
1615
The ADI API allows interaction with the ADI network through a set of JSON-RPC methods. Its design is familiar to developers who have worked with Ethereum's JSON-RPC APIs, making it intuitive and straightforward to use.
1716

18-
## Getting Started Instructions
19-
20-
### 1. Choose a Package Manager (npm or yarn)
17+
## Send Your First Request on Alchemy
2118

22-
Select a package manager to manage your project's dependencies. Choose between `npm` and `yarn` based on your preference or project requirements.
19+
Let's use the [`viem`](https://www.npmjs.com/package/viem) package to create an ADI client connected to Alchemy and fetch the latest block number!
2320

2421
<CodeGroup>
25-
```shell npm
26-
# Begin with npm by following the npm documentation
27-
# https://docs.npmjs.com/downloading-and-installing-node-js-and-npm
22+
```text npm
23+
npm install --save viem
2824
```
2925

30-
```shell yarn
31-
# For yarn, refer to yarn's installation guide
32-
# https://classic.yarnpkg.com/lang/en/docs/install
26+
```text yarn
27+
yarn add viem
3328
```
3429
</CodeGroup>
3530

36-
### 2. Set Up Your Project
37-
38-
Open your terminal and execute the following commands to create and initialize your project:
31+
## Create Client Connected to Alchemy
3932

4033
<CodeGroup>
41-
```shell npm
42-
mkdir adi-api-quickstart
43-
cd adi-api-quickstart
44-
npm init --yes
45-
```
46-
47-
```shell yarn
48-
mkdir adi-api-quickstart
49-
cd adi-api-quickstart
50-
yarn init --yes
51-
```
34+
```js
35+
import { createPublicClient, http, defineChain } from "viem";
36+
37+
const adiTestnet = defineChain({
38+
id: 12227332,
39+
name: "ADI Testnet",
40+
nativeCurrency: { name: "ETH", symbol: "ETH", decimals: 18 },
41+
rpcUrls: {
42+
default: { http: ["https://adi-testnet.g.alchemy.com/v2/YOUR_ALCHEMY_API_KEY"] },
43+
},
44+
});
45+
46+
const client = createPublicClient({
47+
chain: adiTestnet,
48+
transport: http("https://adi-testnet.g.alchemy.com/v2/YOUR_ALCHEMY_API_KEY"),
49+
});
50+
```
5251
</CodeGroup>
5352

54-
This creates a new directory named `adi-api-quickstart` and initializes a Node.js project within it.
53+
Now that you've created a client connected to Alchemy, you can continue with some basics:
5554

56-
### 3. Make Your First Request
57-
58-
Install Axios, a popular HTTP client, to make API requests:
55+
## Get Latest Block Number
5956

6057
<CodeGroup>
61-
```shell npm
62-
npm install axios
63-
```
64-
65-
```shell yarn
66-
yarn add axios
67-
```
58+
```js
59+
const blockNumber = await client.getBlockNumber();
60+
console.log("Current block number:", blockNumber);
61+
```
6862
</CodeGroup>
6963

70-
Create an `index.js` file in your project directory and paste the following code:
64+
## Get an Address Balance
7165

7266
<CodeGroup>
73-
```javascript index.js
74-
const axios = require('axios');
75-
76-
const url = 'https://adi-testnet.g.alchemy.com/v2/${your-api-key}';
77-
78-
const payload = {
79-
jsonrpc: '2.0',
80-
id: 1,
81-
method: 'eth_blockNumber',
82-
params: []
83-
};
84-
85-
axios.post(url, payload)
86-
.then(response => {
87-
console.log('Latest Block:', response.data.result);
88-
})
89-
.catch(error => {
90-
console.error(error);
91-
});
92-
```
67+
```js
68+
const balance = await client.getBalance({ address: "0xab5801a7d398351b8be11c439e05c5b3259aec9b" });
69+
console.log("Balance (ETH):", Number(balance) / 1e18);
70+
```
9371
</CodeGroup>
9472

95-
Remember to replace `your-api-key` with your actual Alchemy API key that you can get from your [Alchemy dashboard](https://dashboard.alchemy.com/signup).
73+
## Read Block Data
9674

97-
### 4. Run Your Script
75+
<CodeGroup>
76+
```js
77+
const block = await client.getBlock({
78+
blockNumber: blockNumber, // from previous example
79+
});
80+
console.log(block);
81+
```
82+
</CodeGroup>
9883

99-
Execute your script to make a request to the ADI network:
84+
## Fetch a Transaction by Hash
10085

101-
<CodeGroup>
102-
```shell shell
103-
node index.js
104-
```
86+
<CodeGroup>
87+
```js
88+
const tx = await client.getTransaction({ hash: "0xYOUR_TX_HASH" });
89+
console.log(tx);
90+
```
10591
</CodeGroup>
10692

107-
You should see the latest block information from ADI's network outputted to your console:
93+
## Fetch Transaction Receipt
10894

10995
<CodeGroup>
110-
```shell shell
111-
Latest Block: 0x...
112-
```
96+
```js
97+
const receipt = await client.getTransactionReceipt({
98+
hash: "0xYOUR_TX_HASH"
99+
});
100+
console.log(receipt);
101+
```
113102
</CodeGroup>
114103

115-
## Next Steps
104+
# ADI APIs
116105

117-
Congratulations! You've made your first request to the ADI network. You can now explore the various JSON-RPC methods available on ADI and start building your dApps on this innovative platform.
106+
For the full list of ADI APIs, see the [ADI API Endpoints](/docs/chains#adi-apis).

fern/api-reference/anime/anime-api-faq.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Developers should use the **Anime Sepolia** testnet for Anime. This testnet prov
4848

4949
## What methods does Alchemy support for the Anime API?
5050

51-
You can find the list of all the methods Alchemy support for the Anime API on Anime API Endpoints page.
51+
You can find the list of all the methods Alchemy supports for the Anime API on the [Anime API Endpoints](/docs/chains#anime-apis) page.
5252

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

0 commit comments

Comments
 (0)