Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 18b786e

Browse files
authoredAug 19, 2024··
(Refactor) Link to new api reference (#401)
* (Refactor) Link to new api reference * test * cehcked references * pre-commit * remove valid snippets * requested changes * requested changes * lint
1 parent 075f387 commit 18b786e

22 files changed

+28
-1383
lines changed
 

‎__tests__/validateCodeSnippets.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,5 @@ function validateCodeSnippets(directoryPath: string): void {
199199
describe("Validate code snippets", () => {
200200
// We only validate code snippets in the API reference.
201201
// However, we exclude Aptos for now because it's annoying (and doesn't seem worth it).
202-
validateCodeSnippets("./pages/price-feeds/api-reference/evm");
203202
validateCodeSnippets("./pages/price-feeds/api-reference/cosmwasm");
204203
});

‎next.config.js

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,14 +140,29 @@ const nextConfig = {
140140
config.resolve.fallback = { fs: false, net: false, tls: false };
141141
return config;
142142
},
143+
143144
async redirects() {
144-
return permanentRedirectArray.map((value) => {
145+
const permanentRedirects = permanentRedirectArray.map((value) => {
145146
return {
146147
source: value[0],
147148
destination: value[1],
148149
permanent: true,
149150
};
150151
});
152+
153+
return [
154+
...permanentRedirects,
155+
{
156+
source: "/price-feeds/api-reference/evm/:slug",
157+
destination: "https://api-reference.pyth.network/price-feeds/evm/:slug",
158+
permanent: false,
159+
},
160+
{
161+
source: "/price-feeds/api-reference/evm/",
162+
destination: "https://api-reference.pyth.network/price-feeds/evm/",
163+
permanent: false,
164+
},
165+
];
151166
},
152167
};
153168

‎package-lock.json

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎pages/price-feeds/api-reference/_meta.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
{
2-
"evm": "EVM",
2+
"evm": {
3+
"title": "EVM ↗",
4+
"href": "https://api-reference.pyth.network/price-feeds/evm/getPriceNoOlderThan",
5+
"newWindow": true
6+
},
37
"aptos": "Aptos",
48
"cosmwasm": "CosmWasm",
59
"hermes": {

‎pages/price-feeds/api-reference/evm.mdx

Lines changed: 0 additions & 15 deletions
This file was deleted.

‎pages/price-feeds/api-reference/evm/_meta.json

Lines changed: 0 additions & 25 deletions
This file was deleted.

‎pages/price-feeds/api-reference/evm/configuration.mdx

Lines changed: 0 additions & 5 deletions
This file was deleted.

‎pages/price-feeds/api-reference/evm/get-ema-price-no-older-than.mdx

Lines changed: 0 additions & 109 deletions
This file was deleted.

‎pages/price-feeds/api-reference/evm/get-ema-price-unsafe.mdx

Lines changed: 0 additions & 102 deletions
This file was deleted.

‎pages/price-feeds/api-reference/evm/get-ema-price.mdx

Lines changed: 0 additions & 102 deletions
This file was deleted.

‎pages/price-feeds/api-reference/evm/get-price-no-older-than.mdx

Lines changed: 0 additions & 108 deletions
This file was deleted.

‎pages/price-feeds/api-reference/evm/get-price-unsafe.mdx

Lines changed: 0 additions & 98 deletions
This file was deleted.

‎pages/price-feeds/api-reference/evm/get-price.mdx

Lines changed: 0 additions & 102 deletions
This file was deleted.

‎pages/price-feeds/api-reference/evm/get-update-fee.mdx

Lines changed: 0 additions & 86 deletions
This file was deleted.

‎pages/price-feeds/api-reference/evm/get-valid-time-period.mdx

Lines changed: 0 additions & 57 deletions
This file was deleted.

‎pages/price-feeds/api-reference/evm/parse-price-feed-updates-unique.mdx

Lines changed: 0 additions & 136 deletions
This file was deleted.

‎pages/price-feeds/api-reference/evm/parse-price-feed-updates.mdx

Lines changed: 0 additions & 134 deletions
This file was deleted.

‎pages/price-feeds/api-reference/evm/sdks.mdx

Lines changed: 0 additions & 62 deletions
This file was deleted.

‎pages/price-feeds/api-reference/evm/update-price-feeds-if-necessary.mdx

Lines changed: 0 additions & 127 deletions
This file was deleted.

‎pages/price-feeds/api-reference/evm/update-price-feeds.mdx

Lines changed: 0 additions & 107 deletions
This file was deleted.

‎pages/price-feeds/create-your-first-pyth-app/evm/part-1.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,9 +336,9 @@ contract MyFirstPythContract {
336336
```
337337

338338
The end of this function calls the `mint` function we defined before.
339-
Before that, however, the function calls [`updatePriceFeeds`](https://docs.pyth.network/price-feeds/api-reference/evm/update-price-feeds) on the Pyth contract.
339+
Before that, however, the function calls [`updatePriceFeeds`](../../api-reference/evm/updatePriceFeeds) on the Pyth contract.
340340
This function takes a payload of `bytes[]` that is passed into the function itself.
341-
The Pyth contract requires a fee to perform this update; the code snippet above calculates the needed fee using [`getUpdateFee`](https://docs.pyth.network/price-feeds/api-reference/evm/get-update-fee).
341+
The Pyth contract requires a fee to perform this update; the code snippet above calculates the needed fee using [`getUpdateFee`](https://api-reference.pyth.network/price-feeds/evm/getUpdateFee).
342342
The caller of this function can pass in a recent Pyth price update as this payload, guaranteeing that the `StalePrice` error won't occur.
343343

344344
We can test this function by adding the following snippet to the test file:

‎pages/price-feeds/create-your-first-pyth-app/evm/part-2.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,5 +291,5 @@ then deployed the contract and interacted with it both via the command line and
291291

292292
## Next Steps
293293

294-
Check out the [EVM Contract References](https://docs.pyth.network/price-feeds/api-reference/evm) for detailed information on the Pyth EVM contract API.
295-
For an end-to-end example using Pyth price feed, check out the [Pyth Oracle AMM Example](https://github.com/pyth-network/pyth-crosschain/tree/main/target_chains/ethereum/examples/oracle_swap).
294+
Check out the [EVM Contract References](https://api-reference.pyth.network/price-feeds/evm/getPriceNoOlderThan) for detailed information on the Pyth EVM contract API.
295+
For an end-to-end example using Pyth price feed, check out the [Pyth Oracle AMM Example](https://github.com/pyth-network/pyth-examples/tree/main/price_feeds/evm).

0 commit comments

Comments
 (0)
Please sign in to comment.