@metamask/controller-utils
Advanced tools
Comparing version 3.1.0 to 3.2.0
@@ -9,2 +9,10 @@ # Changelog | ||
## [3.2.0] | ||
### Uncategorized | ||
- deps: eth-rpc-errors@4.0.0->4.0.2 ([#1215](https://github.com/MetaMask/core/pull/1215)) | ||
- deps: bump @metamask/utils to 5.0.1 ([#1211](https://github.com/MetaMask/core/pull/1211)) | ||
- Add ORIGIN_METAMASK constant ([#1166](https://github.com/MetaMask/core/pull/1166)) | ||
- Add ApprovalType enum ([#1174](https://github.com/MetaMask/core/pull/1174)) | ||
- Improve return type of `toHex` ([#1195](https://github.com/MetaMask/core/pull/1195)) | ||
## [3.1.0] | ||
@@ -73,3 +81,4 @@ ### Added | ||
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/controller-utils@3.1.0...HEAD | ||
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/controller-utils@3.2.0...HEAD | ||
[3.2.0]: https://github.com/MetaMask/core/compare/@metamask/controller-utils@3.1.0...@metamask/controller-utils@3.2.0 | ||
[3.1.0]: https://github.com/MetaMask/core/compare/@metamask/controller-utils@3.0.0...@metamask/controller-utils@3.1.0 | ||
@@ -76,0 +85,0 @@ [3.0.0]: https://github.com/MetaMask/core/compare/@metamask/controller-utils@2.0.0...@metamask/controller-utils@3.0.0 |
@@ -70,1 +70,25 @@ import { NetworksTicker, NetworksChainId } from './types'; | ||
export declare const OPENSEA_TEST_API_URL = "https://testnets-api.opensea.io/api/v1"; | ||
export declare const ORIGIN_METAMASK = "metamask"; | ||
/** | ||
* Approval request types for various operations. | ||
* These types are used by different controllers to create and manage | ||
* approval requests consistently. | ||
*/ | ||
export declare enum ApprovalType { | ||
AddEthereumChain = "wallet_addEthereumChain", | ||
EthDecrypt = "eth_decrypt", | ||
EthGetEncryptionPublicKey = "eth_getEncryptionPublicKey", | ||
EthSign = "eth_sign", | ||
EthSignTypedData = "eth_signTypedData", | ||
PersonalSign = "personal_sign", | ||
SwitchEthereumChain = "wallet_switchEthereumChain", | ||
Transaction = "transaction", | ||
WalletRequestPermissions = "wallet_requestPermissions", | ||
WatchAsset = "wallet_watchAsset", | ||
SnapDialogAlert = "snap_dialog:alert", | ||
SnapDialogConfirmation = "snap_dialog:confirmation", | ||
SnapDialogPrompt = "snap_dialog:prompt", | ||
Unlock = "unlock", | ||
ConnectAccounts = "connect_accounts" | ||
} | ||
//# sourceMappingURL=constants.d.ts.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.OPENSEA_TEST_API_URL = exports.OPENSEA_API_URL = exports.OPENSEA_PROXY_URL = exports.BUILT_IN_NETWORKS = exports.TESTNET_TICKER_SYMBOLS = exports.ASSET_TYPES = exports.GWEI = exports.ERC1155_TOKEN_RECEIVER_INTERFACE_ID = exports.ERC1155_METADATA_URI_INTERFACE_ID = exports.ERC1155_INTERFACE_ID = exports.ERC721_ENUMERABLE_INTERFACE_ID = exports.ERC721_METADATA_INTERFACE_ID = exports.ERC721_INTERFACE_ID = exports.ERC20 = exports.ERC1155 = exports.ERC721 = exports.MAX_SAFE_CHAIN_ID = exports.GANACHE_CHAIN_ID = exports.IPFS_DEFAULT_GATEWAY_URL = exports.FALL_BACK_VS_CURRENCY = exports.RPC = void 0; | ||
exports.ApprovalType = exports.ORIGIN_METAMASK = exports.OPENSEA_TEST_API_URL = exports.OPENSEA_API_URL = exports.OPENSEA_PROXY_URL = exports.BUILT_IN_NETWORKS = exports.TESTNET_TICKER_SYMBOLS = exports.ASSET_TYPES = exports.GWEI = exports.ERC1155_TOKEN_RECEIVER_INTERFACE_ID = exports.ERC1155_METADATA_URI_INTERFACE_ID = exports.ERC1155_INTERFACE_ID = exports.ERC721_ENUMERABLE_INTERFACE_ID = exports.ERC721_METADATA_INTERFACE_ID = exports.ERC721_INTERFACE_ID = exports.ERC20 = exports.ERC1155 = exports.ERC721 = exports.MAX_SAFE_CHAIN_ID = exports.GANACHE_CHAIN_ID = exports.IPFS_DEFAULT_GATEWAY_URL = exports.FALL_BACK_VS_CURRENCY = exports.RPC = void 0; | ||
const types_1 = require("./types"); | ||
@@ -80,2 +80,27 @@ exports.RPC = 'rpc'; | ||
exports.OPENSEA_TEST_API_URL = 'https://testnets-api.opensea.io/api/v1'; | ||
// Default origin for controllers | ||
exports.ORIGIN_METAMASK = 'metamask'; | ||
/** | ||
* Approval request types for various operations. | ||
* These types are used by different controllers to create and manage | ||
* approval requests consistently. | ||
*/ | ||
var ApprovalType; | ||
(function (ApprovalType) { | ||
ApprovalType["AddEthereumChain"] = "wallet_addEthereumChain"; | ||
ApprovalType["EthDecrypt"] = "eth_decrypt"; | ||
ApprovalType["EthGetEncryptionPublicKey"] = "eth_getEncryptionPublicKey"; | ||
ApprovalType["EthSign"] = "eth_sign"; | ||
ApprovalType["EthSignTypedData"] = "eth_signTypedData"; | ||
ApprovalType["PersonalSign"] = "personal_sign"; | ||
ApprovalType["SwitchEthereumChain"] = "wallet_switchEthereumChain"; | ||
ApprovalType["Transaction"] = "transaction"; | ||
ApprovalType["WalletRequestPermissions"] = "wallet_requestPermissions"; | ||
ApprovalType["WatchAsset"] = "wallet_watchAsset"; | ||
ApprovalType["SnapDialogAlert"] = "snap_dialog:alert"; | ||
ApprovalType["SnapDialogConfirmation"] = "snap_dialog:confirmation"; | ||
ApprovalType["SnapDialogPrompt"] = "snap_dialog:prompt"; | ||
ApprovalType["Unlock"] = "unlock"; | ||
ApprovalType["ConnectAccounts"] = "connect_accounts"; | ||
})(ApprovalType = exports.ApprovalType || (exports.ApprovalType = {})); | ||
//# sourceMappingURL=constants.js.map |
@@ -5,1 +5,2 @@ export * from './constants'; | ||
export * from './siwe'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -5,1 +5,2 @@ /// <reference types="debug" /> | ||
export { createModuleLogger }; | ||
//# sourceMappingURL=logger.d.ts.map |
@@ -30,1 +30,2 @@ import { ParsedMessage } from '@spruceid/siwe-parser'; | ||
}) => SIWEMessage; | ||
//# sourceMappingURL=siwe.d.ts.map |
@@ -35,1 +35,2 @@ /** | ||
}; | ||
//# sourceMappingURL=types.d.ts.map |
/// <reference types="bn.js" /> | ||
import { BN } from 'ethereumjs-util'; | ||
import type { Hex } from '@metamask/utils'; | ||
import type { Json } from './types'; | ||
@@ -80,3 +81,3 @@ /** | ||
*/ | ||
export declare function toHex(value: number | string | BN): string; | ||
export declare function toHex(value: number | string | BN): Hex; | ||
/** | ||
@@ -225,1 +226,2 @@ * Execute and return an asynchronous operation without throwing errors. | ||
export {}; | ||
//# sourceMappingURL=util.d.ts.map |
@@ -20,2 +20,3 @@ "use strict"; | ||
const fast_deep_equal_1 = __importDefault(require("fast-deep-equal")); | ||
const utils_1 = require("@metamask/utils"); | ||
const constants_1 = require("./constants"); | ||
@@ -127,3 +128,3 @@ const TIMEOUT_ERROR = new Error('timeout'); | ||
function hexToBN(inputHex) { | ||
return new ethereumjs_util_1.BN((0, ethereumjs_util_1.stripHexPrefix)(inputHex), 16); | ||
return inputHex ? new ethereumjs_util_1.BN((0, ethereumjs_util_1.stripHexPrefix)(inputHex), 16) : new ethereumjs_util_1.BN(0); | ||
} | ||
@@ -170,3 +171,3 @@ exports.hexToBN = hexToBN; | ||
function toHex(value) { | ||
if (typeof value === 'string' && (0, ethereumjs_util_1.isHexString)(value)) { | ||
if (typeof value === 'string' && (0, utils_1.isStrictHexString)(value)) { | ||
return value; | ||
@@ -173,0 +174,0 @@ } |
{ | ||
"name": "@metamask/controller-utils", | ||
"version": "3.1.0", | ||
"version": "3.2.0", | ||
"description": "Data and convenience functions shared by multiple packages", | ||
@@ -32,6 +32,6 @@ "keywords": [ | ||
"dependencies": { | ||
"@metamask/utils": "^3.3.1", | ||
"@metamask/utils": "^5.0.1", | ||
"@spruceid/siwe-parser": "1.1.3", | ||
"eth-ens-namehash": "^2.0.8", | ||
"eth-rpc-errors": "^4.0.0", | ||
"eth-rpc-errors": "^4.0.2", | ||
"ethereumjs-util": "^7.0.10", | ||
@@ -38,0 +38,0 @@ "ethjs-unit": "^0.1.6", |
Sorry, the diff of this file is not supported yet
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
91046
28
1118
+ Added@ethereumjs/common@3.2.0(transitive)
+ Added@ethereumjs/rlp@4.0.1(transitive)
+ Added@ethereumjs/tx@4.2.0(transitive)
+ Added@ethereumjs/util@8.1.0(transitive)
+ Added@metamask/utils@5.0.2(transitive)
+ Added@noble/curves@1.4.2(transitive)
+ Added@noble/hashes@1.4.0(transitive)
+ Added@scure/base@1.1.9(transitive)
+ Added@scure/bip32@1.4.0(transitive)
+ Added@scure/bip39@1.3.0(transitive)
+ Addedcrc-32@1.2.2(transitive)
+ Addedethereum-cryptography@2.2.1(transitive)
+ Addedmicro-ftch@0.3.1(transitive)
- Removed@metamask/utils@3.6.0(transitive)
Updated@metamask/utils@^5.0.1
Updatedeth-rpc-errors@^4.0.2