Skip to content

Commit d4748be

Browse files
committed
Merge branch 'main' into feat/conformance-reports-temp
2 parents f9b2665 + 56465a9 commit d4748be

File tree

74 files changed

+943
-4560
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+943
-4560
lines changed

.github/workflows/ci-turbo-build.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,17 @@ jobs:
2626
# precompiled binary isn't found.
2727
- name: Install libusb
2828
run: sudo apt-get update && sudo apt-get install -y libusb-1.0-0-dev libudev-dev
29+
# Install Foundry for Ethereum contract builds
30+
- name: Install Foundry
31+
uses: foundry-rs/foundry-toolchain@v1
32+
with:
33+
version: v0.3.0
2934
- uses: pnpm/action-setup@v4
3035
name: Install pnpm
3136
with:
3237
run_install: true
38+
- name: Install Forge dependencies
39+
run: cd target_chains/ethereum/contracts && pnpm run install-forge-deps
3340
- name: Cache for Turbo
3441
uses: rharkor/[email protected]
3542
- name: Build

.github/workflows/ci-turbo-test.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ jobs:
1717
runs-on: ubuntu-latest
1818
steps:
1919
- uses: actions/checkout@v4
20+
- uses: actions-rust-lang/setup-rust-toolchain@v1
2021
- uses: actions/setup-node@v4
2122
with:
2223
node-version-file: "package.json"
@@ -25,10 +26,17 @@ jobs:
2526
# precompiled binary isn't found.
2627
- name: Install libusb
2728
run: sudo apt-get update && sudo apt-get install -y libusb-1.0-0-dev libudev-dev
29+
# Install Foundry for Ethereum contract tests
30+
- name: Install Foundry
31+
uses: foundry-rs/foundry-toolchain@v1
32+
with:
33+
version: v0.3.0
2834
- uses: pnpm/action-setup@v4
2935
name: Install pnpm
3036
with:
3137
run_install: true
38+
- name: Install Forge dependencies
39+
run: cd target_chains/ethereum/contracts && pnpm run install-forge-deps
3240
- name: Cache for Turbo
3341
uses: rharkor/[email protected]
3442
- name: Test

.github/workflows/publish-js.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ jobs:
99
name: Publish Javascript Packages to NPM
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v2
12+
- uses: actions/checkout@v4
13+
- uses: actions-rust-lang/setup-rust-toolchain@v1
1314
- uses: actions/setup-node@v4
1415
with:
1516
node-version-file: "package.json"
@@ -18,10 +19,17 @@ jobs:
1819
# precompiled binary isn't found.
1920
- name: Install libusb
2021
run: sudo apt-get update && sudo apt-get install -y libusb-1.0-0-dev libudev-dev
22+
# Install Foundry for Ethereum contract builds
23+
- name: Install Foundry
24+
uses: foundry-rs/foundry-toolchain@v1
25+
with:
26+
version: v0.3.0
2127
- uses: pnpm/action-setup@v4
2228
name: Install pnpm
2329
with:
2430
run_install: true
31+
- name: Install Forge dependencies
32+
run: cd target_chains/ethereum/contracts && pnpm run install-forge-deps
2533
- name: Set publishing config
2634
run: pnpm config set '//registry.npmjs.org/:_authToken' "${NODE_AUTH_TOKEN}"
2735
env:

Cargo.lock

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

apps/developer-hub/next-env.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/// <reference types="next" />
22
/// <reference types="next/image-types/global" />
3+
/// <reference path="./.next/types/routes.d.ts" />
34

45
// NOTE: This file should not be edited
56
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.

apps/insights/src/cache.ts

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,24 @@ const transformer = {
99
deserialize: parse,
1010
};
1111

12-
export const DEFAULT_CACHE_TTL = 3600; // 1 hour
13-
export const DEFAULT_CACHE_STALE = 86_400; // 24 hours
12+
/**
13+
* - API routes will be cached for 1 hour
14+
* - Cached function will be cached for 10 minutes,
15+
* If the function is called within 1 hour, it will
16+
* still be served from the cache, but also fetch the latest data
17+
*/
18+
export const DEFAULT_NEXT_FETCH_TTL = 3600; // 1 hour
19+
export const DEFAULT_REDIS_CACHE_TTL = 60 * 10; // 10 minutes
20+
export const DEFAULT_REDIS_CACHE_STALE = 3600; // 1 hour
1421

1522
export const redisCache: ACDCache = createCache({
1623
transformer,
17-
stale: DEFAULT_CACHE_STALE,
18-
ttl: DEFAULT_CACHE_TTL,
24+
stale: DEFAULT_REDIS_CACHE_STALE,
25+
ttl: DEFAULT_REDIS_CACHE_TTL,
1926
storage: {
2027
type: "redis",
2128
options: {
2229
client: getRedis(),
2330
},
2431
},
2532
});
26-
27-
export const memoryOnlyCache: ACDCache = createCache({
28-
ttl: DEFAULT_CACHE_TTL,
29-
stale: DEFAULT_CACHE_STALE,
30-
});
Lines changed: 4 additions & 0 deletions
Loading

