-
- Go to References and click on the method you want to document to go to the page (further mentioned as Reference Page).
-
- Copy the method name and create a new file in
pages/ethereum-api
with the namemethodName.mdx
.
- Copy the method name and create a new file in
-
- Create a new component in
components/method-docs/ethereum
with the nameEthereumMethod_methodName.tsx
.
- Create a new component in
-
- Let's use
EthereumMethod_getBlockByNumber.tsx
as reference file for the new file creation. Copy the content ofEthereumMethod_getBlockByNumber.tsx
into the new file and replace the method name with the new method name.
- Let's use
-
- Import the new
EthereumMethod_methodName.tsx
component in themethodName.mdx
file and render it.
- Import the new
-
- Add
methodName
to the_meta.json
inpages/ethereum-api
folder.
- Add
-
- Go to ChatGPT conversation and paste the cURL request example in the chat with the following prompt:
Hi! I need the analogs for the following HTTP request code in JS, Python, Go and Rust.
Use fetch for JS and Node.js
The following code is:
-- here goes cURL request code from Reference Page--
-
-
After that, ChatGPT should provide you with the code snippets in JS, Python, Go and Rust. Use this snippets to fill the content of the code snippets in the new page.
-
- Important: For cURL make sure to escape line-breaking symbol "\" (slash) with "\" (double-slash) in the code snippet.
-
- Important: Replace URL value in string with interpolated
${DRPC_ENDPOINT_URL}
in each string literal snippet. You can see how it's done in existing pages.
- Important: Replace URL value in string with interpolated
-
-
-
- To get
Response
body from the Reference Page click on "Try" button as shown on the image below and paste it in theResponse
section of the new page.
- To get
-
- Now, I personally find it more convenient to fill the Request Params and Response Params by looking at the Quicknode Reference Page for the same
methodName
that you currently copy/fill from Reference Page.
- Now, I personally find it more convenient to fill the Request Params and Response Params by looking at the Quicknode Reference Page for the same
For example, eth_getBlockByNumber page.
Request Params are shown like this:
Response Params are shown like this:
-
- Copy and paste the Request Params and Response Params from the Quicknode Reference Page to the new page component props as required by format.
You can see example on the existing pages like EthereumMethod_getBlockByNumber.tsx.
-
- Go to ChatGPT and ask it to give 3 use cases and 3 constraints for the method you are documenting. Use the following prompt:
Hi! I need 3 use cases and 3 constraints, 3-6 words for each, for the following Ethereum method:
-- here goes the method name. For example getBlockByNumber --
Note: This guide is for Ethereum API methods documentation. You still can use this guide for other API methods documentation by changing the method name.
The main process for Solana is the same as for Ethereum, but with some differences.
For Solana, you can use the ALchemy Solana RPC API Reference to get the method name and the cURL request example.