@0xsequence/network
Advanced tools
Comparing version 0.36.4 to 0.36.5
@@ -28,6 +28,3 @@ 'use strict'; | ||
const getAuthNetwork = networks => { | ||
if (!networks || networks.length === 0) return undefined; | ||
if (networks[0] && networks[0].isAuthChain) return networks[0]; | ||
if (networks.length > 1 && networks[1].isAuthChain) return networks[1]; | ||
return undefined; | ||
return networks.find(network => network.isAuthChain); | ||
}; | ||
@@ -34,0 +31,0 @@ const isValidNetworkConfig = (networkConfig, raise = false, skipRelayerCheck = false) => { |
@@ -28,6 +28,3 @@ 'use strict'; | ||
const getAuthNetwork = networks => { | ||
if (!networks || networks.length === 0) return undefined; | ||
if (networks[0] && networks[0].isAuthChain) return networks[0]; | ||
if (networks.length > 1 && networks[1].isAuthChain) return networks[1]; | ||
return undefined; | ||
return networks.find(network => network.isAuthChain); | ||
}; | ||
@@ -34,0 +31,0 @@ const isValidNetworkConfig = (networkConfig, raise = false, skipRelayerCheck = false) => { |
@@ -24,6 +24,3 @@ import { urlClean, logger } from '@0xsequence/utils'; | ||
const getAuthNetwork = networks => { | ||
if (!networks || networks.length === 0) return undefined; | ||
if (networks[0] && networks[0].isAuthChain) return networks[0]; | ||
if (networks.length > 1 && networks[1].isAuthChain) return networks[1]; | ||
return undefined; | ||
return networks.find(network => network.isAuthChain); | ||
}; | ||
@@ -30,0 +27,0 @@ const isValidNetworkConfig = (networkConfig, raise = false, skipRelayerCheck = false) => { |
{ | ||
"name": "@0xsequence/network", | ||
"version": "0.36.4", | ||
"version": "0.36.5", | ||
"description": "network sub-package for Sequence", | ||
@@ -16,3 +16,3 @@ "repository": "https://github.com/0xsequence/sequence.js/tree/master/packages/network", | ||
"dependencies": { | ||
"@0xsequence/utils": "^0.36.4", | ||
"@0xsequence/utils": "^0.36.5", | ||
"@ethersproject/providers": "^5.5.1", | ||
@@ -19,0 +19,0 @@ "ethers": "^5.5.2" |
@@ -25,6 +25,3 @@ import { ethers, BigNumberish } from 'ethers' | ||
export const getAuthNetwork = (networks: NetworkConfig[]): NetworkConfig | undefined => { | ||
if (!networks || networks.length === 0) return undefined | ||
if (networks[0] && networks[0].isAuthChain) return networks[0] | ||
if (networks.length > 1 && networks[1].isAuthChain) return networks[1] | ||
return undefined | ||
return networks.find(network => network.isAuthChain) | ||
} | ||
@@ -31,0 +28,0 @@ |
117280
3195
Updated@0xsequence/utils@^0.36.5