Skip to content

Commit

Permalink
fix: resolved merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
k0beLeenders committed Oct 31, 2024
1 parent 56f3b75 commit e493a5b
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 18 deletions.
7 changes: 1 addition & 6 deletions apps/marginfi-v2-ui/src/components/common/Navbar/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,10 @@ import Link from "next/link";
import Image from "next/image";
import { useRouter } from "next/router";

import { PublicKey } from "@solana/web3.js";
import { IconBell, IconBrandTelegram, IconSettings } from "@tabler/icons-react";
import { IconBell, IconBrandTelegram } from "@tabler/icons-react";

import { collectRewardsBatch, capture, cn } from "@mrgnlabs/mrgn-utils";
import { Settings, Wallet } from "@mrgnlabs/mrgn-ui";
import { capture, cn } from "@mrgnlabs/mrgn-utils";
import { Wallet } from "@mrgnlabs/mrgn-ui";
import { Settings, Wallet } from "@mrgnlabs/mrgn-ui";

import { useMrgnlendStore, useUiStore, useUserProfileStore } from "~/store";
import { useFirebaseAccount } from "~/hooks/useFirebaseAccount";
Expand Down Expand Up @@ -60,7 +56,6 @@ export const Navbar: FC = () => {
setTransactionSettings: state.setTransactionSettings,
})
);
const [isOraclesStale] = useUiStore((state) => [state.isOraclesStale, state.priorityFee]);

const [userPointsData] = useUserProfileStore((state) => [state.userPointsData]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import React from "react";
import Image from "next/image";
import { IconAlertTriangle } from "@tabler/icons-react";

import { IconAlertTriangle } from "@tabler/icons-react";
import { usdFormatter, numeralFormatter, dynamicNumeralFormatter } from "@mrgnlabs/mrgn-common";
import { ActiveBankInfo, ActionType, ExtendedBankInfo } from "@mrgnlabs/marginfi-v2-ui-state";
import { capture } from "@mrgnlabs/mrgn-utils";
Expand Down
15 changes: 11 additions & 4 deletions packages/marginfi-client-v2/src/models/account/wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1071,9 +1071,16 @@ class MarginfiAccountWrapper {
);
}

async makeWithdrawEmissionsTx(bankAddresses: PublicKey[]): Promise<VersionedTransaction> {
const bundleTipIx = makeBundleTipIx(this.client.provider.publicKey);
const priorityFeeIx = this.makePriorityFeeIx(0); // TODO: set priorityfee
async makeWithdrawEmissionsTx(
bankAddresses: PublicKey[],
priorityFeeUi?: number,
broadcastType: TransactionBroadcastType = "BUNDLE"
): Promise<VersionedTransaction> {
const { bundleTipIx, priorityFeeIx } = makeTxPriorityIx(
this.client.provider.publicKey,
priorityFeeUi,
broadcastType
);
const blockhash = (await this._program.provider.connection.getLatestBlockhash()).blockhash;

const ixs: TransactionInstruction[] = [];
Expand All @@ -1087,7 +1094,7 @@ class MarginfiAccountWrapper {

return new VersionedTransaction(
new TransactionMessage({
instructions: [bundleTipIx, ...priorityFeeIx, ...ixs],
instructions: [priorityFeeIx, ...(bundleTipIx ? [bundleTipIx] : []), ...ixs],
payerKey: this.authority,
recentBlockhash: blockhash,
}).compileToV0Message()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,15 @@ import {
computeAccountSummary,
DEFAULT_ACCOUNT_SUMMARY,
} from "@mrgnlabs/marginfi-v2-ui-state";
import { ActionMethod, MarginfiActionParams, PreviousTxn, useConnection, usePriorityFee } from "@mrgnlabs/mrgn-utils";
import { ActionMessageType, checkLendActionAvailable, MarginfiActionParams, PreviousTxn } from "@mrgnlabs/mrgn-utils";

import { MarginfiAccountWrapper, MarginfiClient } from "@mrgnlabs/marginfi-client-v2";
import {
ActionMessageType,
checkLendActionAvailable,
MarginfiActionParams,
PreviousTxn,
usePriorityFee,
} from "@mrgnlabs/mrgn-utils";

import { ActionButton } from "~/components/action-box-v2/components";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
MarginfiActionParams,
PreviousTxn,
showErrorToast,
usePriorityFee,
} from "@mrgnlabs/mrgn-utils";
import { MarginfiAccountWrapper, MarginfiClient } from "@mrgnlabs/marginfi-client-v2";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useEffect } from "react";
import React from "react";

import { WalletContextState } from "@solana/wallet-adapter-react";

Expand All @@ -10,17 +10,18 @@ import { nativeToUi, NATIVE_MINT as SOL_MINT, uiToNative } from "@mrgnlabs/mrgn-
import { useActionAmounts } from "~/components/action-box-v2/hooks";
import { WalletContextStateOverride } from "~/components/wallet-v2/hooks/use-wallet.hook";
import { ActionMessage } from "~/components";
import { usePriorityFee } from "~/hooks";

import { useActionBoxStore } from "../../store";
import { ActionButton, ActionSettingsButton } from "../../components";
import { useActionContext, useStakeBoxContext } from "../../contexts";

import { useStakeBoxStore } from "./store";
import { AmountPreview } from "./components/amount-preview";
import { ActionButton, ActionSettingsButton } from "../../components";
import { StatsPreview } from "./components/stats-preview";
import { useStakeSimulation } from "./hooks";
import { useActionBoxStore } from "../../store";
import { handleExecuteLstAction } from "./utils/stake-action.utils";
import { ActionInput } from "./components/action-input";
import { checkActionAvailable } from "./utils";
import { useActionContext, useStakeBoxContext } from "../../contexts";

export type StakeBoxProps = {
nativeSolBalance: number;
Expand Down

0 comments on commit e493a5b

Please sign in to comment.