Skip to content

16.0.0 #364

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 13, 2025
Merged
Changes from all commits
Commits
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
27 changes: 26 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -6,6 +6,30 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [16.0.0]
### Added
- Support updated EIP-5792 specification ([#363](https://github.com/MetaMask/eth-json-rpc-middleware/pull/363))
- Add optional `id` to `SendCallsParams`.
- Add optional `capabilities` to each call in `SendCallsParams`.
- Add `optional` property to both top-level and call-level capabilities.
- Add `SendCallsResult` type.
- Add `id`, `version`, and optional `capabilities` to `GetCallsStatusResult`.
- Add `GetCallsStatusCode` enum.
- Add `GetCallsStatusHook` type.
- Add optional `chainIds` argument to `GetCapabilitiesParams`.

### Changed
- **BREAKING:** Support updated EIP-5792 specification ([#363](https://github.com/MetaMask/eth-json-rpc-middleware/pull/363))
- Return `SendCallsResult` from `wallet_sendCalls` instead of `string`.
- Change `GetCallsStatusParams` to contain `Hex` instead of `string`.
- Change `status` in `GetCallsStatusResult` to `number` instead of `string`.
- Replace `GetTransactionReceiptsByBatchIdHook` with `GetCallsStatusHook`.

### Removed
- **BREAKING:** Support updated EIP-5792 specification ([#363](https://github.com/MetaMask/eth-json-rpc-middleware/pull/363))
- Remove `GetCallsStatusReceipt` type.
- Remove `GetTransactionReceiptsByBatchIdHook` type.

## [15.3.0]
### Added
- Support EIP-5792 ([#357](https://github.com/MetaMask/eth-json-rpc-middleware/pull/359))
@@ -282,7 +306,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `json-rpc-engine@5.3.0` ([#53](https://github.com/MetaMask/eth-json-rpc-middleware/pull/53))
- `eth-rpc-errors@3.0.0` ([#55](https://github.com/MetaMask/eth-json-rpc-middleware/pull/55))

[Unreleased]: https://github.com/MetaMask/eth-json-rpc-middleware/compare/v15.3.0...HEAD
[Unreleased]: https://github.com/MetaMask/eth-json-rpc-middleware/compare/v16.0.0...HEAD
[16.0.0]: https://github.com/MetaMask/eth-json-rpc-middleware/compare/v15.3.0...v16.0.0
[15.3.0]: https://github.com/MetaMask/eth-json-rpc-middleware/compare/v15.2.0...v15.3.0
[15.2.0]: https://github.com/MetaMask/eth-json-rpc-middleware/compare/v15.1.2...v15.2.0
[15.1.2]: https://github.com/MetaMask/eth-json-rpc-middleware/compare/v15.1.1...v15.1.2
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@metamask/eth-json-rpc-middleware",
"version": "15.3.0",
"version": "16.0.0",
"description": "Ethereum-related json-rpc-engine middleware.",
"repository": {
"type": "git",
22 changes: 21 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
@@ -993,7 +993,27 @@ __metadata:
languageName: node
linkType: hard

"@metamask/eth-json-rpc-middleware@^15.0.1, @metamask/eth-json-rpc-middleware@workspace:.":
"@metamask/eth-json-rpc-middleware@npm:^15.0.1":
version: 15.3.0
Comment on lines +996 to +997
Copy link
Member

Choose a reason for hiding this comment

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

Hmm, interesting. It looks like we have two versions of this package in the lock. Do you have a guess for why this is the case?

Copy link
Member Author

Choose a reason for hiding this comment

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

I though that was strange too 😄

Circular dependency via the network controller I believe.

resolution: "@metamask/eth-json-rpc-middleware@npm:15.3.0"
dependencies:
"@metamask/eth-block-tracker": ^11.0.4
"@metamask/eth-json-rpc-provider": ^4.1.7
"@metamask/eth-sig-util": ^8.1.2
"@metamask/json-rpc-engine": ^10.0.2
"@metamask/rpc-errors": ^7.0.2
"@metamask/superstruct": ^3.1.0
"@metamask/utils": ^11.1.0
"@types/bn.js": ^5.1.5
bn.js: ^5.2.1
klona: ^2.0.6
pify: ^5.0.0
safe-stable-stringify: ^2.4.3
checksum: 6d6946daf799d898d66133104c10718966e96c3edc59b71c4910fd29587a0aa800dcaa0ba12d404418f7508c5559593d218b5a5f9245f51dd02d229dd913b57f
languageName: node
linkType: hard

"@metamask/eth-json-rpc-middleware@workspace:.":
version: 0.0.0-use.local
resolution: "@metamask/eth-json-rpc-middleware@workspace:."
dependencies:

Unchanged files with check annotations Beta

//
class BlockCacheStrategy {
private cache: Cache;

Check warning on line 35 in src/block-cache.ts

GitHub Actions / Build, lint, and test / Lint (18.x)

Use a hash name instead

Check warning on line 35 in src/block-cache.ts

GitHub Actions / Build, lint, and test / Lint (20.x)

Use a hash name instead

Check warning on line 35 in src/block-cache.ts

GitHub Actions / Build, lint, and test / Lint (22.x)

Use a hash name instead
constructor() {
this.cache = {};
)
) {
if (
!result ||

Check warning on line 113 in src/block-cache.ts

GitHub Actions / Build, lint, and test / Lint (18.x)

Prefer using an optional chain expression instead, as it's more concise and easier to read

Check warning on line 113 in src/block-cache.ts

GitHub Actions / Build, lint, and test / Lint (20.x)

Prefer using an optional chain expression instead, as it's more concise and easier to read

Check warning on line 113 in src/block-cache.ts

GitHub Actions / Build, lint, and test / Lint (22.x)

Prefer using an optional chain expression instead, as it's more concise and easier to read
!result.blockHash ||
result.blockHash ===
'0x0000000000000000000000000000000000000000000000000000000000000000'
* @deprecated This function was created to support a now-deprecated signature
* for {@link createFetchMiddleware}. It will be removed in a future major
* version.
* @param options - Options

Check warning on line 279 in src/fetch.ts

GitHub Actions / Build, lint, and test / Lint (18.x)

JSDoc description does not satisfy the regex pattern

Check warning on line 279 in src/fetch.ts

GitHub Actions / Build, lint, and test / Lint (20.x)

JSDoc description does not satisfy the regex pattern

Check warning on line 279 in src/fetch.ts

GitHub Actions / Build, lint, and test / Lint (22.x)

JSDoc description does not satisfy the regex pattern
* @param options.btoa - Generates a base64-encoded string from a binary string.
* @param options.rpcUrl - The URL to send the request to.
* @param options.originHttpHeaderKey - If provider, the origin field for each JSON-RPC request
* will be attached to each outgoing fetch request under this header.
* @param options.req

Check warning on line 284 in src/fetch.ts

GitHub Actions / Build, lint, and test / Lint (18.x)

Missing JSDoc @param "options.req" description

Check warning on line 284 in src/fetch.ts

GitHub Actions / Build, lint, and test / Lint (20.x)

Missing JSDoc @param "options.req" description

Check warning on line 284 in src/fetch.ts

GitHub Actions / Build, lint, and test / Lint (22.x)

Missing JSDoc @param "options.req" description
* @returns The fetch middleware.
*/
export function createFetchConfigFromReq({
};
/**
* Normalizes the messageData for the eth_signTypedData

Check warning on line 15 in src/utils/normalize.ts

GitHub Actions / Build, lint, and test / Lint (18.x)

JSDoc description does not satisfy the regex pattern

Check warning on line 15 in src/utils/normalize.ts

GitHub Actions / Build, lint, and test / Lint (20.x)

JSDoc description does not satisfy the regex pattern

Check warning on line 15 in src/utils/normalize.ts

GitHub Actions / Build, lint, and test / Lint (22.x)

JSDoc description does not satisfy the regex pattern
*
* @param messageData - The messageData to normalize.
* @returns The normalized messageData.
}
/**
* Parses the messageData to obtain the data object for EIP712 normalization

Check warning on line 41 in src/utils/normalize.ts

GitHub Actions / Build, lint, and test / Lint (18.x)

JSDoc description does not satisfy the regex pattern

Check warning on line 41 in src/utils/normalize.ts

GitHub Actions / Build, lint, and test / Lint (20.x)

JSDoc description does not satisfy the regex pattern

Check warning on line 41 in src/utils/normalize.ts

GitHub Actions / Build, lint, and test / Lint (22.x)

JSDoc description does not satisfy the regex pattern
*
* @param data - The messageData to parse.
* @returns The data object for EIP712 normalization.
}
/**
* Normalizes the address to standard hexadecimal format

Check warning on line 55 in src/utils/normalize.ts

GitHub Actions / Build, lint, and test / Lint (18.x)

JSDoc description does not satisfy the regex pattern

Check warning on line 55 in src/utils/normalize.ts

GitHub Actions / Build, lint, and test / Lint (20.x)

JSDoc description does not satisfy the regex pattern

Check warning on line 55 in src/utils/normalize.ts

GitHub Actions / Build, lint, and test / Lint (22.x)

JSDoc description does not satisfy the regex pattern
*
* @param address - The address to normalize.
* @returns The normalized address.
jest.advanceTimersByTime(50);
expect(promise).toNeverResolve();

Check warning on line 48 in src/utils/timeout.test.ts

GitHub Actions / Build, lint, and test / Lint (18.x)

Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator

Check warning on line 48 in src/utils/timeout.test.ts

GitHub Actions / Build, lint, and test / Lint (20.x)

Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator

Check warning on line 48 in src/utils/timeout.test.ts

GitHub Actions / Build, lint, and test / Lint (22.x)

Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator
});
it('resolves after the given duration', async () => {
*
* @param address - The address to validate and normalize.
* @param req - The request object.
* @returns {string} - The normalized address, if valid. Otherwise, throws

Check warning on line 464 in src/wallet.ts

GitHub Actions / Build, lint, and test / Lint (18.x)

There must be no hyphen before @returns description

Check warning on line 464 in src/wallet.ts

GitHub Actions / Build, lint, and test / Lint (18.x)

JSDoc description does not satisfy the regex pattern

Check warning on line 464 in src/wallet.ts

GitHub Actions / Build, lint, and test / Lint (20.x)

There must be no hyphen before @returns description

Check warning on line 464 in src/wallet.ts

GitHub Actions / Build, lint, and test / Lint (20.x)

JSDoc description does not satisfy the regex pattern

Check warning on line 464 in src/wallet.ts

GitHub Actions / Build, lint, and test / Lint (22.x)

There must be no hyphen before @returns description

Check warning on line 464 in src/wallet.ts

GitHub Actions / Build, lint, and test / Lint (22.x)

JSDoc description does not satisfy the regex pattern
* an error
*/
async function validateAndNormalizeKeyholder(