Skip to content

Commit

Permalink
fixup! chore(trading): add buy middleware and thunks
Browse files Browse the repository at this point in the history
  • Loading branch information
adderpositive committed Feb 11, 2025
1 parent 690b573 commit 7422381
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions suite-common/trading/src/thunks/tradingThunks.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import { createAction } from '@reduxjs/toolkit';

import { createThunk } from '@suite-common/redux-utils';
import { UserContextPayload } from '@suite-common/suite-types';
import { notificationsActions } from '@suite-common/toast-notifications';
import { confirmAddressOnDeviceThunk, selectSelectedDevice } from '@suite-common/wallet-core';
import { Account, AddressDisplayOptions } from '@suite-common/wallet-types';
Expand All @@ -13,10 +10,6 @@ import { getUnusedAddressFromAccount } from '../utils';

const TRADING_COMMON_PREFIX = '@trading-common/thunk';

const openModal = createAction('@modal/open-user-context', (payload: UserContextPayload) => ({
payload,
}));

interface VerifyAddressThunk {
account: Account;
address: string | undefined;
Expand All @@ -29,7 +22,7 @@ const verifyAddressThunk = createThunk(
`${TRADING_COMMON_PREFIX}/verifyAddress`,
async (
{ account, address, path, tradingAction }: VerifyAddressThunk,
{ dispatch, getState },
{ dispatch, getState, extra },
) => {
const device = selectSelectedDevice(getState());
if (!device || !account) return;
Expand All @@ -47,7 +40,7 @@ const verifyAddressThunk = createThunk(
// Show warning when device is not connected
if (!connected || !available) {
dispatch(
openModal({
extra.actions.openModal({
type: 'unverified-address-proceed',
value: address,
}),
Expand Down

0 comments on commit 7422381

Please sign in to comment.