Skip to content

Commit db8d27d

Browse files
authored
Merge branch 'main' into upgrade-transaction-controller-to-v58
2 parents d88aa86 + affbb96 commit db8d27d

9 files changed

Lines changed: 430 additions & 16 deletions

File tree

CHANGELOG.md

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

88
## [Unreleased]
99

10+
### Added
11+
12+
- This package can now be used in ESM environments as well as CommonJS ([#469](https://github.com/MetaMask/smart-transactions-controller/pull/469))
13+
14+
### Changed
15+
16+
- **BREAKING:** Disallow subpath exports ([#469](https://github.com/MetaMask/smart-transactions-controller/pull/469))
17+
18+
## [18.1.0]
19+
20+
### Added
21+
22+
- Add Linea URL for Sentinel ([#527](https://github.com/MetaMask/smart-transactions-controller/pull/527))
23+
24+
## [18.0.0]
25+
26+
### Changed
27+
28+
- **BREAKING:**: Don't persist controller state ([#525](https://github.com/MetaMask/smart-transactions-controller/pull/525))
29+
1030
## [17.0.0]
1131

1232
### Added
@@ -578,7 +598,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
578598
- Add initial SmartTransactionsController ([#1](https://github.com/MetaMask/smart-transactions-controller/pull/1))
579599
- Initial commit
580600

581-
[Unreleased]: https://github.com/MetaMask/smart-transactions-controller/compare/v17.0.0...HEAD
601+
[Unreleased]: https://github.com/MetaMask/smart-transactions-controller/compare/v18.1.0...HEAD
602+
[18.1.0]: https://github.com/MetaMask/smart-transactions-controller/compare/v18.0.0...v18.1.0
603+
[18.0.0]: https://github.com/MetaMask/smart-transactions-controller/compare/v17.0.0...v18.0.0
582604
[17.0.0]: https://github.com/MetaMask/smart-transactions-controller/compare/v16.5.0...v17.0.0
583605
[16.5.0]: https://github.com/MetaMask/smart-transactions-controller/compare/v16.4.0...v16.5.0
584606
[16.4.0]: https://github.com/MetaMask/smart-transactions-controller/compare/v16.3.1...v16.4.0

jest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ module.exports = {
66
coverageReporters: ['text', 'html'],
77
coverageThreshold: {
88
global: {
9-
branches: 75.52,
9+
branches: 74.65,
1010
functions: 92.5,
1111
lines: 92.52,
1212
statements: 92.51,

package.json

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,41 @@
11
{
22
"name": "@metamask/smart-transactions-controller",
3-
"version": "17.0.0",
3+
"version": "18.1.0",
44
"description": "Improves success rates for swaps by trialing transactions privately and finding minimum fees",
55
"repository": {
66
"type": "git",
77
"url": "https://github.com/MetaMask/smart-transactions-controller.git"
88
},
99
"license": "SEE LICENSE IN LICENSE",
10-
"main": "dist/index.js",
11-
"types": "dist/index.d.ts",
10+
"sideEffects": false,
11+
"exports": {
12+
".": {
13+
"import": {
14+
"types": "./dist/index.d.mts",
15+
"default": "./dist/index.mjs"
16+
},
17+
"require": {
18+
"types": "./dist/index.d.cts",
19+
"default": "./dist/index.cjs"
20+
}
21+
},
22+
"./package.json": "./package.json"
23+
},
24+
"main": "./dist/index.cjs",
25+
"module": "./dist/index.mjs",
26+
"types": "./dist/index.d.cts",
1227
"files": [
13-
"dist/"
28+
"dist"
1429
],
1530
"scripts": {
16-
"build": "tsc --project tsconfig.build.json",
17-
"build:clean": "rm -rf dist && yarn build",
18-
"build:link": "yarn build && cd dist && yarn link && rm -rf node_modules && cd ..",
31+
"build": "ts-bridge --project tsconfig.build.json --clean",
1932
"lint": "yarn lint:eslint && yarn lint:misc --check && yarn lint:changelog",
2033
"lint:changelog": "auto-changelog validate --prettier",
2134
"lint:eslint": "eslint . --cache --ext js,ts",
2235
"lint:fix": "yarn lint:eslint --fix && yarn lint:misc --write && yarn lint:changelog",
2336
"lint:misc": "prettier '**/*.json' '**/*.md' '**/*.yml' '!.yarnrc.yml' --ignore-path .gitignore --no-error-on-unmatched-pattern",
2437
"prepack": "./scripts/prepack.sh",
25-
"test": "jest",
38+
"test": "jest && attw --pack",
2639
"test:watch": "jest --watchAll"
2740
},
2841
"dependencies": {
@@ -42,6 +55,7 @@
4255
"lodash": "^4.17.21"
4356
},
4457
"devDependencies": {
58+
"@arethetypeswrong/cli": "^0.18.2",
4559
"@lavamoat/allow-scripts": "^3.2.1",
4660
"@lavamoat/preinstall-always-fail": "^2.1.0",
4761
"@metamask/auto-changelog": "^3.1.0",
@@ -53,6 +67,7 @@
5367
"@metamask/json-rpc-engine": "^10.0.1",
5468
"@metamask/network-controller": "^24.0.0",
5569
"@metamask/transaction-controller": "^58.1.0",
70+
"@ts-bridge/cli": "^0.6.3",
5671
"@types/jest": "^26.0.24",
5772
"@types/lodash": "^4.14.194",
5873
"@types/node": "^18.19.17",

scripts/prepack.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ if [[ -n $SKIP_PREPACK ]]; then
99
exit 0
1010
fi
1111

12-
yarn build:clean
12+
yarn build

src/SmartTransactionsController.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ const controllerName = 'SmartTransactionsController';
7777

7878
const controllerMetadata = {
7979
smartTransactionsState: {
80-
persist: true,
80+
persist: false,
8181
anonymous: true,
8282
},
8383
};

src/constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export const SENTINEL_API_BASE_URL_MAP: SentinelApiBaseUrlMap = {
1010
56: 'https://tx-sentinel-bsc-mainnet.api.cx.metamask.io',
1111
8453: 'https://tx-sentinel-base-mainnet.api.cx.metamask.io',
1212
42161: 'https://tx-sentinel-arbitrum-mainnet.api.cx.metamask.io',
13+
59144: 'https://tx-sentinel-linea-mainnet.api.cx.metamask.io',
1314
11155111: 'https://tx-sentinel-ethereum-sepolia.api.cx.metamask.io',
1415
};
1516

tsconfig.build.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
"extends": "./tsconfig.json",
33
"compilerOptions": {
44
"declaration": true,
5+
"declarationMap": true,
6+
"emitDeclarationOnly": true,
57
"inlineSources": true,
68
"noEmit": false,
79
"outDir": "dist",

tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"module": "CommonJS",
66
"moduleResolution": "node",
77
"noEmit": true,
8+
"noErrorTruncation": true,
89
"resolveJsonModule": true,
910
"skipLibCheck": true,
1011
"strict": true,

0 commit comments

Comments
 (0)