@metamask/keyring-api
Advanced tools
Comparing version 4.0.1 to 4.0.2
@@ -10,2 +10,10 @@ # Changelog | ||
## [4.0.2] | ||
### Changed | ||
- Bump @metamask/snaps-sdk to ^3.1.1 ([#271](https://github.com/MetaMask/keyring-api/pull/271)) | ||
- Bump @metamask/safe-event-emitter from 3.0.0 to 3.1.0 ([#270](https://github.com/MetaMask/keyring-api/pull/270)) | ||
- Fix bundler URL validation ([#262](https://github.com/MetaMask/keyring-api/pull/262)) | ||
## [4.0.1] | ||
@@ -231,3 +239,4 @@ | ||
[Unreleased]: https://github.com/MetaMask/keyring-api/compare/v4.0.1...HEAD | ||
[Unreleased]: https://github.com/MetaMask/keyring-api/compare/v4.0.2...HEAD | ||
[4.0.2]: https://github.com/MetaMask/keyring-api/compare/v4.0.1...v4.0.2 | ||
[4.0.1]: https://github.com/MetaMask/keyring-api/compare/v4.0.0...v4.0.1 | ||
@@ -234,0 +243,0 @@ [4.0.0]: https://github.com/MetaMask/keyring-api/compare/v3.0.0...v4.0.0 |
@@ -61,3 +61,3 @@ import { type Infer } from 'superstruct'; | ||
dummySignature: string; | ||
bundlerUrl: string; | ||
bundlerUrl: unknown; | ||
gasLimits?: { | ||
@@ -83,3 +83,3 @@ callGasLimit: string; | ||
dummySignature: import("superstruct").Struct<string, null>; | ||
bundlerUrl: import("superstruct").Struct<string, null>; | ||
bundlerUrl: import("superstruct").Struct<unknown, null>; | ||
}>; | ||
@@ -86,0 +86,0 @@ export declare type EthBaseUserOperation = Infer<typeof EthBaseUserOperationStruct>; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.EthUserOperationPatchStruct = exports.EthBaseUserOperationStruct = exports.EthBaseTransactionStruct = exports.EthUserOperationStruct = void 0; | ||
const superstruct_1 = require("superstruct"); | ||
const superstruct_2 = require("../../superstruct"); | ||
const superstruct_1 = require("../../superstruct"); | ||
const types_1 = require("../types"); | ||
@@ -11,3 +10,3 @@ /** | ||
*/ | ||
exports.EthUserOperationStruct = (0, superstruct_2.object)({ | ||
exports.EthUserOperationStruct = (0, superstruct_1.object)({ | ||
sender: types_1.EthAddressStruct, | ||
@@ -29,3 +28,3 @@ nonce: types_1.EthUint256Struct, | ||
*/ | ||
exports.EthBaseTransactionStruct = (0, superstruct_2.object)({ | ||
exports.EthBaseTransactionStruct = (0, superstruct_1.object)({ | ||
/** | ||
@@ -44,7 +43,7 @@ * Address of the transaction recipient. | ||
}); | ||
exports.EthBaseUserOperationStruct = (0, superstruct_2.object)({ | ||
exports.EthBaseUserOperationStruct = (0, superstruct_1.object)({ | ||
nonce: types_1.EthUint256Struct, | ||
initCode: types_1.EthBytesStruct, | ||
callData: types_1.EthBytesStruct, | ||
gasLimits: (0, superstruct_2.exactOptional)((0, superstruct_2.object)({ | ||
gasLimits: (0, superstruct_1.exactOptional)((0, superstruct_1.object)({ | ||
callGasLimit: types_1.EthUint256Struct, | ||
@@ -56,10 +55,10 @@ verificationGasLimit: types_1.EthUint256Struct, | ||
dummySignature: types_1.EthBytesStruct, | ||
bundlerUrl: (0, superstruct_1.string)(), | ||
bundlerUrl: superstruct_1.UrlStruct, | ||
}); | ||
exports.EthUserOperationPatchStruct = (0, superstruct_2.object)({ | ||
exports.EthUserOperationPatchStruct = (0, superstruct_1.object)({ | ||
paymasterAndData: types_1.EthBytesStruct, | ||
callGasLimit: (0, superstruct_2.exactOptional)(types_1.EthUint256Struct), | ||
verificationGasLimit: (0, superstruct_2.exactOptional)(types_1.EthUint256Struct), | ||
preVerificationGas: (0, superstruct_2.exactOptional)(types_1.EthUint256Struct), | ||
callGasLimit: (0, superstruct_1.exactOptional)(types_1.EthUint256Struct), | ||
verificationGasLimit: (0, superstruct_1.exactOptional)(types_1.EthUint256Struct), | ||
preVerificationGas: (0, superstruct_1.exactOptional)(types_1.EthUint256Struct), | ||
}); | ||
//# sourceMappingURL=types.js.map |
@@ -72,2 +72,9 @@ import type { Infer } from 'superstruct'; | ||
export declare function definePattern(name: string, pattern: RegExp): Struct<string, null>; | ||
/** | ||
* Validates if a given value is a valid URL. | ||
* | ||
* @param value - The value to be validated. | ||
* @returns A boolean indicating if the value is a valid URL. | ||
*/ | ||
export declare const UrlStruct: Struct<unknown, null>; | ||
export {}; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.definePattern = exports.exactOptional = exports.object = void 0; | ||
exports.UrlStruct = exports.definePattern = exports.exactOptional = exports.object = void 0; | ||
const superstruct_1 = require("superstruct"); | ||
@@ -65,2 +65,18 @@ /** | ||
exports.definePattern = definePattern; | ||
/** | ||
* Validates if a given value is a valid URL. | ||
* | ||
* @param value - The value to be validated. | ||
* @returns A boolean indicating if the value is a valid URL. | ||
*/ | ||
exports.UrlStruct = (0, superstruct_1.define)('Url', (value) => { | ||
let url; | ||
try { | ||
url = new URL(value); | ||
} | ||
catch (_) { | ||
return false; | ||
} | ||
return url.protocol === 'http:' || url.protocol === 'https:'; | ||
}); | ||
//# sourceMappingURL=superstruct.js.map |
{ | ||
"name": "@metamask/keyring-api", | ||
"version": "4.0.1", | ||
"version": "4.0.2", | ||
"description": "MetaMask Keyring API", | ||
@@ -42,3 +42,3 @@ "keywords": [ | ||
"@metamask/providers": "^15.0.0", | ||
"@metamask/snaps-sdk": "^3.1.0", | ||
"@metamask/snaps-sdk": "^3.1.1", | ||
"@metamask/utils": "^8.3.0", | ||
@@ -45,0 +45,0 @@ "@types/uuid": "^9.0.1", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
190189
2289
Updated@metamask/snaps-sdk@^3.1.1