Ui 2 provider rename (web3Provider -> ethereum) (#6031)
* Rename web3Provider -> ethereumProvider * ethereumProvider -> ethereum
This commit is contained in:
parent
699aab0b80
commit
4dd68f1ef3
@ -16,8 +16,8 @@
|
||||
|
||||
import Api from '@parity/api';
|
||||
|
||||
const web3Provider = (window.parity && window.parity.web3Provider) || (window.parent && window.parent.web3Provider);
|
||||
const api = new Api(web3Provider);
|
||||
const ethereumProvider = window.ethereum || window.parent.ethereum;
|
||||
const api = new Api(ethereumProvider);
|
||||
|
||||
export {
|
||||
api
|
||||
|
@ -17,8 +17,8 @@
|
||||
import Web3 from 'web3';
|
||||
import Api from '@parity/api';
|
||||
|
||||
const web3Provider = (window.parity && window.parity.web3Provider) || (window.parent && window.parent.web3Provider);
|
||||
const api = new Api(web3Provider);
|
||||
const ethereumProvider = window.ethereum || window.parent.ethereum;
|
||||
const api = new Api(ethereumProvider);
|
||||
|
||||
let web3;
|
||||
|
||||
|
@ -16,8 +16,8 @@
|
||||
|
||||
import Api from '@parity/api';
|
||||
|
||||
const web3Provider = (window.parity && window.parity.web3Provider) || (window.parent && window.parent.web3Provider);
|
||||
const api = new Api(web3Provider);
|
||||
const ethereumProvider = window.ethereum || window.parent.ethereum;
|
||||
const api = new Api(ethereumProvider);
|
||||
|
||||
function trackRequest (signerRequestId, statusCallback) {
|
||||
return api.pollMethod('parity_checkRequest', signerRequestId)
|
||||
|
@ -16,8 +16,8 @@
|
||||
|
||||
import Api from '@parity/api';
|
||||
|
||||
const web3Provider = (window.parity && window.parity.web3Provider) || (window.parent && window.parent.web3Provider);
|
||||
const api = new Api(web3Provider);
|
||||
const ethereumProvider = window.ethereum || window.parent.ethereum;
|
||||
const api = new Api(ethereumProvider);
|
||||
|
||||
export {
|
||||
api
|
||||
|
@ -16,8 +16,8 @@
|
||||
|
||||
import Api from '@parity/api';
|
||||
|
||||
const web3Provider = (window.parity && window.parity.web3Provider) || (window.parent && window.parent.web3Provider);
|
||||
const api = new Api(web3Provider);
|
||||
const ethereumProvider = window.ethereum || window.parent.ethereum;
|
||||
const api = new Api(ethereumProvider);
|
||||
|
||||
export {
|
||||
api
|
||||
|
@ -16,8 +16,8 @@
|
||||
|
||||
import Api from '@parity/api';
|
||||
|
||||
const web3Provider = (window.parity && window.parity.web3Provider) || (window.parent && window.parent.web3Provider);
|
||||
const api = new Api(web3Provider);
|
||||
const ethereumProvider = window.ethereum || window.parent.ethereum;
|
||||
const api = new Api(ethereumProvider);
|
||||
const { bytesToHex, sha3, toWei, fromWei } = api.util;
|
||||
|
||||
export {
|
||||
|
@ -16,8 +16,8 @@
|
||||
|
||||
import Api from '@parity/api';
|
||||
|
||||
const web3Provider = (window.parity && window.parity.web3Provider) || (window.parent && window.parent.web3Provider);
|
||||
const api = new Api(web3Provider);
|
||||
const ethereumProvider = window.ethereum || window.parent.ethereum;
|
||||
const api = new Api(ethereumProvider);
|
||||
|
||||
export {
|
||||
api
|
||||
|
@ -16,8 +16,8 @@
|
||||
|
||||
import Api from '@parity/api';
|
||||
|
||||
const web3Provider = (window.parity && window.parity.web3Provider) || (window.parent && window.parent.web3Provider);
|
||||
const api = new Api(web3Provider);
|
||||
const ethereumProvider = window.ethereum || window.parent.ethereum;
|
||||
const api = new Api(ethereumProvider);
|
||||
|
||||
export {
|
||||
api
|
||||
|
@ -16,8 +16,8 @@
|
||||
|
||||
import Api from '@parity/api';
|
||||
|
||||
const web3Provider = (window.parity && window.parity.web3Provider) || (window.parent && window.parent.web3Provider);
|
||||
const api = new Api(web3Provider);
|
||||
const ethereumProvider = window.ethereum || window.parent.ethereum;
|
||||
const api = new Api(ethereumProvider);
|
||||
|
||||
export {
|
||||
api
|
||||
|
@ -23,11 +23,11 @@ import Api from './api';
|
||||
|
||||
import './dev.parity.html';
|
||||
|
||||
const web3Provider = new Api.Provider.Http('/rpc/');
|
||||
const api = new Api(web3Provider);
|
||||
const ethereumProvider = new Api.Provider.Http('/rpc/');
|
||||
const api = new Api(ethereumProvider);
|
||||
|
||||
window.parity = {
|
||||
Api,
|
||||
api,
|
||||
web3Provider
|
||||
ethereumProvider
|
||||
};
|
||||
|
@ -79,7 +79,7 @@ const dappsHistory = HistoryStore.get('dapps');
|
||||
function onEnterDapp ({ params: { id } }) {
|
||||
const token = DappMethodsStore.get().createToken(id);
|
||||
|
||||
window.web3Provider = new Api.Provider.PostMessage(token, window);
|
||||
window.ethereum = new Api.Provider.PostMessage(token, window);
|
||||
|
||||
if (!dapps[id] || !dapps[id].skipHistory) {
|
||||
dappsHistory.add(id);
|
||||
|
@ -16,6 +16,6 @@
|
||||
|
||||
import Api from '@parity/api';
|
||||
|
||||
const web3Provider = (window.parity && window.parity.web3Provider) || (window.parent && window.parent.web3Provider);
|
||||
const ethereumProvider = window.ethereum || window.parent.ethereum;
|
||||
|
||||
export default new Api(web3Provider);
|
||||
export default new Api(ethereumProvider);
|
||||
|
@ -16,6 +16,6 @@
|
||||
|
||||
import Api from '@parity/api';
|
||||
|
||||
const web3Provider = (window.parity && window.parity.web3Provider) || (window.parent && window.parent.web3Provider);
|
||||
const ethereumProvider = window.ethereum || window.parent.ethereum;
|
||||
|
||||
export default new Api(web3Provider);
|
||||
export default new Api(ethereumProvider);
|
||||
|
@ -16,6 +16,6 @@
|
||||
|
||||
import Api from '@parity/api';
|
||||
|
||||
const web3Provider = (window.parity && window.parity.web3Provider) || (window.parent && window.parent.web3Provider);
|
||||
const ethereumProvider = window.ethereum || window.parent.ethereum;
|
||||
|
||||
export default new Api(web3Provider);
|
||||
export default new Api(ethereumProvider);
|
||||
|
@ -16,6 +16,6 @@
|
||||
|
||||
import Api from '@parity/api';
|
||||
|
||||
const web3Provider = (window.parity && window.parity.web3Provider) || (window.parent && window.parent.web3Provider);
|
||||
const ethereumProvider = window.ethereum || window.parent.ethereum;
|
||||
|
||||
export default new Api(web3Provider);
|
||||
export default new Api(ethereumProvider);
|
||||
|
@ -16,6 +16,6 @@
|
||||
|
||||
import Api from '@parity/api';
|
||||
|
||||
const web3Provider = (window.parity && window.parity.web3Provider) || (window.parent && window.parent.web3Provider);
|
||||
const ethereumProvider = window.ethereum || window.parent.ethereum;
|
||||
|
||||
export default new Api(web3Provider);
|
||||
export default new Api(ethereumProvider);
|
||||
|
@ -16,6 +16,6 @@
|
||||
|
||||
import Api from '@parity/api';
|
||||
|
||||
const web3Provider = (window.parity && window.parity.web3Provider) || (window.parent && window.parent.web3Provider);
|
||||
const ethereumProvider = window.ethereum || window.parent.ethereum;
|
||||
|
||||
export default new Api(web3Provider);
|
||||
export default new Api(ethereumProvider);
|
||||
|
@ -16,6 +16,6 @@
|
||||
|
||||
import Api from '@parity/api';
|
||||
|
||||
const web3Provider = (window.parity && window.parity.web3Provider) || (window.parent && window.parent.web3Provider);
|
||||
const ethereumProvider = window.ethereum || window.parent.ethereum;
|
||||
|
||||
export default new Api(web3Provider);
|
||||
export default new Api(ethereumProvider);
|
||||
|
@ -16,6 +16,6 @@
|
||||
|
||||
import Api from '@parity/api';
|
||||
|
||||
const web3Provider = (window.parity && window.parity.web3Provider) || (window.parent && window.parent.web3Provider);
|
||||
const ethereumProvider = window.ethereum || window.parent.ethereum;
|
||||
|
||||
export default new Api(web3Provider);
|
||||
export default new Api(ethereumProvider);
|
||||
|
@ -16,6 +16,6 @@
|
||||
|
||||
import Api from '@parity/api';
|
||||
|
||||
const web3Provider = (window.parity && window.parity.web3Provider) || (window.parent && window.parent.web3Provider);
|
||||
const ethereumProvider = window.ethereum || window.parent.ethereum;
|
||||
|
||||
export default new Api(web3Provider);
|
||||
export default new Api(ethereumProvider);
|
||||
|
@ -16,6 +16,6 @@
|
||||
|
||||
import Api from '@parity/api';
|
||||
|
||||
const web3Provider = (window.parity && window.parity.web3Provider) || (window.parent && window.parent.web3Provider);
|
||||
const ethereumProvider = window.ethereum || window.parent.ethereum;
|
||||
|
||||
export default new Api(web3Provider);
|
||||
export default new Api(ethereumProvider);
|
||||
|
@ -16,6 +16,6 @@
|
||||
|
||||
import Api from '@parity/api';
|
||||
|
||||
const web3Provider = (window.parity && window.parity.web3Provider) || (window.parent && window.parent.web3Provider);
|
||||
const ethereumProvider = window.ethereum || window.parent.ethereum;
|
||||
|
||||
export default new Api(web3Provider);
|
||||
export default new Api(ethereumProvider);
|
||||
|
@ -16,6 +16,6 @@
|
||||
|
||||
import Api from '@parity/api';
|
||||
|
||||
const web3Provider = (window.parity && window.parity.web3Provider) || (window.parent && window.parent.web3Provider);
|
||||
const ethereumProvider = window.ethereum || window.parent.ethereum;
|
||||
|
||||
export default new Api(web3Provider);
|
||||
export default new Api(ethereumProvider);
|
||||
|
@ -16,6 +16,6 @@
|
||||
|
||||
import Api from '@parity/api';
|
||||
|
||||
const web3Provider = (window.parity && window.parity.web3Provider) || (window.parent && window.parent.web3Provider);
|
||||
const ethereumProvider = window.ethereum || window.parent.ethereum;
|
||||
|
||||
export default new Api(web3Provider);
|
||||
export default new Api(ethereumProvider);
|
||||
|
@ -16,6 +16,6 @@
|
||||
|
||||
import Api from '@parity/api';
|
||||
|
||||
const web3Provider = (window.parity && window.parity.web3Provider) || (window.parent && window.parent.web3Provider);
|
||||
const ethereumProvider = window.ethereum || window.parent.ethereum;
|
||||
|
||||
export default new Api(web3Provider);
|
||||
export default new Api(ethereumProvider);
|
||||
|
@ -16,8 +16,8 @@
|
||||
|
||||
import Api from '@parity/api';
|
||||
|
||||
const web3Provider = (window.parity && window.parity.web3Provider) || (window.parent && window.parent.web3Provider);
|
||||
const api = new Api(web3Provider);
|
||||
const ethereumProvider = window.ethereum || window.parent.ethereum;
|
||||
const api = new Api(ethereumProvider);
|
||||
|
||||
export {
|
||||
api
|
||||
|
Loading…
Reference in New Issue
Block a user