New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@metamask-previews/network-controller

Package Overview
Dependencies
Maintainers
2
Versions
492
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@metamask-previews/network-controller - npm Package Compare versions

Comparing version 17.2.1-preview.eb2135e to 18.0.1-preview-07ab424

30

CHANGELOG.md

@@ -10,2 +10,28 @@ # Changelog

## [18.0.1]
### Fixed
- Fix `types` field in `package.json` ([#4047](https://github.com/MetaMask/core/pull/4047))
## [18.0.0]
### Added
- **BREAKING**: Add ESM build ([#3998](https://github.com/MetaMask/core/pull/3998))
- It's no longer possible to import files from `./dist` directly.
- Add network client for Linea Sepolia (chain ID `0xe705`) ([#3995](https://github.com/MetaMask/core/pull/3995))
- Bump `@metamask/eth-json-rpc-infura` to `^9.1.0` to bring this change.
### Changed
- **BREAKING:** Bump `@metamask/base-controller` to `^5.0.0` ([#4039](https://github.com/MetaMask/core/pull/4039))
- This version has a number of breaking changes. See the changelog for more.
- Bump `@metamask/controller-utils` to `^9.0.0` ([#4039](https://github.com/MetaMask/core/pull/4039))
### Fixed
- **BREAKING:** Narrow `NetworkControllerMessenger` type parameters `AllowedAction` and `AllowedEvent` from `string` to `never` ([#4031](https://github.com/MetaMask/core/pull/4031))
- Allowlisting or using any external actions or events will now produce a type error.
## [17.2.1]

@@ -436,3 +462,5 @@

[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/network-controller@17.2.1...HEAD
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/network-controller@18.0.1...HEAD
[18.0.1]: https://github.com/MetaMask/core/compare/@metamask/network-controller@18.0.0...@metamask/network-controller@18.0.1
[18.0.0]: https://github.com/MetaMask/core/compare/@metamask/network-controller@17.2.1...@metamask/network-controller@18.0.0
[17.2.1]: https://github.com/MetaMask/core/compare/@metamask/network-controller@17.2.0...@metamask/network-controller@17.2.1

@@ -439,0 +467,0 @@ [17.2.0]: https://github.com/MetaMask/core/compare/@metamask/network-controller@17.1.0...@metamask/network-controller@17.2.0

4

dist/types/create-auto-managed-network-client.d.ts

@@ -17,3 +17,3 @@ import type { BlockTracker, NetworkClientConfiguration, Provider } from './types';

*/
export declare type ProxyWithAccessibleTarget<TargetType> = TargetType & {
export type ProxyWithAccessibleTarget<TargetType> = TargetType & {
[REFLECTIVE_PROPERTY_NAME]: TargetType;

@@ -26,3 +26,3 @@ };

*/
export declare type AutoManagedNetworkClient<Configuration extends NetworkClientConfiguration> = {
export type AutoManagedNetworkClient<Configuration extends NetworkClientConfiguration> = {
configuration: Configuration;

@@ -29,0 +29,0 @@ provider: ProxyWithAccessibleTarget<Provider>;

@@ -6,3 +6,3 @@ import type { BlockTracker, NetworkClientConfiguration, Provider } from './types';

*/
export declare type NetworkClient = {
export type NetworkClient = {
configuration: NetworkClientConfiguration;

@@ -9,0 +9,0 @@ provider: Provider;

@@ -21,3 +21,3 @@ import type { ControllerGetStateAction, ControllerStateChangeEvent, RestrictedControllerMessenger } from '@metamask/base-controller';

*/
export declare type ProviderConfig = {
export type ProviderConfig = {
rpcUrl?: string;

@@ -33,3 +33,3 @@ type: NetworkType;

};
export declare type Block = {
export type Block = {
baseFeePerGas?: string;

@@ -40,3 +40,3 @@ };

*/
export declare type NetworkMetadata = {
export type NetworkMetadata = {
/**

@@ -62,3 +62,3 @@ * EIPs supported by the network.

*/
export declare type NetworkConfiguration = {
export type NetworkConfiguration = {
rpcUrl: string;

@@ -75,3 +75,3 @@ chainId: Hex;

*/
declare type NetworkConfigurations = Record<NetworkConfigurationId, NetworkConfiguration & {
type NetworkConfigurations = Record<NetworkConfigurationId, NetworkConfiguration & {
id: NetworkConfigurationId;

@@ -96,15 +96,15 @@ }>;

*/
declare type BuiltInNetworkClientId = InfuraNetworkType;
type BuiltInNetworkClientId = InfuraNetworkType;
/**
* The string that uniquely identifies a custom network client.
*/
declare type CustomNetworkClientId = string;
type CustomNetworkClientId = string;
/**
* The string that uniquely identifies a network client.
*/
export declare type NetworkClientId = BuiltInNetworkClientId | CustomNetworkClientId;
export type NetworkClientId = BuiltInNetworkClientId | CustomNetworkClientId;
/**
* Information about networks not held by any other part of state.
*/
export declare type NetworksMetadata = {
export type NetworksMetadata = {
[networkClientId: NetworkClientId]: NetworkMetadata;

@@ -120,3 +120,3 @@ };

*/
export declare type NetworkState = {
export type NetworkState = {
selectedNetworkClientId: NetworkClientId;

@@ -135,3 +135,3 @@ providerConfig: ProviderConfig;

*/
export declare type BlockTrackerProxy = SwappableProxy<ProxyWithAccessibleTarget<BlockTracker>>;
export type BlockTrackerProxy = SwappableProxy<ProxyWithAccessibleTarget<BlockTracker>>;
/**

@@ -144,4 +144,4 @@ * Represents the provider for the currently selected network. (Note that this

*/
export declare type ProviderProxy = SwappableProxy<ProxyWithAccessibleTarget<Provider>>;
export declare type NetworkControllerStateChangeEvent = ControllerStateChangeEvent<typeof name, NetworkState>;
export type ProviderProxy = SwappableProxy<ProxyWithAccessibleTarget<Provider>>;
export type NetworkControllerStateChangeEvent = ControllerStateChangeEvent<typeof name, NetworkState>;
/**

@@ -152,3 +152,3 @@ * `networkWillChange` is published when the current network is about to be

*/
export declare type NetworkControllerNetworkWillChangeEvent = {
export type NetworkControllerNetworkWillChangeEvent = {
type: 'NetworkController:networkWillChange';

@@ -161,3 +161,3 @@ payload: [NetworkState];

*/
export declare type NetworkControllerNetworkDidChangeEvent = {
export type NetworkControllerNetworkDidChangeEvent = {
type: 'NetworkController:networkDidChange';

@@ -171,3 +171,3 @@ payload: [NetworkState];

*/
export declare type NetworkControllerInfuraIsBlockedEvent = {
export type NetworkControllerInfuraIsBlockedEvent = {
type: 'NetworkController:infuraIsBlocked';

@@ -181,25 +181,25 @@ payload: [];

*/
export declare type NetworkControllerInfuraIsUnblockedEvent = {
export type NetworkControllerInfuraIsUnblockedEvent = {
type: 'NetworkController:infuraIsUnblocked';
payload: [];
};
export declare type NetworkControllerEvents = NetworkControllerStateChangeEvent | NetworkControllerNetworkWillChangeEvent | NetworkControllerNetworkDidChangeEvent | NetworkControllerInfuraIsBlockedEvent | NetworkControllerInfuraIsUnblockedEvent;
export declare type NetworkControllerGetStateAction = ControllerGetStateAction<typeof name, NetworkState>;
export declare type NetworkControllerGetProviderConfigAction = {
export type NetworkControllerEvents = NetworkControllerStateChangeEvent | NetworkControllerNetworkWillChangeEvent | NetworkControllerNetworkDidChangeEvent | NetworkControllerInfuraIsBlockedEvent | NetworkControllerInfuraIsUnblockedEvent;
export type NetworkControllerGetStateAction = ControllerGetStateAction<typeof name, NetworkState>;
export type NetworkControllerGetProviderConfigAction = {
type: `NetworkController:getProviderConfig`;
handler: () => ProviderConfig;
};
export declare type NetworkControllerGetEthQueryAction = {
export type NetworkControllerGetEthQueryAction = {
type: `NetworkController:getEthQuery`;
handler: () => EthQuery | undefined;
};
export declare type NetworkControllerGetNetworkClientByIdAction = {
export type NetworkControllerGetNetworkClientByIdAction = {
type: `NetworkController:getNetworkClientById`;
handler: NetworkController['getNetworkClientById'];
};
export declare type NetworkControllerGetEIP1559CompatibilityAction = {
export type NetworkControllerGetEIP1559CompatibilityAction = {
type: `NetworkController:getEIP1559Compatibility`;
handler: NetworkController['getEIP1559Compatibility'];
};
export declare type NetworkControllerFindNetworkClientIdByChainIdAction = {
export type NetworkControllerFindNetworkClientIdByChainIdAction = {
type: `NetworkController:findNetworkClientIdByChainId`;

@@ -214,17 +214,17 @@ handler: NetworkController['findNetworkClientIdByChainId'];

*/
export declare type NetworkControllerSetProviderTypeAction = {
export type NetworkControllerSetProviderTypeAction = {
type: `NetworkController:setProviderType`;
handler: NetworkController['setProviderType'];
};
export declare type NetworkControllerSetActiveNetworkAction = {
export type NetworkControllerSetActiveNetworkAction = {
type: `NetworkController:setActiveNetwork`;
handler: NetworkController['setActiveNetwork'];
};
export declare type NetworkControllerGetNetworkConfigurationByNetworkClientId = {
export type NetworkControllerGetNetworkConfigurationByNetworkClientId = {
type: `NetworkController:getNetworkConfigurationByNetworkClientId`;
handler: NetworkController['getNetworkConfigurationByNetworkClientId'];
};
export declare type NetworkControllerActions = NetworkControllerGetStateAction | NetworkControllerGetProviderConfigAction | NetworkControllerGetEthQueryAction | NetworkControllerGetNetworkClientByIdAction | NetworkControllerGetEIP1559CompatibilityAction | NetworkControllerFindNetworkClientIdByChainIdAction | NetworkControllerSetActiveNetworkAction | NetworkControllerSetProviderTypeAction | NetworkControllerGetNetworkConfigurationByNetworkClientId;
export declare type NetworkControllerMessenger = RestrictedControllerMessenger<typeof name, NetworkControllerActions, NetworkControllerEvents, never, never>;
export declare type NetworkControllerOptions = {
export type NetworkControllerActions = NetworkControllerGetStateAction | NetworkControllerGetProviderConfigAction | NetworkControllerGetEthQueryAction | NetworkControllerGetNetworkClientByIdAction | NetworkControllerGetEIP1559CompatibilityAction | NetworkControllerFindNetworkClientIdByChainIdAction | NetworkControllerSetActiveNetworkAction | NetworkControllerSetProviderTypeAction | NetworkControllerGetNetworkConfigurationByNetworkClientId;
export type NetworkControllerMessenger = RestrictedControllerMessenger<typeof name, NetworkControllerActions, NetworkControllerEvents, never, never>;
export type NetworkControllerOptions = {
messenger: NetworkControllerMessenger;

@@ -236,11 +236,11 @@ trackMetaMetricsEvent: () => void;

export declare const defaultState: NetworkState;
declare type NetworkConfigurationId = string;
type NetworkConfigurationId = string;
/**
* The collection of auto-managed network clients that map to Infura networks.
*/
declare type AutoManagedBuiltInNetworkClientRegistry = Record<BuiltInNetworkClientId, AutoManagedNetworkClient<InfuraNetworkClientConfiguration>>;
type AutoManagedBuiltInNetworkClientRegistry = Record<BuiltInNetworkClientId, AutoManagedNetworkClient<InfuraNetworkClientConfiguration>>;
/**
* The collection of auto-managed network clients that map to Infura networks.
*/
declare type AutoManagedCustomNetworkClientRegistry = Record<CustomNetworkClientId, AutoManagedNetworkClient<CustomNetworkClientConfiguration>>;
type AutoManagedCustomNetworkClientRegistry = Record<CustomNetworkClientId, AutoManagedNetworkClient<CustomNetworkClientConfiguration>>;
/**

@@ -247,0 +247,0 @@ * Controller that creates and manages an Ethereum network provider.

@@ -5,4 +5,4 @@ import type { InfuraNetworkType } from '@metamask/controller-utils';

import type { BlockTracker as BaseBlockTracker } from 'eth-block-tracker';
export declare type Provider = SafeEventEmitterProvider;
export declare type BlockTracker = BaseBlockTracker & {
export type Provider = SafeEventEmitterProvider;
export type BlockTracker = BaseBlockTracker & {
checkForLatestBlock(): Promise<string>;

@@ -21,3 +21,3 @@ };

*/
export declare type CustomNetworkClientConfiguration = {
export type CustomNetworkClientConfiguration = {
chainId: Hex;

@@ -32,3 +32,3 @@ rpcUrl: string;

*/
export declare type InfuraNetworkClientConfiguration = {
export type InfuraNetworkClientConfiguration = {
chainId: Hex;

@@ -43,3 +43,3 @@ network: InfuraNetworkType;

*/
export declare type NetworkClientConfiguration = CustomNetworkClientConfiguration | InfuraNetworkClientConfiguration;
export type NetworkClientConfiguration = CustomNetworkClientConfiguration | InfuraNetworkClientConfiguration;
//# sourceMappingURL=types.d.ts.map
{
"name": "@metamask-previews/network-controller",
"version": "17.2.1-preview.eb2135e",
"version": "18.0.1-preview-07ab424",
"description": "Provides an interface to the currently selected network via a MetaMask-compatible provider object",

@@ -28,3 +28,3 @@ "keywords": [

"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"types": "./dist/types/index.d.ts",
"files": [

@@ -45,9 +45,9 @@ "dist/"

"dependencies": {
"@metamask/base-controller": "^4.1.1",
"@metamask/controller-utils": "^8.0.4",
"@metamask/base-controller": "^5.0.1",
"@metamask/controller-utils": "^9.0.2",
"@metamask/eth-json-rpc-infura": "^9.1.0",
"@metamask/eth-json-rpc-middleware": "^12.1.0",
"@metamask/eth-json-rpc-provider": "^2.3.2",
"@metamask/eth-json-rpc-provider": "^3.0.1",
"@metamask/eth-query": "^4.0.0",
"@metamask/json-rpc-engine": "^7.3.3",
"@metamask/json-rpc-engine": "^8.0.1",
"@metamask/rpc-errors": "^6.2.1",

@@ -76,3 +76,3 @@ "@metamask/swappable-obj-proxy": "^2.2.0",

"typedoc-plugin-missing-exports": "^2.0.0",
"typescript": "~4.8.4"
"typescript": "~4.9.5"
},

@@ -79,0 +79,0 @@ "engines": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc