Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
jkbpvsc committed Sep 26, 2023
2 parents 5da9428 + 45879c1 commit 466dc20
Show file tree
Hide file tree
Showing 57 changed files with 2,337 additions and 208 deletions.
3 changes: 3 additions & 0 deletions apps/marginfi-v2-ui/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,6 @@ next-env.d.ts

# turbo
.turbo

# Sentry Auth Token
.sentryclirc
35 changes: 35 additions & 0 deletions apps/marginfi-v2-ui/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,38 @@ module.exports = withBundleAnalyzer({
],
},
});

const { withSentryConfig } = require("@sentry/nextjs");

module.exports = withSentryConfig(
module.exports,
{
// For all available options, see:
// https://github.com/getsentry/sentry-webpack-plugin#options

// Suppresses source map uploading logs during build
silent: true,

org: "mrgn-labs",
project: "marginfi-v2-ui",
},
{
// For all available options, see:
// https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/

// Upload a larger set of source maps for prettier stack traces (increases build time)
widenClientFileUpload: true,

// Transpiles SDK to be compatible with IE11 (increases bundle size)
transpileClientSDK: true,

// Routes browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers (increases server load)
tunnelRoute: "/monitoring",

// Hides source maps from generated client bundles
hideSourceMaps: true,

// Automatically tree-shake Sentry logger statements to reduce bundle size
disableLogger: true,
}
);
7 changes: 7 additions & 0 deletions apps/marginfi-v2-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@
"lint-fix": "yarn lint --fix"
},
"dependencies": {
"@bonfida/spl-name-service": "^1.1.1",
"@coral-xyz/borsh": "^0.28.0",
"@emotion/react": "^11.10.5",
"@emotion/styled": "^11.10.5",
"@jup-ag/api": "^6.0.6",
"@jup-ag/react-hook": "^6.0.0-beta.2",
"@mrgnlabs/lip-client": "*",
"@mrgnlabs/marginfi-client-v2": "*",
"@mrgnlabs/marginfi-v2-ui-state": "*",
Expand All @@ -22,7 +25,10 @@
"@mui/material": "^5.11.2",
"@next/bundle-analyzer": "^13.4.19",
"@next/font": "13.1.1",
"@sentry/nextjs": "^7.68.0",
"@socialgouv/matomo-next": "^1.4.0",
"@solana/spl-stake-pool": "^0.6.5",
"@solana/spl-token-registry": "^0.2.4574",
"@solana/wallet-adapter-base": "^0.9.20",
"@solana/wallet-adapter-react": "^0.15.28",
"@solana/wallet-adapter-react-ui": "^0.9.27",
Expand All @@ -34,6 +40,7 @@
"bs58": "^5.0.0",
"firebase": "^9.22.1",
"firebase-admin": "^11.9.0",
"jsbi": "^4.3.0",
"next": "13.4.19",
"react": "18.2.0",
"react-dom": "18.2.0",
Expand Down
5 changes: 5 additions & 0 deletions apps/marginfi-v2-ui/sentry.client.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// This file configures the initialization of Sentry on the client.
// The config you add here will be used whenever a users loads a page in their browser.
// https://docs.sentry.io/platforms/javascript/guides/nextjs/

import * as Sentry from "@sentry/nextjs";
7 changes: 7 additions & 0 deletions apps/marginfi-v2-ui/sentry.edge.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import * as Sentry from "@sentry/nextjs";

Sentry.init({
dsn: process.env.SENTRY_DSN,
tracesSampleRate: 1,
debug: false,
});
7 changes: 7 additions & 0 deletions apps/marginfi-v2-ui/sentry.server.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import * as Sentry from "@sentry/nextjs";

Sentry.init({
dsn: process.env.SENTRY_DSN,
tracesSampleRate: 1,
debug: false,
});
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import { useWalletContext } from "~/components/useWalletContext";

const CLOSE_BALANCE_TOAST_ID = "close-balance";
const BORROW_OR_LEND_TOAST_ID = "borrow-or-lend";
const EMISSION_MINT_INFO_MAP = new Map<string, { tokenSymbol: string; tokenLogoUri: string }>([
export const EMISSION_MINT_INFO_MAP = new Map<string, { tokenSymbol: string; tokenLogoUri: string }>([
[
"UXD",
{
Expand Down
18 changes: 9 additions & 9 deletions apps/marginfi-v2-ui/src/components/CampaignWizard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ const CampaignWizardInputBox: FC<CampaignWizardInputBox> = ({
);
};

interface CampaignWizardProps { }
interface CampaignWizardProps {}

const CampaignWizard: FC<CampaignWizardProps> = () => {
const [guaranteedApy, setGuaranteedApy] = useState(0);
Expand Down Expand Up @@ -271,7 +271,7 @@ const CampaignWizard: FC<CampaignWizardProps> = () => {
<CampaignWizardInputBox
value={guaranteedApy * 100}
setValue={(value) => setGuaranteedApy(value / 100)}
loadingSafetyCheck={() => { }}
loadingSafetyCheck={() => {}}
maxDecimals={2}
disabled={!walletContext.connected}
/>
Expand All @@ -282,7 +282,7 @@ const CampaignWizard: FC<CampaignWizardProps> = () => {
<CampaignWizardInputBox
value={lockupPeriodInDays}
setValue={setLockupPeriodInDays}
loadingSafetyCheck={() => { }}
loadingSafetyCheck={() => {}}
maxDecimals={4}
disabled={!walletContext.connected}
/>
Expand All @@ -293,7 +293,7 @@ const CampaignWizard: FC<CampaignWizardProps> = () => {
<CampaignWizardInputBox
value={depositCapacity}
setValue={setDepositCapacity}
loadingSafetyCheck={() => { }}
loadingSafetyCheck={() => {}}
maxDecimals={3}
disabled={!walletContext.connected}
/>
Expand Down Expand Up @@ -343,12 +343,12 @@ const CampaignWizard: FC<CampaignWizardProps> = () => {
>
{campaignBank
? percentFormatterDyn.format(
computeGuaranteedApy(
contractInputs.lockupPeriod.toNumber(),
contractInputs.maxDeposits.toNumber(),
contractInputs.maxRewards.toNumber()
computeGuaranteedApy(
contractInputs.lockupPeriod.toNumber(),
contractInputs.maxDeposits.toNumber(),
contractInputs.maxRewards.toNumber()
)
)
)
: 0}
</span>
</div>
Expand Down
3 changes: 1 addition & 2 deletions apps/marginfi-v2-ui/src/components/Earn/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { FC, MouseEventHandler, ReactNode, useCallback, useEffect, useMemo, useState } from "react";
import { useConnection, useWallet } from "@solana/wallet-adapter-react";
import { useConnection } from "@solana/wallet-adapter-react";
import { PageHeader } from "~/components/PageHeader";
import { useLipClient } from "~/context";
import Button from "@mui/material/Button";
Expand Down Expand Up @@ -210,7 +210,6 @@ const Earn = () => {

return (
<>
<PageHeader />
<div className="h-full flex flex-col justify-start items-center content-start py-[48px] w-4/5 max-w-7xl gap-4">
<div className="w-[360px] flex flex-col items-center gap-6">
<div className="w-[300px] h-[100px] flex flex-col gap-5 justify-center">
Expand Down
20 changes: 16 additions & 4 deletions apps/marginfi-v2-ui/src/components/Footer/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,19 @@ const HotkeysInfo: FC = () => {
};

const LendZoomControl: FC = () => {
const [lendZoomLevel, setLendZoomLevel] = useUserProfileStore((state) => [state.lendZoomLevel, state.setLendZoomLevel]);
const [lendZoomLevel, setLendZoomLevel] = useUserProfileStore((state) => [
state.lendZoomLevel,
state.setLendZoomLevel,
]);

return (
<div className="flex gap-4 items-center justify-center border-r border-[#4E5257] pr-4">
<div className="flex items-center h-full">
<SvgIcon onClick={() => setLendZoomLevel(1)} viewBox="0 0 17 17">
<svg fill="#868E95" className={`cursor-pointer ${lendZoomLevel === 1 && "fill-[#DCE85D]"} hover:fill-[#DCE85D] text-lg`}>
<svg
fill="#868E95"
className={`cursor-pointer ${lendZoomLevel === 1 && "fill-[#DCE85D]"} hover:fill-[#DCE85D] text-lg`}
>
<path
strokeWidth={1.5}
d="M1 1h3v3h-3v-3zM5 4h3v-3h-3v3zM9 4h3v-3h-3v3zM13 1v3h3v-3h-3zM1 8h3v-3h-3v3zM5 8h3v-3h-3v3zM9 8h3v-3h-3v3zM13 8h3v-3h-3v3zM1 12h3v-3h-3v3zM5 12h3v-3h-3v3zM9 12h3v-3h-3v3zM13 12h3v-3h-3v3zM1 16h3v-3h-3v3zM5 16h3v-3h-3v3zM9 16h3v-3h-3v3zM13 16h3v-3h-3v3z"
Expand All @@ -80,7 +86,10 @@ const LendZoomControl: FC = () => {
</div>
<div className="flex items-center h-full">
<SvgIcon onClick={() => setLendZoomLevel(2)} viewBox="0 0 16 16">
<svg fill="#868E95" className={`cursor-pointer ${lendZoomLevel === 2 && "fill-[#DCE85D]"} hover:fill-[#DCE85D] text-lg`}>
<svg
fill="#868E95"
className={`cursor-pointer ${lendZoomLevel === 2 && "fill-[#DCE85D]"} hover:fill-[#DCE85D] text-lg`}
>
<path
strokeWidth={1.5}
d="M1 2a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2zm5 0a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V2zm5 0a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1V2zM1 7a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V7zm5 0a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V7zm5 0a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1V7zM1 12a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1v-2zm5 0a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1v-2zm5 0a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1v-2z"
Expand All @@ -90,7 +99,10 @@ const LendZoomControl: FC = () => {
</div>
<div className="flex items-center h-full">
<SvgIcon onClick={() => setLendZoomLevel(3)} viewBox="0 0 16 16">
<svg fill="#868E95" className={`cursor-pointer ${lendZoomLevel === 3 && "fill-[#DCE85D]"} hover:fill-[#DCE85D] text-lg`}>
<svg
fill="#868E95"
className={`cursor-pointer ${lendZoomLevel === 3 && "fill-[#DCE85D]"} hover:fill-[#DCE85D] text-lg`}
>
<path
strokeWidth={1.5}
d="M1 2.5A1.5 1.5 0 0 1 2.5 1h3A1.5 1.5 0 0 1 7 2.5v3A1.5 1.5 0 0 1 5.5 7h-3A1.5 1.5 0 0 1 1 5.5v-3zm8 0A1.5 1.5 0 0 1 10.5 1h3A1.5 1.5 0 0 1 15 2.5v3A1.5 1.5 0 0 1 13.5 7h-3A1.5 1.5 0 0 1 9 5.5v-3zm-8 8A1.5 1.5 0 0 1 2.5 9h3A1.5 1.5 0 0 1 7 10.5v3A1.5 1.5 0 0 1 5.5 15h-3A1.5 1.5 0 0 1 1 13.5v-3zm8 0A1.5 1.5 0 0 1 10.5 9h3a1.5 1.5 0 0 1 1.5 1.5v3a1.5 1.5 0 0 1-1.5 1.5h-3A1.5 1.5 0 0 1 9 13.5v-3z"
Expand Down
4 changes: 1 addition & 3 deletions apps/marginfi-v2-ui/src/components/Navbar/AirdropZone.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,7 @@ const AirdropZone: FC = () => {

return (
<div>
<span onClick={open}>
Airdrop
</span>
<span onClick={open}>Airdrop</span>
<Modal open={isOpen} onClose={close} aria-labelledby="title" aria-describedby="description">
<div id={styles["container"]}>
<div id={styles["overlay"]}>
Expand Down
Loading

0 comments on commit 466dc20

Please sign in to comment.