Skip to content

Commit c751b7d

Browse files
authored
Merge branch 'main' into bump-braces
2 parents 9ff7663 + 2946ebe commit c751b7d

23 files changed

+2569
-149
lines changed

.github/CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@
22
# Each line is a file pattern followed by one or more owners.
33

44
* @MetaMask/wallet-framework-engineers
5+
src/methods @MetaMask/wallet-api-platform-engineers @MetaMask/confirmations
6+
src/wallet.* @MetaMask/wallet-api-platform-engineers @MetaMask/confirmations

.github/workflows/security-code-scanner.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
name: 'MetaMask Security Code Scanner'
1+
name: MetaMask Security Code Scanner
22

33
on:
44
push:
5-
branches: ['main']
5+
branches:
6+
- main
67
pull_request:
7-
branches: ['main']
8+
branches:
9+
- main
10+
workflow_dispatch:
811

912
jobs:
1013
run-security-scan:
@@ -15,7 +18,7 @@ jobs:
1518
security-events: write
1619
steps:
1720
- name: MetaMask Security Code Scanner
18-
uses: MetaMask/Security-Code-Scanner@main
21+
uses: MetaMask/action-security-code-scanner@v1
1922
with:
2023
repo: ${{ github.repository }}
2124
paths_ignored: |

CHANGELOG.md

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

77
## [Unreleased]
88

