Skip to content

Commit

Permalink
Type fixes for confirm-transaction slice selectors
Browse files Browse the repository at this point in the history
  • Loading branch information
MajorLift committed Jan 7, 2025
1 parent 689dc40 commit 89263ea
Show file tree
Hide file tree
Showing 4 changed files with 240 additions and 183 deletions.
4 changes: 2 additions & 2 deletions shared/modules/Numeric.ts
Original file line number Diff line number Diff line change
Expand Up @@ -420,8 +420,8 @@ export class Numeric {
* @param invert - if true, inverts the rate
* @returns New Numeric value with conversion rate applied.
*/
applyConversionRate(rate?: number | BigNumber, invert?: boolean) {
if (typeof rate === 'undefined') {
applyConversionRate(rate?: number | BigNumber | null, invert?: boolean) {
if (typeof rate === 'undefined' || rate === null) {
return this;
}

Expand Down
6 changes: 3 additions & 3 deletions shared/modules/conversion.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export function getWeiHexFromDecimalValue({
invertConversionRate = false,
}: {
value: NumericValue;
conversionRate?: number;
conversionRate?: number | null;
fromDenomination?: EtherDenomination;
fromCurrency?: string;
invertConversionRate?: boolean;
Expand Down Expand Up @@ -97,7 +97,7 @@ export function getEthConversionFromWeiHex({
numberOfDecimals = 6,
}: {
value: NumericValue;
conversionRate?: number;
conversionRate?: number | null;
fromCurrency?: EtherDenomination | string;
numberOfDecimals?: number;
}) {
Expand Down Expand Up @@ -139,7 +139,7 @@ export function getValueFromWeiHex({
value: NumericValue;
fromCurrency?: EtherDenomination | string;
toCurrency?: EtherDenomination | string;
conversionRate?: number;
conversionRate?: number | null;
numberOfDecimals?: number;
toDenomination?: EtherDenomination;
}) {
Expand Down
4 changes: 2 additions & 2 deletions ui/helpers/utils/confirm-tx.util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ export function getTransactionFee({
numberOfDecimals,
}: {
value: string;
fromCurrency: EtherDenomination;
fromCurrency: EtherDenomination | string;
toCurrency: string;
conversionRate: number;
conversionRate: number | null;
numberOfDecimals: number;
}): string {
let fee = new Numeric(value, 16, EtherDenomination.WEI)
Expand Down
Loading

0 comments on commit 89263ea

Please sign in to comment.