mirror of
https://github.com/oceanprotocol/ocean.js.git
synced 2024-11-26 20:39:05 +01:00
Merge pull request #156 from oceanprotocol/feature/add_oceanTokenAddress
Update ConfigHelper.ts
This commit is contained in:
commit
46ab602f28
@ -32,6 +32,12 @@ export class Config {
|
||||
*/
|
||||
public web3Provider?: any
|
||||
|
||||
/**
|
||||
* Ocean Token address
|
||||
* @type {string}
|
||||
*/
|
||||
public oceanTokenAddress?: string
|
||||
|
||||
/**
|
||||
* Factory address
|
||||
* @type {string}
|
||||
|
@ -2,6 +2,7 @@ export interface ConfigHelper {
|
||||
network: string
|
||||
url: string
|
||||
factoryAddress: string
|
||||
oceanTokenAddress: string
|
||||
}
|
||||
|
||||
const configs = [
|
||||
@ -9,12 +10,14 @@ const configs = [
|
||||
{
|
||||
network: 'pacific',
|
||||
url: 'https://pacific.oceanprotocol.com',
|
||||
factoryAddress: '0x1234'
|
||||
factoryAddress: '0x1234',
|
||||
oceanTokenAddress: '0x012578f9381e876A9E2a9111Dfd436FF91A451ae'
|
||||
},
|
||||
{
|
||||
network: 'mainnet',
|
||||
url: 'https://mainnet.infura.io/v3/YOUR-PROJECT-ID',
|
||||
factoryAddress: '0x1234'
|
||||
factoryAddress: '0x1234',
|
||||
oceanTokenAddress: '0x985dd3d42de1e256d09e1c10f112bccb8015ad41'
|
||||
}
|
||||
]
|
||||
|
||||
@ -25,9 +28,11 @@ export class ConfigHelper {
|
||||
confighelp.factoryAddress = null
|
||||
confighelp.url = null
|
||||
confighelp.network = network
|
||||
confighelp.oceanTokenAddress = null
|
||||
const knownconfig = configs.find((c) => c.network === network)
|
||||
if (knownconfig) {
|
||||
confighelp.factoryAddress = knownconfig.factoryAddress
|
||||
confighelp.oceanTokenAddress = knownconfig.oceanTokenAddress
|
||||
confighelp.url = knownconfig.url
|
||||
confighelp.network = knownconfig.network
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user