Skip to content

Commit

Permalink
feat: move emissions tokens map to utils
Browse files Browse the repository at this point in the history
  • Loading branch information
borcherd committed Oct 31, 2024
1 parent b85d51e commit 180ac9e
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ import Link from "next/link";
import { useRouter } from "next/router";

import { PublicKey, VersionedTransaction } from "@solana/web3.js";
import { IconInfoCircle } from "@tabler/icons-react";

import { numeralFormatter } from "@mrgnlabs/mrgn-common";
import { usdFormatter, usdFormatterDyn } from "@mrgnlabs/mrgn-common";
import { ActiveBankInfo } from "@mrgnlabs/marginfi-v2-ui-state";
import { LendingModes, MultiStepToastHandle } from "@mrgnlabs/mrgn-utils";
import { LendingModes, MultiStepToastHandle, EMISSION_MINT_INFO_MAP } from "@mrgnlabs/mrgn-utils";

import { useMrgnlendStore, useUiStore, useUserProfileStore } from "~/store";

Expand All @@ -17,15 +18,12 @@ import { useWallet } from "~/components/wallet-v2/hooks/use-wallet.hook";
import { Loader } from "~/components/ui/loader";
import { RewardsDialog } from "./components/rewards";
import { IconLoader } from "~/components/ui/icons";
import { IconInfoCircle } from "@tabler/icons-react";

import { PortfolioAssetCard, PortfolioAssetCardSkeleton, PortfolioUserStats } from "./components";
import { rewardsType } from "./types";
import { useRewardSimulation } from "./hooks";
import { executeCollectTxn } from "./utils";
import { Select, SelectContent, SelectItem, SelectTrigger } from "~/components/ui/select";
import { EMISSION_MINT_INFO_MAP } from "~/components/desktop/AssetList/components";
import { ActionComplete } from "~/components";

export const LendingPortfolio = () => {
const router = useRouter();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,13 @@ import {
PositionData,
RateData,
UtilizationData,
EMISSION_MINT_INFO_MAP,
} from "@mrgnlabs/mrgn-utils";

import { IMAGE_CDN_URL } from "~/config/constants";
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "~/components/ui/tooltip";
import { IconPyth, IconSwitchboard } from "~/components/ui/icons";

export const EMISSION_MINT_INFO_MAP = new Map<string, { tokenSymbol: string; tokenLogoUri: string }>([
[
"UXD",
{
tokenSymbol: "UXP",
tokenLogoUri: "/uxp-icon-white.png",
},
],
[
"bSOL",
{
tokenSymbol: "BLZE",
tokenLogoUri: "/blze.png",
},
],
]);

export const getAssetCell = (asset: AssetData) => (
<div className="flex gap-4 justify-start items-center">
<Image src={asset.image} alt={`${asset.symbol} logo`} height={25} width={25} className="rounded-full" />
Expand Down
9 changes: 9 additions & 0 deletions packages/mrgn-utils/src/emissions.consts.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export const EMISSION_MINT_INFO_MAP = new Map<string, { tokenSymbol: string; tokenLogoUri: string }>([
// [
// "bSOL",
// {
// tokenSymbol: "BLZE",
// tokenLogoUri: "/blze.png",
// },
// ],
]);
1 change: 1 addition & 0 deletions packages/mrgn-utils/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ export * from "./jup-referral.utils";
export * from "./bank-data.utils";
export * from "./action-message.utils";
export * from "./sentry.utils";
export * from "./emissions.consts";

0 comments on commit 180ac9e

Please sign in to comment.