Skip to content

Commit

Permalink
more config helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcos20 committed Jul 16, 2020
1 parent b705dfd commit 2426561
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions src/utils/ConfigHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,41 @@ export interface ConfigHelper {
url: string
factoryAddress: string
oceanTokenAddress: string
metadataStoreUri?: string
providerUri?: string
metadataStoreUri: string
providerUri: string
}

const configs = [
{ network: 'development', url: 'http://localhost:8545', factoryAddress: null },
{
network: 'development',
url: 'http://localhost:8545',
factoryAddress: null,
metadataStoreUri: 'http://127.0.0.1:5000',
providerUri: 'http://127.0.0.1:8030'
},
{
network: 'pacific',
url: 'https://pacific.oceanprotocol.com',
factoryAddress: '0x1234',
oceanTokenAddress: '0x012578f9381e876A9E2a9111Dfd436FF91A451ae'
oceanTokenAddress: '0x012578f9381e876A9E2a9111Dfd436FF91A451ae',
metadataStoreUri: null,
providerUri: null
},
{
network: 'rinkeby',
url: 'https://rinkeby.infura.io/v3/YOUR-PROJECT-ID',
factoryAddress: '0xB9d406D24B310A7D821D0b782a36909e8c925471',
oceanTokenAddress: '0x8967BCF84170c91B0d24D4302C2376283b0B3a07',
metadataStoreUri: 'https://aquarius.rinkeby.v3.dev-ocean.com/',
providerUri: 'https://provider.rinkeby.v3.dev-ocean.com/',
providerUri: 'https://provider.rinkeby.v3.dev-ocean.com/'
},
{
network: 'mainnet',
url: 'https://mainnet.infura.io/v3/YOUR-PROJECT-ID',
factoryAddress: '0x1234',
oceanTokenAddress: '0x985dd3d42de1e256d09e1c10f112bccb8015ad41'
oceanTokenAddress: '0x985dd3d42de1e256d09e1c10f112bccb8015ad41',
metadataStoreUri: null,
providerUri: null
}
]

Expand All @@ -41,7 +51,7 @@ export class ConfigHelper {
confighelp.oceanTokenAddress = null
confighelp.metadataStoreUri = null
confighelp.providerUri = null

const knownconfig = configs.find((c) => c.network === network)
if (knownconfig) {
confighelp.factoryAddress = knownconfig.factoryAddress
Expand Down

0 comments on commit 2426561

Please sign in to comment.