Skip to content

Commit

Permalink
Stronger Functions banners in Any API pages
Browse files Browse the repository at this point in the history
  • Loading branch information
thedriftofwords committed Jan 23, 2025
1 parent 7e110d0 commit 7b0a2f6
Show file tree
Hide file tree
Showing 14 changed files with 40 additions and 69 deletions.
2 changes: 2 additions & 0 deletions src/content/any-api/api-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ isMdx: true
import { Aside, CodeSample } from "@components"
import AnyApiCallout from "@features/any-api/common/AnyApiCallout.astro"

<AnyApiCallout callout="usefunctions" />

<Aside type="note" title="API reference for ChainlinkClient">

`ChainlinkClient` [contracts](https://github.com/smartcontractkit/chainlink/blob/develop/contracts/src/v0.8/ChainlinkClient.sol)
Expand Down
10 changes: 4 additions & 6 deletions src/content/any-api/find-oracle.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,11 @@ whatsnext: { "API Reference": "/any-api/api-reference/", "Testnet Oracles": "/an

import { Aside } from "@components"

This page explains how to find an existing Oracle Job to suit the needs of your API call.
import AnyApiCallout from "@features/any-api/common/AnyApiCallout.astro"

<AnyApiCallout callout="usefunctions" />

<Aside type="note" title="Chainlink Functions">
Chainlink Functions provides your smart contracts access to trust-minimized compute infrastructure, allowing you to
fetch data from APIs and perform custom computation. Read the [Chainlink Functions
documentation](/chainlink-functions) to learn more.
</Aside>
This page explains how to find an existing Oracle Job to suit the needs of your API call.

## Introduction to Oracles

Expand Down
8 changes: 2 additions & 6 deletions src/content/any-api/get-request/examples/array-response.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,9 @@ whatsnext:
import { Aside, CodeSample } from "@components"
import AnyApiCallout from "@features/any-api/common/AnyApiCallout.astro"

This guide explains how to make an HTTP GET request to an external API, that returns a _json_ array, from a smart contract, using Chainlink's [Request & Receive Data](/any-api/introduction) cycle and then receive the needed data from the array.
<AnyApiCallout callout="usefunctions" />

<Aside type="note" title="Chainlink Functions">
Chainlink Functions provides your smart contracts access to trust-minimized compute infrastructure, allowing you to
fetch data from APIs and perform custom computation. Read the [Chainlink Functions
documentation](/chainlink-functions) to learn more.
</Aside>
This guide explains how to make an HTTP GET request to an external API, that returns a _json_ array, from a smart contract, using Chainlink's [Request & Receive Data](/any-api/introduction) cycle and then receive the needed data from the array.

<AnyApiCallout callout="prerequisites" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,9 @@ metadata:
import { Aside, CodeSample } from "@components"
import AnyApiCallout from "@features/any-api/common/AnyApiCallout.astro"

Using an _existing_ Oracle Job makes your smart contract code more succinct. This page explains how to retrieve the gas price from an existing Chainlink job that calls [etherscan gas tracker API](https://docs.etherscan.io/api-endpoints/gas-tracker#get-gas-oracle).
<AnyApiCallout callout="usefunctions" />

<Aside type="note" title="Chainlink Functions">
Chainlink Functions provides your smart contracts access to trust-minimized compute infrastructure, allowing you to
fetch data from APIs and perform custom computation. Read the [Chainlink Functions
documentation](/chainlink-functions) to learn more.
</Aside>
Using an _existing_ Oracle Job makes your smart contract code more succinct. This page explains how to retrieve the gas price from an existing Chainlink job that calls [etherscan gas tracker API](https://docs.etherscan.io/api-endpoints/gas-tracker#get-gas-oracle).

<AnyApiCallout callout="prerequisites" />

Expand Down
8 changes: 2 additions & 6 deletions src/content/any-api/get-request/examples/large-responses.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,9 @@ whatsnext:
import { Aside, CodeSample } from "@components"
import AnyApiCallout from "@features/any-api/common/AnyApiCallout.astro"

This guide explains how to make an HTTP GET request to an external API from a smart contract, using Chainlink's [Request & Receive Data](/any-api/introduction) cycle and then receive large responses.
<AnyApiCallout callout="usefunctions" />

<Aside type="note" title="Chainlink Functions">
Chainlink Functions provides your smart contracts access to trust-minimized compute infrastructure, allowing you to
fetch data from APIs and perform custom computation. Read the [Chainlink Functions
documentation](/chainlink-functions) to learn more.
</Aside>
This guide explains how to make an HTTP GET request to an external API from a smart contract, using Chainlink's [Request & Receive Data](/any-api/introduction) cycle and then receive large responses.

<AnyApiCallout callout="prerequisites" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,11 @@ whatsnext:
import { Aside, CodeSample } from "@components"
import AnyApiCallout from "@features/any-api/common/AnyApiCallout.astro"

<AnyApiCallout callout="usefunctions" />

This guide explains how to make an HTTP GET request to an external API from a smart contract, using Chainlink's [Request & Receive Data](/any-api/introduction) cycle and then receive multiple responses.
This is known as **multi-variable** or **multi-word** responses.

<Aside type="note" title="Chainlink Functions">
Chainlink Functions provides your smart contracts access to trust-minimized compute infrastructure, allowing you to
fetch data from APIs and perform custom computation. Read the [Chainlink Functions
documentation](/chainlink-functions) to learn more.
</Aside>

<AnyApiCallout callout="prerequisites" />

## Example
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,9 @@ metadata:
import { Aside, CodeSample } from "@components"
import AnyApiCallout from "@features/any-api/common/AnyApiCallout.astro"

This guide explains how to make an HTTP GET request to an external API from a smart contract using Chainlink's [Request & Receive Data](/any-api/introduction) cycle and receive a single response.
<AnyApiCallout callout="usefunctions" />

<Aside type="note" title="Chainlink Functions">
Chainlink Functions provides your smart contracts access to trust-minimized compute infrastructure, allowing you to
fetch data from APIs and perform custom computation. Read the [Chainlink Functions
documentation](/chainlink-functions) to learn more.
</Aside>
This guide explains how to make an HTTP GET request to an external API from a smart contract using Chainlink's [Request & Receive Data](/any-api/introduction) cycle and receive a single response.

<AnyApiCallout callout="prerequisites" />

Expand Down
8 changes: 2 additions & 6 deletions src/content/any-api/get-request/introduction.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,9 @@ metadata:
import { Aside } from "@components"
import AnyApiCallout from "@features/any-api/common/AnyApiCallout.astro"

This series of guides explains how to make HTTP GET requests to external APIs from smart contracts, using Chainlink's [Request & Receive Data](/any-api/introduction) cycle.
<AnyApiCallout callout="usefunctions" />

<Aside type="note" title="Chainlink Functions">
Chainlink Functions provides your smart contracts access to trust-minimized compute infrastructure, allowing you to
fetch data from APIs and perform custom computation. Read the [Chainlink Functions
documentation](/chainlink-functions) to learn more.
</Aside>
This series of guides explains how to make HTTP GET requests to external APIs from smart contracts, using Chainlink's [Request & Receive Data](/any-api/introduction) cycle.

<AnyApiCallout callout="common" />

Expand Down
14 changes: 2 additions & 12 deletions src/content/any-api/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,9 @@ metadata:

import { Aside, CodeSample } from "@components"
import { YouTube } from "@astro-community/astro-embed-youtube"
import AnyApiCallout from "@features/any-api/common/AnyApiCallout.astro"

<Aside type="note" title="Chainlink Functions">
Chainlink Functions provides your smart contracts access to trust-minimized compute infrastructure, allowing you to
fetch data from APIs and perform custom computation. Read the [Chainlink Functions
documentation](/chainlink-functions) to learn more.
</Aside>

<Aside type="note" title="Requirements">
This guide requires basic knowledge about smart contracts. If you are new to smart contract development, learn how to
[Deploy Your First Smart Contract](/quickstarts/deploy-your-first-contract) before you begin.
</Aside>

<YouTube id="https://www.youtube.com/watch?v=ay4rXZhAefs" />
<AnyApiCallout callout="usefunctions" />

In this guide, you will learn how to request data from a public API in a smart contract. This includes understanding what Tasks and External adapters are and how Oracle Jobs use them. You will also learn how to find the Oracle Jobs and Tasks for your contract and how to request data from an Oracle Job.

Expand Down
13 changes: 2 additions & 11 deletions src/content/any-api/introduction.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,9 @@ metadata:
import AnyApiCallout from "@features/any-api/common/AnyApiCallout.astro"
import { Aside } from "@components"

<Aside type="note" title="Talk to an expert">
<a href="https://chain.link/contact?ref_id=AnyAPI">Contact us</a> to talk to an expert about using Chainlink Any API
to get your data on chain.
</Aside>

<Aside type="note" title="Chainlink Functions">
Chainlink Functions provides your smart contracts access to trust-minimized compute infrastructure, allowing you to
fetch data from APIs and perform custom computation. Read the [Chainlink Functions
documentation](/chainlink-functions) to learn more.
</Aside>
<AnyApiCallout callout="usefunctions" />

**Connecting to any API** with Chainlink enables your contracts to access to _any_ external data source through our decentralized oracle network. We understand making smart contracts compatible with offchain data adds to the complexity of building smart contracts. We created a framework with minimal requirements, yet unbounded flexibility, so developers can focus more on the functionality of smart contracts rather than what feeds them. Chainlinks decentralized oracle network provides smart contracts with the ability to push and pull data, facilitating the interoperability between onchain and offchain applications.
**Connecting to any API** with Chainlink enables your contracts to access to _any_ external data source through our decentralized oracle network. We understand making smart contracts compatible with offchain data adds to the complexity of building smart contracts. We created a framework with minimal requirements, yet unbounded flexibility, so developers can focus more on the functionality of smart contracts rather than what feeds them. Chainlink's decentralized oracle network provides smart contracts with the ability to push and pull data, facilitating the interoperability between onchain and offchain applications.

Whether your contract requires sports results, the latest weather, or any other publicly available data, the [Chainlink contract library](https://github.com/smartcontractkit/chainlink/tree/master/contracts) provides the tools required for your contract to consume it.

Expand Down
3 changes: 2 additions & 1 deletion src/content/any-api/testnet-oracles.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ metadata:
---

import { Aside } from "@components"
import AnyApiCallout from "@features/any-api/common/AnyApiCallout.astro"

The Chainlink Developer Relations team maintains several testnet oracles that you can use to test your implementation quickly.
<AnyApiCallout callout="usefunctions" />

<Aside type="tip" title="Link token address and Faucet details">

Expand Down
4 changes: 2 additions & 2 deletions src/content/architecture-overview/architecture-overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ metadata:

Chainlink connects smart contracts with external data using its decentralized oracle network. Chainlink API requests are handled 1:1 by an oracle.

The [Basic Request Model](/architecture-overview/architecture-request-model) describes the onchain architecture of requesting data from a single oracle source.
The [Basic Request Model](/architecture-overview/architecture-request-model) describes the onchain architecture of requesting data from a single oracle source. This request model still describes how Data Feeds works.

To learn how to make a GET request using a single oracle, see [Make a GET Request](/any-api/get-request/introduction).
Historically, [Any API](/any-api/get-request/introduction) was used to make GET requests using a single oracle. Currently, we recommend using Chainlink Functions to send a request to the Decentralized Oracle Network (DON). Learn about the [Request and Receive Data model](/chainlink-functions/resources/architecture) used in Chainlink Functions.

## Decentralized data model

Expand Down
6 changes: 5 additions & 1 deletion src/features/any-api/common/AnyApiCallout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@ const CommonComponent = common[0].Content
const prerequisites = await Astro.glob("./CommonPrerequisites.mdx")
const PrerequisitesComponent = prerequisites[0].Content
const usefunctions = await Astro.glob("./UseFunctions.mdx")
const UseFunctionsComponent = usefunctions[0].Content
export type Props = {
callout?: "common" | "prerequisites"
callout?: "common" | "prerequisites" | "usefunctions"
}
const { callout } = Astro.props as Props
---

{callout === "common" && <CommonComponent />}
{callout === "prerequisites" && <PrerequisitesComponent />}
{callout === "usefunctions" && <UseFunctionsComponent />}
9 changes: 9 additions & 0 deletions src/features/any-api/common/UseFunctions.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { Aside } from "@components"

<Aside type="caution" title="Use Chainlink Functions">
The Any API docs remain as a public historical reference for node operators. Please use Chainlink Functions instead.

Chainlink Functions provides your smart contracts access to trust-minimized compute infrastructure, allowing you to fetch data from APIs and perform custom computation. Read the [Chainlink Functions
documentation](/chainlink-functions) to learn more.

</Aside>

0 comments on commit 7b0a2f6

Please sign in to comment.