apps/insights/src/components/PriceFeedIcon/index.module.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,9 @@
4242
background: theme.pallette-color("emerald", 300);
4343
fill: theme.pallette-color("stone", 700);
4444
}
45+
46+
&[data-asset-class="ECO"] {
47+
background: theme.pallette-color("sky", 200);
48+
fill: theme.pallette-color("sky", 800);
49+
}
4550
}

apps/insights/src/components/PriceFeedIcon/index.tsx

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import Commodities from "./commodities.svg";
44
import CryptoIndex from "./crypto-index.svg";
55
import CryptoRedemptionRate from "./crypto-redemption-rate.svg";
66
import Crypto from "./crypto.svg";
7+
import Eco from "./eco.svg";
78
import Equity from "./equity.svg";
89
import Fx from "./fx.svg";
910
import { icons } from "./icons";
@@ -19,19 +20,25 @@ type Props = Omit<SVGProps, keyof OwnProps | "width" | "height" | "viewBox"> &
1920
OwnProps;
2021

2122
export const PriceFeedIcon = ({ assetClass, symbol, ...props }: Props) => {
22-
if (assetClass === "Crypto") {
23-
const firstPart = symbol.split(".")[1]?.split("/")[0];
24-
const Icon = firstPart ? (icons as SVGRecord)[firstPart] : undefined;
25-
return Icon ? (
26-
<Icon width="100%" height="100%" viewBox="0 0 32 32" {...props} />
27-
) : (
28-
<GenericIcon assetClass="Crypto" {...props} />
29-
);
30-
} else {
31-
return assetClassHasIcon(assetClass) ? (
32-
<GenericIcon assetClass={assetClass} {...props} />
33-
) : // eslint-disable-next-line unicorn/no-null
34-
null;
23+
switch (assetClass) {
24+
case "Crypto": {
25+
const firstPart = symbol.split(".")[1]?.split("/")[0];
26+
const Icon = firstPart ? (icons as SVGRecord)[firstPart] : undefined;
27+
return Icon ? (
28+
<Icon width="100%" height="100%" viewBox="0 0 32 32" {...props} />
29+
) : (
30+
<GenericIcon assetClass="Crypto" {...props} />
31+
);
32+
}
33+
case "Crypto NAV": {
34+
return <GenericIcon assetClass="Crypto" {...props} />;
35+
}
36+
default: {
37+
return assetClassHasIcon(assetClass) ? (
38+
<GenericIcon assetClass={assetClass} {...props} />
39+
) : // eslint-disable-next-line unicorn/no-null
40+
null;
41+
}
3542
}
3643
};
3744

@@ -64,6 +71,7 @@ const ASSET_CLASS_TO_ICON = {
6471
"Crypto Index": CryptoIndex,
6572
"Crypto Redemption Rate": CryptoRedemptionRate,
6673
Crypto,
74+
ECO: Eco,
6775
Equity,
6876
FX: Fx,
6977
Metal,

apps/insights/src/server/pyth.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { parse } from "superjson";
22
import { z } from "zod";
33

4-
import { DEFAULT_CACHE_TTL } from "../cache";
4+
import { DEFAULT_NEXT_FETCH_TTL } from "../cache";
55
import { VERCEL_REQUEST_HEADERS } from "../config/server";
66
import { getHost } from "../get-host";
77
import { priceFeedsSchema } from "../schemas/pyth/price-feeds-schema";
@@ -19,7 +19,7 @@ export async function getPublishersForFeedRequest(
1919

2020
const data = await fetch(url, {
2121
next: {
22-
revalidate: DEFAULT_CACHE_TTL,
22+
revalidate: DEFAULT_NEXT_FETCH_TTL,
2323
},
2424
headers: VERCEL_REQUEST_HEADERS,
2525
});
@@ -39,7 +39,7 @@ export async function getFeedsForPublisherRequest(
3939

4040
const data = await fetch(url, {
4141
next: {
42-
revalidate: DEFAULT_CACHE_TTL,
42+
revalidate: DEFAULT_NEXT_FETCH_TTL,
4343
},
4444
headers: VERCEL_REQUEST_HEADERS,
4545
});
@@ -55,7 +55,7 @@ export const getFeedsRequest = async (cluster: Cluster) => {
5555

5656
const data = await fetch(url, {
5757
next: {
58-
revalidate: DEFAULT_CACHE_TTL,
58+
revalidate: DEFAULT_NEXT_FETCH_TTL,
5959
},
6060
headers: VERCEL_REQUEST_HEADERS,
6161
});
@@ -83,7 +83,7 @@ export const getFeedForSymbolRequest = async ({
8383

8484
const data = await fetch(url, {
8585
next: {
86-
revalidate: DEFAULT_CACHE_TTL,
86+
revalidate: DEFAULT_NEXT_FETCH_TTL,
8787
},
8888
headers: VERCEL_REQUEST_HEADERS,
8989
});
@@ -94,5 +94,7 @@ export const getFeedForSymbolRequest = async ({
9494

9595
const rawData = await data.text();
9696
const parsedData = parse(rawData);
97-
return priceFeedsSchema.element.parse(parsedData);
97+
return parsedData === undefined
98+
? undefined
99+
: priceFeedsSchema.element.parse(parsedData);
98100
};

0 commit comments

Comments
 (0)