Skip to content

Commit ae43480

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

File tree

15 files changed

+175
-163
lines changed

15 files changed

+175
-163
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 & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import {
3535
Form,
3636
MenuTrigger,
3737
} from "react-aria-components";
38+
import type { lookup } from "@pythnetwork/known-publishers";
3839

3940
import { type States, StateType as ApiStateType } from "../../hooks/use-api";
4041
import {
@@ -1171,12 +1172,7 @@ type PublisherProps = {
11711172
totalStaked: bigint;
11721173
isSelf?: boolean | undefined;
11731174
publisher: {
1174-
identity:
1175-
| {
1176-
name: string;
1177-
icon: ComponentType<SVGProps<SVGSVGElement>>;
1178-
}
1179-
| undefined;
1175+
identity: ReturnType<typeof lookup>;
11801176
publicKey: PublicKey;
11811177
stakeAccount: PublicKey | undefined;
11821178
selfStake: bigint;
@@ -1723,7 +1719,7 @@ const PublisherIdentity = ({
17231719
props.children.identity ? (
17241720
<span className={clsx(className, withNameClassName)}>
17251721
<span>
1726-
{createElement(props.children.identity.icon, {
1722+
{createElement(props.children.identity.icon.monochrome, {
17271723
className: "mr-2 inline-block h-[20px] align-sub",
17281724
})}
17291725
<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)