@metamask/eth-json-rpc-middleware
Advanced tools
Comparing version 12.0.1 to 12.1.0
@@ -9,2 +9,10 @@ # Changelog | ||
## [12.1.0] | ||
### Added | ||
- Add `signatureMethod` property to `MessageParams` ([#273](https://github.com/MetaMask/eth-json-rpc-middleware/pull/273)) | ||
- Add `version` property to `eth_signTypedData` message params ([#282](https://github.com/MetaMask/eth-json-rpc-middleware/pull/282)) | ||
### Changed | ||
- Update message types ([#282](https://github.com/MetaMask/eth-json-rpc-middleware/pull/282)) | ||
## [12.0.1] | ||
@@ -160,3 +168,4 @@ ### Changed | ||
[Unreleased]: https://github.com/MetaMask/eth-json-rpc-middleware/compare/v12.0.1...HEAD | ||
[Unreleased]: https://github.com/MetaMask/eth-json-rpc-middleware/compare/v12.1.0...HEAD | ||
[12.1.0]: https://github.com/MetaMask/eth-json-rpc-middleware/compare/v12.0.1...v12.1.0 | ||
[12.0.1]: https://github.com/MetaMask/eth-json-rpc-middleware/compare/v12.0.0...v12.0.1 | ||
@@ -163,0 +172,0 @@ [12.0.0]: https://github.com/MetaMask/eth-json-rpc-middleware/compare/v11.0.2...v12.0.0 |
@@ -9,2 +9,3 @@ import type { JsonRpcMiddleware } from '@metamask/json-rpc-engine'; | ||
data: string; | ||
signatureMethod?: string; | ||
}; | ||
@@ -14,2 +15,5 @@ export declare type TypedMessageParams = MessageParams & { | ||
}; | ||
export declare type TypedMessageV1Params = Omit<TypedMessageParams, 'data'> & { | ||
data: Record<string, unknown>[]; | ||
}; | ||
export interface WalletMiddlewareOptions { | ||
@@ -23,3 +27,3 @@ getAccounts: (req: JsonRpcRequest) => Promise<string[]>; | ||
processSignTransaction?: (txParams: TransactionParams, req: JsonRpcRequest) => Promise<string>; | ||
processTypedMessage?: (msgParams: MessageParams, req: JsonRpcRequest, version: string) => Promise<string>; | ||
processTypedMessage?: (msgParams: TypedMessageV1Params, req: JsonRpcRequest, version: string) => Promise<string>; | ||
processTypedMessageV3?: (msgParams: TypedMessageParams, req: JsonRpcRequest, version: string) => Promise<string>; | ||
@@ -26,0 +30,0 @@ processTypedMessageV4?: (msgParams: TypedMessageParams, req: JsonRpcRequest, version: string) => Promise<string>; |
@@ -106,3 +106,3 @@ "use strict"; | ||
const extraParams = params[2] || {}; | ||
const msgParams = Object.assign(Object.assign({}, extraParams), { from: address, data: message }); | ||
const msgParams = Object.assign(Object.assign({}, extraParams), { from: address, data: message, signatureMethod: 'eth_sign' }); | ||
res.result = await processEthSignMessage(msgParams, req); | ||
@@ -124,3 +124,3 @@ } | ||
const extraParams = params[2] || {}; | ||
const msgParams = Object.assign(Object.assign({}, extraParams), { from: address, data: message }); | ||
const msgParams = Object.assign(Object.assign({}, extraParams), { from: address, data: message, signatureMethod: 'eth_signTypedData', version }); | ||
res.result = await processTypedMessage(msgParams, req, version); | ||
@@ -145,2 +145,3 @@ } | ||
version, | ||
signatureMethod: 'eth_signTypedData_v3', | ||
}; | ||
@@ -166,2 +167,3 @@ res.result = await processTypedMessageV3(msgParams, req, version); | ||
version, | ||
signatureMethod: 'eth_signTypedData_v4', | ||
}; | ||
@@ -207,3 +209,3 @@ res.result = await processTypedMessageV4(msgParams, req, version); | ||
address = await validateAndNormalizeKeyholder(address, req); | ||
const msgParams = Object.assign(Object.assign({}, extraParams), { from: address, data: message }); | ||
const msgParams = Object.assign(Object.assign({}, extraParams), { from: address, data: message, signatureMethod: 'personal_sign' }); | ||
// eslint-disable-next-line require-atomic-updates | ||
@@ -210,0 +212,0 @@ res.result = await processPersonalMessage(msgParams, req); |
{ | ||
"name": "@metamask/eth-json-rpc-middleware", | ||
"version": "12.0.1", | ||
"version": "12.1.0", | ||
"description": "Ethereum-related json-rpc-engine middleware.", | ||
@@ -5,0 +5,0 @@ "repository": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
164098
1463