mirror of
https://github.com/oceanprotocol/commons.git
synced 2023-03-15 18:03:00 +01:00
add support for Pacific network
This commit is contained in:
parent
97d6c2756e
commit
46e6d89057
@ -153,13 +153,16 @@ export default class UserProvider extends PureComponent<{}, UserProviderState> {
|
|||||||
await window.web3.eth.net.getId((err, netId) => {
|
await window.web3.eth.net.getId((err, netId) => {
|
||||||
if (err) return
|
if (err) return
|
||||||
|
|
||||||
|
const isPacific = netId === 0xcea11
|
||||||
const isNile = netId === 8995
|
const isNile = netId === 8995
|
||||||
const isDuero = netId === 2199
|
const isDuero = netId === 2199
|
||||||
const isSpree = netId === 8996
|
const isSpree = netId === 8996
|
||||||
|
|
||||||
isOceanNetwork = isNile || isDuero || isSpree
|
isOceanNetwork = isPacific || isNile || isDuero || isSpree
|
||||||
|
|
||||||
const network = isNile
|
const network = isPacific
|
||||||
|
? 'Pacific'
|
||||||
|
: isNile
|
||||||
? 'Nile'
|
? 'Nile'
|
||||||
: isDuero
|
: isDuero
|
||||||
? 'Duero'
|
? 'Duero'
|
||||||
@ -255,10 +258,11 @@ export default class UserProvider extends PureComponent<{}, UserProviderState> {
|
|||||||
|
|
||||||
if (isWeb3) {
|
if (isWeb3) {
|
||||||
const network = await ocean.keeper.getNetworkName()
|
const network = await ocean.keeper.getNetworkName()
|
||||||
|
const isPacific = network === 'Pacific'
|
||||||
const isNile = network === 'Nile'
|
const isNile = network === 'Nile'
|
||||||
const isDuero = network === 'Duero'
|
const isDuero = network === 'Duero'
|
||||||
const isSpree = network === 'Spree'
|
const isSpree = network === 'Spree'
|
||||||
const isOceanNetwork = isNile || isDuero || isSpree
|
const isOceanNetwork = isPacific || isNile || isDuero || isSpree
|
||||||
|
|
||||||
network !== this.state.network &&
|
network !== this.state.network &&
|
||||||
this.setState({ isOceanNetwork, network })
|
this.setState({ isOceanNetwork, network })
|
||||||
|
Loading…
Reference in New Issue
Block a user