mirror of
https://github.com/oceanprotocol/ocean.js.git
synced 2024-11-26 20:39:05 +01:00
use networkID instead of chainId
This commit is contained in:
parent
0526778182
commit
92f0f4c92d
@ -12,13 +12,13 @@ export declare type ConfigHelperNetworkName =
|
|||||||
export declare type ConfigHelperNetworkId = 1 | 4 | number
|
export declare type ConfigHelperNetworkId = 1 | 4 | number
|
||||||
|
|
||||||
export interface ConfigHelperConfig extends Config {
|
export interface ConfigHelperConfig extends Config {
|
||||||
chainId: ConfigHelperNetworkId
|
networkId: ConfigHelperNetworkId
|
||||||
network: ConfigHelperNetworkName
|
network: ConfigHelperNetworkName
|
||||||
}
|
}
|
||||||
|
|
||||||
const configs: ConfigHelperConfig[] = [
|
const configs: ConfigHelperConfig[] = [
|
||||||
{
|
{
|
||||||
chainId: null,
|
networkId: null,
|
||||||
network: 'development',
|
network: 'development',
|
||||||
nodeUri: 'http://localhost:8545',
|
nodeUri: 'http://localhost:8545',
|
||||||
factoryAddress: null,
|
factoryAddress: null,
|
||||||
@ -29,7 +29,19 @@ const configs: ConfigHelperConfig[] = [
|
|||||||
metadataContractAddress: null
|
metadataContractAddress: null
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
chainId: 4,
|
// barge
|
||||||
|
networkId: 8996,
|
||||||
|
network: 'development',
|
||||||
|
nodeUri: 'http://localhost:8545',
|
||||||
|
factoryAddress: null,
|
||||||
|
metadataStoreUri: 'http://127.0.0.1:5000',
|
||||||
|
providerUri: 'http://127.0.0.1:8030',
|
||||||
|
poolFactoryAddress: null,
|
||||||
|
fixedRateExchangeAddress: null,
|
||||||
|
metadataContractAddress: null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
networkId: 4,
|
||||||
network: 'rinkeby',
|
network: 'rinkeby',
|
||||||
nodeUri: 'https://rinkeby.infura.io/v3',
|
nodeUri: 'https://rinkeby.infura.io/v3',
|
||||||
factoryAddress: '0x241D0f315d2bfe32b90282e6863AC22A309EbFa0',
|
factoryAddress: '0x241D0f315d2bfe32b90282e6863AC22A309EbFa0',
|
||||||
@ -41,7 +53,7 @@ const configs: ConfigHelperConfig[] = [
|
|||||||
metadataContractAddress: '0x0220D0b4FfCC4A14C7601215aA23da06d5b1c921'
|
metadataContractAddress: '0x0220D0b4FfCC4A14C7601215aA23da06d5b1c921'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
chainId: 1,
|
networkId: 1,
|
||||||
network: 'mainnet',
|
network: 'mainnet',
|
||||||
nodeUri: 'https://mainnet.infura.io/v3',
|
nodeUri: 'https://mainnet.infura.io/v3',
|
||||||
factoryAddress: '0x1234',
|
factoryAddress: '0x1234',
|
||||||
@ -87,7 +99,7 @@ export class ConfigHelper {
|
|||||||
network: ConfigHelperNetworkName | ConfigHelperNetworkId,
|
network: ConfigHelperNetworkName | ConfigHelperNetworkId,
|
||||||
infuraProjectId?: string
|
infuraProjectId?: string
|
||||||
): Config {
|
): Config {
|
||||||
const filterBy = typeof network === 'string' ? 'network' : 'chainId'
|
const filterBy = typeof network === 'string' ? 'network' : 'networkId'
|
||||||
let config = configs.find((c) => c[filterBy] === network)
|
let config = configs.find((c) => c[filterBy] === network)
|
||||||
|
|
||||||
if (!config) {
|
if (!config) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user