Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
deac397
Improve sample-controllers to be more useful examples
mcmire Jul 18, 2025
3d76ba7
Merge branch 'main' into update-sample-controllers
mcmire Jul 22, 2025
0962c3e
Fix typo
mcmire Jul 22, 2025
e1dea00
Fix error messages
mcmire Jul 22, 2025
c0b6e96
Fix race condition
mcmire Jul 22, 2025
bb71b2d
Fix test
mcmire Jul 22, 2025
5e343da
Fix race condition for real
mcmire Jul 22, 2025
c4d0fc4
Merge branch 'main' into update-sample-controllers
mcmire Aug 15, 2025
d73a7ba
Change CONTROLLER_NAME back to controllerName
mcmire Aug 15, 2025
7d53513
Inline SampleGasPricesService options
mcmire Aug 15, 2025
7e967d2
Use the new controller/service method actions pattern
mcmire Aug 15, 2025
31fc78b
Pull JSON parsing logic out of policy execution; add onBreak and onDe…
mcmire Aug 15, 2025
c7c20c1
Flip around these test helpers/types
mcmire Aug 15, 2025
b3f9796
Comprehensively test messenger actions, simply test methods
mcmire Aug 15, 2025
44e100f
Merge branch 'main' into update-sample-controllers
mcmire Aug 21, 2025
9d0799e
Remove unnecessary changelog entry
mcmire Aug 21, 2025
525c4d8
Add changelog entry for removing SampleAbstractGasPricesService
mcmire Aug 21, 2025
0240763
Update to match the sample-controllers messenger migration PR
mcmire Aug 22, 2025
78d29c5
Merge branch 'main' into update-sample-controllers
mcmire Aug 22, 2025
1ac6bcc
Fix JSDoc
mcmire Aug 22, 2025
8f9a6b9
Don't assume the response data is in a certain format
mcmire Aug 22, 2025
0abf441
Update JSDoc to encourage using controllers/services through messenger
mcmire Aug 22, 2025
07e80e8
Remove overzealous comment
mcmire Aug 22, 2025
e0e52b3
RPC endpoint -> API
mcmire Aug 22, 2025
7a97b62
buildRootMessenger -> getRootMessenger
mcmire Aug 27, 2025
3754d4c
Merge branch 'main' into update-sample-controllers
mcmire Aug 27, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions packages/sample-controllers/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,32 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- `SampleGasPricesController.updateGasPrices` is now callable via the messaging system ([#6168](https://github.com/MetaMask/core/pull/6168))
- An action type, `SampleGasPricesControllerUpdateGasPricesAction`, is now available for use
- `SamplePetnamesController.assignPetname` is now callable via the messaging system ([#6168](https://github.com/MetaMask/core/pull/6168))
- An action type, `SamplePetnamesControllerAssignPetnameAction`, is now available for use
- Export new types for `SampleGasPricesService` ([#6168](https://github.com/MetaMask/core/pull/6168))
- `SampleGasPricesServiceActions`
- `SampleGasPricesServiceEvents`
- `SampleGasPricesServiceFetchGasPricesAction`
- `SampleGasPricesServiceMessenger`
- Export `getDefaultPetnamesControllerState` ([#6168](https://github.com/MetaMask/core/pull/6168))

### Changed

- **BREAKING:** The messenger for `SampleGasPricesController` now expects `NetworkController:getNetworkClientById` to be allowed, and no longer expects `NetworkController:getState` to be allowed ([#6168](https://github.com/MetaMask/core/pull/6168))
- **BREAKING:** `SampleGasPricesController.updateGasPrices` now takes a required `chainId` option ([#6168](https://github.com/MetaMask/core/pull/6168))
- `SampleGasPricesController` will now automatically update gas prices when the globally selected chain changes ([#6168](https://github.com/MetaMask/core/pull/6168))
- Bump `@metamask/controller-utils` from `^11.10.0` to `^11.11.0` ([#6069](https://github.com/MetaMask/core/pull/6069))
- Bump `@metamask/utils` from `^11.2.0` to `^11.4.2` ([#6054](https://github.com/MetaMask/core/pull/6054))

### Removed

- **BREAKING:** `SampleGasPricesController` no longer takes a `gasPricesService` option ([#6168](https://github.com/MetaMask/core/pull/6168))
- The controller now expects `SampleGasPricesService` to have been instantiated ahead of time

## [1.0.0]

### Changed
Expand Down
1 change: 1 addition & 0 deletions packages/sample-controllers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"deepmerge": "^4.2.2",
"jest": "^27.5.1",
"nock": "^13.3.1",
"sinon": "^9.2.4",
"ts-jest": "^27.1.4",
"typedoc": "^0.24.8",
"typedoc-plugin-missing-exports": "^2.0.0",
Expand Down
14 changes: 0 additions & 14 deletions packages/sample-controllers/src/index.test.ts

This file was deleted.

18 changes: 13 additions & 5 deletions packages/sample-controllers/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,33 @@
export type {
SampleGasPricesServiceActions,
SampleGasPricesServiceEvents,
SampleGasPricesServiceFetchGasPricesAction,
SampleGasPricesServiceMessenger,
} from './sample-gas-prices-service/sample-gas-prices-service';
export { SampleGasPricesService } from './sample-gas-prices-service/sample-gas-prices-service';
export type {
SampleGasPricesControllerActions,
SampleGasPricesControllerEvents,
SampleGasPricesControllerGetStateAction,
SampleGasPricesControllerMessenger,
SampleGasPricesControllerState,
SampleGasPricesControllerStateChangeEvent,
SampleGasPricesControllerUpdateGasPricesAction,
} from './sample-gas-prices-controller';
export {
getDefaultSampleGasPricesControllerState,
SampleGasPricesController,
getDefaultSampleGasPricesControllerState,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This export was already present, but it was not ordered alphabetically.

} from './sample-gas-prices-controller';
export type {
SamplePetnamesControllerActions,
SamplePetnamesControllerAssignPetnameAction,
SamplePetnamesControllerEvents,
SamplePetnamesControllerGetStateAction,
SamplePetnamesControllerMessenger,
SamplePetnamesControllerState,
SamplePetnamesControllerStateChangeEvent,
} from './sample-petnames-controller';
export { SamplePetnamesController } from './sample-petnames-controller';
export {
SampleGasPricesService,
type SampleAbstractGasPricesService,
} from './sample-gas-prices-service';
SamplePetnamesController,
getDefaultPetnamesControllerState,
} from './sample-petnames-controller';
40 changes: 0 additions & 40 deletions packages/sample-controllers/src/network-controller-types.ts
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file was added originally before sample-controllers was published to NPM as it wasn't a requirement that SampleGasPricesController be a working example, just illustrative. Since then, network-controller has been added as a peer dependency, so we can simply use the types from there.

This file was deleted.

Loading
Loading