Socket
Socket
Sign inDemoInstall

@wagmi/core

Package Overview
Dependencies
Maintainers
2
Versions
490
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wagmi/core - npm Package Compare versions

Comparing version 2.13.2 to 2.13.3

20

dist/esm/createConfig.js

@@ -141,9 +141,3 @@ import { createStore as createMipd, } from 'mipd';

const initialState = getInitialState();
const chainId = persistedState &&
typeof persistedState === 'object' &&
'chainId' in persistedState &&
typeof persistedState.chainId === 'number' &&
chains.getState().some((x) => x.id === persistedState.chainId)
? persistedState.chainId
: initialState.chainId;
const chainId = validatePersistedChainId(persistedState, initialState.chainId);
return { ...initialState, chainId };

@@ -173,5 +167,8 @@ },

delete persistedState.status;
// Make sure persisted `chainId` is valid
const chainId = validatePersistedChainId(persistedState, currentState.chainId);
return {
...currentState,
...persistedState,
chainId,
};

@@ -184,2 +181,11 @@ },

: getInitialState));
function validatePersistedChainId(persistedState, defaultChainId) {
return persistedState &&
typeof persistedState === 'object' &&
'chainId' in persistedState &&
typeof persistedState.chainId === 'number' &&
chains.getState().some((x) => x.id === persistedState.chainId)
? persistedState.chainId
: defaultChainId;
}
/////////////////////////////////////////////////////////////////////////////////////////////////

@@ -186,0 +192,0 @@ // Subscribe to changes

@@ -1,2 +0,2 @@

export const version = '2.13.2';
export const version = '2.13.3';
//# sourceMappingURL=version.js.map

@@ -1,2 +0,2 @@

export declare const version = "2.13.2";
export declare const version = "2.13.3";
//# sourceMappingURL=version.d.ts.map
{
"name": "@wagmi/core",
"description": "VanillaJS library for Ethereum",
"version": "2.13.2",
"version": "2.13.3",
"license": "MIT",

@@ -6,0 +6,0 @@ "repository": {

@@ -227,10 +227,6 @@ import {

const initialState = getInitialState()
const chainId =
persistedState &&
typeof persistedState === 'object' &&
'chainId' in persistedState &&
typeof persistedState.chainId === 'number' &&
chains.getState().some((x) => x.id === persistedState.chainId)
? persistedState.chainId
: initialState.chainId
const chainId = validatePersistedChainId(
persistedState,
initialState.chainId,
)
return { ...initialState, chainId }

@@ -264,5 +260,11 @@ },

delete persistedState.status
// Make sure persisted `chainId` is valid
const chainId = validatePersistedChainId(
persistedState,
currentState.chainId,
)
return {
...currentState,
...(persistedState as object),
chainId,
}

@@ -278,2 +280,15 @@ },

function validatePersistedChainId(
persistedState: unknown,
defaultChainId: number,
) {
return persistedState &&
typeof persistedState === 'object' &&
'chainId' in persistedState &&
typeof persistedState.chainId === 'number' &&
chains.getState().some((x) => x.id === persistedState.chainId)
? persistedState.chainId
: defaultChainId
}
/////////////////////////////////////////////////////////////////////////////////////////////////

@@ -280,0 +295,0 @@ // Subscribe to changes

@@ -1,1 +0,1 @@

export const version = '2.13.2'
export const version = '2.13.3'

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