From 4540d366cd3bbe3b07d4d091196799ba71f1c61a Mon Sep 17 00:00:00 2001 From: "Karim H." <98668332+khadni@users.noreply.github.com> Date: Wed, 11 Dec 2024 20:26:30 +0100 Subject: [PATCH] init (#2212) --- public/assets/chains/aptos.svg | 1 + public/files/json/feeds-aptos-testnet.json | 197 ++++++++++ .../QuickLinks/data/productChainLinks.ts | 2 + src/config/sidebar.ts | 9 + .../ccip/api-reference/v1.5.1/pool.mdx | 4 +- src/content/data-feeds/aptos/index.mdx | 340 ++++++++++++++++++ src/features/data/chains.ts | 19 + src/features/feeds/components/FeedList.tsx | 273 ++++++++------ src/features/feeds/components/Tables.tsx | 32 +- 9 files changed, 753 insertions(+), 124 deletions(-) create mode 100644 public/assets/chains/aptos.svg create mode 100644 public/files/json/feeds-aptos-testnet.json create mode 100644 src/content/data-feeds/aptos/index.mdx diff --git a/public/assets/chains/aptos.svg b/public/assets/chains/aptos.svg new file mode 100644 index 00000000000..b7d712e5f60 --- /dev/null +++ b/public/assets/chains/aptos.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/files/json/feeds-aptos-testnet.json b/public/files/json/feeds-aptos-testnet.json new file mode 100644 index 00000000000..3e3c70690cd --- /dev/null +++ b/public/files/json/feeds-aptos-testnet.json @@ -0,0 +1,197 @@ +[ + { + "compareOffchain": "", + "contractAddress": "x", + "name": "BTC / USD", + "path": "btc-usd", + "proxyAddress": "0x01a0b4d920000332000000000000000000000000000000000000000000000000", + "threshold": 0.1, + "heartbeat": 1800, + "valuePrefix": "", + "assetName": "", + "feedCategory": "", + "feedType": "", + "docs": {}, + "decimals": 18 + }, + { + "compareOffchain": "", + "contractAddress": "x", + "name": "APT / USD", + "path": "apt-usd", + "proxyAddress": "0x011e22d6bf000332000000000000000000000000000000000000000000000000", + "threshold": 0.1, + "heartbeat": 1800, + "valuePrefix": "", + "assetName": "", + "feedCategory": "", + "feedType": "", + "docs": {}, + "decimals": 18 + }, + { + "compareOffchain": "", + "contractAddress": "x", + "name": "USDC / USD", + "path": "usdc-usd", + "proxyAddress": "0x01a80ff216000332000000000000000000000000000000000000000000000000", + "threshold": 0.1, + "heartbeat": 1800, + "valuePrefix": "", + "assetName": "", + "feedCategory": "", + "feedType": "", + "docs": {}, + "decimals": 18 + }, + { + "compareOffchain": "", + "contractAddress": "x", + "name": "USDT / USD", + "path": "usdt-usd", + "proxyAddress": "0x016d06ebb6000332000000000000000000000000000000000000000000000000", + "threshold": 0.1, + "heartbeat": 1800, + "valuePrefix": "", + "assetName": "", + "feedCategory": "", + "feedType": "", + "docs": {}, + "decimals": 18 + }, + { + "compareOffchain": "", + "contractAddress": "x", + "name": "ETH / USD", + "path": "eth-usd", + "proxyAddress": "0x01d585327c000332000000000000000000000000000000000000000000000000", + "threshold": 0.1, + "heartbeat": 1800, + "valuePrefix": "", + "assetName": "", + "feedCategory": "", + "feedType": "", + "docs": {}, + "decimals": 18 + }, + { + "compareOffchain": "", + "contractAddress": "x", + "name": "LINK / USD", + "path": "link-usd", + "proxyAddress": "0x0101199b3b000332000000000000000000000000000000000000000000000000", + "threshold": 0.1, + "heartbeat": 1800, + "valuePrefix": "", + "assetName": "", + "feedCategory": "", + "feedType": "", + "docs": {}, + "decimals": 18 + }, + { + "compareOffchain": "", + "contractAddress": "x", + "name": "BNB / USD", + "path": "bnb-usd", + "proxyAddress": "0x011d45b006000332000000000000000000000000000000000000000000000000", + "threshold": 0.1, + "heartbeat": 1800, + "valuePrefix": "", + "assetName": "", + "feedCategory": "", + "feedType": "", + "docs": {}, + "decimals": 18 + }, + { + "compareOffchain": "", + "contractAddress": "x", + "name": "POL / USD", + "path": "pol-usd", + "proxyAddress": "0x01e5984da6000332000000000000000000000000000000000000000000000000", + "threshold": 0.1, + "heartbeat": 1800, + "valuePrefix": "", + "assetName": "", + "feedCategory": "", + "feedType": "", + "docs": {}, + "decimals": 18 + }, + { + "compareOffchain": "", + "contractAddress": "x", + "name": "METIS / USD", + "path": "metis-usd", + "proxyAddress": "0x01e835288b000332000000000000000000000000000000000000000000000000", + "threshold": 0.1, + "heartbeat": 1800, + "valuePrefix": "", + "assetName": "", + "feedCategory": "", + "feedType": "", + "docs": {}, + "decimals": 18 + }, + { + "compareOffchain": "", + "contractAddress": "x", + "name": "DAI / USD", + "path": "dai-usd", + "proxyAddress": "0x0112be0d78000332000000000000000000000000000000000000000000000000", + "threshold": 0.1, + "heartbeat": 1800, + "valuePrefix": "", + "assetName": "", + "feedCategory": "", + "feedType": "", + "docs": {}, + "decimals": 18 + }, + { + "compareOffchain": "", + "contractAddress": "x", + "name": "AVAX / USD", + "path": "avax-usd", + "proxyAddress": "0x016d7a70e3000332000000000000000000000000000000000000000000000000", + "threshold": 0.1, + "heartbeat": 1800, + "valuePrefix": "", + "assetName": "", + "feedCategory": "", + "feedType": "", + "docs": {}, + "decimals": 18 + }, + { + "compareOffchain": "", + "contractAddress": "x", + "name": "WEMIX / USD", + "path": "wemix-usd", + "proxyAddress": "0x01ef65a95a000332000000000000000000000000000000000000000000000000", + "threshold": 0.1, + "heartbeat": 1800, + "valuePrefix": "", + "assetName": "", + "feedCategory": "", + "feedType": "", + "docs": {}, + "decimals": 18 + }, + { + "compareOffchain": "", + "contractAddress": "x", + "name": "CELO / USD", + "path": "celo-usd", + "proxyAddress": "0x0132427bcd000332000000000000000000000000000000000000000000000000", + "threshold": 0.1, + "heartbeat": 1800, + "valuePrefix": "", + "assetName": "", + "feedCategory": "", + "feedType": "", + "docs": {}, + "decimals": 18 + } +] diff --git a/src/components/QuickLinks/data/productChainLinks.ts b/src/components/QuickLinks/data/productChainLinks.ts index fbd475f30a9..1dbcc9ac9db 100644 --- a/src/components/QuickLinks/data/productChainLinks.ts +++ b/src/components/QuickLinks/data/productChainLinks.ts @@ -48,6 +48,7 @@ export const productChainLinks: ProductChainLinks = { learnMoreLink: "data-feeds", logo: dataFeedsLogo, chains: { + aptos: "/data-feeds/price-feeds/addresses?network=aptos", arbitrum: "/data-feeds/price-feeds/addresses?network=arbitrum", avalanche: "/data-feeds/price-feeds/addresses?network=avalanche", base: "/data-feeds/price-feeds/addresses?network=base", @@ -160,6 +161,7 @@ export const productChainLinks: ProductChainLinks = { } export const chainNames: Record = { + aptos: "Aptos", arbitrum: "Arbitrum", astar: "Astar", avalanche: "Avalanche", diff --git a/src/config/sidebar.ts b/src/config/sidebar.ts index 778351b8b30..db05afe1848 100644 --- a/src/config/sidebar.ts +++ b/src/config/sidebar.ts @@ -138,6 +138,15 @@ export const SIDEBAR: Partial> = { }, ], }, + { + section: "Aptos Guides", + contents: [ + { + title: "Data Feeds on Aptos", + url: "data-feeds/aptos", + }, + ], + }, { section: "API Reference", contents: [ diff --git a/src/content/ccip/api-reference/v1.5.1/pool.mdx b/src/content/ccip/api-reference/v1.5.1/pool.mdx index 4c9970857ae..1d8001e25ac 100644 --- a/src/content/ccip/api-reference/v1.5.1/pool.mdx +++ b/src/content/ccip/api-reference/v1.5.1/pool.mdx @@ -61,7 +61,7 @@ struct LockOrBurnInV1 { | ------------------- | ------- | -------------------------------------------------------------------------------- | | receiver | bytes | The recipient of the tokens on the destination chain, ABI encoded | | remoteChainSelector | uint64 | The chain ID of the destination chain | -| originalSender | address | The original sender of the transaction on the source chain | +| originalSender | address | The original sender of the transaction on the source chain | | amount | uint256 | The amount of tokens to lock or burn, denominated in the source token's decimals | | localToken | address | The address on this chain of the token to lock or burn | @@ -100,7 +100,7 @@ struct ReleaseOrMintInV1 { | Name | Type | Description | | ------------------- | ------- | ----------------------------------------------------------------------------------- | -| originalSender | bytes | The original sender of the transaction on the source chain | +| originalSender | bytes | The original sender of the transaction on the source chain | | remoteChainSelector | uint64 | The chain ID of the source chain | | receiver | address | The recipient of the tokens on the destination chain | | amount | uint256 | The amount of tokens to release or mint, denominated in the source token's decimals | diff --git a/src/content/data-feeds/aptos/index.mdx b/src/content/data-feeds/aptos/index.mdx new file mode 100644 index 00000000000..29a45fbce58 --- /dev/null +++ b/src/content/data-feeds/aptos/index.mdx @@ -0,0 +1,340 @@ +--- +section: dataFeeds +date: Last Modified +title: "Using Data Feeds on Aptos" +isIndex: true +whatsnext: { "Aptos Price Feed Addresses": "/data-feeds/price-feeds/addresses?network=aptos" } +metadata: + description: "Explore how to use Chainlink Data Feeds on Aptos to power your applications with data." +--- + +import { CopyText } from "@components" + +Aptos is a Layer 1 blockchain that uses the [Move](https://move-language.github.io/move/) programming language for smart contracts. + +Chainlink Data Feeds on Aptos provides data through a single price feed contract that handles multiple data feeds. You interact with this contract by passing the specific feed ID(s) for the data you need. This contrasts with Chainlink's integration on other blockchains, where each price feed has a separate contract address. + +## Getting Started (CLI) + +This guide explains how to use Chainlink Data Feeds with your Move smart contracts on Aptos testnet using the `Benchmark` structure provided by the data feeds contract. You will use the [Aptos CLI](https://aptos.dev/en/build/cli) to compile, publish, and interact with your contract. + +### Requirements + +Make sure you have the [Aptos CLI](https://aptos.dev/en/build/cli) installed. You can run in your terminal to verify if the CLI is correctly installed. + +### Integrate Chainlink Data Feeds on Aptos + +Create a new directory for your project and navigate to it in your terminal: + +```bash +mkdir aptos-data-feeds && cd aptos-data-feeds +``` + +#### Set up your Aptos testnet account + +1. Run the following command in your terminal to create a new account on testnet: + + ```bash + aptos init --network=testnet --assume-yes + ``` + +1. You are prompted to enter a private key: + + ```bash + Configuring for profile default + Configuring for network Testnet + Enter your private key as a hex literal (0x...) [Current: Redacted | No input: Generate new key (or keep one if present)] + ``` + + Press `Enter` to generate a new key pair with the [`ed25519` key scheme](https://aptos.dev/en/network/blockchain/accounts#authentication-key). + + Expect an output similar to the following: + + ```bash + No key given, generating key... + Account 0x35107a273065fc0f428b2db719145682f6b5bf16a32b071ccd649fcd8b1a44e9 doesn't exist, creating it and funding it with 100000000 Octas + Account 0x35107a273065fc0f428b2db719145682f6b5bf16a32b071ccd649fcd8b1a44e9 funded successfully + + --- + Aptos CLI is now set up for account 0x35107a273065fc0f428b2db719145682f6b5bf16a32b071ccd649fcd8b1a44e9 as profile default! + See the account here: https://explorer.aptoslabs.com/account/0x35107a273065fc0f428b2db719145682f6b5bf16a32b071ccd649fcd8b1a44e9?network=testnet + Run `aptos --help` for more information about commands + { + "Result": "Success" + } + ``` + +You now have a funded testnet account on Aptos. + +#### Set up your project + +1. Initialize a Move package in your `aptos-data-feeds` directory: + + ```bash + aptos move init --name aptos-data-feeds + ``` + + Expect the following output: + + ```bash + { + "Result": "Success" + } + ``` + + You should now have a Move project with the following structure: + + ```plaintext + Move.toml + ├── /.aptos + ├── /scripts + ├── /sources + └── /tests + ``` + +1. Update your `Move.toml` file to include the required dependencies and addresses: + + ```toml + [package] + name = "my-app" + version = "1.0.0" + authors = [] + + [addresses] + sender = "" + owner = "" + data_feeds = "0xf1099f135ddddad1c065203431be328a408b0ca452ada70374ce26bd2b32fdd3" + platform = "0x516e771e1b4a903afe74c27d057c65849ecc1383782f6642d7ff21425f4f9c99" + move_stdlib = "0x1" + aptos_std = "0x1" + + [dev-addresses] + + [dependencies] + AptosFramework = { git = "https://github.com/aptos-labs/aptos-core.git", subdir = "aptos-move/framework/aptos-framework", rev = "main" } + MoveStdlib = { git = "https://github.com/aptos-labs/aptos-core.git", subdir = "aptos-move/framework/move-stdlib", rev = "main" } + ChainlinkDataFeeds = { local = "./ChainlinkDataFeeds" } + ``` + + Where: + + - `` is your Aptos testnet account address. You can find your address in the `~/.aptos/config.yaml` file. Alternatively, run the following command in your terminal to retrieve it: + + ```bash + aptos config show-profiles --profile=default + ``` + + - The `data_feeds` address is the Chainlink Data Feeds contract address on Aptos testnet (`0xf1099f135ddddad1c065203431be328a408b0ca452ada70374ce26bd2b32fdd3`). + +1. Run the following command to download the compiled bytecode for the `ChainlinkPlatform` and `ChainlinkDataFeeds` packages: + + ```bash + aptos move download --account 0x516e771e1b4a903afe74c27d057c65849ecc1383782f6642d7ff21425f4f9c99 --package ChainlinkPlatform && \ + aptos move download --account 0xccad6853cabea164842907df3de4f89bb34be5bf249bbf16939f9c90db1bf63b --package ChainlinkDataFeeds + ``` + + Expect an output similar to the following: + + ```bash + Saved package with 2 module(s) to `~/aptos-data-feeds/ChainlinkPlatform` + { + "Result": "Download succeeded" + } + Saved package with 2 module(s) to `~/aptos-data-feeds/ChainlinkDataFeeds` + { + "Result": "Download succeeded" + } + ``` + +1. Open the `ChainlinkDataFeeds` package configuration file (`ChainlinkDataFeeds/Move.toml`) and update the `ChainlinkPlatform` dependency to point to your local path: + + ```toml + ChainlinkPlatform = { local = "../ChainlinkPlatform" } + ``` + +#### Write the Move contract to interact with Chainlink Data Feeds + +In this step, you will develop a Move module that interacts with Chainlink Data Feeds to fetch the latest price and timestamp for a specified feed ID. This module retrieves benchmark data for the given feed ID, extracts the price and timestamp, and stores this information in the invoking account's global storage. You can then retrieve this data using a view function. + +1. Create a new Move module in the `sources` directory of your project: + + ```bash + touch sources/MyOracleContract.move + ``` + +1. Insert the following code example and save your `MyOracleContract.move` file: + + ```rust + module sender::MyOracleContractTest { + use std::vector; + use std::signer; + use data_feeds::router::get_benchmarks; + use data_feeds::registry::{Benchmark, get_benchmark_value, get_benchmark_timestamp}; + use move_stdlib::option::{Option, some, none}; + + struct PriceData has copy, key, store { + /// The price value with 18 decimal places of precision + price: u256, + /// Unix timestamp in seconds + timestamp: u256, + } + + // Function to fetch and store the price data for a given feed ID + public entry fun fetch_price(account: &signer, feed_id: vector) acquires PriceData { + let feed_ids = vector[feed_id]; // Use the passed feed_id + let billing_data = vector[]; + let benchmarks: vector = get_benchmarks(account, feed_ids, billing_data); + let benchmark = vector::pop_back(&mut benchmarks); + let price: u256 = get_benchmark_value(&benchmark); + let timestamp: u256 = get_benchmark_timestamp(&benchmark); + + // Check if PriceData exists and update it + if (exists(signer::address_of(account))) { + let data = borrow_global_mut(signer::address_of(account)); + data.price = price; + data.timestamp = timestamp; + } else { + // If PriceData does not exist, create a new one + move_to(account, PriceData { price, timestamp }); + } + } + + // View function to get the stored price data + #[view] + public fun get_price_data(account_address: address): Option acquires PriceData { + if (exists(account_address)) { + let data = borrow_global(account_address); + some(*data) + } else { + none() + } + } + } + ``` + +#### Compile and publish the contract + +1. Compile and publish the contract to the Aptos testnet: + + ```bash + aptos move publish --skip-fetch-latest-git-deps + ``` + + - You are prompted to confirm the transaction details. Type `yes` and press `Enter` to proceed. + + ```bash + Compiling, may take a little while to download git dependencies... + INCLUDING DEPENDENCY AptosFramework + INCLUDING DEPENDENCY AptosStdlib + INCLUDING DEPENDENCY ChainlinkDataFeeds + INCLUDING DEPENDENCY ChainlinkKeystone + INCLUDING DEPENDENCY MoveStdlib + BUILDING my-app + package size 2133 bytes + Do you want to submit a transaction for a range of [176700 - 265000] Octas at a gas unit price of 100 Octas? [yes/no] > + ``` + + - Expect an output similar to the following: + + ```bash + Transaction submitted: https://explorer.aptoslabs.com/txn/0x22a65eedb37ad7e41e195409c06e23b154c71bba11c73e6f67df6ba41e6768a4?network=testnet + { + "Result": { + "transaction_hash": "0x22a65eedb37ad7e41e195409c06e23b154c71bba11c73e6f67df6ba41e6768a4", + "gas_used": 1767, + "gas_unit_price": 100, + "sender": "4006c4623e114a6169b409cc0ad91b0780e62667633ce2e069b31125cc6a5d37", + "sequence_number": 0, + "success": true, + "timestamp_us": 1731707700843776, + "version": 6238520375, + "vm_status": "Executed successfully" + } + } + ``` + +**Notes**: + +- Your `default` profile within the `~/.aptos/config.yaml` file is used by default. You can specify a different profile using the `--profile` flag. +- Ensure you have enough testnet APT tokens in your account to cover the deployment fees. You can fund your account with testnet APT tokens using the following command, where the amount used is in Octas (1 APT = 100,000,000 Octas): + ```bash + aptos account fund-with-faucet --account --amount 100000000 + ``` + +#### Interact with the deployed contract + +In this step, you will interact with your deployed contract to fetch the BTC/USD price and timestamp. The BTC/USD feed ID on Aptos testnet is: . You can find the feed ID for other assets in the [Feed Addresses page](/data-feeds/price-feeds/addresses?network=aptos&page=1). + +1. Fetch benchmark data for the BTC/USD feed, extract the price and timestamp, and store this information in your account's global storage. + + - Run the following command, replacing `` with your actual account address: + + ```bash + aptos move run \ + --function-id '::MyOracleContractTest::fetch_price' \ + --args hex:0x01a0b4d920000332000000000000000000000000000000000000000000000000 + ``` + + **Note**: `` is your Aptos testnet account address. You can find your address in the `~/.aptos/config.yaml` file. Alternatively, run the following command in your terminal to retrieve it: + + ```bash + aptos config show-profiles --profile=default + ``` + + - You are prompted to confirm the transaction details. Type `yes` and press `Enter` to proceed: + + ```bash + Do you want to submit a transaction for a range of [47200 - 70800] Octas at a gas unit price of 100 Octas? [yes/no] > + ``` + + - Expect an output similar to the following: + + ```bash + Transaction submitted: https://explorer.aptoslabs.com/txn/0x7180e890ececbcab4f052f84ecae21d37f33a31d0e475f566f92fc6df157c725?network=testnet + { + "Result": { + "transaction_hash": "0x7180e890ececbcab4f052f84ecae21d37f33a31d0e475f566f92fc6df157c725", + "gas_used": 472, + "gas_unit_price": 100, + "sender": "4006c4623e114a6169b409cc0ad91b0780e62667633ce2e069b31125cc6a5d37", + "sequence_number": 1, + "success": true, + "timestamp_us": 1731707764586551, + "version": 6238524110, + "vm_status": "Executed successfully" + } + } + ``` + +1. Retrieve this data using the view function: + + - Run the following command, replacing `` with your actual account address: + + ```bash + aptos move view \ + --function-id '::MyOracleContractTest::get_price_data' \ + --args address: + ``` + + - Expect an output similar to the following: + + ```bash + { + "Result": [ + { + "vec": [ + { + "price": "70376345325832900000000", + "timestamp": "1730827175" + } + ] + } + ] + } + ``` + + Where: + + - `price` is the latest BTC/USD price with 18 decimal places. + - `timestamp` is the Unix timestamp in seconds when the price is fetched. diff --git a/src/features/data/chains.ts b/src/features/data/chains.ts index 33c16d58da9..033ffea65d0 100644 --- a/src/features/data/chains.ts +++ b/src/features/data/chains.ts @@ -523,6 +523,25 @@ export const CHAINS: Chain[] = [ }, ], }, + { + page: "aptos", + label: "Aptos", + title: "Aptos Data Feeds", + img: "/assets/chains/aptos.svg", + networkStatusUrl: "https://explorer.aptoslabs.com/", + tags: ["default"], + supportedFeatures: ["feeds"], + networks: [ + { + name: "Aptos Testnet", + explorerUrl: "", + networkType: "testnet", + rddUrl: + "https://gist.githubusercontent.com/khadni/0894bd57169f2aaa840b89e40440e21a/raw/2cc8db69ab04f370de3ec2cee2d94b46c1282480/feeds-aptos-testnet.json", + queryString: "aptos-testnet", + }, + ], + }, ] // All mainnet feeds. Used for deprecated feeds. diff --git a/src/features/feeds/components/FeedList.tsx b/src/features/feeds/components/FeedList.tsx index 2ba02b28328..55185e174d0 100644 --- a/src/features/feeds/components/FeedList.tsx +++ b/src/features/feeds/components/FeedList.tsx @@ -2,6 +2,7 @@ import { useEffect, useState, useRef } from "preact/hooks" import { MainnetTable, TestnetTable, StreamsVerifierProxyTable } from "./Tables" import feedList from "./FeedList.module.css" +import tableStyles from "./Tables.module.css" import { clsx } from "~/lib" import { Chain, CHAINS, ALL_CHAINS, ChainNetwork } from "~/features/data/chains" import { useGetChainMetadata } from "./useGetChainMetadata" @@ -253,125 +254,181 @@ export const FeedList = ({ }) .map((network: ChainNetwork) => { return ( - - {network.networkType === "mainnet" ? ( - <> - {!isStreams && chain.l2SequencerFeed && ( -

- {network.name} is an L2 network. As a best practice, use the L2 sequencer feed to verify the - status of the sequencer when running applications on L2 networks. See the{" "} - L2 Sequencer Uptime Feeds page for examples. -

- )} -
- {!isStreams && !isSmartData && ( -
- setShowCategoriesDropdown((prev) => !prev)}> - Data Feed Categories - - -
+ <> + + {network.networkType === "mainnet" ? ( + <> + {!isStreams && chain.l2SequencerFeed && ( +

+ {network.name} is an L2 network. As a best practice, use the L2 sequencer feed to verify the + status of the sequencer when running applications on L2 networks. See the{" "} + L2 Sequencer Uptime Feeds page for examples. +

)} - {isSmartData && ( -
- setShowCategoriesDropdown((prev) => !prev)}> - SmartData Type - - -
+ {network.name === "Aptos Mainnet" && ( + <> +

+ Chainlink Data Feeds on Aptos provides data through a single price feed contract that handles + multiple data feeds. You interact with this contract by passing the specific feed ID(s) for + the data you need. For more details, refer to the{" "} + Using Data Feeds on Aptos guide. +

+

+ Price feed contract on Aptos Mainnet:{" "} + + 0x3f985798ce4975f430ef5c75776ff98a77b9f9d0fb38184d225adc9c1cc6b79b + + +

+ + )} +
+ {!isStreams && !isSmartData && ( +
+ setShowCategoriesDropdown((prev) => !prev)}> + Data Feed Categories + + +
+ )} + {isSmartData && ( +
+ setShowCategoriesDropdown((prev) => !prev)}> + SmartData Type + + +
+ )} +
+ { + setSearchValue((event.target as HTMLInputElement).value) + setCurrentPage("1") + }} + /> +
+ {!isStreams && ( + + )} +
+ + + ) : ( + <> + {network.name === "Aptos Testnet" && ( + <> +

+ Chainlink Data Feeds on Aptos provides data through a single price feed contract that handles + multiple data feeds. You interact with this contract by passing the specific feed ID(s) for + the data you need. For more details, refer to the{" "} + Using Data Feeds on Aptos guide. +

+

+ Price feed contract on Aptos Testnet:{" "} + + 0xf1099f135ddddad1c065203431be328a408b0ca452ada70374ce26bd2b32fdd3 + + +

+ )} -
- { - setSearchValue((event.target as HTMLInputElement).value) - setCurrentPage("1") - }} - /> -
{!isStreams && ( -
- - - ) : ( - <> - {!isStreams && ( - - )} - - - )} -
+ + + )} + + ) })} {isDeprecating && netCount === 0 && ( diff --git a/src/features/feeds/components/Tables.tsx b/src/features/feeds/components/Tables.tsx index 9205d207205..4aada8bff7e 100644 --- a/src/features/feeds/components/Tables.tsx +++ b/src/features/feeds/components/Tables.tsx @@ -118,17 +118,21 @@ const handleClick = (e, additionalInfo) => { window.dataLayer.push(dataLayerEvent) } -const DefaultTHead = ({ showExtraDetails }: { showExtraDetails: boolean }) => ( - - - Pair - Deviation - Heartbeat - Dec - Address and info - - -) +const DefaultTHead = ({ showExtraDetails, networkName }: { showExtraDetails: boolean; networkName: string }) => { + const isAptosNetwork = networkName === "Aptos Mainnet" || networkName === "Aptos Testnet" + + return ( + + + Pair + Deviation + Heartbeat + Dec + {isAptosNetwork ? "Feed ID and info" : "Address and info"} + + + ) +} const DefaultTr = ({ network, proxy, showExtraDetails, isTestnet = false }) => ( @@ -789,7 +793,7 @@ export const MainnetTable = ({ <> {isStreams && } {isSmartData && } - {isDefault && } + {isDefault && } {slicedFilteredMetadata.map((proxy) => ( <> @@ -855,8 +859,8 @@ export const TestnetTable = ({ {isStreams && } {isSmartData && } - {isDefault && } - {isRates && } + {isDefault && } + {isRates && } {filteredMetadata.map((proxy) => ( <>