Skip to content

Commit

Permalink
stash-wip
Browse files Browse the repository at this point in the history
  • Loading branch information
MajorLift committed Jan 6, 2025
1 parent 87d63fa commit 00b71d0
Show file tree
Hide file tree
Showing 10 changed files with 274 additions and 194 deletions.
10 changes: 4 additions & 6 deletions app/scripts/controllers/swaps/swaps.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,10 @@ export type SwapsControllerState = {
swapsStxGetTransactionsRefreshTime: number;
swapsStxMaxFeeMultiplier: number;
swapsFeatureFlags:
| ({
smartTransactions?: Partial<FeatureFlags>;
} & {
[networkName: string]: { smartTransactions?: Partial<FeatureFlags> };
})
| Record<string, boolean>;
| Partial<FeatureFlags>
| {
[networkName: string]: Partial<FeatureFlags>;
};
};
};

Expand Down
2 changes: 1 addition & 1 deletion app/scripts/lib/ppom/ppom-middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export function createPPOMMiddleware<

const { chainId } =
getProviderConfig({
metamask: networkController.state,
metamask: { NetworkController: networkController.state },
}) ?? {};
if (!chainId) {
return;
Expand Down
4 changes: 2 additions & 2 deletions shared/constants/multichain/assets.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { CaipAssetType } from '@metamask/keyring-api';
import { MultichainNetworks } from './networks';
import { MultichainNetworkIds, MultichainNetworks } from './networks';

export const MULTICHAIN_NATIVE_CURRENCY_TO_CAIP19 = {
BTC: `${MultichainNetworks.BITCOIN}/slip44:0`,
Expand All @@ -20,7 +20,7 @@ export enum MultichainNativeAssets {
* Each network is mapped to an array containing its native asset for consistency.
*/
export const MULTICHAIN_NETWORK_TO_ASSET_TYPES: Record<
MultichainNetworks,
MultichainNetworkIds,
CaipAssetType[]
> = {
[MultichainNetworks.SOLANA]: [MultichainNativeAssets.SOLANA],
Expand Down
4 changes: 1 addition & 3 deletions shared/modules/selectors/smart-transactions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ export const getSmartTransactionsOptInStatusInternal = createSelector(
* @returns true if the user has explicitly opted in, false if they have opted out,
* or null if they have not explicitly opted in or out.
*/
// @ts-expect-error TODO: Fix types for `getSmartTransactionsOptInStatusInternal` once `getPreferences is converted to TypeScript
export const getSmartTransactionsOptInStatusForMetrics = createSelector(
getSmartTransactionsOptInStatusInternal,
(optInStatus: boolean): boolean => optInStatus,
Expand All @@ -60,7 +59,6 @@ export const getSmartTransactionsOptInStatusForMetrics = createSelector(
* @param state
* @returns
*/
// @ts-expect-error TODO: Fix types for `getSmartTransactionsOptInStatusInternal` once `getPreferences is converted to TypeScript
export const getSmartTransactionsPreferenceEnabled = createSelector(
getSmartTransactionsOptInStatusInternal,
(optInStatus: boolean): boolean => {
Expand Down Expand Up @@ -100,7 +98,7 @@ export const getSmartTransactionsEnabled = (
// TODO: Create a new proxy service only for MM feature flags.
const smartTransactionsFeatureFlagEnabled =
state.metamask.SwapsController.swapsState?.swapsFeatureFlags
?.smartTransactions?.extensionActive;
?.extensionActive;
const smartTransactionsLiveness =
state.metamask.SmartTransactionsController.smartTransactionsState?.liveness;
return Boolean(
Expand Down
3 changes: 2 additions & 1 deletion ui/ducks/confirm-transaction/confirm-transaction.duck.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ import { isEqualCaseInsensitive } from '../../../shared/modules/string-utils';
import { parseStandardTokenTransactionData } from '../../../shared/modules/transaction.utils';

// Actions
const createActionType = (action) => `metamask/confirm-transaction/${action}`;
const createActionType = (action: string) =>
`metamask/confirm-transaction/${action}`;

const UPDATE_TX_DATA = createActionType('UPDATE_TX_DATA');
const UPDATE_TOKEN_DATA = createActionType('UPDATE_TOKEN_DATA');
Expand Down
Loading

0 comments on commit 00b71d0

Please sign in to comment.