diff --git a/fern/api-reference/data/nft-api/nft-api-overview.mdx b/fern/api-reference/data/nft-api/nft-api-overview.mdx index 02cb47b26..2e55e391f 100644 --- a/fern/api-reference/data/nft-api/nft-api-overview.mdx +++ b/fern/api-reference/data/nft-api/nft-api-overview.mdx @@ -13,3 +13,42 @@ Rather than searching, indexing, and storing data yourself - you can now make on * All NFTs owned by an address * Metadata and attributes for a specific NFT token + +## Supported Networks + +Use the network slug in the request URL: `https://{network}.g.alchemy.com/nft/v3/{apiKey}/...` + +**Mainnets:** + +| Network Slug | | | +|--------------|--------------|--------------| +| `abstract-mainnet` | `alchemy-internal` | `anime-mainnet` | +| `apechain-mainnet` | `arb-mainnet` | `arbnova-mainnet` | +| `avax-mainnet` | `base-mainnet` | `berachain-mainnet` | +| `blast-mainnet` | `bnb-mainnet` | `celo-mainnet` | +| `eth-mainnet` | `gnosis-mainnet` | `lens-mainnet` | +| `linea-mainnet` | `mythos-mainnet` | `opt-mainnet` | +| `polygon-mainnet` | `ronin-mainnet` | `rootstock-mainnet` | +| `scroll-mainnet` | `settlus-mainnet` | `shape-mainnet` | +| `soneium-mainnet` | `starknet-mainnet` | `story-mainnet` | +| `unichain-mainnet` | `worldchain-mainnet` | `zetachain-mainnet` | +| `zksync-mainnet` | `zora-mainnet` | | + +**Testnets:** + +| Network Slug | | | +|--------------|--------------|--------------| +| `abstract-testnet` | `alchemy-sepolia` | `anime-sepolia` | +| `apechain-curtis` | `arb-sepolia` | `avax-fuji` | +| `base-sepolia` | `blast-sepolia` | `celo-sepolia` | +| `eth-sepolia` | `gnosis-chiado` | `lens-sepolia` | +| `linea-sepolia` | `monad-testnet` | `opt-sepolia` | +| `polygon-amoy` | `ronin-saigon` | `rootstock-testnet` | +| `scroll-sepolia` | `settlus-septestnet` | `shape-sepolia` | +| `soneium-minato` | `starknet-sepolia` | `story-aeneid` | +| `unichain-sepolia` | `worldchain-sepolia` | `zetachain-testnet` | +| `zksync-sepolia` | `zora-sepolia` | | + + + Check the [Chains](https://dashboard.alchemy.com/chains) page for the most up-to-date product and chain support! + diff --git a/fern/api-reference/data/portfolio-apis/portfolio-apis.mdx b/fern/api-reference/data/portfolio-apis/portfolio-apis.mdx index 25fbbf148..c4821c877 100644 --- a/fern/api-reference/data/portfolio-apis/portfolio-apis.mdx +++ b/fern/api-reference/data/portfolio-apis/portfolio-apis.mdx @@ -15,6 +15,48 @@ Portfolio APIs include *everything* you need to build a view of a user's assets: * 🪨 **Long Term Partners**: We have 7+ years of experience supporting the largest customers that are onchain and will be around to support you for the long term. * ⛰️**Scalable**: These APIs power some of the biggest Wallets in the space - rest easy knowing that we can scale with you. +## Supported Networks + +Pass network slugs in the `networks` query parameter to fetch data across multiple chains in a single request. + +**Mainnets:** + +| Network Slug | | | +|--------------|--------------|--------------| +| `abstract-mainnet` | `alchemy-internal` | `anime-mainnet` | +| `apechain-mainnet` | `arb-mainnet` | `arbnova-mainnet` | +| `avax-mainnet` | `base-mainnet` | `berachain-mainnet` | +| `blast-mainnet` | `bnb-mainnet` | `celo-mainnet` | +| `eth-mainnet` | `gnosis-mainnet` | `hyperliquid-mainnet` | +| `ink-mainnet` | `lens-mainnet` | `linea-mainnet` | +| `mythos-mainnet` | `opt-mainnet` | `polygon-mainnet` | +| `ronin-mainnet` | `rootstock-mainnet` | `scroll-mainnet` | +| `settlus-mainnet` | `shape-mainnet` | `soneium-mainnet` | +| `story-mainnet` | `unichain-mainnet` | `worldchain-mainnet` | +| `zetachain-mainnet` | `zksync-mainnet` | `zora-mainnet` | + +**Testnets:** + +| Network Slug | | | +|--------------|--------------|--------------| +| `abstract-testnet` | `alchemy-sepolia` | `anime-sepolia` | +| `apechain-curtis` | `arb-sepolia` | `avax-fuji` | +| `base-sepolia` | `blast-sepolia` | `bnb-testnet` | +| `celo-sepolia` | `eth-sepolia` | `gensyn-testnet` | +| `gnosis-chiado` | `ink-sepolia` | `lens-sepolia` | +| `linea-sepolia` | `monad-testnet` | `opt-sepolia` | +| `polygon-amoy` | `ronin-saigon` | `rootstock-testnet` | +| `scroll-sepolia` | `settlus-septestnet` | `shape-sepolia` | +| `soneium-minato` | `sonic-blaze` | `story-aeneid` | +| `tea-sepolia` | `unichain-sepolia` | `worldchain-sepolia` | +| `zetachain-testnet` | `zksync-sepolia` | `zora-sepolia` | + + + Check the [Chains](https://dashboard.alchemy.com/chains) page for the most up-to-date product and chain support! + + +## Endpoints + | [**Get Tokens By Wallet**](/reference/get-tokens-by-address) | [**NFTs By Wallet**](/reference/get-nfts-by-address) | [Transaction History](/reference/get-transaction-history-by-address) | | ----------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | | ![Image 1](https://alchemyapi-res.cloudinary.com/image/upload/v1764179965/docs/api-reference/data/cc619a4df5351c534c2c0f6c718d26336600c07275d076dd15fe80e1964aaee5-Screenshot_2025-02-24_at_4.22.57_PM.png) | ![Image 2](https://alchemyapi-res.cloudinary.com/image/upload/v1764179966/docs/api-reference/data/b6a2d47e1d0a755c480ec042ebfd011dcb7403c4338ded3c1a8e0edf106bc848-Screenshot_2025-02-24_at_4.22.10_PM.png) | ![Image 3](https://alchemyapi-res.cloudinary.com/image/upload/v1764179967/docs/api-reference/data/4b35a354494bf54afdd84697b1cabf8e199c9863394f50066727892e497111f1-Screenshot_2025-02-24_at_4.23.35_PM.png) | diff --git a/fern/api-reference/data/prices-api/prices-api-quickstart.mdx b/fern/api-reference/data/prices-api/prices-api-quickstart.mdx index 69d351787..f13db0a4c 100644 --- a/fern/api-reference/data/prices-api/prices-api-quickstart.mdx +++ b/fern/api-reference/data/prices-api/prices-api-quickstart.mdx @@ -25,6 +25,28 @@ The Prices API includes the following REST endpoints: *** +# Supported Networks + +For Token Prices By Address and Historical Prices endpoints, pass the network slug in the `network` field of your request body. + +**Mainnets:** + +| Network Slug | | | +|--------------|--------------|--------------| +| `apechain-mainnet` | `arb-mainnet` | `arbnova-mainnet` | +| `avax-mainnet` | `base-mainnet` | `blast-mainnet` | +| `bnb-mainnet` | `eth-mainnet` | `fantom-mainnet` | +| `gnosis-mainnet` | `linea-mainnet` | `metis-mainnet` | +| `opbnb-mainnet` | `opt-mainnet` | `polygon-mainnet` | +| `polygonzkevm-mainnet` | `scroll-mainnet` | `solana-mainnet` | +| `worldchain-mainnet` | `zetachain-mainnet` | `zksync-mainnet` | + + + Check the [Chains](https://dashboard.alchemy.com/chains) page for the most up-to-date product and chain support! + + +*** + # Getting Started ## Via HTTP Requests @@ -174,149 +196,3 @@ Execute the script from your command line: ``` -## Via Node Fetch - -`node-fetch` is a lightweight option for making HTTP requests with Javascript. - -### Installation - -Install the `node-fetch` package using `npm` or `yarn`: - - - ```shell npm - npm install node-fetch - ``` - - ```shell yarn - yarn add node-fetch - ``` - - -### Usage - -Create a new JavaScript file (e.g., `prices-fetch-script.js`) and add the following code. - - - ```js By Symbol - // prices-fetch-script.js - - - // Replace with your Alchemy API key: - const apiKey = "YOUR_ALCHEMY_API_KEY"; - const fetchURL = `https://api.g.alchemy.com/prices/v1/${apiKey}/tokens/by-symbol`; - - // Define the symbols you want to fetch prices for. - const symbols = ["ETH", "BTC", "USDT"]; - - const params = new URLSearchParams(); - symbols.forEach(symbol => params.append('symbols', symbol)); - - const urlWithParams = `${fetchURL}?${params.toString()}`; - - const requestOptions = { - method: 'GET', - headers: { - 'Content-Type': 'application/json', - }, - }; - - fetch(urlWithParams, requestOptions) - .then(response => response.json()) - .then(data => { - console.log("Token Prices By Symbol:"); - console.log(JSON.stringify(data, null, 2)); - }) - .catch(error => console.error('Error:', error)); - ``` - - ```js By Address - // prices-fetch-script.js - - - // Replace with your Alchemy API key: - const apiKey = "YOUR_ALCHEMY_API_KEY"; - const fetchURL = `https://api.g.alchemy.com/prices/v1/${apiKey}/tokens/by-address`; - - // Define the network and contract addresses you want to fetch prices for. - const requestBody = { - addresses: [ - { - network: "eth-mainnet", - address: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48" // USDC - }, - { - network: "eth-mainnet", - address: "0xdac17f958d2ee523a2206206994597c13d831ec7" // USDT - } - ] - }; - - const requestOptions = { - method: 'POST', - headers: { - 'Content-Type': 'application/json', - 'Authorization': `Bearer ${apiKey}`, - }, - body: JSON.stringify(requestBody), - }; - - fetch(fetchURL, requestOptions) - .then(response => response.json()) - .then(data => { - console.log("Token Prices By Address:"); - console.log(JSON.stringify(data, null, 2)); - }) - .catch(error => console.error('Error:', error)); - ``` - - -### Running the Script - -Execute the script from your command line: - - - ```bash bash - node prices-fetch-script.js - ``` - - -**Expected Output:** - - - ```json json - { - "data": [ - { - "symbol": "ETH", - "prices": [ - { - "currency": "USD", - "value": "3000.00", - "lastUpdatedAt": "2024-04-27T12:34:56Z" - } - ], - "error": null}, - { - "symbol": "BTC", - "prices": [ - { - "currency": "USD", - "value": "45000.00", - "lastUpdatedAt": "2024-04-27T12:34:56Z" - } - ], - "error": null}, - { - "symbol": "USDT", - "prices": [ - { - "currency": "USD", - "value": "1.00", - "lastUpdatedAt": "2024-04-27T12:34:56Z" - } - ], - "error": null} - ] - } - ``` - diff --git a/fern/api-reference/data/token-api/token-api-overview.mdx b/fern/api-reference/data/token-api/token-api-overview.mdx index 9372733b4..691af88ef 100644 --- a/fern/api-reference/data/token-api/token-api-overview.mdx +++ b/fern/api-reference/data/token-api/token-api-overview.mdx @@ -15,6 +15,52 @@ slug: reference/token-api-overview With the Token API, you can retrieve token balances, metadata, and more. Easily request information on specific tokens such as **metadata** or **balances**. +## Supported Networks + +Use the network slug in the request URL: `https://{network}.g.alchemy.com/v2/{apiKey}` + +**Mainnets:** + +| Network Slug | | | +|--------------|--------------|--------------| +| `abstract-mainnet` | `anime-mainnet` | `apechain-mainnet` | +| `arb-mainnet` | `arbnova-mainnet` | `avax-mainnet` | +| `base-mainnet` | `berachain-mainnet` | `blast-mainnet` | +| `bnb-mainnet` | `celo-mainnet` | `eth-mainnet` | +| `eth-mainnetbeacon` | `gensyn-mainnet` | `gnosis-mainnet` | +| `hyperliquid-mainnet` | `ink-mainnet` | `lens-mainnet` | +| `linea-mainnet` | `monad-mainnet` | `mythos-mainnet` | +| `opt-mainnet` | `polygon-mainnet` | `ronin-mainnet` | +| `rootstock-mainnet` | `scroll-mainnet` | `settlus-mainnet` | +| `shape-mainnet` | `soneium-mainnet` | `story-mainnet` | +| `unichain-mainnet` | `worldchain-mainnet` | `zetachain-mainnet` | +| `zksync-mainnet` | `zora-mainnet` | | + +**Testnets:** + +| Network Slug | | | +|--------------|--------------|--------------| +| `abstract-testnet` | `anime-sepolia` | `apechain-curtis` | +| `arb-sepolia` | `avax-fuji` | `base-sepolia` | +| `berachain-artio` | `berachain-bartio` | `berachain-bepolia` | +| `blast-sepolia` | `bnb-testnet` | `celo-alfajores` | +| `celo-sepolia` | `eth-holesky` | `eth-holeskybeacon` | +| `eth-hoodi` | `eth-hoodibeacon` | `eth-sepolia` | +| `eth-sepoliabeacon` | `gensyn-testnet` | `gnosis-chiado` | +| `hyperliquid-testnet` | `ink-sepolia` | `lens-sepolia` | +| `linea-sepolia` | `monad-testnet` | `opt-sepolia` | +| `polygon-amoy` | `ronin-saigon` | `rootstock-testnet` | +| `scroll-sepolia` | `settlus-septestnet` | `shape-sepolia` | +| `soneium-minato` | `story-aeneid` | `tea-sepolia` | +| `unichain-sepolia` | `worldchain-sepolia` | `zetachain-testnet` | +| `zksync-sepolia` | `zora-sepolia` | | + + + Check the [Chains](https://dashboard.alchemy.com/chains) page for the most up-to-date product and chain support! + + +## Endpoints + Alchemy currently supports the following [Token API Endpoints](/reference/token-api): * [`alchemy_getTokenAllowance`](/reference/alchemy-gettokenallowance): Returns the amount which the sender is allowed to withdraw from the owner. diff --git a/fern/api-reference/data/token-api/token-api-quickstart.mdx b/fern/api-reference/data/token-api/token-api-quickstart.mdx index bc3080205..a0139126f 100644 --- a/fern/api-reference/data/token-api/token-api-quickstart.mdx +++ b/fern/api-reference/data/token-api/token-api-quickstart.mdx @@ -118,91 +118,3 @@ You should see output like this: ``` -### Usage - -[![token-api-javascript-scripts/fetch-script.js at main · alchemyplatform/token-api-javascript-scripts](https://alchemyapi-res.cloudinary.com/image/upload/v1764179977/docs/api-reference/data/token-api/token-api-javascript-scripts.png)](https://github.com/alchemyplatform/token-api-javascript-scripts/blob/main/fetch-script.js) - -[![github.com](https://alchemyapi-res.cloudinary.com/image/upload/v1764179977/docs/api-reference/data/token-api/favicon.ico)github.com](https://github.com/alchemyplatform/token-api-javascript-scripts/blob/main/fetch-script.js) - -[token-api-javascript-scripts/fetch-script.js at main · alchemyplatform/token-api-javascript-scripts](https://github.com/alchemyplatform/token-api-javascript-scripts/blob/main/fetch-script.js) - - - ```shell shell - touch fetch-script.js - ``` - - -and then paste the following code snippet into the file to explore the `getNFTs` method:= - - - ```javascript fetch-script.js - // alchemy-token-api/fetch-script.js - - - // Replace with your Alchemy API key: - const apiKey = "demo"; - const fetchURL = `https://eth-mainnet.g.alchemy.com/v2/${apiKey}`; - - // Replace with the wallet address you want to query: - const ownerAddr = "0x3f5ce5fbfe3e9af3971dd833d26ba9b5c936f0be"; - // Replace with the token contract address you want to query: - const tokenAddr = "0x607f4c5bb672230e8672085532f7e901544a7375"; - - var raw = JSON.stringify({ - "jsonrpc": "2.0", - "method": "alchemy_getTokenBalances", - "headers": { - "Content-Type": "application/json" - }, - "params": [ - `${ownerAddr}`, - [ - `${tokenAddr}`, - ] - ], - "id": 42 - }); - - var requestOptions = { - method: 'POST', - body: raw, - redirect: 'follow' - }; - - // Make the request and print the formatted response: - fetch(fetchURL, requestOptions) - .then(response => response.json()) - .then(response => JSON.stringify(response, null, 2)) - .then(result => console.log(result)) - .catch(error => console.log('error', error)); - ``` - - -From your command line, you can execute the script with: - - - ```shell shell - node fetch-script.js - ``` - - -Your output should look like the following: - - - ```json json - { - "jsonrpc": "2.0", - "id": 42, - "result": { - "address": "0x3f5ce5fbfe3e9af3971dd833d26ba9b5c936f0be", - "tokenBalances": [ - { - "contractAddress": "0x607f4c5bb672230e8672085532f7e901544a7375", - "tokenBalance": "0x00000000000000000000000000000000000000000000000000003c005f81ab00", - "error": null - } - ] - } - } - ``` - diff --git a/fern/api-reference/data/transfers-api/transfers-api-quickstart.mdx b/fern/api-reference/data/transfers-api/transfers-api-quickstart.mdx index cf1a9e1e3..a57331c80 100644 --- a/fern/api-reference/data/transfers-api/transfers-api-quickstart.mdx +++ b/fern/api-reference/data/transfers-api/transfers-api-quickstart.mdx @@ -9,14 +9,48 @@ slug: reference/transfers-api-quickstart ## Transfers API Chain Support - - Check the [Chains](https://dashboard.alchemy.com/chains) page for details about product and chain support! +Use the network slug in the request URL: `https://{network}.g.alchemy.com/v2/{apiKey}` + +**Mainnets:** + +| Network Slug | | | +|--------------|--------------|--------------| +| `abstract-mainnet` | `anime-mainnet` | `apechain-mainnet` | +| `arb-mainnet` | `arbnova-mainnet` | `avax-mainnet` | +| `base-mainnet` | `berachain-mainnet` | `blast-mainnet` | +| `bnb-mainnet` | `celo-mainnet` | `eth-mainnet` | +| `eth-mainnetbeacon` | `gensyn-mainnet` | `gnosis-mainnet` | +| `hyperliquid-mainnet` | `ink-mainnet` | `lens-mainnet` | +| `linea-mainnet` | `monad-mainnet` | `mythos-mainnet` | +| `opt-mainnet` | `polygon-mainnet` | `ronin-mainnet` | +| `rootstock-mainnet` | `scroll-mainnet` | `settlus-mainnet` | +| `shape-mainnet` | `soneium-mainnet` | `story-mainnet` | +| `unichain-mainnet` | `worldchain-mainnet` | `zetachain-mainnet` | +| `zksync-mainnet` | `zora-mainnet` | | + +**Testnets:** + +| Network Slug | | | +|--------------|--------------|--------------| +| `abstract-testnet` | `anime-sepolia` | `apechain-curtis` | +| `arb-sepolia` | `avax-fuji` | `base-sepolia` | +| `berachain-artio` | `berachain-bartio` | `berachain-bepolia` | +| `blast-sepolia` | `bnb-testnet` | `celo-alfajores` | +| `celo-sepolia` | `eth-holesky` | `eth-holeskybeacon` | +| `eth-hoodi` | `eth-hoodibeacon` | `eth-sepolia` | +| `eth-sepoliabeacon` | `gensyn-testnet` | `gnosis-chiado` | +| `hyperliquid-testnet` | `ink-sepolia` | `lens-sepolia` | +| `linea-sepolia` | `monad-testnet` | `opt-sepolia` | +| `polygon-amoy` | `ronin-saigon` | `rootstock-testnet` | +| `scroll-sepolia` | `settlus-septestnet` | `shape-sepolia` | +| `soneium-minato` | `story-aeneid` | `tea-sepolia` | +| `unichain-sepolia` | `worldchain-sepolia` | `zetachain-testnet` | +| `zksync-sepolia` | `zora-sepolia` | | - ![](https://alchemyapi-res.cloudinary.com/image/upload/v1764179964/docs/api-reference/alchemy-transact/transaction-simulation/523fb8a9a9d899921ee1046d0ff1b389967a9976d1c6112ebbbe071ddd1ef374-image.png) + + Check the [Chains](https://dashboard.alchemy.com/chains) page for the most up-to-date product and chain support! -*NOTE: see the table below for the [types of transfers](#types-of-transfers) supported by each network* - ## What are Transfers? Transfers are a representation of value being exchanged between two accounts. Often times users wish to see the historical transactions associated with a specific account or address. This is currently an extremely challenging and inefficient task, requiring users to scan the entire blockchain and index everything to search for transactions associated with the desired address. However, with the Transfers API users can query all types of historical transactions for a given address in a single request.