Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ describe('snap_getPreferences', () => {
locale: 'en',
currency: 'usd',
hideBalances: false,
useSecurityAlerts: true,
useSimulations: true,
useTokenDetection: true,
batchCheckBalances: true,
displayNftMedia: false,
useNftDetection: false,
usePriceCheck: true,
}),
};

Expand All @@ -42,7 +49,18 @@ describe('snap_getPreferences', () => {
},
method: 'snap_getPreferences',
}),
).toStrictEqual({ locale: 'en', currency: 'usd', hideBalances: false });
).toStrictEqual({
locale: 'en',
currency: 'usd',
hideBalances: false,
useSecurityAlerts: true,
useSimulations: true,
useTokenDetection: true,
batchCheckBalances: true,
displayNftMedia: false,
useNftDetection: false,
usePriceCheck: true,
});
});
});
});
14 changes: 14 additions & 0 deletions packages/snaps-sdk/src/types/methods/get-preferences.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,23 @@ export type GetPreferencesParams = never;
* @property locale - The user's selected locale.
* @property currency - The user's selected currency.
* @property hideBalances - Whether the user has chosen to hide balances.
* @property useSecurityAlerts - Whether to run transactions and signatures through blockaid.
* @property useSimulations - Whether to simulate transactions and signatures.
* @property useTokenDetection - Whether to auto-detect tokens.
* @property batchCheckBalances - Whether to fetch balances in an aggregated manner.
* @property displayNftMedia - Whether to display NFT media.
* @property useNftDetection - Whether to auto-detect NFTs.
* @property usePriceCheck - Whether to get token price data from an external source.
*/
export type GetPreferencesResult = {
locale: string;
currency: string;
hideBalances: boolean;
useSecurityAlerts: boolean;
useSimulations: boolean;
useTokenDetection: boolean;
batchCheckBalances: boolean;
displayNftMedia: boolean;
useNftDetection: boolean;
usePriceCheck: boolean;
};
Loading