Skip to content

Commit f557ead

Browse files
committed
Merge branch 'main' into fix/remove-history-property
2 parents 55daea2 + 1af128e commit f557ead

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+461
-303
lines changed

eslint-suppressions.json

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1955,26 +1955,8 @@
19551955
}
19561956
},
19571957
"packages/keyring-controller/src/KeyringController.ts": {
1958-
"@typescript-eslint/await-thenable": {
1959-
"count": 1
1960-
},
1961-
"@typescript-eslint/explicit-function-return-type": {
1962-
"count": 10
1963-
},
19641958
"@typescript-eslint/naming-convention": {
19651959
"count": 10
1966-
},
1967-
"@typescript-eslint/no-unused-vars": {
1968-
"count": 1
1969-
},
1970-
"@typescript-eslint/prefer-nullish-coalescing": {
1971-
"count": 3
1972-
},
1973-
"id-length": {
1974-
"count": 2
1975-
},
1976-
"no-case-declarations": {
1977-
"count": 5
19781960
}
19791961
},
19801962
"packages/keyring-controller/tests/mocks/mockEncryptor.ts": {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@metamask/core-monorepo",
3-
"version": "710.0.0",
3+
"version": "713.0.0",
44
"private": true,
55
"description": "Monorepo for packages shared between MetaMask clients",
66
"repository": {

packages/assets-controllers/CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Added
11+
12+
- Support for Monad in NFT assets-controllers, [#7254](https://github.com/MetaMask/core/pull/7254)
13+
14+
### Changed
15+
16+
- Bump `@metamask/transaction-controller` from `^62.4.0` to `^62.5.0` ([#7325](https://github.com/MetaMask/core/pull/7325))
17+
18+
### Fixed
19+
20+
- Added decimal precision (default 9dp) for `CurrencyRateController` `conversionRate` and `conversionRate` properties. ([#7324](https://github.com/MetaMask/core/pull/7324))
21+
- This fixes any BigNumber conversion errors due to exceeding the 15 significant digit limit
22+
1023
## [93.1.0]
1124

1225
### Added

packages/assets-controllers/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
"@metamask/snaps-controllers": "^14.0.1",
7979
"@metamask/snaps-sdk": "^9.0.0",
8080
"@metamask/snaps-utils": "^11.0.0",
81-
"@metamask/transaction-controller": "^62.4.0",
81+
"@metamask/transaction-controller": "^62.5.0",
8282
"@metamask/utils": "^11.8.1",
8383
"@types/bn.js": "^5.1.5",
8484
"@types/uuid": "^8.3.0",

packages/assets-controllers/src/CurrencyRateController.test.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import { CurrencyRateController } from './CurrencyRateController';
1919
import type { AbstractTokenPricesService } from './token-prices-service';
2020
import { advanceTime } from '../../../tests/helpers';
2121

22-
const namespace = 'CurrencyRateController' as const;
22+
const namespace = 'CurrencyRateController';
2323

2424
type AllCurrencyRateControllerActions = MessengerActions<CurrencyRateMessenger>;
2525

@@ -283,7 +283,7 @@ describe('CurrencyRateController', () => {
283283
expect(controller.state.currencyRates).toStrictEqual({
284284
ETH: {
285285
conversionDate: 10,
286-
conversionRate: 4149.764437073889,
286+
conversionRate: 4149.764437074,
287287
usdConversionRate: null,
288288
},
289289
});
@@ -297,7 +297,7 @@ describe('CurrencyRateController', () => {
297297
expect(controller.state.currencyRates).toStrictEqual({
298298
ETH: {
299299
conversionDate: 20,
300-
conversionRate: 4149.764437073889,
300+
conversionRate: 4149.764437074,
301301
usdConversionRate: null,
302302
},
303303
});
@@ -416,8 +416,8 @@ describe('CurrencyRateController', () => {
416416
expect(controller.state.currencyRates).toStrictEqual({
417417
ETH: {
418418
conversionDate: getStubbedDate() / 1000,
419-
conversionRate: 4149.764437073889,
420-
usdConversionRate: 0.009009009009009009,
419+
conversionRate: 4149.764437074,
420+
usdConversionRate: 0.009009009,
421421
},
422422
});
423423

@@ -468,7 +468,7 @@ describe('CurrencyRateController', () => {
468468
},
469469
SepoliaETH: {
470470
conversionDate: getStubbedDate() / 1000,
471-
conversionRate: 4149.764437073889,
471+
conversionRate: 4149.764437074,
472472
usdConversionRate: 1000,
473473
},
474474
});
@@ -537,13 +537,13 @@ describe('CurrencyRateController', () => {
537537
currencyRates: {
538538
ETH: {
539539
conversionDate: getStubbedDate() / 1000,
540-
conversionRate: 4149.764437073889,
541-
usdConversionRate: 181.81818181818184,
540+
conversionRate: 4149.764437074,
541+
usdConversionRate: 181.818181818,
542542
},
543543
BTC: {
544544
conversionDate: getStubbedDate() / 1000,
545545
conversionRate: 9636.6518,
546-
usdConversionRate: 454.5454545454545,
546+
usdConversionRate: 454.545454545,
547547
},
548548
},
549549
});
@@ -616,7 +616,7 @@ describe('CurrencyRateController', () => {
616616
currencyRates: {
617617
ETH: {
618618
conversionDate: getStubbedDate() / 1000,
619-
conversionRate: 2000.4199999999998,
619+
conversionRate: 2000.42,
620620
usdConversionRate: null,
621621
},
622622
},

packages/assets-controllers/src/CurrencyRateController.ts

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,9 @@ type CurrencyRatePollingInput = {
100100
nativeCurrencies: string[];
101101
};
102102

103+
const boundedPrecisionNumber = (value: number, precision = 9): number =>
104+
Number(value.toFixed(precision));
105+
103106
/**
104107
* Controller that passively polls on a set interval for an exchange rate from the current network
105108
* asset to the user's preferred currency.
@@ -201,8 +204,12 @@ export class CurrencyRateController extends StaticIntervalPollingController<Curr
201204

202205
acc[nativeCurrency] = {
203206
conversionDate: rate !== undefined ? Date.now() / 1000 : null,
204-
conversionRate: rate?.value ? Number(1 / rate?.value) : null,
205-
usdConversionRate: rate?.usd ? Number(1 / rate?.usd) : null,
207+
conversionRate: rate?.value
208+
? boundedPrecisionNumber(1 / rate.value)
209+
: null,
210+
usdConversionRate: rate?.usd
211+
? boundedPrecisionNumber(1 / rate.usd)
212+
: null,
206213
};
207214
return acc;
208215
}, {});
@@ -263,7 +270,9 @@ export class CurrencyRateController extends StaticIntervalPollingController<Curr
263270
return {
264271
nativeCurrency,
265272
conversionDate: tokenPrice ? Date.now() / 1000 : null,
266-
conversionRate: tokenPrice?.price ?? null,
273+
conversionRate: tokenPrice?.price
274+
? boundedPrecisionNumber(tokenPrice.price)
275+
: null,
267276
usdConversionRate: null, // Token prices service doesn't provide USD rate in this context
268277
};
269278
}),
@@ -291,8 +300,12 @@ export class CurrencyRateController extends StaticIntervalPollingController<Curr
291300
>((acc, rate) => {
292301
acc[rate.nativeCurrency] = {
293302
conversionDate: rate.conversionDate,
294-
conversionRate: rate.conversionRate,
295-
usdConversionRate: rate.usdConversionRate,
303+
conversionRate: rate.conversionRate
304+
? boundedPrecisionNumber(rate.conversionRate)
305+
: null,
306+
usdConversionRate: rate.usdConversionRate
307+
? boundedPrecisionNumber(rate.usdConversionRate)
308+
: null,
296309
};
297310
return acc;
298311
}, {});

packages/assets-controllers/src/NftDetectionController.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ const supportedNftDetectionNetworks: Set<Hex> = new Set([
7373
'0x1', // Mainnet
7474
'0xe708', // Linea Mainnet
7575
'0x531', // Sei
76+
'0x8f', // Monad
7677
]);
7778

7879
/**

packages/bridge-controller/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111

1212
- Bump `@metamask/assets-controllers` from `^93.0.0` to `^93.1.0` ([#7309](https://github.com/MetaMask/core/pull/7309)
1313
- Bump `@metamask/remote-feature-flag-controller` from `^2.0.1` to `^3.0.0` ([#7309](https://github.com/MetaMask/core/pull/7309)
14+
- Bump `@metamask/transaction-controller` from `^62.4.0` to `^62.5.0` ([#7325](https://github.com/MetaMask/core/pull/7325))
15+
16+
### Fixed
17+
18+
- Update gas calculation logic to use the priority fee provided by the gas-api and stop adding the base fee ([#7403](https://github.com/MetaMask/core/pull/7403))
1419

1520
## [64.0.0]
1621

packages/bridge-controller/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
"@metamask/polling-controller": "^16.0.0",
6767
"@metamask/remote-feature-flag-controller": "^3.0.0",
6868
"@metamask/snaps-controllers": "^14.0.1",
69-
"@metamask/transaction-controller": "^62.4.0",
69+
"@metamask/transaction-controller": "^62.5.0",
7070
"@metamask/utils": "^11.8.1",
7171
"bignumber.js": "^9.1.2",
7272
"reselect": "^5.1.1",

0 commit comments

Comments
 (0)