Skip to content

Commit 35ac83a

Browse files
authored
feat: expose SmartTransactionsController methods through messenger (#574)
* feat: expose SmartTransactionsController methods through messenger Upgrade TypeScript to ~5.3.3 to align with core. Add method action type generation script and expose controller methods via messenger. * docs: add changelog entry for messenger actions and TypeScript upgrade * docs: mark TypeScript upgrade as breaking change
1 parent dcfa095 commit 35ac83a

7 files changed

Lines changed: 1323 additions & 16 deletions

CHANGELOG.md

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

88
## [Unreleased]
99

10+
### Added
11+
12+
- Expose `SmartTransactionsController` methods through its messenger ([#574](https://github.com/MetaMask/smart-transactions-controller/pull/574))
13+
- The following actions are now available:
14+
- `SmartTransactionsController:checkPoll`
15+
- `SmartTransactionsController:initializeSmartTransactionsForChainId`
16+
- `SmartTransactionsController:poll`
17+
- `SmartTransactionsController:stop`
18+
- `SmartTransactionsController:setOptInState`
19+
- `SmartTransactionsController:trackStxStatusChange`
20+
- `SmartTransactionsController:isNewSmartTransaction`
21+
- `SmartTransactionsController:updateSmartTransaction`
22+
- `SmartTransactionsController:updateSmartTransactions`
23+
- `SmartTransactionsController:fetchSmartTransactionsStatus`
24+
- `SmartTransactionsController:clearFees`
25+
- `SmartTransactionsController:getFees`
26+
- `SmartTransactionsController:submitSignedTransactions`
27+
- `SmartTransactionsController:cancelSmartTransaction`
28+
- `SmartTransactionsController:fetchLiveness`
29+
- `SmartTransactionsController:setStatusRefreshInterval`
30+
- `SmartTransactionsController:getTransactions`
31+
- `SmartTransactionsController:getSmartTransactionByMinedTxHash`
32+
- `SmartTransactionsController:wipeSmartTransactions`
33+
- Corresponding action types (e.g. `SmartTransactionsControllerCheckPollAction`) are available as well.
34+
35+
### Changed
36+
37+
- **BREAKING:** Upgrade TypeScript from `~4.8.4` to `~5.3.3` ([#574](https://github.com/MetaMask/smart-transactions-controller/pull/574))
38+
- Consumers on TypeScript 4.x may experience type errors and should upgrade to TypeScript 5.x.
39+
1040
## [23.0.0]
1141

1242
### Changed

package.json

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,11 @@
2929
],
3030
"scripts": {
3131
"build": "ts-bridge --project tsconfig.build.json --clean",
32-
"lint": "yarn lint:eslint && yarn lint:misc --check && yarn lint:changelog",
32+
"generate-method-action-types": "tsx ./scripts/generate-method-action-types.ts ./src",
33+
"lint": "yarn lint:eslint && yarn lint:misc --check && yarn lint:changelog && yarn generate-method-action-types --check",
3334
"lint:changelog": "auto-changelog validate --prettier",
3435
"lint:eslint": "eslint . --cache --ext js,ts",
35-
"lint:fix": "yarn lint:eslint --fix && yarn lint:misc --write && yarn lint:changelog",
36+
"lint:fix": "yarn lint:eslint --fix && yarn lint:misc --write && yarn lint:changelog && yarn generate-method-action-types --fix",
3637
"lint:misc": "prettier '**/*.json' '**/*.md' '**/*.yml' '!.yarnrc.yml' --ignore-path .gitignore --no-error-on-unmatched-pattern",
3738
"prepack": "./scripts/prepack.sh",
3839
"test": "jest && attw --pack",
@@ -73,6 +74,7 @@
7374
"@metamask/gas-fee-controller": "^26.0.0",
7475
"@metamask/json-rpc-engine": "^10.0.1",
7576
"@ts-bridge/cli": "^0.6.3",
77+
"@types/eslint": "^9.6.1",
7678
"@types/jest": "^26.0.24",
7779
"@types/lodash": "^4.14.194",
7880
"@types/node": "^18.19.17",
@@ -94,7 +96,9 @@
9496
"prettier-plugin-packagejson": "^2.4.3",
9597
"sinon": "^9.2.4",
9698
"ts-jest": "^29.1.4",
97-
"typescript": "~4.8.4"
99+
"tsx": "^4.20.5",
100+
"typescript": "~5.3.3",
101+
"yargs": "^17.7.2"
98102
},
99103
"peerDependenciesMeta": {
100104
"@metamask/accounts-controller": {
@@ -125,7 +129,8 @@
125129
"@metamask/controller-utils>ethereumjs-util>ethereum-cryptography>secp256k1": false,
126130
"@metamask/controller-utils>babel-runtime>core-js": false,
127131
"@metamask/transaction-controller>@metamask/core-backend>@metamask/keyring-controller>ethereumjs-wallet>ethereum-cryptography>keccak": false,
128-
"@metamask/transaction-controller>@metamask/core-backend>@metamask/keyring-controller>ethereumjs-wallet>ethereum-cryptography>secp256k1": false
132+
"@metamask/transaction-controller>@metamask/core-backend>@metamask/keyring-controller>ethereumjs-wallet>ethereum-cryptography>secp256k1": false,
133+
"tsx>esbuild": false
129134
}
130135
}
131136
}

0 commit comments

Comments
 (0)