Skip to content

Commit

Permalink
v7.8.2
Browse files Browse the repository at this point in the history
v7.8.2
  • Loading branch information
platschi authored Sep 20, 2023
2 parents 41707a4 + dbb237d commit b67ae79
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 10 deletions.
10 changes: 10 additions & 0 deletions packages/app/src/state/futures/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,16 @@ export const useFetchStakeMigrateData = () => {
useFetchAction(fetchStakeMigrateData, {
dependencies: [networkId, wallet],
})

useFetchAction(fetchFuturesFees, {
dependencies: [networkId, start, end],
disabled: !networkSupportsStaking,
})

useFetchAction(fetchFuturesFeesForAccount, {
dependencies: [networkId, wallet, start, end],
disabled: !wallet || !networkSupportsStaking,
})
}

export const useFetchReferralData = () => {
Expand Down
19 changes: 9 additions & 10 deletions packages/app/src/state/futures/smartMargin/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ import {
selectAllSmartMarginPositions,
} from './selectors'
import { SmartMarginBalanceInfo } from './types'
import { selectSelectedEpoch } from 'state/staking/selectors'

export const fetchMarketsV2 = createAsyncThunk<
{ markets: PerpsMarketV2<string>[]; networkId: NetworkId } | undefined,
Expand Down Expand Up @@ -931,12 +932,11 @@ export const fetchFuturesFees = createAsyncThunk<
{
totalFuturesFeePaid: string
},
{
start: number
end: number
},
void,
ThunkConfig
>('futures/fetchFuturesFees', async ({ start, end }, { extra: { sdk } }) => {
>('futures/fetchFuturesFees', async (_, { getState, extra: { sdk } }) => {
const { start, end } = selectSelectedEpoch(getState())

try {
const totalFuturesFeePaid = await sdk.kwentaToken.getFuturesFee(start, end)
return { totalFuturesFeePaid: totalFuturesFeePaid.toString() }
Expand All @@ -950,12 +950,11 @@ export const fetchFuturesFeesForAccount = createAsyncThunk<
{
futuresFeePaid: string
},
{
start: number
end: number
},
void,
ThunkConfig
>('futures/fetchFuturesFeesForAccount', async ({ start, end }, { getState, extra: { sdk } }) => {
>('futures/fetchFuturesFeesForAccount', async (_, { getState, extra: { sdk } }) => {
const { start, end } = selectSelectedEpoch(getState())

try {
const wallet = selectWallet(getState())
const futuresFeePaid = await sdk.kwentaToken.getFuturesFeeForAccount(wallet!, start, end)
Expand Down

1 comment on commit b67ae79

@vercel
Copy link

@vercel vercel bot commented on b67ae79 Sep 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

kwenta – ./packages/app

kwenta-kwenta.vercel.app
kwenta-git-main-kwenta.vercel.app
www.kwenta.io
kwenta.io

Please sign in to comment.