Skip to content

Commit cb7a9ef

Browse files
committed
update quickstarts
1 parent 3e5345f commit cb7a9ef

File tree

141 files changed

+4920
-6213
lines changed

Some content is hidden

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

141 files changed

+4920
-6213
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ The Abstract API allows interaction with the Abstract network through a set of J
1515

1616
## How can I get started using Abstract?
1717

18-
Explained in [Abstract API Quickstart](/reference/abstract-api-quickstart).
18+
Explained in [Abstract API Quickstart](/docs/abstract).
1919

2020
## Is Abstract EVM compatible?
2121

Lines changed: 69 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,101 +1,101 @@
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
5-
slug: reference/abstract-api-quickstart
3+
description: How to get started building on Abstract using Alchemy
4+
subtitle: How to get started building on Abstract using Alchemy
5+
slug: docs/abstract
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

10-
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.
13+
## Send Your First Request on Alchemy
1114

12-
## What is the Abstract API?
15+
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!
1316

14-
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.
15-
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.
21-
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). |
17+
<CodeGroup>
18+
```text npm
19+
npm install --save viem
20+
```
2521

26-
### 2. Set Up Your Project
22+
```text yarn
23+
yarn add viem
24+
```
25+
</CodeGroup>
2726

28-
Open your terminal and execute the following commands to create and initialize your project:
27+
## Create Client Connected to Alchemy
2928

30-
```shell
31-
mkdir abstract-api-quickstart
32-
cd abstract-api-quickstart
33-
npm init --yes
29+
<CodeGroup>
30+
```js
31+
import { createPublicClient, http } from "viem";
32+
import { abstract } from "viem/chains";
33+
34+
const client = createPublicClient({
35+
chain: abstract,
36+
transport: http("https://abstract-mainnet.g.alchemy.com/v2/YOUR_ALCHEMY_API_KEY"),
37+
});
3438
```
39+
</CodeGroup>
3540

36-
```shell
37-
mkdir abstract-api-quickstart
38-
cd abstract-api-quickstart
39-
yarn init --yes
40-
```
41+
Now that you've created a client connected to Alchemy, you can continue with some basics:
4142

42-
This creates a new directory named `abstract-api-quickstart` and initializes a Node.js project within it.
43+
## Get Latest Block Number
4344

44-
### 3. Make Your First Request
45+
<CodeGroup>
46+
```js
47+
const blockNumber = await client.getBlockNumber();
48+
console.log("Current block number:", blockNumber);
49+
```
50+
</CodeGroup>
4551

46-
Install Axios, a popular HTTP client, to make API requests:
52+
## Get an Address Balance
4753

4854
<CodeGroup>
49-
```bash bash
50-
npm install axios
51-
# Or with yarn
52-
# yarn add axios
53-
```
55+
```js
56+
const balance = await client.getBalance({ address: "0xab5801a7d398351b8be11c439e05c5b3259aec9b" });
57+
console.log("Balance (ETH):", Number(balance) / 1e18);
58+
```
5459
</CodeGroup>
5560

56-
Create an `index.js` file in your project directory and paste the following code:
61+
## Read Block Data
5762

5863
<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-
```
64+
```js
65+
const block = await client.getBlock({
66+
blockNumber: blockNumber, // from previous example
67+
});
68+
console.log(block);
69+
```
7970
</CodeGroup>
8071

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).
72+
## Fetch a Transaction by Hash
8273

83-
### 4. Run Your Script
74+
<CodeGroup>
75+
```js
76+
const tx = await client.getTransaction({ hash: "0xYOUR_TX_HASH" });
77+
console.log(tx);
78+
```
79+
</CodeGroup>
8480

85-
Execute your script to make a request to the Abstract mainnet:
81+
## Fetch Transaction Receipt
8682

8783
<CodeGroup>
88-
```bash bash
89-
node index.js
90-
```
84+
```js
85+
const receipt = await client.getTransactionReceipt({
86+
hash: "0xYOUR_TX_HASH"
87+
});
88+
console.log(receipt);
89+
```
9190
</CodeGroup>
9291

93-
You should see the latest block information from Abstract's mainnet outputted to your console:
92+
# Abstract Tutorials
9493

95-
```shell
96-
Latest Block: 0x...
97-
```
94+
Check out the following tutorials to learn how to build on Abstract:
95+
96+
* [Abstract API Endpoints](/reference/abstract-api-endpoints)
9897

