Skip to content

Commit ea112e6

Browse files
authored
Merge pull request #2407 from pyth-network/cprussin/ui-59-add-orca-to-known-publishers
feat(known-publishers): add Orca as a known publisher
2 parents 2d0cf12 + a42bd10 commit ea112e6

File tree

15 files changed

+175
-166
lines changed

15 files changed

+175
-166
lines changed

apps/staking/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"@heroicons/react": "^2.1.4",
2626
"@next/third-parties": "^14.2.5",
2727
"@pythnetwork/hermes-client": "workspace:*",
28+
"@pythnetwork/known-publishers": "workspace:*",
2829
"@pythnetwork/staking-sdk": "workspace:*",
2930
"@react-aria/toast": "3.0.0-beta.16",
3031
"@react-hookz/web": "^24.0.4",

apps/staking/src/api.ts

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type { HermesClient, PublisherCaps } from "@pythnetwork/hermes-client";
2+
import { lookup } from "@pythnetwork/known-publishers";
23
import {
34
epochToDate,
45
extractPublisherData,
@@ -12,8 +13,6 @@ import {
1213
import { PublicKey } from "@solana/web3.js";
1314
import { z } from "zod";
1415

15-
import { KNOWN_PUBLISHERS } from "./known-publishers";
16-
1716
const publishersRankingSchema = z
1817
.object({
1918
publisher: z.string(),
@@ -49,9 +48,7 @@ type Data = {
4948
m: bigint;
5049
z: bigint;
5150
integrityStakingPublishers: {
52-
identity:
53-
| (typeof KNOWN_PUBLISHERS)[keyof typeof KNOWN_PUBLISHERS]
54-
| undefined;
51+
identity: ReturnType<typeof lookup>;
5552
publicKey: PublicKey;
5653
stakeAccount: PublicKey | undefined;
5754
selfStake: bigint;
@@ -270,12 +267,7 @@ const loadPublisherData = async (
270267

271268
return {
272269
apyHistory,
273-
identity: (
274-
KNOWN_PUBLISHERS as Record<
275-
string,
276-
(typeof KNOWN_PUBLISHERS)[keyof typeof KNOWN_PUBLISHERS]
277-
>
278-
)[publisher.pubkey.toBase58()],
270+
identity: lookup(publisher.pubkey.toBase58()),
279271
numFeeds: numberOfSymbols ?? 0,
280272
poolCapacity: getPublisherCap(publisherCaps, publisher.pubkey),
281273
poolUtilization: publisher.totalDelegation,

apps/staking/src/components/OracleIntegrityStaking/index.tsx

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
ChevronDoubleLeftIcon,
88
ChevronDoubleRightIcon,
99
} from "@heroicons/react/24/outline";
10+
import type { lookup } from "@pythnetwork/known-publishers";
1011
import { calculateApy } from "@pythnetwork/staking-sdk";
1112
import { PublicKey } from "@solana/web3.js";
1213
import clsx from "clsx";
@@ -21,8 +22,6 @@ import {
2122
type SetStateAction,
2223
type HTMLAttributes,
2324
type FormEvent,
24-
type ComponentType,
25-
type SVGProps,
2625
} from "react";
2726
import { useFilter, useCollator } from "react-aria";
2827
import {
@@ -1171,12 +1170,7 @@ type PublisherProps = {
11711170
totalStaked: bigint;
11721171
isSelf?: boolean | undefined;
11731172
publisher: {
1174-
identity:
1175-
| {
1176-
name: string;
1177-
icon: ComponentType<SVGProps<SVGSVGElement>>;
1178-
}
1179-
| undefined;
1173+
identity: ReturnType<typeof lookup>;
11801174
publicKey: PublicKey;
11811175
stakeAccount: PublicKey | undefined;
11821176
selfStake: bigint;
@@ -1723,7 +1717,7 @@ const PublisherIdentity = ({
17231717
props.children.identity ? (
17241718
<span className={clsx(className, withNameClassName)}>
17251719
<span>
1726-
{createElement(props.children.identity.icon, {
1720+
{createElement(props.children.identity.icon.monochrome, {
17271721
className: "mr-2 inline-block h-[20px] align-sub",
17281722
})}
17291723
<span className="mr-[0.5em]">{props.children.identity.name}</span>

apps/staking/src/known-publishers.ts

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

apps/staking/src/publisher-icons/blocksize.svg

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

apps/staking/src/publisher-icons/elfomo.svg

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

apps/staking/src/publisher-icons/finazon.svg

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

apps/staking/src/publisher-icons/gluex.svg

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

apps/staking/src/publisher-icons/ltp.svg

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

apps/staking/src/publisher-icons/sentio.svg

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

0 commit comments

Comments
 (0)