9+
## [17.0.0]
10+
### Changed
11+
- **BREAKING:** Support version `2.0.0` of EIP-5792 ([#370](https://github.com/MetaMask/eth-json-rpc-middleware/pull/370))
12+
- Add `atomicRequired` property to `SendCallsStruct`.
13+
- Make `from` optional in `SendCallsStruct`.
14+
- Add `atomic` property to `GetCallsStatusResult`.
15+
- Validate `address` in `GetCapabilitiesParams` is added to wallet.
16+
- Use `-32602` code for all EIP-5792 schema errors.
17+
18+
## [16.0.1]
19+
### Fixed
20+
- Fix `fetch` middleware so that non-standard JSON-RPC error responses are no longer treated as successful responses ([#367](https://github.com/MetaMask/eth-json-rpc-middleware/pull/367))
21+
- A "non-standard" error response is one with an `error` field but where there are more properties in the error object than expected
22+
23+
## [16.0.0]
24+
### Added
25+
- Support updated EIP-5792 specification ([#363](https://github.com/MetaMask/eth-json-rpc-middleware/pull/363))
26+
- Add optional `id` to `SendCallsParams`.
27+
- Add optional `capabilities` to each call in `SendCallsParams`.
28+
- Add `optional` property to both top-level and call-level capabilities.
29+
- Add `SendCallsResult` type.
30+
- Add `id`, `version`, and optional `capabilities` to `GetCallsStatusResult`.
31+
- Add `GetCallsStatusCode` enum.
32+
- Add `GetCallsStatusHook` type.
33+
- Add optional `chainIds` argument to `GetCapabilitiesParams`.
34+
35+
### Changed
36+
- **BREAKING:** Support updated EIP-5792 specification ([#363](https://github.com/MetaMask/eth-json-rpc-middleware/pull/363))
37+
- Return `SendCallsResult` from `wallet_sendCalls` instead of `string`.
38+
- Change `GetCallsStatusParams` to contain `Hex` instead of `string`.
39+
- Change `status` in `GetCallsStatusResult` to `number` instead of `string`.
40+
- Replace `GetTransactionReceiptsByBatchIdHook` with `GetCallsStatusHook`.
41+
42+
### Removed
43+
- **BREAKING:** Support updated EIP-5792 specification ([#363](https://github.com/MetaMask/eth-json-rpc-middleware/pull/363))
44+
- Remove `GetCallsStatusReceipt` type.
45+
- Remove `GetTransactionReceiptsByBatchIdHook` type.
46+
47+
## [15.3.0]
48+
### Added
49+
- Support EIP-5792 ([#357](https://github.com/MetaMask/eth-json-rpc-middleware/pull/359))
50+
- Add support for RPC methods:
51+
- `wallet_sendCalls`
52+
- `wallet_getCallsStatus`
53+
- `wallet_getCapabilities`
54+
- Add optional hooks to `WalletMiddlewareOptions`:
55+
- `getCapabilities`
56+
- `getTransactionReceiptsByBatchId`
57+
- `processSendCalls`
58+
- Add types:
59+
- `GetCallsStatusParams`
60+
- `GetCallsStatusReceipt`
61+
- `GetCallsStatusResult`
62+
- `GetCapabilitiesHook`
63+
- `GetCapabilitiesParams`
64+
- `GetCapabilitiesResult`
65+
- `GetTransactionReceiptsByBatchIdHook`
66+
- `ProcessSendCallsHook`
67+
- `SendCalls`
68+
- `SendCallsParams`
69+
70+
## [15.2.0]
71+
### Added
72+
- Add a way to pass an RPC service to `createFetchMiddleware` ([#357](https://github.com/MetaMask/eth-json-rpc-middleware/pull/357))
73+
- The new, recommended function signature is now `createFetchMiddleware({ rpcService: AbstractRpcService; options?: { originHttpHeaderKey?: string; } })`, where `AbstractRpcService` matches the same interface from `@metamask/network-controller`
74+
- This allows us to support automatic failover to a secondary node when the network goes down
75+
76+
### Changed
77+
- Bump `@metamask/utils` to `^11.1.0` ([#358](https://github.com/MetaMask/eth-json-rpc-middleware/pull/358))
78+
79+
### Deprecated
80+
- Deprecate passing an RPC endpoint to `createFetchMiddleware` ([#357](https://github.com/MetaMask/eth-json-rpc-middleware/pull/357))
81+
- See recommended function signature above
82+
- The existing signature `createFetchMiddleware({ btoa: typeof btoa; fetch: typeof fetch; rpcUrl: string; originHttpHeaderKey?: string; })` will be removed in a future major version
83+
- Deprecate `PayloadWithOrigin` type ([#357](https://github.com/MetaMask/eth-json-rpc-middleware/pull/357))
84+
- There is no replacement for this type; it will be removed in a future major version.
85+
86+
## [15.1.2]
87+
### Changed
88+
- Fix validation of primary type for signTypedDataV3 and signTypedDataV4 ([#353](https://github.com/MetaMask/eth-json-rpc-middleware/pull/353))
89+
- It was updated to handle `undefined` input
90+
91+
## [15.1.1]
92+
### Changed
93+
- Bump `@metamask/eth-block-tracker` from `^11.0.3` to `^11.0.4` ([#351](https://github.com/MetaMask/eth-json-rpc-middleware/pull/351))
94+
- Bump `@metamask/eth-json-rpc-provider` from `^4.1.5` to `^4.1.7` ([#351](https://github.com/MetaMask/eth-json-rpc-middleware/pull/351))
95+
- Bump `@metamask/eth-sig-util` from `^7.0.3` to `^8.1.2` ([#351](https://github.com/MetaMask/eth-json-rpc-middleware/pull/351))
96+
- Bump `@metamask/json-rpc-engine` from `^10.0.0` to `^10.0.2` ([#351](https://github.com/MetaMask/eth-json-rpc-middleware/pull/351))
97+
- Bump `@metamask/rpc-errors` from `^7.0.0` to `^7.0.2` ([#351](https://github.com/MetaMask/eth-json-rpc-middleware/pull/351))
98+
- Bump `@metamask/utils` from `^9.1.0` to `^11.0.1` ([#351](https://github.com/MetaMask/eth-json-rpc-middleware/pull/351))
99+
100+
## [15.1.0]
101+
### Changed
102+
- Improved validation of primary type for signTypedDataV3 and signTypedDataV4 ([#350](https://github.com/MetaMask/eth-json-rpc-middleware/pull/350))
103+
104+
## [15.0.1]
105+
### Changed
106+
- Bump `@metamask/eth-block-tracker` from `^11.0.1` to `^11.0.3` ([#347](https://github.com/MetaMask/eth-json-rpc-middleware/pull/347))
107+
108+
## [15.0.0]
109+
### Changed
110+
- **BREAKING**: Update `@metamask/rpc-errors` from `^6.3.1` to `^7.0.0` ([#342](https://github.com/MetaMask/eth-json-rpc-middleware/pull/342))
111+
- **BREAKING**: Update `@metamask/json-rpc-engine` from `^9.0.2` to `^10.0.0` ([#342](https://github.com/MetaMask/eth-json-rpc-middleware/pull/342))
112+
- Bump `@metamask/eth-json-rpc-provider` from `^4.1.1` to `^4.1.5` ([#342](https://github.com/MetaMask/eth-json-rpc-middleware/pull/342))
113+
114+
### Removed
115+
- **BREAKING**: Remove `eth_sign` support ([#320](https://github.com/MetaMask/eth-json-rpc-middleware/pull/320))
116+
- The functions `ethSign` and `processEthSignMessage` have been removed
117+
118+
## [14.0.2]
119+
### Fixed
120+
- Allow the string "cosmos" in the "verifyingContract" field of EIP-712 signatures ([#333](https://github.com/MetaMask/eth-json-rpc-middleware/pull/333))
121+
- This change was made to support Ethermint's EIP-712 implementation, which was broken by validation added in v14.0.0
122+
9123
## [14.0.1]
10124
### Fixed
11125
- Request validation should not throw if verifyingContract is not defined in typed signature ([#328](https://github.com/MetaMask/eth-json-rpc-middleware/pull/328))
@@ -206,7 +320,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
206320
- `json-rpc-engine@5.3.0` ([#53](https://github.com/MetaMask/eth-json-rpc-middleware/pull/53))
207321
- `eth-rpc-errors@3.0.0` ([#55](https://github.com/MetaMask/eth-json-rpc-middleware/pull/55))
208322

209-
[Unreleased]: https://github.com/MetaMask/eth-json-rpc-middleware/compare/v14.0.1...HEAD
323+
[Unreleased]: https://github.com/MetaMask/eth-json-rpc-middleware/compare/v17.0.0...HEAD
324+
[17.0.0]: https://github.com/MetaMask/eth-json-rpc-middleware/compare/v16.0.1...v17.0.0
325+
[16.0.1]: https://github.com/MetaMask/eth-json-rpc-middleware/compare/v16.0.0...v16.0.1
326+
[16.0.0]: https://github.com/MetaMask/eth-json-rpc-middleware/compare/v15.3.0...v16.0.0
327+
[15.3.0]: https://github.com/MetaMask/eth-json-rpc-middleware/compare/v15.2.0...v15.3.0
328+
[15.2.0]: https://github.com/MetaMask/eth-json-rpc-middleware/compare/v15.1.2...v15.2.0
329+
[15.1.2]: https://github.com/MetaMask/eth-json-rpc-middleware/compare/v15.1.1...v15.1.2
330+
[15.1.1]: https://github.com/MetaMask/eth-json-rpc-middleware/compare/v15.1.0...v15.1.1
331+
[15.1.0]: https://github.com/MetaMask/eth-json-rpc-middleware/compare/v15.0.1...v15.1.0
332+
[15.0.1]: https://github.com/MetaMask/eth-json-rpc-middleware/compare/v15.0.0...v15.0.1
333+
[15.0.0]: https://github.com/MetaMask/eth-json-rpc-middleware/compare/v14.0.2...v15.0.0
334+
[14.0.2]: https://github.com/MetaMask/eth-json-rpc-middleware/compare/v14.0.1...v14.0.2
210335
[14.0.1]: https://github.com/MetaMask/eth-json-rpc-middleware/compare/v14.0.0...v14.0.1
211336
[14.0.0]: https://github.com/MetaMask/eth-json-rpc-middleware/compare/v13.0.0...v14.0.0
212337
[13.0.0]: https://github.com/MetaMask/eth-json-rpc-middleware/compare/v12.1.2...v13.0.0

jest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ module.exports = {
2222
collectCoverage: true,
2323

2424
// An array of glob patterns indicating a set of files for which coverage information should be collected
25-
collectCoverageFrom: ['./src/**/*.ts'],
25+
collectCoverageFrom: ['./src/**/*.ts', '!./src/**/*.test-d.ts'],
2626

2727
// The directory where Jest should output its coverage files
2828
coverageDirectory: 'coverage',

package.json

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@metamask/eth-json-rpc-middleware",
3-
"version": "14.0.1",
3+
"version": "17.0.0",
44
"description": "Ethereum-related json-rpc-engine middleware.",
55
"repository": {
66
"type": "git",
@@ -24,16 +24,18 @@
2424
"lint:fix": "yarn lint:eslint --fix && yarn lint:misc --write",
2525
"lint:misc": "prettier '**/*.json' '**/*.md' '!CHANGELOG.md' '**/*.yml' '!.yarnrc.yml' --ignore-path .gitignore --no-error-on-unmatched-pattern",
2626
"prepack": "./scripts/prepack.sh",
27-
"test": "jest",
27+
"test": "jest && yarn build:clean && yarn test:types",
28+
"test:types": "tsd --files 'src/**/*.test-d.ts'",
2829
"test:watch": "jest --watch"
2930
},
3031
"dependencies": {
31-
"@metamask/eth-block-tracker": "^11.0.1",
32-
"@metamask/eth-json-rpc-provider": "^4.1.1",
33-
"@metamask/eth-sig-util": "^7.0.3",
34-
"@metamask/json-rpc-engine": "^9.0.2",
35-
"@metamask/rpc-errors": "^6.3.1",
36-
"@metamask/utils": "^9.1.0",
32+
"@metamask/eth-block-tracker": "^12.0.0",
33+
"@metamask/eth-json-rpc-provider": "^4.1.7",
34+
"@metamask/eth-sig-util": "^8.1.2",
35+
"@metamask/json-rpc-engine": "^10.0.2",
36+
"@metamask/rpc-errors": "^7.0.2",
37+
"@metamask/superstruct": "^3.1.0",
38+
"@metamask/utils": "^11.1.0",
3739
"@types/bn.js": "^5.1.5",
3840
"bn.js": "^5.2.1",
3941
"klona": "^2.0.6",
@@ -48,6 +50,7 @@
4850
"@metamask/eslint-config-jest": "^12.1.0",
4951
"@metamask/eslint-config-nodejs": "^12.1.0",
5052
"@metamask/eslint-config-typescript": "^12.1.0",
53+
"@metamask/network-controller": "22.2.0",
5154
"@types/btoa": "^1.2.3",
5255
"@types/jest": "^27.4.1",
5356
"@types/node": "^18.16",
@@ -68,6 +71,7 @@
6871
"rimraf": "^3.0.2",
6972
"ts-jest": "^27.1.4",
7073
"ts-node": "^10.7.0",
74+
"tsd": "^0.31.2",
7175
"typescript": "~4.8.4"
7276
},
7377
"packageManager": "yarn@3.2.1",

0 commit comments

Comments
 (0)