Skip to content

Commit eafb1e0

Browse files
committed
feat(known-publishers): add Orca as a known publisher
1 parent 083a098 commit eafb1e0

File tree

15 files changed

+175
-165
lines changed

15 files changed

+175
-165
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 & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
import { PublicKey } from "@solana/web3.js";
1313
import { z } from "zod";
1414

15-
import { KNOWN_PUBLISHERS } from "./known-publishers";
15+
import { lookup } from "@pythnetwork/known-publishers";
1616

1717
const publishersRankingSchema = z
1818
.object({
@@ -49,9 +49,7 @@ type Data = {
4949
m: bigint;
5050
z: bigint;
5151
integrityStakingPublishers: {
52-
identity:
53-
| (typeof KNOWN_PUBLISHERS)[keyof typeof KNOWN_PUBLISHERS]
54-
| undefined;
52+
identity: ReturnType<typeof lookup>;
5553
publicKey: PublicKey;
5654
stakeAccount: PublicKey | undefined;
5755
selfStake: bigint;
@@ -270,12 +268,7 @@ const loadPublisherData = async (
270268

271269
return {
272270
apyHistory,
273-
identity: (
274-
KNOWN_PUBLISHERS as Record<
275-
string,
276-
(typeof KNOWN_PUBLISHERS)[keyof typeof KNOWN_PUBLISHERS]
277-
>
278-
)[publisher.pubkey.toBase58()],
271+
identity: lookup(publisher.pubkey.toBase58()),
279272
numFeeds: numberOfSymbols ?? 0,
280273
poolCapacity: getPublisherCap(publisherCaps, publisher.pubkey),
281274
poolUtilization: publisher.totalDelegation,

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

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ import {
2121
type SetStateAction,
2222
type HTMLAttributes,
2323
type FormEvent,
24-
type ComponentType,
25-
type SVGProps,
2624
} from "react";
2725
import { useFilter, useCollator } from "react-aria";
2826
import {
@@ -35,6 +33,7 @@ import {
3533
Form,
3634
MenuTrigger,
3735
} from "react-aria-components";
36+
import type { lookup } from "@pythnetwork/known-publishers";
3837

3938
import { type States, StateType as ApiStateType } from "../../hooks/use-api";
4039
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)