Skip to content

Commit 7e273d0

Browse files
authored
Merge pull request #2028 from cprussin/add-sentio
feat(staking): add Sentio to known publishers
2 parents e80eb00 + d312fa7 commit 7e273d0

File tree

6 files changed

+30
-15
lines changed

6 files changed

+30
-15
lines changed
Binary file not shown.

apps/staking/src/api.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,7 @@ type Data = {
5050
z: bigint;
5151
integrityStakingPublishers: {
5252
identity:
53-
| {
54-
name: string;
55-
icon: string;
56-
}
53+
| (typeof KNOWN_PUBLISHERS)[keyof typeof KNOWN_PUBLISHERS]
5754
| undefined;
5855
publicKey: PublicKey;
5956
stakeAccount: PublicKey | undefined;
@@ -271,7 +268,10 @@ const loadPublisherData = async (
271268
return {
272269
apyHistory,
273270
identity: (
274-
KNOWN_PUBLISHERS as Record<string, { name: string; icon: string }>
271+
KNOWN_PUBLISHERS as Record<
272+
string,
273+
(typeof KNOWN_PUBLISHERS)[keyof typeof KNOWN_PUBLISHERS]
274+
>
275275
)[publisher.pubkey.toBase58()],
276276
numFeeds: numberOfSymbols ?? 0,
277277
poolCapacity: getPublisherCap(publisherCaps, publisher.pubkey),

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

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,19 @@ import {
1010
import { calculateApy } from "@pythnetwork/staking-sdk";
1111
import { PublicKey } from "@solana/web3.js";
1212
import clsx from "clsx";
13-
import Image from "next/image";
1413
import {
1514
useMemo,
1615
useCallback,
1716
useState,
1817
useRef,
18+
createElement,
1919
type ComponentProps,
2020
type Dispatch,
2121
type SetStateAction,
2222
type HTMLAttributes,
2323
type FormEvent,
24+
type ComponentType,
25+
type SVGProps,
2426
} from "react";
2527
import { useFilter, useCollator } from "react-aria";
2628
import {
@@ -1172,7 +1174,7 @@ type PublisherProps = {
11721174
identity:
11731175
| {
11741176
name: string;
1175-
icon: string;
1177+
icon: ComponentType<SVGProps<SVGSVGElement>>;
11761178
}
11771179
| undefined;
11781180
publicKey: PublicKey;
@@ -1721,13 +1723,9 @@ const PublisherIdentity = ({
17211723
props.children.identity ? (
17221724
<span className={clsx(className, withNameClassName)}>
17231725
<span>
1724-
<Image
1725-
alt={`${props.children.identity.name} icon`}
1726-
src={props.children.identity.icon}
1727-
className="mr-2 inline-block size-[20px] align-sub"
1728-
width={20}
1729-
height={20}
1730-
/>
1726+
{createElement(props.children.identity.icon, {
1727+
className: "mr-2 inline-block size-[20px] align-sub",
1728+
})}
17311729
<span className="mr-[0.5em]">{props.children.identity.name}</span>
17321730
</span>
17331731
<PublisherKey className="text-sm opacity-50" {...props} />

apps/staking/src/known-publishers.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
1+
import blocksize from "./publisher-icons/blocksize.svg";
2+
import sentio from "./publisher-icons/sentio.svg";
3+
14
export const KNOWN_PUBLISHERS = {
25
CfVkYofcLC1iVBcYFzgdYPeiX25SVRmWvBQVHorP1A3y: {
36
name: "BLOCKSIZE",
4-
icon: "/publisher-icons/blocksize.png",
7+
icon: blocksize,
8+
},
9+
"89ijemG1TUL2kdV2RtCrhXzY5QhyKHsWqCmP5iobvLUF": {
10+
name: "Sentio",
11+
icon: sentio,
512
},
613
};
Lines changed: 6 additions & 0 deletions
Loading
Lines changed: 4 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)