1
0
mirror of https://github.com/oceanprotocol/docs.git synced 2024-11-26 19:49:26 +01:00

unify web3 imports

This commit is contained in:
Matthias Kretschmann 2019-04-18 12:45:45 +02:00
parent f1b50746bd
commit 4dd121f4cd
Signed by: m
GPG Key ID: 606EEEF3C479A91F
3 changed files with 5 additions and 5 deletions

View File

@ -101,7 +101,7 @@ Here is the full source of `src/App.js` that you should have if you followed thi
import React, { Component } from 'react'
import './App.css'
import { Ocean } from '@oceanprotocol/squid'
import * as Web3 from 'web3'
import Web3 from 'web3'
import asset from './asset'
const web3 = new Web3(window.web3.currentProvider)

View File

@ -145,7 +145,7 @@ Here is the full source of `src/App.js` that you should have if you followed thi
import React, { Component } from 'react'
import './App.css'
import { Ocean } from '@oceanprotocol/squid'
import * as Web3 from 'web3'
import Web3 from 'web3'
import asset from './asset'
const web3 = new Web3(window.web3.currentProvider)

View File

@ -75,7 +75,7 @@ Below the `import './App.css'` line, let's import the packages we installed, set
```js
// src/App.js
import { Ocean } from '@oceanprotocol/squid'
import * as Web3 from 'web3'
import Web3 from 'web3'
const web3 = new Web3(window.web3.currentProvider)
window.ethereum.enable()
@ -86,7 +86,7 @@ After those steps you should see this, and MetaMask should have asked you to all
![React App 02](images/react-app-02.png)
![React App 03](images/react-app-03.png)
Note: If you see an error like `inpage.js:1 MetaMask - RPC Error: Internal JSON-RPC error.` in your `console.log`, don't worry about it. It's a MetaMask thing.
> Note: If you see an error like `inpage.js:1 MetaMask - RPC Error: Internal JSON-RPC error.` in your `console.log`, don't worry about it. It's a MetaMask thing.
## Create Ocean Instance
@ -125,7 +125,7 @@ Here is the full source of `src/App.js` that you should have if you followed thi
import React, { Component } from 'react'
import './App.css'
import { Ocean } from '@oceanprotocol/squid'
import * as Web3 from 'web3'
import Web3 from 'web3'
const web3 = new Web3(window.web3.currentProvider)
window.ethereum.enable()