99-
## Next Steps
98+
For full documentation on Web3 libraries, check out the official documentation:
10099

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.
100+
* [Viem Documentation](https://viem.sh) - Modern TypeScript interface for Ethereum
101+
* [Ethers.js Documentation](https://docs.ethers.org) - Complete Ethereum wallet implementation

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ slug: reference/adi-api-faq
99
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.
1010

1111
## How do I get started with ADI?
12-
Check out our [ADI API Quickstart guide](/reference/adi-api-quickstart) to get started building on ADI.
12+
Check out our [ADI API Quickstart guide](/docs/adi) to get started building on ADI.
1313

1414
## What is the ADI API?
1515
The ADI API allows developers to interface with the ADI mainnet. With this API, developers can execute transactions, query on-chain data, and interact with the ADI network, relying on a JSON-RPC standard.
Lines changed: 73 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -1,117 +1,109 @@
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
5-
slug: reference/adi-api-quickstart
3+
description: How to get started building on ADI using Alchemy
4+
subtitle: How to get started building on ADI using Alchemy
5+
slug: docs/adi
66
---
77

8-
*To use the ADI API you'll need to [create a free Alchemy account](https://dashboard.alchemy.com/signup) first!*
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

10-
## Introduction
13+
## Send Your First Request on Alchemy
1114

12-
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.
13-
14-
## What is the ADI API?
15-
16-
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.
17-
18-
## Getting Started Instructions
19-
20-
### 1. Choose a Package Manager (npm or yarn)
21-
22-
Select a package manager to manage your project's dependencies. Choose between `npm` and `yarn` based on your preference or project requirements.
15+
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!
2316

2417
<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
18+
```text npm
19+
npm install --save viem
2820
```
2921

30-
```shell yarn
31-
# For yarn, refer to yarn's installation guide
32-
# https://classic.yarnpkg.com/lang/en/docs/install
22+
```text yarn
23+
yarn add viem
3324
```
3425
</CodeGroup>
3526

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

4029
<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-
```
30+
```js
31+
import { createPublicClient, http, defineChain } from "viem";
32+
33+
const adiTestnet = defineChain({
34+
id: 12227332,
35+
name: "ADI Testnet",
36+
nativeCurrency: { name: "ETH", symbol: "ETH", decimals: 18 },
37+
rpcUrls: {
38+
default: { http: ["https://adi-testnet.g.alchemy.com/v2/YOUR_ALCHEMY_API_KEY"] },
39+
},
40+
});
41+
42+
const client = createPublicClient({
43+
chain: adiTestnet,
44+
transport: http("https://adi-testnet.g.alchemy.com/v2/YOUR_ALCHEMY_API_KEY"),
45+
});
46+
```
5247
</CodeGroup>
5348

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

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

6053
<CodeGroup>
61-
```shell npm
62-
npm install axios
63-
```
64-
65-
```shell yarn
66-
yarn add axios
67-
```
54+
```js
55+
const blockNumber = await client.getBlockNumber();
56+
console.log("Current block number:", blockNumber);
57+
```
6858
</CodeGroup>
6959

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

7262
<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-
```
63+
```js
64+
const balance = await client.getBalance({ address: "0xab5801a7d398351b8be11c439e05c5b3259aec9b" });
65+
console.log("Balance (ETH):", Number(balance) / 1e18);
66+
```
9367
</CodeGroup>
9468

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).
69+
## Read Block Data
9670

97-
### 4. Run Your Script
71+
<CodeGroup>
72+
```js
73+
const block = await client.getBlock({
74+
blockNumber: blockNumber, // from previous example
75+
});
76+
console.log(block);
77+
```
78+
</CodeGroup>
9879

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

101-
<CodeGroup>
102-
```shell shell
103-
node index.js
104-
```
82+
<CodeGroup>
83+
```js
84+
const tx = await client.getTransaction({ hash: "0xYOUR_TX_HASH" });
85+
console.log(tx);
86+
```
10587
</CodeGroup>
10688

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

10991
<CodeGroup>
110-
```shell shell
111-
Latest Block: 0x...
112-
```
92+
```js
93+
const receipt = await client.getTransactionReceipt({
94+
hash: "0xYOUR_TX_HASH"
95+
});
96+
console.log(receipt);
97+
```
11398
</CodeGroup>
11499

115-
## Next Steps
100+
# ADI Tutorials
101+
102+
Check out the following tutorials to learn how to build on ADI:
103+
104+
* [ADI API Endpoints](/reference/adi-api-endpoints)
105+
106+
For full documentation on Web3 libraries, check out the official documentation:
116107

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.
108+
* [Viem Documentation](https://viem.sh) - Modern TypeScript interface for Ethereum
109+
* [Ethers.js Documentation](https://docs.ethers.org) - Complete Ethereum wallet implementation

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ The Anime API allows developers to interface with the Anime mainnet and testnet
1414

1515
## How can I get started using the Anime API?
1616

17-
Explained in [Anime API Quickstart](/reference/anime-api-quickstart)
17+
Explained in [Anime API Quickstart](/docs/anime)
1818

1919
## Is Anime EVM compatible?
2020

0 commit comments

Comments
 (0)