@0xsequence/network
Advanced tools
Comparing version 1.10.5 to 1.10.6
@@ -228,25 +228,20 @@ 'use strict'; | ||
} | ||
const genUrls = network => { | ||
const rpcUrl = nodesURL(network); | ||
return { | ||
const createNetworkConfig = (chainId, options) => { | ||
const network = constants_dist_0xsequenceNetworkConstants.networks[chainId]; | ||
if (!network) { | ||
throw new Error(`Network with chainId ${chainId} not found`); | ||
} | ||
const rpcUrl = nodesURL(network.name); | ||
return _extends({}, network, { | ||
rpcUrl, | ||
indexerUrl: indexerURL(network.name), | ||
relayer: { | ||
url: relayerURL(network), | ||
url: relayerURL(network.name), | ||
provider: { | ||
url: rpcUrl | ||
} | ||
}, | ||
indexerUrl: indexerURL(network) | ||
}; | ||
} | ||
}, options); | ||
}; | ||
const allNetworks = validateAndSortNetworks([_extends({}, constants_dist_0xsequenceNetworkConstants.networks[constants_dist_0xsequenceNetworkConstants.ChainId.POLYGON], genUrls('polygon'), { | ||
isDefaultChain: true, | ||
isAuthChain: true | ||
}), _extends({}, constants_dist_0xsequenceNetworkConstants.networks[constants_dist_0xsequenceNetworkConstants.ChainId.MAINNET], genUrls('mainnet')), _extends({}, constants_dist_0xsequenceNetworkConstants.networks[constants_dist_0xsequenceNetworkConstants.ChainId.BSC], genUrls('bsc')), _extends({}, constants_dist_0xsequenceNetworkConstants.networks[constants_dist_0xsequenceNetworkConstants.ChainId.AVALANCHE], genUrls('avalanche')), _extends({}, constants_dist_0xsequenceNetworkConstants.networks[constants_dist_0xsequenceNetworkConstants.ChainId.ARBITRUM], genUrls('arbitrum')), _extends({}, constants_dist_0xsequenceNetworkConstants.networks[constants_dist_0xsequenceNetworkConstants.ChainId.ARBITRUM_NOVA], genUrls('arbitrum-nova')), _extends({}, constants_dist_0xsequenceNetworkConstants.networks[constants_dist_0xsequenceNetworkConstants.ChainId.OPTIMISM], genUrls('optimism')), _extends({}, constants_dist_0xsequenceNetworkConstants.networks[constants_dist_0xsequenceNetworkConstants.ChainId.OPTIMISM_SEPOLIA], genUrls('optimism-sepolia')), _extends({}, constants_dist_0xsequenceNetworkConstants.networks[constants_dist_0xsequenceNetworkConstants.ChainId.POLYGON_ZKEVM], genUrls('polygon-zkevm')), _extends({}, constants_dist_0xsequenceNetworkConstants.networks[constants_dist_0xsequenceNetworkConstants.ChainId.GNOSIS], genUrls('gnosis')), _extends({}, constants_dist_0xsequenceNetworkConstants.networks[constants_dist_0xsequenceNetworkConstants.ChainId.RINKEBY], genUrls('rinkeby'), { | ||
disabled: true | ||
}), _extends({}, constants_dist_0xsequenceNetworkConstants.networks[constants_dist_0xsequenceNetworkConstants.ChainId.GOERLI], genUrls('goerli'), { | ||
disabled: true | ||
}), _extends({}, constants_dist_0xsequenceNetworkConstants.networks[constants_dist_0xsequenceNetworkConstants.ChainId.SEPOLIA], genUrls('sepolia')), _extends({}, constants_dist_0xsequenceNetworkConstants.networks[constants_dist_0xsequenceNetworkConstants.ChainId.POLYGON_MUMBAI], genUrls('mumbai'), { | ||
disabled: true | ||
}), _extends({}, constants_dist_0xsequenceNetworkConstants.networks[constants_dist_0xsequenceNetworkConstants.ChainId.POLYGON_AMOY], genUrls('amoy')), _extends({}, constants_dist_0xsequenceNetworkConstants.networks[constants_dist_0xsequenceNetworkConstants.ChainId.BSC_TESTNET], genUrls('bsc-testnet')), _extends({}, constants_dist_0xsequenceNetworkConstants.networks[constants_dist_0xsequenceNetworkConstants.ChainId.ARBITRUM_SEPOLIA], genUrls('arbitrum-sepolia')), _extends({}, constants_dist_0xsequenceNetworkConstants.networks[constants_dist_0xsequenceNetworkConstants.ChainId.BASE], genUrls('base')), _extends({}, constants_dist_0xsequenceNetworkConstants.networks[constants_dist_0xsequenceNetworkConstants.ChainId.BASE_SEPOLIA], genUrls('base-sepolia')), _extends({}, constants_dist_0xsequenceNetworkConstants.networks[constants_dist_0xsequenceNetworkConstants.ChainId.HOMEVERSE], genUrls('homeverse')), _extends({}, constants_dist_0xsequenceNetworkConstants.networks[constants_dist_0xsequenceNetworkConstants.ChainId.HOMEVERSE_TESTNET], genUrls('homeverse-testnet')), _extends({}, constants_dist_0xsequenceNetworkConstants.networks[constants_dist_0xsequenceNetworkConstants.ChainId.XAI], genUrls('xai')), _extends({}, constants_dist_0xsequenceNetworkConstants.networks[constants_dist_0xsequenceNetworkConstants.ChainId.XAI_SEPOLIA], genUrls('xai-sepolia')), _extends({}, constants_dist_0xsequenceNetworkConstants.networks[constants_dist_0xsequenceNetworkConstants.ChainId.AVALANCHE_TESTNET], genUrls('avalanche-testnet')), _extends({}, constants_dist_0xsequenceNetworkConstants.networks[constants_dist_0xsequenceNetworkConstants.ChainId.ASTAR_ZKEVM], genUrls('astar-zkevm')), _extends({}, constants_dist_0xsequenceNetworkConstants.networks[constants_dist_0xsequenceNetworkConstants.ChainId.ASTAR_ZKYOTO], genUrls('astar-zkyoto')), _extends({}, constants_dist_0xsequenceNetworkConstants.networks[constants_dist_0xsequenceNetworkConstants.ChainId.XR_SEPOLIA], genUrls('xr-sepolia')), _extends({}, constants_dist_0xsequenceNetworkConstants.networks[constants_dist_0xsequenceNetworkConstants.ChainId.B3_SEPOLIA], genUrls('b3-sepolia')), _extends({}, constants_dist_0xsequenceNetworkConstants.networks[constants_dist_0xsequenceNetworkConstants.ChainId.APECHAIN_TESTNET], genUrls('apechain-testnet')), _extends({}, constants_dist_0xsequenceNetworkConstants.networks[constants_dist_0xsequenceNetworkConstants.ChainId.BLAST], genUrls('blast')), _extends({}, constants_dist_0xsequenceNetworkConstants.networks[constants_dist_0xsequenceNetworkConstants.ChainId.BLAST_SEPOLIA], genUrls('blast-sepolia')), _extends({}, constants_dist_0xsequenceNetworkConstants.networks[constants_dist_0xsequenceNetworkConstants.ChainId.TELOS], genUrls('telos')), _extends({}, constants_dist_0xsequenceNetworkConstants.networks[constants_dist_0xsequenceNetworkConstants.ChainId.HARDHAT], { | ||
const hardhatNetworks = [_extends({}, constants_dist_0xsequenceNetworkConstants.networks[constants_dist_0xsequenceNetworkConstants.ChainId.HARDHAT], { | ||
rpcUrl: 'http://localhost:8545', | ||
@@ -267,3 +262,13 @@ relayer: { | ||
} | ||
})]); | ||
})]; | ||
const allNetworks = validateAndSortNetworks([_extends({}, createNetworkConfig(constants_dist_0xsequenceNetworkConstants.ChainId.POLYGON), { | ||
isDefaultChain: true, | ||
isAuthChain: true | ||
}), createNetworkConfig(constants_dist_0xsequenceNetworkConstants.ChainId.MAINNET), createNetworkConfig(constants_dist_0xsequenceNetworkConstants.ChainId.BSC), createNetworkConfig(constants_dist_0xsequenceNetworkConstants.ChainId.AVALANCHE), createNetworkConfig(constants_dist_0xsequenceNetworkConstants.ChainId.ARBITRUM), createNetworkConfig(constants_dist_0xsequenceNetworkConstants.ChainId.ARBITRUM_NOVA), createNetworkConfig(constants_dist_0xsequenceNetworkConstants.ChainId.OPTIMISM), createNetworkConfig(constants_dist_0xsequenceNetworkConstants.ChainId.OPTIMISM_SEPOLIA), createNetworkConfig(constants_dist_0xsequenceNetworkConstants.ChainId.POLYGON_ZKEVM), createNetworkConfig(constants_dist_0xsequenceNetworkConstants.ChainId.GNOSIS), createNetworkConfig(constants_dist_0xsequenceNetworkConstants.ChainId.RINKEBY, { | ||
disabled: true | ||
}), createNetworkConfig(constants_dist_0xsequenceNetworkConstants.ChainId.GOERLI, { | ||
disabled: true | ||
}), createNetworkConfig(constants_dist_0xsequenceNetworkConstants.ChainId.SEPOLIA), createNetworkConfig(constants_dist_0xsequenceNetworkConstants.ChainId.POLYGON_MUMBAI, { | ||
disabled: true | ||
}), createNetworkConfig(constants_dist_0xsequenceNetworkConstants.ChainId.POLYGON_AMOY), createNetworkConfig(constants_dist_0xsequenceNetworkConstants.ChainId.BSC_TESTNET), createNetworkConfig(constants_dist_0xsequenceNetworkConstants.ChainId.ARBITRUM_SEPOLIA), createNetworkConfig(constants_dist_0xsequenceNetworkConstants.ChainId.BASE), createNetworkConfig(constants_dist_0xsequenceNetworkConstants.ChainId.BASE_SEPOLIA), createNetworkConfig(constants_dist_0xsequenceNetworkConstants.ChainId.HOMEVERSE), createNetworkConfig(constants_dist_0xsequenceNetworkConstants.ChainId.HOMEVERSE_TESTNET), createNetworkConfig(constants_dist_0xsequenceNetworkConstants.ChainId.XAI), createNetworkConfig(constants_dist_0xsequenceNetworkConstants.ChainId.XAI_SEPOLIA), createNetworkConfig(constants_dist_0xsequenceNetworkConstants.ChainId.AVALANCHE_TESTNET), createNetworkConfig(constants_dist_0xsequenceNetworkConstants.ChainId.ASTAR_ZKEVM), createNetworkConfig(constants_dist_0xsequenceNetworkConstants.ChainId.ASTAR_ZKYOTO), createNetworkConfig(constants_dist_0xsequenceNetworkConstants.ChainId.XR_SEPOLIA), createNetworkConfig(constants_dist_0xsequenceNetworkConstants.ChainId.B3_SEPOLIA), createNetworkConfig(constants_dist_0xsequenceNetworkConstants.ChainId.APECHAIN_TESTNET), createNetworkConfig(constants_dist_0xsequenceNetworkConstants.ChainId.BLAST), createNetworkConfig(constants_dist_0xsequenceNetworkConstants.ChainId.BLAST_SEPOLIA), createNetworkConfig(constants_dist_0xsequenceNetworkConstants.ChainId.TELOS), ...hardhatNetworks]); | ||
@@ -899,2 +904,3 @@ const JsonRpcVersion = '2.0'; | ||
exports.getChainId = getChainId; | ||
exports.hardhatNetworks = hardhatNetworks; | ||
exports.indexerURL = indexerURL; | ||
@@ -901,0 +907,0 @@ exports.isJsonRpcHandler = isJsonRpcHandler; |
@@ -228,25 +228,20 @@ 'use strict'; | ||
} | ||
const genUrls = network => { | ||
const rpcUrl = nodesURL(network); | ||
return { | ||
const createNetworkConfig = (chainId, options) => { | ||
const network = constants_dist_0xsequenceNetworkConstants.networks[chainId]; | ||
if (!network) { | ||
throw new Error(`Network with chainId ${chainId} not found`); | ||
} | ||
const rpcUrl = nodesURL(network.name); | ||
return _extends({}, network, { | ||
rpcUrl, | ||
indexerUrl: indexerURL(network.name), | ||
relayer: { | ||
url: relayerURL(network), | ||
url: relayerURL(network.name), | ||
provider: { | ||
url: rpcUrl | ||
} | ||
}, | ||
indexerUrl: indexerURL(network) | ||
}; | ||
} | ||
}, options); | ||
}; | ||
const allNetworks = validateAndSortNetworks([_extends({}, constants_dist_0xsequenceNetworkConstants.networks[constants_dist_0xsequenceNetworkConstants.ChainId.POLYGON], genUrls('polygon'), { | ||
isDefaultChain: true, | ||
isAuthChain: true | ||
}), _extends({}, constants_dist_0xsequenceNetworkConstants.networks[constants_dist_0xsequenceNetworkConstants.ChainId.MAINNET], genUrls('mainnet')), _extends({}, constants_dist_0xsequenceNetworkConstants.networks[constants_dist_0xsequenceNetworkConstants.ChainId.BSC], genUrls('bsc')), _extends({}, constants_dist_0xsequenceNetworkConstants.networks[constants_dist_0xsequenceNetworkConstants.ChainId.AVALANCHE], genUrls('avalanche')), _extends({}, constants_dist_0xsequenceNetworkConstants.networks[constants_dist_0xsequenceNetworkConstants.ChainId.ARBITRUM], genUrls('arbitrum')), _extends({}, constants_dist_0xsequenceNetworkConstants.networks[constants_dist_0xsequenceNetworkConstants.ChainId.ARBITRUM_NOVA], genUrls('arbitrum-nova')), _extends({}, constants_dist_0xsequenceNetworkConstants.networks[constants_dist_0xsequenceNetworkConstants.ChainId.OPTIMISM], genUrls('optimism')), _extends({}, constants_dist_0xsequenceNetworkConstants.networks[constants_dist_0xsequenceNetworkConstants.ChainId.OPTIMISM_SEPOLIA], genUrls('optimism-sepolia')), _extends({}, constants_dist_0xsequenceNetworkConstants.networks[constants_dist_0xsequenceNetworkConstants.ChainId.POLYGON_ZKEVM], genUrls('polygon-zkevm')), _extends({}, constants_dist_0xsequenceNetworkConstants.networks[constants_dist_0xsequenceNetworkConstants.ChainId.GNOSIS], genUrls('gnosis')), _extends({}, constants_dist_0xsequenceNetworkConstants.networks[constants_dist_0xsequenceNetworkConstants.ChainId.RINKEBY], genUrls('rinkeby'), { | ||
disabled: true | ||
}), _extends({}, constants_dist_0xsequenceNetworkConstants.networks[constants_dist_0xsequenceNetworkConstants.ChainId.GOERLI], genUrls('goerli'), { | ||
disabled: true | ||
}), _extends({}, constants_dist_0xsequenceNetworkConstants.networks[constants_dist_0xsequenceNetworkConstants.ChainId.SEPOLIA], genUrls('sepolia')), _extends({}, constants_dist_0xsequenceNetworkConstants.networks[constants_dist_0xsequenceNetworkConstants.ChainId.POLYGON_MUMBAI], genUrls('mumbai'), { | ||
disabled: true | ||
}), _extends({}, constants_dist_0xsequenceNetworkConstants.networks[constants_dist_0xsequenceNetworkConstants.ChainId.POLYGON_AMOY], genUrls('amoy')), _extends({}, constants_dist_0xsequenceNetworkConstants.networks[constants_dist_0xsequenceNetworkConstants.ChainId.BSC_TESTNET], genUrls('bsc-testnet')), _extends({}, constants_dist_0xsequenceNetworkConstants.networks[constants_dist_0xsequenceNetworkConstants.ChainId.ARBITRUM_SEPOLIA], genUrls('arbitrum-sepolia')), _extends({}, constants_dist_0xsequenceNetworkConstants.networks[constants_dist_0xsequenceNetworkConstants.ChainId.BASE], genUrls('base')), _extends({}, constants_dist_0xsequenceNetworkConstants.networks[constants_dist_0xsequenceNetworkConstants.ChainId.BASE_SEPOLIA], genUrls('base-sepolia')), _extends({}, constants_dist_0xsequenceNetworkConstants.networks[constants_dist_0xsequenceNetworkConstants.ChainId.HOMEVERSE], genUrls('homeverse')), _extends({}, constants_dist_0xsequenceNetworkConstants.networks[constants_dist_0xsequenceNetworkConstants.ChainId.HOMEVERSE_TESTNET], genUrls('homeverse-testnet')), _extends({}, constants_dist_0xsequenceNetworkConstants.networks[constants_dist_0xsequenceNetworkConstants.ChainId.XAI], genUrls('xai')), _extends({}, constants_dist_0xsequenceNetworkConstants.networks[constants_dist_0xsequenceNetworkConstants.ChainId.XAI_SEPOLIA], genUrls('xai-sepolia')), _extends({}, constants_dist_0xsequenceNetworkConstants.networks[constants_dist_0xsequenceNetworkConstants.ChainId.AVALANCHE_TESTNET], genUrls('avalanche-testnet')), _extends({}, constants_dist_0xsequenceNetworkConstants.networks[constants_dist_0xsequenceNetworkConstants.ChainId.ASTAR_ZKEVM], genUrls('astar-zkevm')), _extends({}, constants_dist_0xsequenceNetworkConstants.networks[constants_dist_0xsequenceNetworkConstants.ChainId.ASTAR_ZKYOTO], genUrls('astar-zkyoto')), _extends({}, constants_dist_0xsequenceNetworkConstants.networks[constants_dist_0xsequenceNetworkConstants.ChainId.XR_SEPOLIA], genUrls('xr-sepolia')), _extends({}, constants_dist_0xsequenceNetworkConstants.networks[constants_dist_0xsequenceNetworkConstants.ChainId.B3_SEPOLIA], genUrls('b3-sepolia')), _extends({}, constants_dist_0xsequenceNetworkConstants.networks[constants_dist_0xsequenceNetworkConstants.ChainId.APECHAIN_TESTNET], genUrls('apechain-testnet')), _extends({}, constants_dist_0xsequenceNetworkConstants.networks[constants_dist_0xsequenceNetworkConstants.ChainId.BLAST], genUrls('blast')), _extends({}, constants_dist_0xsequenceNetworkConstants.networks[constants_dist_0xsequenceNetworkConstants.ChainId.BLAST_SEPOLIA], genUrls('blast-sepolia')), _extends({}, constants_dist_0xsequenceNetworkConstants.networks[constants_dist_0xsequenceNetworkConstants.ChainId.TELOS], genUrls('telos')), _extends({}, constants_dist_0xsequenceNetworkConstants.networks[constants_dist_0xsequenceNetworkConstants.ChainId.HARDHAT], { | ||
const hardhatNetworks = [_extends({}, constants_dist_0xsequenceNetworkConstants.networks[constants_dist_0xsequenceNetworkConstants.ChainId.HARDHAT], { | ||
rpcUrl: 'http://localhost:8545', | ||
@@ -267,3 +262,13 @@ relayer: { | ||
} | ||
})]); | ||
})]; | ||
const allNetworks = validateAndSortNetworks([_extends({}, createNetworkConfig(constants_dist_0xsequenceNetworkConstants.ChainId.POLYGON), { | ||
isDefaultChain: true, | ||
isAuthChain: true | ||
}), createNetworkConfig(constants_dist_0xsequenceNetworkConstants.ChainId.MAINNET), createNetworkConfig(constants_dist_0xsequenceNetworkConstants.ChainId.BSC), createNetworkConfig(constants_dist_0xsequenceNetworkConstants.ChainId.AVALANCHE), createNetworkConfig(constants_dist_0xsequenceNetworkConstants.ChainId.ARBITRUM), createNetworkConfig(constants_dist_0xsequenceNetworkConstants.ChainId.ARBITRUM_NOVA), createNetworkConfig(constants_dist_0xsequenceNetworkConstants.ChainId.OPTIMISM), createNetworkConfig(constants_dist_0xsequenceNetworkConstants.ChainId.OPTIMISM_SEPOLIA), createNetworkConfig(constants_dist_0xsequenceNetworkConstants.ChainId.POLYGON_ZKEVM), createNetworkConfig(constants_dist_0xsequenceNetworkConstants.ChainId.GNOSIS), createNetworkConfig(constants_dist_0xsequenceNetworkConstants.ChainId.RINKEBY, { | ||
disabled: true | ||
}), createNetworkConfig(constants_dist_0xsequenceNetworkConstants.ChainId.GOERLI, { | ||
disabled: true | ||
}), createNetworkConfig(constants_dist_0xsequenceNetworkConstants.ChainId.SEPOLIA), createNetworkConfig(constants_dist_0xsequenceNetworkConstants.ChainId.POLYGON_MUMBAI, { | ||
disabled: true | ||
}), createNetworkConfig(constants_dist_0xsequenceNetworkConstants.ChainId.POLYGON_AMOY), createNetworkConfig(constants_dist_0xsequenceNetworkConstants.ChainId.BSC_TESTNET), createNetworkConfig(constants_dist_0xsequenceNetworkConstants.ChainId.ARBITRUM_SEPOLIA), createNetworkConfig(constants_dist_0xsequenceNetworkConstants.ChainId.BASE), createNetworkConfig(constants_dist_0xsequenceNetworkConstants.ChainId.BASE_SEPOLIA), createNetworkConfig(constants_dist_0xsequenceNetworkConstants.ChainId.HOMEVERSE), createNetworkConfig(constants_dist_0xsequenceNetworkConstants.ChainId.HOMEVERSE_TESTNET), createNetworkConfig(constants_dist_0xsequenceNetworkConstants.ChainId.XAI), createNetworkConfig(constants_dist_0xsequenceNetworkConstants.ChainId.XAI_SEPOLIA), createNetworkConfig(constants_dist_0xsequenceNetworkConstants.ChainId.AVALANCHE_TESTNET), createNetworkConfig(constants_dist_0xsequenceNetworkConstants.ChainId.ASTAR_ZKEVM), createNetworkConfig(constants_dist_0xsequenceNetworkConstants.ChainId.ASTAR_ZKYOTO), createNetworkConfig(constants_dist_0xsequenceNetworkConstants.ChainId.XR_SEPOLIA), createNetworkConfig(constants_dist_0xsequenceNetworkConstants.ChainId.B3_SEPOLIA), createNetworkConfig(constants_dist_0xsequenceNetworkConstants.ChainId.APECHAIN_TESTNET), createNetworkConfig(constants_dist_0xsequenceNetworkConstants.ChainId.BLAST), createNetworkConfig(constants_dist_0xsequenceNetworkConstants.ChainId.BLAST_SEPOLIA), createNetworkConfig(constants_dist_0xsequenceNetworkConstants.ChainId.TELOS), ...hardhatNetworks]); | ||
@@ -899,2 +904,3 @@ const JsonRpcVersion = '2.0'; | ||
exports.getChainId = getChainId; | ||
exports.hardhatNetworks = hardhatNetworks; | ||
exports.indexerURL = indexerURL; | ||
@@ -901,0 +907,0 @@ exports.isJsonRpcHandler = isJsonRpcHandler; |
@@ -225,25 +225,20 @@ import { networks, ChainId } from '../constants/dist/0xsequence-network-constants.esm.js'; | ||
} | ||
const genUrls = network => { | ||
const rpcUrl = nodesURL(network); | ||
return { | ||
const createNetworkConfig = (chainId, options) => { | ||
const network = networks[chainId]; | ||
if (!network) { | ||
throw new Error(`Network with chainId ${chainId} not found`); | ||
} | ||
const rpcUrl = nodesURL(network.name); | ||
return _extends({}, network, { | ||
rpcUrl, | ||
indexerUrl: indexerURL(network.name), | ||
relayer: { | ||
url: relayerURL(network), | ||
url: relayerURL(network.name), | ||
provider: { | ||
url: rpcUrl | ||
} | ||
}, | ||
indexerUrl: indexerURL(network) | ||
}; | ||
} | ||
}, options); | ||
}; | ||
const allNetworks = validateAndSortNetworks([_extends({}, networks[ChainId.POLYGON], genUrls('polygon'), { | ||
isDefaultChain: true, | ||
isAuthChain: true | ||
}), _extends({}, networks[ChainId.MAINNET], genUrls('mainnet')), _extends({}, networks[ChainId.BSC], genUrls('bsc')), _extends({}, networks[ChainId.AVALANCHE], genUrls('avalanche')), _extends({}, networks[ChainId.ARBITRUM], genUrls('arbitrum')), _extends({}, networks[ChainId.ARBITRUM_NOVA], genUrls('arbitrum-nova')), _extends({}, networks[ChainId.OPTIMISM], genUrls('optimism')), _extends({}, networks[ChainId.OPTIMISM_SEPOLIA], genUrls('optimism-sepolia')), _extends({}, networks[ChainId.POLYGON_ZKEVM], genUrls('polygon-zkevm')), _extends({}, networks[ChainId.GNOSIS], genUrls('gnosis')), _extends({}, networks[ChainId.RINKEBY], genUrls('rinkeby'), { | ||
disabled: true | ||
}), _extends({}, networks[ChainId.GOERLI], genUrls('goerli'), { | ||
disabled: true | ||
}), _extends({}, networks[ChainId.SEPOLIA], genUrls('sepolia')), _extends({}, networks[ChainId.POLYGON_MUMBAI], genUrls('mumbai'), { | ||
disabled: true | ||
}), _extends({}, networks[ChainId.POLYGON_AMOY], genUrls('amoy')), _extends({}, networks[ChainId.BSC_TESTNET], genUrls('bsc-testnet')), _extends({}, networks[ChainId.ARBITRUM_SEPOLIA], genUrls('arbitrum-sepolia')), _extends({}, networks[ChainId.BASE], genUrls('base')), _extends({}, networks[ChainId.BASE_SEPOLIA], genUrls('base-sepolia')), _extends({}, networks[ChainId.HOMEVERSE], genUrls('homeverse')), _extends({}, networks[ChainId.HOMEVERSE_TESTNET], genUrls('homeverse-testnet')), _extends({}, networks[ChainId.XAI], genUrls('xai')), _extends({}, networks[ChainId.XAI_SEPOLIA], genUrls('xai-sepolia')), _extends({}, networks[ChainId.AVALANCHE_TESTNET], genUrls('avalanche-testnet')), _extends({}, networks[ChainId.ASTAR_ZKEVM], genUrls('astar-zkevm')), _extends({}, networks[ChainId.ASTAR_ZKYOTO], genUrls('astar-zkyoto')), _extends({}, networks[ChainId.XR_SEPOLIA], genUrls('xr-sepolia')), _extends({}, networks[ChainId.B3_SEPOLIA], genUrls('b3-sepolia')), _extends({}, networks[ChainId.APECHAIN_TESTNET], genUrls('apechain-testnet')), _extends({}, networks[ChainId.BLAST], genUrls('blast')), _extends({}, networks[ChainId.BLAST_SEPOLIA], genUrls('blast-sepolia')), _extends({}, networks[ChainId.TELOS], genUrls('telos')), _extends({}, networks[ChainId.HARDHAT], { | ||
const hardhatNetworks = [_extends({}, networks[ChainId.HARDHAT], { | ||
rpcUrl: 'http://localhost:8545', | ||
@@ -264,3 +259,13 @@ relayer: { | ||
} | ||
})]); | ||
})]; | ||
const allNetworks = validateAndSortNetworks([_extends({}, createNetworkConfig(ChainId.POLYGON), { | ||
isDefaultChain: true, | ||
isAuthChain: true | ||
}), createNetworkConfig(ChainId.MAINNET), createNetworkConfig(ChainId.BSC), createNetworkConfig(ChainId.AVALANCHE), createNetworkConfig(ChainId.ARBITRUM), createNetworkConfig(ChainId.ARBITRUM_NOVA), createNetworkConfig(ChainId.OPTIMISM), createNetworkConfig(ChainId.OPTIMISM_SEPOLIA), createNetworkConfig(ChainId.POLYGON_ZKEVM), createNetworkConfig(ChainId.GNOSIS), createNetworkConfig(ChainId.RINKEBY, { | ||
disabled: true | ||
}), createNetworkConfig(ChainId.GOERLI, { | ||
disabled: true | ||
}), createNetworkConfig(ChainId.SEPOLIA), createNetworkConfig(ChainId.POLYGON_MUMBAI, { | ||
disabled: true | ||
}), createNetworkConfig(ChainId.POLYGON_AMOY), createNetworkConfig(ChainId.BSC_TESTNET), createNetworkConfig(ChainId.ARBITRUM_SEPOLIA), createNetworkConfig(ChainId.BASE), createNetworkConfig(ChainId.BASE_SEPOLIA), createNetworkConfig(ChainId.HOMEVERSE), createNetworkConfig(ChainId.HOMEVERSE_TESTNET), createNetworkConfig(ChainId.XAI), createNetworkConfig(ChainId.XAI_SEPOLIA), createNetworkConfig(ChainId.AVALANCHE_TESTNET), createNetworkConfig(ChainId.ASTAR_ZKEVM), createNetworkConfig(ChainId.ASTAR_ZKYOTO), createNetworkConfig(ChainId.XR_SEPOLIA), createNetworkConfig(ChainId.B3_SEPOLIA), createNetworkConfig(ChainId.APECHAIN_TESTNET), createNetworkConfig(ChainId.BLAST), createNetworkConfig(ChainId.BLAST_SEPOLIA), createNetworkConfig(ChainId.TELOS), ...hardhatNetworks]); | ||
@@ -872,2 +877,2 @@ const JsonRpcVersion = '2.0'; | ||
export { AllowProvider, CachedProvider, EagerProvider, JsonRpcExternalProvider, JsonRpcProvider, JsonRpcRouter, JsonRpcSender, JsonRpcVersion, PublicProvider, SigningProvider, SingleflightMiddleware, allNetworks, allowProviderMiddleware, checkNetworkConfig, createJsonRpcMiddlewareStack, ensureUniqueNetworks, ensureValidNetworks, exceptionProviderMiddleware, findNetworkConfig, findSupportedNetwork, getChainId, indexerURL, isJsonRpcHandler, isJsonRpcProvider, isNetworkConfig, isValidNetworkConfig, loggingProviderMiddleware, maybeChainId, networkProviderMiddleware, networksIndex, nodesURL, relayerURL, sortNetworks, stringTemplate, toChainIdNumber, updateNetworkConfig, validateAndSortNetworks }; | ||
export { AllowProvider, CachedProvider, EagerProvider, JsonRpcExternalProvider, JsonRpcProvider, JsonRpcRouter, JsonRpcSender, JsonRpcVersion, PublicProvider, SigningProvider, SingleflightMiddleware, allNetworks, allowProviderMiddleware, checkNetworkConfig, createJsonRpcMiddlewareStack, ensureUniqueNetworks, ensureValidNetworks, exceptionProviderMiddleware, findNetworkConfig, findSupportedNetwork, getChainId, hardhatNetworks, indexerURL, isJsonRpcHandler, isJsonRpcProvider, isNetworkConfig, isValidNetworkConfig, loggingProviderMiddleware, maybeChainId, networkProviderMiddleware, networksIndex, nodesURL, relayerURL, sortNetworks, stringTemplate, toChainIdNumber, updateNetworkConfig, validateAndSortNetworks }; |
import { BigNumberish, ethers, providers } from 'ethers'; | ||
import { Indexer } from '@0xsequence/indexer'; | ||
import { Relayer, RpcRelayerOptions } from '@0xsequence/relayer'; | ||
import { NetworkMetadata } from "./constants.js"; | ||
import { ChainId, NetworkMetadata } from "./constants.js"; | ||
export type NetworkConfig = NetworkMetadata & { | ||
@@ -20,2 +20,25 @@ rpcUrl: string; | ||
export declare function toChainIdNumber(chainIdLike: ChainIdLike): ethers.BigNumber; | ||
export declare const hardhatNetworks: { | ||
rpcUrl: string; | ||
relayer: { | ||
url: string; | ||
provider: { | ||
url: string; | ||
}; | ||
}; | ||
chainId: ChainId; | ||
type?: import("./constants.js").NetworkType | undefined; | ||
name: string; | ||
title?: string | undefined; | ||
logoURI?: string | undefined; | ||
blockExplorer?: import("./constants.js").BlockExplorerConfig | undefined; | ||
ensAddress?: string | undefined; | ||
testnet?: boolean | undefined; | ||
deprecated?: boolean | undefined; | ||
nativeToken: { | ||
symbol: string; | ||
name: string; | ||
decimals: number; | ||
}; | ||
}[]; | ||
export declare const allNetworks: NetworkConfig[]; |
{ | ||
"name": "@0xsequence/network", | ||
"version": "1.10.5", | ||
"version": "1.10.6", | ||
"description": "network sub-package for Sequence", | ||
@@ -12,6 +12,6 @@ "repository": "https://github.com/0xsequence/sequence.js/tree/master/packages/network", | ||
"dependencies": { | ||
"@0xsequence/core": "1.10.5", | ||
"@0xsequence/indexer": "1.10.5", | ||
"@0xsequence/relayer": "1.10.5", | ||
"@0xsequence/utils": "1.10.5" | ||
"@0xsequence/core": "1.10.6", | ||
"@0xsequence/indexer": "1.10.6", | ||
"@0xsequence/relayer": "1.10.6", | ||
"@0xsequence/utils": "1.10.6" | ||
}, | ||
@@ -18,0 +18,0 @@ "peerDependencies": { |
@@ -47,8 +47,17 @@ import { BigNumberish, ethers, providers } from 'ethers' | ||
const genUrls = (network: string) => { | ||
const rpcUrl = nodesURL(network) | ||
const createNetworkConfig = (chainId: ChainId, options?: { disabled?: boolean }): NetworkConfig => { | ||
const network = networks[chainId] | ||
if (!network) { | ||
throw new Error(`Network with chainId ${chainId} not found`) | ||
} | ||
const rpcUrl = nodesURL(network.name) | ||
return { | ||
...network, | ||
rpcUrl, | ||
indexerUrl: indexerURL(network.name), | ||
relayer: { | ||
url: relayerURL(network), | ||
url: relayerURL(network.name), | ||
provider: { | ||
@@ -58,141 +67,8 @@ url: rpcUrl | ||
}, | ||
indexerUrl: indexerURL(network) | ||
...options | ||
} | ||
} | ||
export const allNetworks = validateAndSortNetworks([ | ||
export const hardhatNetworks = [ | ||
{ | ||
...networks[ChainId.POLYGON], | ||
...genUrls('polygon'), | ||
isDefaultChain: true, | ||
isAuthChain: true | ||
} as LegacyNetworkConfig, | ||
{ | ||
...networks[ChainId.MAINNET], | ||
...genUrls('mainnet') | ||
}, | ||
{ | ||
...networks[ChainId.BSC], | ||
...genUrls('bsc') | ||
}, | ||
{ | ||
...networks[ChainId.AVALANCHE], | ||
...genUrls('avalanche') | ||
}, | ||
{ | ||
...networks[ChainId.ARBITRUM], | ||
...genUrls('arbitrum') | ||
}, | ||
{ | ||
...networks[ChainId.ARBITRUM_NOVA], | ||
...genUrls('arbitrum-nova') | ||
}, | ||
{ | ||
...networks[ChainId.OPTIMISM], | ||
...genUrls('optimism') | ||
}, | ||
{ | ||
...networks[ChainId.OPTIMISM_SEPOLIA], | ||
...genUrls('optimism-sepolia') | ||
}, | ||
{ | ||
...networks[ChainId.POLYGON_ZKEVM], | ||
...genUrls('polygon-zkevm') | ||
}, | ||
{ | ||
...networks[ChainId.GNOSIS], | ||
...genUrls('gnosis') | ||
}, | ||
{ | ||
...networks[ChainId.RINKEBY], | ||
...genUrls('rinkeby'), | ||
disabled: true | ||
}, | ||
{ | ||
...networks[ChainId.GOERLI], | ||
...genUrls('goerli'), | ||
disabled: true | ||
}, | ||
{ | ||
...networks[ChainId.SEPOLIA], | ||
...genUrls('sepolia') | ||
}, | ||
{ | ||
...networks[ChainId.POLYGON_MUMBAI], | ||
...genUrls('mumbai'), | ||
disabled: true | ||
}, | ||
{ | ||
...networks[ChainId.POLYGON_AMOY], | ||
...genUrls('amoy') | ||
}, | ||
{ | ||
...networks[ChainId.BSC_TESTNET], | ||
...genUrls('bsc-testnet') | ||
}, | ||
{ | ||
...networks[ChainId.ARBITRUM_SEPOLIA], | ||
...genUrls('arbitrum-sepolia') | ||
}, | ||
{ | ||
...networks[ChainId.BASE], | ||
...genUrls('base') | ||
}, | ||
{ | ||
...networks[ChainId.BASE_SEPOLIA], | ||
...genUrls('base-sepolia') | ||
}, | ||
{ | ||
...networks[ChainId.HOMEVERSE], | ||
...genUrls('homeverse') | ||
}, | ||
{ | ||
...networks[ChainId.HOMEVERSE_TESTNET], | ||
...genUrls('homeverse-testnet') | ||
}, | ||
{ | ||
...networks[ChainId.XAI], | ||
...genUrls('xai') | ||
}, | ||
{ | ||
...networks[ChainId.XAI_SEPOLIA], | ||
...genUrls('xai-sepolia') | ||
}, | ||
{ | ||
...networks[ChainId.AVALANCHE_TESTNET], | ||
...genUrls('avalanche-testnet') | ||
}, | ||
{ | ||
...networks[ChainId.ASTAR_ZKEVM], | ||
...genUrls('astar-zkevm') | ||
}, | ||
{ | ||
...networks[ChainId.ASTAR_ZKYOTO], | ||
...genUrls('astar-zkyoto') | ||
}, | ||
{ | ||
...networks[ChainId.XR_SEPOLIA], | ||
...genUrls('xr-sepolia') | ||
}, | ||
{ | ||
...networks[ChainId.B3_SEPOLIA], | ||
...genUrls('b3-sepolia') | ||
}, | ||
{ | ||
...networks[ChainId.APECHAIN_TESTNET], | ||
...genUrls('apechain-testnet') | ||
}, | ||
{ | ||
...networks[ChainId.BLAST], | ||
...genUrls('blast') | ||
}, | ||
{ | ||
...networks[ChainId.BLAST_SEPOLIA], | ||
...genUrls('blast-sepolia') | ||
}, | ||
{ | ||
...networks[ChainId.TELOS], | ||
...genUrls('telos') | ||
}, | ||
{ | ||
...networks[ChainId.HARDHAT], | ||
@@ -217,2 +93,39 @@ rpcUrl: 'http://localhost:8545', | ||
} | ||
] | ||
export const allNetworks = validateAndSortNetworks([ | ||
{ ...createNetworkConfig(ChainId.POLYGON), isDefaultChain: true, isAuthChain: true } as LegacyNetworkConfig, | ||
createNetworkConfig(ChainId.MAINNET), | ||
createNetworkConfig(ChainId.BSC), | ||
createNetworkConfig(ChainId.AVALANCHE), | ||
createNetworkConfig(ChainId.ARBITRUM), | ||
createNetworkConfig(ChainId.ARBITRUM_NOVA), | ||
createNetworkConfig(ChainId.OPTIMISM), | ||
createNetworkConfig(ChainId.OPTIMISM_SEPOLIA), | ||
createNetworkConfig(ChainId.POLYGON_ZKEVM), | ||
createNetworkConfig(ChainId.GNOSIS), | ||
createNetworkConfig(ChainId.RINKEBY, { disabled: true }), | ||
createNetworkConfig(ChainId.GOERLI, { disabled: true }), | ||
createNetworkConfig(ChainId.SEPOLIA), | ||
createNetworkConfig(ChainId.POLYGON_MUMBAI, { disabled: true }), | ||
createNetworkConfig(ChainId.POLYGON_AMOY), | ||
createNetworkConfig(ChainId.BSC_TESTNET), | ||
createNetworkConfig(ChainId.ARBITRUM_SEPOLIA), | ||
createNetworkConfig(ChainId.BASE), | ||
createNetworkConfig(ChainId.BASE_SEPOLIA), | ||
createNetworkConfig(ChainId.HOMEVERSE), | ||
createNetworkConfig(ChainId.HOMEVERSE_TESTNET), | ||
createNetworkConfig(ChainId.XAI), | ||
createNetworkConfig(ChainId.XAI_SEPOLIA), | ||
createNetworkConfig(ChainId.AVALANCHE_TESTNET), | ||
createNetworkConfig(ChainId.ASTAR_ZKEVM), | ||
createNetworkConfig(ChainId.ASTAR_ZKYOTO), | ||
createNetworkConfig(ChainId.XR_SEPOLIA), | ||
createNetworkConfig(ChainId.B3_SEPOLIA), | ||
createNetworkConfig(ChainId.APECHAIN_TESTNET), | ||
createNetworkConfig(ChainId.BLAST), | ||
createNetworkConfig(ChainId.BLAST_SEPOLIA), | ||
createNetworkConfig(ChainId.TELOS), | ||
...hardhatNetworks | ||
]) |
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
248004
6928
+ Added@0xsequence/abi@1.10.6(transitive)
+ Added@0xsequence/core@1.10.6(transitive)
+ Added@0xsequence/indexer@1.10.6(transitive)
+ Added@0xsequence/relayer@1.10.6(transitive)
+ Added@0xsequence/utils@1.10.6(transitive)
- Removed@0xsequence/abi@1.10.5(transitive)
- Removed@0xsequence/core@1.10.5(transitive)
- Removed@0xsequence/indexer@1.10.5(transitive)
- Removed@0xsequence/relayer@1.10.5(transitive)
- Removed@0xsequence/utils@1.10.5(transitive)
Updated@0xsequence/core@1.10.6
Updated@0xsequence/indexer@1.10.6
Updated@0xsequence/relayer@1.10.6
Updated@0xsequence/utils@1.10.6